/* Quando il menu mobile è aperto, la sidebar va temporaneamente sotto */
.dojo-kun-sidebar.menu-open {
    z-index: 100 !important; /* Valore più basso rispetto alla navbar di Bootstrap (solitamente 1030/1050) */
}

/* Container principale fissato sul bordo sinistro e centrato verticalmente */
.dojo-kun-sidebar {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1050;
    display: flex;
    align-items: center;
}

/* Linguetta verticale sul bordo */
.dojo-kun-tab {
    background-color: #1a1a1a;
    color: #ffffff;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg); /* Gira la scritta nel verso corretto */
    padding: 18px 10px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border: 1px solid rgba(220, 53, 69, 0.5);
    border-left: none;
    cursor: pointer;
    box-shadow: 4px 0px 15px rgba(0, 0, 0, 0.7);
    transition: background-color 0.3s, color 0.3s;
}

.dojo-kun-sidebar:hover .dojo-kun-tab {
    background-color: #dc3545;
    color: #ffffff;
}

/* Pannello a scomparsa laterale */
.dojo-kun-content {
    width: 0;
    max-height: 85vh;
    overflow-y: auto;
    background: linear-gradient(145deg, #121212, #1c1c1c);
    color: #e0e0e0;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    box-shadow: 8px 0px 30px rgba(0, 0, 0, 0.9);
    transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1), padding 0.4s;
    white-space: nowrap; /* Evita che il testo vada a capo male durante l'apertura */
}

/* Apertura al passaggio del mouse */
.dojo-kun-sidebar:hover .dojo-kun-content {
    width: 340px;
    padding: 20px;
    border: 1px solid rgba(220, 53, 69, 0.4);
    border-left: none;
}

/* Contenuto interno formattato */
.dojo-kun-inner {
    width: 300px; /* Larghezza fissa interna per bloccare il testo formattato correttamente */
    white-space: normal;
}

/* CORNICE ROSSA ATTORNO ALL'IMMAGINE */
.dojo-kun-inner img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 3px solid #dc3545; /* Cornice rossa spessa */
    padding: 5px;              /* Spazio interno tra l'immagine e la cornice */
    background-color: #141414; /* Sfondo del padding */
    box-shadow: 0 0 12px rgba(220, 53, 69, 0.5); /* Effetto luce rossa sfumata */
}

.dojo-kun-inner h4 {
    color: #dc3545;
    font-family: serif;
    letter-spacing: 1px;
    margin-bottom: 12px;
    font-size: 1.05rem;
    text-align: center;
    border-bottom: 1px solid rgba(220, 53, 69, 0.3);
    padding-bottom: 6px;
}

/* TESTO PIÙ IMPORTANTE E LEGGIBILE */
.dojo-kun-inner p {
    font-size: 0.86rem;        /* Testo ottimizzato e più leggibile */
    line-height: 1.65;         /* Interlinea più ampia */
    color: #ffffff;            /* Colore bianco puro per risaltare */
    text-align: justify;
    margin-bottom: 0;
    font-weight: 400;
}

/* Evidenziazione in rosso per date e nomi importanti */
.dojo-kun-inner p strong {
    color: #dc3545;
    font-weight: 700;
}

/* Corsivi resi più luminosi */
.dojo-kun-inner p em {
    color: #f1f1f1;
    font-style: italic;
}

/* Scrollbar personalizzata */
.dojo-kun-content::-webkit-scrollbar {
    width: 4px;
}
.dojo-kun-content::-webkit-scrollbar-thumb {
    background: #dc3545;
    border-radius: 10px;
}