/* =====================================================================================
   Compléments au design du site actuel (css/etvoiloue.css, compilé depuis scss/ sans modification du design) :
   uniquement les éléments qui n'existaient pas (sélecteur de langue, autocomplétion de ville, connexion Google /
   Apple, choix de l'organisation, bandeau cookies…), dans le même style (Bootstrap 5 + couleurs etVoiloue).
   ===================================================================================== */
:root {
    --etv-primary: #245364;
    --etv-yellow: #ffd264;
    --etv-red: #eb506e;
    --etv-green: #7dc8b9;
    --etv-blue: #00b4cd;
}

[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.link-btn { background: none; border: 0; padding: 0; color: var(--etv-primary); text-decoration: underline; cursor: pointer; font: inherit; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 10001; background: #fff; padding: .5rem 1rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* Messages : position et aspect des alertes du site actuel (.alert-wrapper) ; plusieurs messages s'empilent */
.alert-stack { position: fixed; top: 90px; right: 10px; z-index: 9999; display: grid; gap: .5rem; max-width: min(480px, calc(100vw - 20px)); }
.alert-stack .alert { position: static; margin: 0; color: #000; background: #fff; box-shadow: 0 4px 16px 0 rgba(167, 175, 183, .33); }
.alert-stack .alert-danger, .alert-stack .alert-error { border-color: var(--etv-red); }
.alert-stack .alert-success { border-color: var(--etv-green); }
.alert-stack .alert-success svg { color: var(--etv-primary); }

/* Bandeaux (adresse e-mail à confirmer, textes légaux mis à jour, maintenance) */
.etv-banner { border-radius: 10px; }
.maintenance-banner { background: var(--etv-yellow); color: #000; text-align: center; padding: .5rem 1rem; position: relative; z-index: 1040; }
.maintenance-banner.is-active { background: var(--etv-red); color: #fff; }

/* Pastille de notifications */
.nav-badge { display: inline-block; min-width: 1.25rem; padding: 0 .35rem; border-radius: 1rem; background: var(--etv-red); color: #fff; font-size: .75rem; line-height: 1.25rem; text-align: center; font-weight: bold; }

/* Pied de page : liens et réseaux */
footer .link-secondary { color: rgba(255, 255, 255, .75) !important; }
footer .link-btn { color: rgba(255, 255, 255, .75); text-decoration: none; }
footer .link-btn:hover { color: #fff; }
footer .social-links a { color: #fff; }

/* Connexion : boutons Google / Apple et séparateur « ou » */
.social-login { display: grid; gap: .5rem; }
.social-login .btn { display: flex; align-items: center; justify-content: center; gap: .6rem; border: 1px solid #ced4da; background: #fff; color: #000; }
.social-login .btn:hover { border-color: var(--etv-primary); background: #f8f9fa; color: #000; }
.social-login svg { width: 20px; height: 20px; flex: none; }
.or-divider { display: flex; align-items: center; gap: .75rem; color: #6c757d; margin: 1rem 0; font-size: .9rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid #dee2e6; }

/* Autocomplétion (villes, adresses) */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: 100%; z-index: 1060; list-style: none; margin: 2px 0 0; padding: .25rem 0; background: #fff; border: 1px solid #ced4da; border-radius: .375rem; box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); max-height: 260px; overflow: auto; }
.combo-list li { padding: .4rem .75rem; cursor: pointer; }
.combo-list li[aria-selected="true"], .combo-list li:hover { background: var(--etv-primary); color: #fff; }

/* Espace connecté : choix de l'organisation dans le menu de gauche */
.org-switcher { color: #fff; }
.org-switcher summary { list-style: none; cursor: pointer; text-align: center; }
.org-switcher summary::-webkit-details-marker { display: none; }
.org-switcher-name { display: block; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-switcher-hint { font-size: .75rem; opacity: .8; }
.org-switcher ul { list-style: none; margin: .5rem 0 0; padding: .5rem; background: rgba(255, 255, 255, .1); border-radius: 10px; font-size: .9rem; }
.org-switcher li { padding: .2rem 0; }
.org-switcher a, .org-switcher .link-btn { color: #fff; text-decoration: none; }
.org-switcher a:hover, .org-switcher .link-btn:hover { text-decoration: underline; }
#sidebar-nav.active .org-switcher { display: none; }
#sidebar-nav .sidebar-footer a, #sidebar-nav .sidebar-footer .link-btn, #sidebar-nav .sidebar-footer summary { color: #fff; font-size: .85rem; text-decoration: none; }
#sidebar-nav.active .sidebar-footer { display: none; }
#sidebar-nav .nav-item a.active { color: var(--etv-primary); background: #fff; }
#sidebar-nav { overflow-y: auto; z-index: 1030; }

/* Liste des membres (même aspect que les listes du site actuel) */
.eli-header { background: var(--etv-primary); color: #fff; border-radius: 10px 10px 0 0; font-weight: bold; }
.eli-row { border: 1px solid #dee2e6; border-top: 0; }
.eli-row:last-child { border-radius: 0 0 10px 10px; }

/* Bandeau cookies (mesure d'audience) */
.consent { position: fixed; left: 1rem; right: 1rem; bottom: 1rem; z-index: 10002; display: flex; justify-content: center; }
.consent-inner { background: #fff; border: 1px solid var(--etv-primary); border-radius: 20px; box-shadow: 0 4px 16px 0 rgba(167, 175, 183, .5); padding: 1rem 1.25rem; max-width: 760px; display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.consent-text { flex: 1 1 320px; }
.consent-text p { margin: .25rem 0 0; font-size: .9rem; }
.consent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }

/* Publicité */
.ad-slot { margin: 1rem 0; }
.ad-label { display: block; font-size: .7rem; color: #6c757d; text-transform: uppercase; letter-spacing: .05em; }

/* Pages de texte (CGVU, confidentialité…) : contenu saisi dans l'administration */
.legal-content h2 { font-size: 1.3rem; margin-top: 2rem; }
.legal-content h3 { margin-top: 1.5rem; }
.legal-content table { width: 100%; margin: 1rem 0; border-collapse: collapse; }
.legal-content th, .legal-content td { border: 1px solid #dee2e6; padding: .4rem .6rem; }

/* Notifications */
.notif-item.is-unread { border-left: 4px solid var(--etv-red) !important; }

/* Petit écran : le menu de gauche de l'espace connecté s'ouvre par-dessus */
@media (max-width: 991px) {
    #sidebar-nav { position: fixed; }
    .alert-stack { top: 80px; }
}

/* Calendrier de disponibilité : jours où il reste une partie des exemplaires (légende du site actuel) */
.fc .availability-limited { background: #ffd264; border-color: #ffd264; color: #000; font-weight: bold; text-align: center; }
.fc .availability-limited .fc-event-title { color: #000; }
/* Calendrier des disponibilités : cases carrées, toutes de la même taille (hauteur minimale sur petit écran) */
[data-availability-calendar] .fc-daygrid-day-frame { min-height: 72px; }
@media (min-width: 576px) { [data-availability-calendar] .fc-daygrid-day-frame { aspect-ratio: 1 / 1; min-height: 0; } }
.eli-media-thumb { cursor: grab; }

/* Fiches de prêt : zone de signature (le canevas prend la largeur de la carte, 500 px au plus) */
.signature-canvas { background: #fff; max-width: 100%; cursor: crosshair; }
.signature-image { max-width: 220px; max-height: 110px; background: #fff; }

/* Messagerie (lot 2b) : vignettes de la liste du haut (mobile) à la taille de la ligne, titre de discussion sobre */
#message-list-discussion-top .discussion .img-80 { width: 50px; height: 50px; }
/* Liste des discussions : hauteur de l'écran, défilement interne (la page ne s'allonge plus avec les discussions) */
#message-list-discussion { min-height: 0; height: calc(100vh - 170px); max-height: calc(100vh - 170px); }
/* Fil des messages : la discussion et le champ d'envoi tiennent dans l'écran */
#display-message { height: calc(100vh - 430px); min-height: 240px; }
#message-list-discussion .discussion .img-80 { width: 60px; height: 60px; }
.conversation-title { font-family: inherit; font-size: 1.1rem; font-weight: 700; }
