/*
Script css
----------
Par Dominique DUGAST
*/
@media print {
    /* Masquer les boutons et contrôles */
    .tts-btn,
    .tts-btn-play,
    .tts-btn-stop,
    .tts-controls,
    .top-controls,
    .fas.fa-play,
    .fas.fa-pause,
    .fas.fa-stop {
        display: none !important;
    }

    /* Supprimer les bordures des éléments en lecture/pause */
    .en-lecture,
    .en-pause {
        border: none !important;
    }

    /* Masquer le menu latéral gauche */
    #sideMenuGauche {
        display: none !important;
    }
}

.textToSpeech {
    border: 2px solid transparent;
    border-radius: 8px;
    padding: 0px;
    margin-top: 5px;
    margin-bottom: 0px;
    background: #ffffff;
}

.en-lecture {
    border: 2px solid rgba(34,140,34,0.5);
}

.en-pause { 
    border: 2px solid rgba(200,14,51,0.5);
}

.tts-controls {
    margin-top: 10px;
    display: flex;
    gap: 10px;
    justify-content: flex-end; /* aligne tout à droite */
}

.tts-btn {
    border: none;              /* ✅ pas de bordure noire */
    outline: none;             /* ✅ pas de contour focus */
    border-radius: 4px;        /* arrondis doux */
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
}

.tts-btn-play { 
    background-color: rgba(34,140,34); 
    color: #fff; 
}

.tts-btn-stop { 
    background-color: rgba(200,14,51); 
    color: #fff; 
}

.tts-btn:hover {
    opacity: 1;   /* effet visuel au survol */
    filter: brightness(1.2); /* rend le bouton 20% plus lumineux */
    filter: contrast(1.3); /* augmente le contraste */
}

.top-controls { 
    display: block;  /* chaque enfant div prend toute la largeur */
    margin-bottom: 20px; 
    padding: 15px;
    gap: 20px; 
    color: black;
}

/* Menu latéral gauche contenant les contrôles voix*/
/* Label vertical */
.vertical-label-gauche {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%) rotate(180deg); /* fait remonter */
    writing-mode: vertical-rl;   /* texte vertical */
    text-orientation: mixed;
    padding: 0px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.vertical-label-gauche i {
    transform: rotate(90deg); /* remet l’icône dans le bon sens */
}

/* Menu latéral gauche */
#sideMenuGauche {
    position: fixed;
    top: 140px;
    left: -356px;
    width: 380px;
    border: 2px solid rgba(200,14,51,0.5);
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    color: black;
    padding: 0 24px 0px 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start !important;
    align-items: flex-start;
    transition: left 0.9s ease;
    z-index: 998;
    box-sizing: border-box;       /* inclut padding dans la largeur */
    overflow-x: hidden;           /* cache tout débordement horizontal */
    overflow-wrap: break-word;    /* coupe les mots trop longs */
    word-wrap: break-word;        /* compatibilité */
    white-space: normal;          /* permet retour à la ligne */
}

/* Survol : fond moins transparent */
#sideMenuGauche:hover {
    background-color: rgba(255, 255, 255, 0.9); /* presque opaque */
    z-index: 998;
}

/* État ouvert */
#sideMenuGauche.open {
    left: 0;
}

/* Contenu du menu */
.menu-content {
    flex: 1;
    padding-top: 0;      /* pas d'espace au-dessus */
    margin-top: 0;       /* en cas de marge héritée */
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;       /* coupe les mots trop longs */
}

/* Paragraphes dans le menu */
#sideMenuGauche p {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    margin: 0;        
    padding: 0;       
}

/* Liens du menu */
#sideMenuGauche a {
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
    margin: 0;        
    padding: 0;       
}

#sideMenuGauche a:hover {
    background-color: #999999;
}
