/* bundle: variables.css bootstrap-bohio.css base.css layout.css components.css style.css header-modern.css responsive.css ui-v2.css */

/* ===== variables.css ===== */
/**
 * Bohio MAG - Design Tokens
 * Thème jaune/noir (WCAG AAA) - Blueprint section 14
 */

:root {
    /* Couleurs principales - Jaune #FFEE00 / #FFD700 sur noir */
    --primary: #FFD700;
    --primary-dark: #E6C200;
    --primary-light: #FFEE00;
    --secondary: #1a1a1a;
    --accent: #FFD700;
    
    /* Sémantiques */
    --success: #10B981;
    --danger: #EF4444;
    --warning: #F59E0B;
    --info: #3B82F6;
    
    /* Gris — inversés pour le thème sombre.
       The ramp is used both ways round: low numbers as subtle SURFACES, high
       numbers as TEXT. Inverting it keeps both readings correct, so a rule
       saying `color: var(--gray-900)` stays "strongest text" and one saying
       `background: var(--gray-100)` stays "faintly raised panel". Patching the
       call sites individually would have broken whichever meaning was missed. */
    --gray-50:  #17151A;
    --gray-100: #1E1B21;
    --gray-200: #262229;
    --gray-300: #332E38;
    --gray-400: #6E6875;
    --gray-500: #9A938F;
    --gray-600: #B4ADA4;
    --gray-700: #CFC8BF;
    --gray-800: #E4DFD8;
    --gray-900: #F3F0EC;
    
    /* Backgrounds — dark theme. Warm-tinted charcoals rather than pure black or
       blue-grey: a neutral #111 next to the yellow accent reads cold, and pure
       black makes the covers look like they are floating in a void. Surfaces
       step up in lightness (page < band < card) so depth comes from tone, not
       from borders. */
    --bg-primary: #121013;
    --bg-secondary: #1A171B;
    --bg-dark: #000000;
    --bg-card: #201D22;

    /* Texte - Contraste élevé sur fond sombre.
       --text-primary on --bg-primary is ~15:1 (WCAG AAA). */
    --text-primary: #F3F0EC;
    --text-secondary: #B7B0A7;
    --text-light: #8B847B;
    --text-inverse: #1A1419;

    /* Bordures */
    --border-color: #322D34;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    
    /* Ombres */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    
    /* Typography */
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 1.875rem;
    --font-size-4xl: 2.25rem;
    
    --transition: all 0.2s ease-in-out;
}

/* ──────────────────────────────────────────────────────────────────────────
   Échelles de design (décembre 2026)
   Le site utilisait 72 tailles de texte, 23 arrondis et des espacements au cas
   par cas. Les nouveaux composants — et ceux qu'on retouche — piochent ici,
   pour que cartes, badges et boutons parlent enfin la même langue.
   ────────────────────────────────────────────────────────────────────────── */
:root {
    /* Texte : 6 tailles */
    --text-xs:   0.75rem;   /* 12px — badges, métadonnées */
    --text-sm:   0.875rem;  /* 14px — texte secondaire */
    --text-base: 1rem;      /* 16px — texte courant */
    --text-lg:   1.125rem;  /* 18px — titres de carte */
    --text-xl:   1.5rem;    /* 24px — titres de section */
    --text-2xl:  2rem;      /* 32px — titres de page */

    /* Arrondis : 4 valeurs */
    --radius-sm:   6px;     /* badges, petits contrôles */
    --radius-md:   10px;    /* cartes, couvertures */
    --radius-lg:   16px;    /* panneaux, modales */
    --radius-pill: 999px;   /* pastilles, boutons arrondis */

    /* Espacement : pas de 4px */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-8: 3rem;

    /* Mouvement */
    --ease-out: cubic-bezier(.2, .8, .2, 1);
    --dur-fast: 150ms;
    --dur-base: 250ms;
}


/* ===== bootstrap-bohio.css ===== */
/* Bootstrap theme bridge for Bohio MAG
 *
 * Light page surface, yellow brand accents — matches assets/css/variables.css
 * (--bg-primary #FFFFFF, --text-primary #111827, --primary #FFD700).
 *
 * This file used to force `body { background:#000; color:#fff }`, which is what
 * made every page dark and overrode the white surface variables.css defines.
 * The navbar, the mobile nav panel and any explicit .bg-dark panel stay dark on
 * purpose — see the "dark islands" section at the bottom.
 */

:root {
    --bs-primary: #FFD700;
    --bs-primary-rgb: 255, 215, 0;
    --bs-dark: #111111;
    --bs-dark-rgb: 17, 17, 17;

    /* Bootstrap's own variables must track the design tokens. Left hardcoded to
       the old light values, every .card / .table / .text-muted kept painting
       near-black text onto the dark surface (~1.06:1 — invisible). */
    --bs-body-bg: var(--bg-primary, #121013);
    --bs-body-color: var(--text-primary, #F3F0EC);
    --bs-secondary-color: var(--text-secondary, #B7B0A7);
    --bs-border-color: var(--border-color, #322D34);

    /* On the dark surface the full gold is legible, so no darkening needed */
    --bs-link-color: var(--primary, #FFD700);
    --bs-link-hover-color: #FFE55C;
}

body {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

.card {
    background: var(--bg-card, #201D22);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.form-control,
.form-select {
    background-color: var(--bg-secondary, #1A171B);
    border-color: var(--border-color, #322D34);
    color: var(--bs-body-color);
}

.form-control::placeholder { color: var(--text-light, #8B847B); }

.form-control:focus,
.form-select:focus {
    background-color: var(--bg-secondary, #1A171B);
    color: var(--bs-body-color);
    border-color: #FFD700;
    box-shadow: 0 0 0 .25rem rgba(255, 215, 0, 0.25);
}

.btn-primary {
    --bs-btn-color: #111111;
    --bs-btn-bg: #FFD700;
    --bs-btn-border-color: #E6C200;
    --bs-btn-hover-color: #111111;
    --bs-btn-hover-bg: #FFEE00;
    --bs-btn-hover-border-color: #FFD700;
}

.btn-outline-light {
    --bs-btn-color: var(--text-primary, #F3F0EC);
    --bs-btn-border-color: var(--border-color, #322D34);
    --bs-btn-hover-color: #111111;
    --bs-btn-hover-bg: #FFD700;
    --bs-btn-hover-border-color: #FFD700;
}

.table {
    --bs-table-color: var(--text-primary, #F3F0EC);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--border-color, #322D34);
    --bs-table-striped-color: var(--text-primary, #F3F0EC);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.03);
}

.footer-shell {
    background: linear-gradient(180deg, #111111 0%, #000000 100%);
    border-top: 3px solid #FFD700;
}

/* .text-white / .text-light / .link-light used to be forced dark here, because
   the admin markup assumed a dark page while the surface was white. The surface
   is dark again, so they are simply left alone — overriding them now would put
   near-black text back on a near-black background. */
.text-light {
    color: var(--text-primary, #F3F0EC) !important;
}

.link-light {
    color: var(--primary, #FFD700) !important;
}

.link-light:hover {
    color: #FFE55C !important;
}

/* ── Dark islands ────────────────────────────────────────────────────────────
   Regions that are meant to be dark: the navbar, the mobile nav panel, the
   footer, and anything explicitly marked .bg-dark. */
.bg-dark,
.bohio-navbar,
.mobile-nav-panel,
.footer-shell {
    color: #E8E8E8;
}

.bg-dark .text-white,
.bg-dark .text-light,
.bohio-navbar .text-white,
.bohio-navbar .text-light,
.mobile-nav-panel .text-white,
.mobile-nav-panel .text-light,
.footer-shell .text-white,
.footer-shell .text-light {
    color: #FFFFFF !important;
}

.bg-dark .link-light,
.bohio-navbar .link-light,
.mobile-nav-panel .link-light,
.footer-shell .link-light {
    color: #F3F4F6 !important;
}

.bg-dark .link-light:hover,
.bohio-navbar .link-light:hover,
.mobile-nav-panel .link-light:hover,
.footer-shell .link-light:hover {
    color: #FFD700 !important;
}

.footer-shell .text-secondary {
    color: #9CA3AF !important;
}


/* ===== base.css ===== */
/**
 * Bohio MAG - Reset & Base
 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p { margin-bottom: var(--spacing-md); }

a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--gray-800);
}

/* ── Titre lu, jamais vu ─────────────────────────────────────────────────────
 *
 * La page d'accueil n'avait aucun <h1> : ses sections commencent en <h2>, si
 * bien que rien ne nommait la page pour un moteur de recherche ni pour un
 * lecteur d'écran. En ajouter un visible aurait posé une ligne de texte au
 * dessus de la bande de couvertures — or c'est l'image qui doit accueillir,
 * pas une phrase.
 *
 * Cette classe existait déjà dans header.css… qui n'est chargé nulle part. Le
 * titre s'affichait donc en toutes lettres, à 36 px. Elle est reprise ici, dans
 * une feuille réellement chargée.
 *
 * L'élément reste dans le document et dans l'arbre d'accessibilité : il occupe
 * un pixel, hors du flux, découpé à zéro. `display:none` l'aurait retiré des
 * deux, ce qui reviendrait à ne pas avoir de titre du tout.
 */
.sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);      /* navigateurs anciens */
    clip-path: inset(50%);        /* recette actuelle */
    white-space: nowrap;
    border: 0;
}

/* ── Icônes de rôle : Supernova et Launchpad ─────────────────────────────────
 *
 * Le dessin est posé en masque, pas en image. Une image garderait sa couleur
 * d'origine : dorée sur fond sombre elle irait, mais sur l'onglet actif — qui
 * est doré — elle disparaîtrait. En masque, c'est currentColor qui la peint,
 * donc l'icône suit toujours la couleur du texte à côté d'elle.
 *
 * La taille est en em : l'icône grandit avec le texte qu'elle accompagne, sans
 * qu'on ait à la régler à chaque endroit.
 */
.role-icon {
    display: inline-block;
    width: 1.22em;
    height: 1.22em;
    vertical-align: -0.22em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
    flex-shrink: 0;
}

.role-icon--supernova {
    -webkit-mask-image: url('../images/icon-supernova.png');
            mask-image: url('../images/icon-supernova.png');
}

.role-icon--launchpad {
    -webkit-mask-image: url('../images/icon-launchpad.png');
            mask-image: url('../images/icon-launchpad.png');
}

/* Pastille posée sur une couverture. Le nom du rôle passe en infobulle et en
   texte pour lecteur d'écran : sur une vignette, l'icône seule suffit à l'œil,
   mais elle ne dit rien à qui ne voit pas. */
.role-badge {
    position: absolute;
    top: .5rem;
    left: .5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(10, 8, 11, .72);
    -webkit-backdrop-filter: blur(4px);
            backdrop-filter: blur(4px);
    border: 1px solid rgba(244, 197, 66, .35);
    color: var(--bohio-primary, #F4C542);
    font-size: 15px;
    line-height: 0;
    z-index: 2;
    pointer-events: none;
}

.role-badge .role-icon { width: 17px; height: 17px; vertical-align: 0; }

/* Pastille de rôle réduite à son icône.
   Les classes existantes gardent la position et les couleurs ; seule la forme
   change, de rectangle à texte vers carré à icône. */
.work-badge.is-role-icon,
.browse-flag.is-role-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 9px;

    box-shadow: 0 1px 3px rgba(10, 8, 11, .35);
}

/* Supernova : noir sur jaune, comme la tuile d'origine. La classe de base la
   peignait en bleu (#3B82F6), une couleur étrangère à la marque.
   Launchpad garde son vert : il se distingue ainsi d'un coup d'œil, ce qui est
   tout l'intérêt d'avoir deux pastilles.
   La classe de base n'est pas touchée — elle sert aussi à des pastilles de
   texte (« Nouvelle œuvre ») qui doivent conserver leur teinte. */
.work-badge.badge-type-original.is-role-icon {
    background: var(--bohio-primary, #F4C542) !important;
    color: #15131a !important;
}

.work-badge.is-role-icon .role-icon,
.browse-flag.is-role-icon .role-icon {
    width: 19px;
    height: 19px;
    vertical-align: 0;
}

/* Dans un lien de navigation, l'icône précède le mot sans le serrer. */
.bohio-nav-link .role-icon,
.bohio-mobile-tab .role-icon,
.mobile-nav-link .role-icon {
    margin-right: .38em;
}

/* ── Badge de rôle posé sur la photo de profil ───────────────────────────────
 *
 * Sur une fiche d'auteur, le rôle se lit d'un coup d'oeil quand il est posé sur
 * la photo plutôt que rangé à côté. Le badge déborde légèrement du cercle : sans
 * ce débordement il a l'air découpé dans la photo au lieu d'être posé dessus.
 */
.avatar-with-badge {
    position: relative;
    display: inline-block;
    line-height: 0;          /* pas de blanc sous l'image dans le conteneur */
    flex-shrink: 0;
}

.avatar-role-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 40px;
    height: 40px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: #000;
    /* le liseré reprend le fond de la page : c'est lui qui détache le badge
       de la photo, quelle que soit la couverture derrière */
    border: 3px solid var(--bg-primary);
}

.avatar-role-badge .role-icon {
    width: 23px;
    height: 23px;
    vertical-align: 0;
}

/* La carte d'auteur centrait sa photo par la marge de l'image elle-même. Une
   fois l'image enveloppée, c'est le conteneur qui doit la porter, sinon la
   carte se décale et l'espacement sous la photo disparaît. */
.author-card .avatar-with-badge {
    display: block;
    margin: 0 auto var(--spacing-md);
}

.avatar-with-badge > .author-avatar,
.avatar-with-badge > .author-hero-avatar {
    display: block;
    margin: 0;
}

@media (max-width: 640px) {
    .avatar-role-badge {
        width: 33px;
        height: 33px;
        border-width: 2px;
    }

    .avatar-role-badge .role-icon {
        width: 19px;
        height: 19px;
    }
}

/* ── Pied de page colle en bas ───────────────────────────────────────────────
 *
 * Sur une page courte — une categorie de forum vide, un article isole, une
 * page legale breve — le pied venait se poser juste sous le contenu, au milieu
 * de l'ecran, avec du vide en dessous.
 *
 * Le corps devient une colonne d'au moins une hauteur d'ecran, et le <main>
 * prend la place restante. C'est lui qui pousse le pied, pas une marge
 * automatique sur le pied : celui-ci porte deja un mt-5, et le lui reprendre
 * aurait supprime cet ecart sur toutes les pages longues.
 */
body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body > main {
    flex: 1 0 auto;
    /* Les pages a colonne centree (legal, a propos) posent margin-inline: auto
       sur leur <main>. Sur un element flex, une marge automatique dans l'axe
       transversal absorbe l'espace libre et empeche l'etirement : la colonne
       se retrouvait 42 px plus etroite qu'avant. La largeur explicite rend le
       comportement identique a celui d'un bloc, max-width continuant a la
       borner. */
    width: 100%;
}


/* ===== layout.css ===== */
/**
 * Bohio MAG - Layout (Container, Header, Footer)
 */

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-fluid {
    width: 100%;
    padding: 0 var(--spacing-md);
}

/* ===== SIDEBAR MOBILE ===== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.sidebar-overlay.active {
    opacity: 1;
}

.sidebar-mobile {
    position: fixed;
    left: -100%;
    top: 0;
    width: 280px;
    height: 100vh;
    background: var(--bg-dark);
    color: var(--text-inverse);
    z-index: 1000;
    transition: left 0.3s ease-in-out;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
}

.sidebar-mobile.active {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-lg);
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-header .logo {
    font-size: var(--font-size-xl);
    font-weight: 700;
    color: var(--primary);
}

.sidebar-close {
    background: none;
    border: none;
    color: var(--text-inverse);
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--spacing-md) 0;
}

.sidebar-link {
    padding: var(--spacing-md) var(--spacing-lg);
    color: var(--gray-300);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sidebar-link:hover {
    background: var(--gray-800);
    color: var(--primary);
    border-left-color: var(--primary);
}

.sidebar-logout {
    color: var(--red-400);
}

.sidebar-divider {
    height: 1px;
    background: var(--gray-700);
    margin: var(--spacing-sm) 0;
}

.sidebar-auth {
    padding: var(--spacing-lg) 0;
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-user {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) var(--spacing-lg);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--gray-700);
}

.sidebar-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    object-fit: cover;
}

.sidebar-user-name {
    margin: 0;
    font-weight: 600;
    color: var(--text-inverse);
}

.sidebar-user-email {
    margin: 0.2rem 0 0 0;
    font-size: 0.85rem;
    color: var(--gray-400);
}

.sidebar-register {
    background: var(--primary);
    color: var(--bg-dark);
    font-weight: 600;
    margin: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    border-left-color: transparent !important;
}

.sidebar-register:hover {
    background: var(--primary-light);
    border-left-color: transparent !important;
}

.sidebar-footer {
    padding: var(--spacing-lg);
    border-top: 1px solid var(--gray-700);
}

.sidebar-lang {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.sidebar-lang-label {
    font-size: 0.9rem;
    color: var(--gray-400);
    font-weight: 500;
}

.lang-btn-sidebar {
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--gray-600);
    background: var(--gray-800);
    color: var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    cursor: pointer;
    transition: var(--transition);
    width: 100%;
    text-align: center;
}

.lang-btn-sidebar:hover, .lang-btn-sidebar.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

/* Header - Thème jaune/noir */
.header {
    background: var(--bg-dark);
    color: var(--text-inverse);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-md) 0;
    gap: var(--spacing-md);
}

.logo {
    font-size: var(--font-size-2xl);
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
    flex-shrink: 0;
}

.nav-link {
    color: var(--gray-300);
    font-weight: 500;
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary);
}

.nav-link.active {
    color: var(--primary);
}

.search-bar {
    position: relative;
    max-width: 300px;
    width: 100%;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    padding-right: 40px;
    border: 1px solid var(--gray-600);
    border-radius: var(--border-radius);
    background: var(--gray-800);
    color: var(--text-inverse);
    font-size: var(--font-size-sm);
}

.search-input::placeholder {
    color: var(--gray-400);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.lang-selector {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.lang-btn {
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid var(--gray-600);
    background: transparent;
    color: var(--gray-300);
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    cursor: pointer;
    transition: var(--transition);
}

.lang-btn:hover, .lang-btn.active {
    background: var(--primary);
    color: var(--bg-dark);
    border-color: var(--primary);
}

.auth-area {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    flex-shrink: 0;
}

.user-menu {
    position: relative;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--primary);
}

.dropdown {
    position: absolute;
    top: calc(100% + var(--spacing-sm));
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    z-index: 1000;
}

.dropdown.active { display: block; }

.dropdown-item {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-primary);
}

.dropdown-item:hover {
    background: var(--gray-50);
    color: var(--primary-dark);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    /* RESPONSIVE DESIGN */
    @media (max-width: 1100px) {
        .nav {
            gap: 15px;
        }
    
        .search-bar {
            min-width: 150px;
        }
    }

    @media (max-width: 900px) {
        .header-content {
            gap: 15px;
        }
    
        .nav {
            gap: 10px;
            font-size: 14px;
        }
    
        .search-bar {
            min-width: 120px;
            padding: 6px 10px;
        }
    
        .search-input {
            font-size: 12px;
        }
    
        .lang-btn {
            padding: 6px 10px;
            font-size: 11px;
        }
    }

    @media (max-width: 768px) {
        .container {
            padding: 0 15px;
        }
    
        .header {
            padding: 12px 0;
        }
    
        .logo {
            font-size: 18px;
            min-width: 100px;
        }
    
        .nav {
            display: none;
        }
    
        .search-bar {
            display: none;
        }
    
        .lang-selector {
            display: none;
        }
    
        .header-content {
            gap: 10px;
            justify-content: space-between;
        }
    
        .dropdown {
            right: -10px;
        }
    }

    @media (max-width: 480px) {
        .header {
            padding: 10px 0;
        }
    
        .logo {
            font-size: 16px;
        }
    
        .user-avatar {
            width: 35px;
            height: 35px;
        }
    }}

/* ===== components.css ===== */
/**
 * Bohio MAG - Composants réutilisables
 */

/* Boutons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-sm) var(--spacing-lg);
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

.btn-primary:hover {
    background: var(--primary-light);
    color: var(--bg-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--gray-300);
    color: #000;
    /* ensure readable on light bg */
}

/* Explicit white button style for places where background is white */
.btn-white {
    background: #ffffff;
    color: #000;
    border: 1px solid #e6e6e6;
}

.btn-white:hover {
    background: #f7f7f7;
    color: #000;
    border-color: #d9d9d9;
}

/* A 2px yellow border on every secondary button turned any row of actions into
   a wall of outlined boxes. A subtle surface with a hairline in the border
   colour reads as secondary without shouting. */
.btn-outline {
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, .1);
    border-color: #4A4350;
    color: var(--text-primary);
}

/* Ghost button — fond noir, texte blanc, bordure semi-transparente */
.btn-ghost {
    background: #000000;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
}

/* Ensure btn-link is always visible */
.btn-link {
    color: var(--primary-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: var(--font-size-sm);
    transition: var(--transition);
}

.btn-link:hover {
    color: var(--primary);
    text-decoration: underline;
}

/* Large button variant */
.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--font-size-lg);
}

/* Missing Button Variants */
.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #DC2626;
    /* Darker red */
}

.btn-warning {
    background: var(--warning);
    color: var(--bg-dark);
    /* Ensure text is legible on orange */
}

.btn-warning:hover {
    background: #D97706;
    /* Darker orange */
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
    /* Darker green */
}

.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--font-size-xs);
}

/* Header override pour boutons dans nav noire */
.header .btn-outline {
    border-color: var(--primary);
    color: var(--primary);
}

.header .btn-outline:hover {
    background: var(--primary);
    color: var(--bg-dark);
}

.header .btn-primary {
    background: var(--primary);
    color: var(--bg-dark);
}

/* Cards */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

.card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: var(--font-size-xl);
    font-weight: 600;
    margin-bottom: 0;
}

/* Work Grid */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-xl) 0;
}

.work-card {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative; /* Required for .work-card-link stretched-link */
}

/* Stretched-link: makes the entire card clickable via an absolutely-positioned <a> */
.work-card-link {
    position: absolute;
    inset: 0;
    z-index: 1;
}
.work-card-link:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}
/* Ensure interactive elements inside the card stay above the stretched-link */
.work-card .btn, .work-card button, .work-card form {
    position: relative;
    z-index: 2;
}

.work-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.work-cover {
    width: 100%;
    aspect-ratio: 3/4;
    object-fit: cover;
    background: var(--gray-200);
}

.work-info {
    padding: var(--spacing-md);
}

.work-title {
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
    font-size: var(--font-size-base);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.work-author {
    color: var(--text-secondary);
    font-size: var(--font-size-sm);
}

.work-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

/* Badges */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    font-size: var(--font-size-xs);
    font-weight: 500;
}

.badge-visitor {
    background: var(--gray-100);
    color: var(--gray-600);
}

.badge-reader {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-launchpad {
    background: #FEF3C7;
    color: #92400E;
}

.badge-supernova {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-editor {
    background: #E0E7FF;
    color: #3730A3;
}

.badge-admin {
    background: var(--primary);
    color: var(--bg-dark);
}

.badge-banned {
    background: var(--danger);
    color: white;
}

.badge-draft {
    background: var(--gray-200);
    color: var(--gray-700);
}

.badge-submitted {
    background: #FEF3C7;
    color: #92400E;
}

.badge-published {
    background: var(--success);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

/* Chapitre déjà acquis. Volontairement discret : c'est une confirmation, pas
   une promotion — le lecteur a seulement besoin de savoir qu'il peut ouvrir. */
.badge-owned {
    background: rgba(46, 204, 113, .14);
    color: var(--success);
    border: 1px solid rgba(46, 204, 113, .4);
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

.badge-removed {
    background: var(--danger);
    color: white;
}

.badge-archived {
    background: var(--gray-400);
    color: white;
}

.badge-warning {
    background: #FEF3C7;
    color: #92400E;
}

.badge-info {
    background: #DBEAFE;
    color: #1E40AF;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

.badge-secondary {
    background: var(--gray-300);
    color: var(--gray-700);
}

/* Work type badges for search results */
.badge-type-launchpad {
    background: #10B981;
    color: white;
    font-size: 0.7rem;
}

.badge-type-original {
    background: #3B82F6;
    color: white;
    font-size: 0.7rem;
}

/* Alias pour badges inline sur les cartes */
.badge-original {
    background: #3B82F6;
    color: white;
}

/* Statuts de modération manquants */
.badge-pending {
    background: #FEF3C7;
    color: #92400E;
}

.badge-approved {
    background: #D1FAE5;
    color: #065F46;
}

.badge-flagged {
    background: #FEE2E2;
    color: #991B1B;
}

.badge-rejected {
    background: var(--danger);
    color: white;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: var(--font-size-base);
    font-family: inherit;
    transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.2);
}

/* ── Champs de date et d'heure ────────────────────────────────────────────
   Le navigateur dessine la petite icône de calendrier en noir : sur un fond
   sombre elle était pratiquement invisible, et rien n'indiquait que le champ
   ouvrait un sélecteur. On l'inverse en blanc.

   La saisie au clavier reste possible sans passer par le calendrier : chaque
   segment (jour, mois, heure) s'écrit directement, et les flèches haut/bas les
   ajustent. Les segments prennent donc la couleur du texte, sinon ils se
   perdaient eux aussi sur le fond sombre. */
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="month"] {
    color-scheme: dark;              /* le sélecteur natif s'affiche en sombre */
    color: var(--text-primary);
}

input[type="date"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: .75;
    cursor: pointer;
    padding: 2px;
    border-radius: 3px;
    transition: opacity .15s ease, background .15s ease;
}
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover,
input[type="month"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
    background: rgba(255, 255, 255, .12);
}

/* Segments éditables : lisibles au repos, surlignés quand on les sélectionne. */
input[type="date"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit {
    color: var(--text-primary);
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="datetime-local"]::-webkit-datetime-edit-fields-wrapper,
input[type="time"]::-webkit-datetime-edit-fields-wrapper {
    padding: 0;
}
input[type="datetime-local"]::-webkit-datetime-edit-text {
    color: var(--text-secondary);    /* les séparateurs / et : restent discrets */
    padding: 0 1px;
}
input[type="date"]::-webkit-datetime-edit-day-field:focus,
input[type="date"]::-webkit-datetime-edit-month-field:focus,
input[type="date"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-day-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-month-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-year-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-hour-field:focus,
input[type="datetime-local"]::-webkit-datetime-edit-minute-field:focus,
input[type="time"]::-webkit-datetime-edit-hour-field:focus,
input[type="time"]::-webkit-datetime-edit-minute-field:focus {
    background: var(--primary);
    color: #1a1206;
    border-radius: 2px;
    outline: none;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-error {
    color: var(--danger);
    font-size: var(--font-size-sm);
    margin-top: var(--spacing-xs);
}

/* Alerts */
.alert {
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.alert-success {
    background: #D1FAE5;
    border-color: var(--success);
    color: #065F46;
}

.alert-error {
    background: #FEE2E2;
    border-color: var(--danger);
    color: #991B1B;
}

.alert-warning {
    background: #FEF3C7;
    border-color: var(--warning);
    color: #92400E;
}

.alert-info {
    background: #DBEAFE;
    border-color: var(--info);
    color: #1E40AF;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--spacing-lg) 0;
}

.table th,
.table td {
    padding: var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    background: var(--gray-50);
    font-weight: 600;
}

.table tr:hover {
    background: var(--gray-50);
}

/* Dashboard */
.dashboard {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-xl);
    margin: var(--spacing-xl) 0;
}

.dashboard-sidebar {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    height: fit-content;
    position: sticky;
    top: 80px;
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    margin-bottom: var(--spacing-xs);
}

.sidebar-nav-link {
    display: block;
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background: var(--primary);
    color: var(--bg-dark);
}

.dashboard-content {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-xl);
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2d2d2d 100%);
    color: var(--primary);
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
}

.stat-value {
    font-size: var(--font-size-3xl);
    font-weight: 700;
}

.stat-label {
    opacity: 0.9;
    font-size: var(--font-size-sm);
}

/* Utilities */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-between {
    display: flex;
    justify-content: space-between;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gap-1 {
    gap: var(--spacing-sm);
}

.gap-2 {
    gap: var(--spacing-md);
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-top: var(--spacing-md);
    }

    .dashboard {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
    }

    .works-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-md);
    }
}
/* ── Bandeau de confirmation d'adresse ──────────────────────────────────── */
.verify-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
    padding: .6rem 1rem;
    background: rgba(217, 162, 22, .12);
    border-bottom: 1px solid rgba(217, 162, 22, .35);
    font-size: .86rem;
    color: var(--text-primary);
}
.verify-strip-text { display: inline-flex; align-items: center; gap: .45rem; }
.verify-strip i { color: var(--warning, #D9A216); }
.verify-strip-cta {
    padding: .28rem .8rem;
    background: var(--warning, #D9A216);
    color: #1a1206;
    font-weight: 700;
    font-size: .8rem;
    border-radius: 999px;
    text-decoration: none;
    white-space: nowrap;
}
.verify-strip-cta:hover { filter: brightness(1.08); color: #1a1206; }

@media (max-width: 560px) {
    .verify-strip { font-size: .8rem; padding: .55rem .8rem; text-align: center; }
}


/* ===== style.css ===== */
/* @import retiré : chargé avec sa version par includes/header.php. */
/**
 * Bohio MAG - Stylesheet Principal
 * Structure: Variables -> Base -> Layout -> Components -> Page-specific
 * Thème: Jaune (#FFD700) sur Noir (#000000)
 */

/* variables.css is NOT imported here: header.php already loads it with an
   mtime query string, and this bare @import re-loaded it afterwards from cache.
   The stale copy then won the cascade, so token edits appeared to do nothing
   until a hard refresh. */

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: var(--spacing-sm); }
.mt-2 { margin-top: var(--spacing-md); }
.mt-3 { margin-top: var(--spacing-lg); }
.mt-4 { margin-top: var(--spacing-xl); }
.mt-5 { margin-top: var(--spacing-2xl); }

.mb-1 { margin-bottom: var(--spacing-sm); }
.mb-2 { margin-bottom: var(--spacing-md); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.mb-5 { margin-bottom: var(--spacing-2xl); }

.mx-auto { margin-left: auto; margin-right: auto; }

/* Alerts */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid;
}

.alert-info {
    background: #E0F2FE;
    border-left-color: #3B82F6;
    color: #1E40AF;
}

.alert-success {
    background: #DCFCE7;
    border-left-color: #10B981;
    color: #065F46;
}

.alert-warning {
    background: #FEF3C7;
    border-left-color: #F59E0B;
    color: #92400E;
}

.alert-danger {
    background: #FEE2E2;
    border-left-color: #EF4444;
    color: #991B1B;
}

/* Forms */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-weight: 500;
    color: var(--text-primary);
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--font-size-base);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

/* Grid Utilities */
.grid {
    display: grid;
    gap: var(--spacing-lg);
}

.grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 768px) {
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    .form-input, .form-textarea, .form-select {
        font-size: 16px; /* Prévient le zoom sur mobile */
    }
}

@media (max-width: 480px) {
    .alert {
        margin-bottom: var(--spacing-md);
        padding: var(--spacing-md);
        font-size: var(--font-size-sm);
    }

    .btn {
        padding: var(--spacing-sm) var(--spacing-md);
        font-size: var(--font-size-sm);
    }
}

/* Flex Utilities */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.gap-md {
    gap: var(--spacing-md);
}

/* Loading */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
/* ══════════════════════════════════════════════════════════════════════════
   ASTRA CURRENCY MARK
   Four-point star, inherits the surrounding text colour.
   ══════════════════════════════════════════════════════════════════════════ */

.astra-badge {
    display: inline-flex;
    align-items: center;
    gap: .3em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.astra-icon {
    flex-shrink: 0;
    color: var(--primary, #FFD700);
    filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .18));
    vertical-align: -.12em;
}

.astra-amount {
    font-weight: 700;
}

.astra-name {
    font-size: .78em;
    letter-spacing: .04em;
    opacity: .75;
}

/* Pill variant, for chapter prices and other inline callouts */
.astra-badge--pill {
    padding: .18em .6em;
    border-radius: 999px;
    background: rgba(255, 215, 0, .16);
    border: 1px solid rgba(255, 215, 0, .5);
    color: #6b5200;
}

/* On dark surfaces the pill needs a lighter ink */
.bohio-navbar .astra-badge--pill,
.bg-dark .astra-badge--pill,
.footer-shell .astra-badge--pill {
    color: var(--primary, #FFD700);
    background: rgba(255, 215, 0, .12);
}


/* ===== header-modern.css ===== */
/**
 * Bohio MAG — header-modern.css
 * Design inspired by BuyMore with Bohio-MAG colors
 * Palette: Yellow #FFD700 · Black #000000 · Accent #FFEE00
 */

/* ════════════════════════════════════════════════════════════════════════════════
   VARIABLES
   ════════════════════════════════════════════════════════════════════════════════ */
:root {
  --bohio-primary:       #FFD700;        /* Bohio yellow */
  --bohio-accent:        #FFEE00;        /* Lighter yellow */
  --bohio-dark:          #1a1a1a;        /* Near-black */
  --bohio-dark2:         #0a0a0a;        /* Darker black */
  --bohio-dark3:         #141414;        /* Very dark */
  --bohio-text:          #e8e8e8;        /* Light text */
  --bohio-text-muted:    #888888;        /* Muted text */
  --bohio-border:        #333333;        /* Borders */
  --bohio-light:         #f9fafb;        /* Light gray */
  --bohio-radius:        8px;            /* Border radius */
  --bohio-shadow:        0 4px 24px rgba(255, 215, 0, 0.15);
  --bohio-font:          'Inter', 'Segoe UI', system-ui, sans-serif;
}

/* ════════════════════════════════════════════════════════════════════════════════
   RESET & BASE
   ════════════════════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Page surface is light (yellow-on-white). The navbar and mobile panel below
   keep their dark treatment via the --bohio-dark* tokens. */
body {
  font-family: var(--bohio-font);
  color: var(--text-primary, #241C15);
  line-height: 1.6;

  /* Dark surface with two soft accent glows bleeding down from the top and a
     faint grain. Stops the page reading as a flat slab of charcoal, and costs
     nothing extra — all CSS gradients, no image request. */
  background-color: var(--bg-primary, #121013);
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.022) 1px, transparent 0),
    radial-gradient(900px 460px at 8% -10%, rgba(244, 197, 66, 0.10), transparent 64%),
    radial-gradient(760px 420px at 100% 0%, rgba(244, 197, 66, 0.06), transparent 62%);
  background-size: 22px 22px, auto, auto;
  background-repeat: repeat, no-repeat, no-repeat;
  background-attachment: fixed, fixed, fixed;
}

/* ════════════════════════════════════════════════════════════════════════════════
   NAVBAR
   ════════════════════════════════════════════════════════════════════════════════ */
.bohio-navbar {
  background: linear-gradient(135deg, var(--bohio-dark2) 0%, #0f0f0f 100%);
  border-bottom: 3px solid var(--bohio-primary);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1050;
  box-shadow: 0 2px 20px rgba(255, 215, 0, 0.15);
}

.bohio-navbar .container {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.8rem;
  font-weight: 900;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: 0.5rem;
}

/* ════════════════════════════════════════════════════════════════════════════════
   SEARCH BAR
   ════════════════════════════════════════════════════════════════════════════════ */
.bohio-search-form {
  flex: 0 1 400px;
  max-width: 100%;
  position: relative;
  margin-right: 1rem;
}

.bohio-search-form form {
  display: flex;
  width: 100%;
}

.bohio-search-input {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 1px solid var(--bohio-border);
  border-radius: 8px 0 0 8px;
  background: var(--bohio-dark3);
  color: var(--bohio-text);
  font-size: 0.9rem;
  outline: none;
}

.bohio-search-input::placeholder {
  color: var(--bohio-text-muted);
}

.bohio-search-input:focus {
  background: var(--bohio-dark3);
  border-color: var(--bohio-primary);
  box-shadow: 0 0 0 2px rgba(255, 215, 0, 0.2);
}

.btn-search {
  padding: 0.6rem 1rem;
  background: var(--bohio-primary);
  color: black;
  border: none;
  border-radius: 0 8px 8px 0;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  font-weight: 700;
  transition: background 0.2s;
}

.btn-search:hover {
  background: var(--bohio-accent);
}

/* Autocomplete dropdown */
.bohio-ac-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  margin-top: 0;
  background: var(--bohio-dark2);
  border: 1px solid var(--bohio-border);
  border-radius: 12px;
  z-index: 2100;
  max-height: 400px;
  overflow-y: auto;
  box-shadow: 0 10px 32px rgba(255, 215, 0, 0.15);
}

.bohio-ac-dropdown.open {
  display: block;
}

.bohio-ac-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.85rem;
  text-decoration: none;
  color: var(--bohio-text);
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.bohio-ac-item:last-child {
  border-bottom: none;
}

.bohio-ac-item:hover,
.bohio-ac-item.focused {
  background: rgba(255, 215, 0, 0.08);
  color: var(--bohio-primary);
}

.bohio-ac-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  background: var(--bohio-dark3);
  border-radius: 6px;
  flex-shrink: 0;
  padding: 3px;
}

.bohio-ac-img-placeholder {
  width: 40px;
  height: 40px;
  background: var(--bohio-dark3);
  border-radius: 6px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--bohio-text-muted);
}

.bohio-ac-info {
  flex: 1;
  min-width: 0;
}

.bohio-ac-name {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bohio-ac-author {
  font-size: 0.72rem;
  color: var(--bohio-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

.bohio-ac-footer {
  padding: 0.45rem 0.85rem;
  font-size: 0.78rem;
  color: var(--bohio-text-muted);
  background: rgba(0, 0, 0, 0.2);
  text-align: center;
  cursor: pointer;
  transition: background 0.15s;
}

.bohio-ac-footer:hover {
  background: rgba(255, 215, 0, 0.08);
  color: var(--bohio-primary);
}

.bohio-ac-empty {
  padding: 0.75rem 0.85rem;
  font-size: 0.83rem;
  color: var(--bohio-text-muted);
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════════════════ */
.btn-primary {
  background: var(--bohio-primary);
  color: black;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-primary:hover {
  background: var(--bohio-accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

.btn-outline {
  background: transparent;
  color: var(--bohio-primary);
  border: 2px solid var(--bohio-primary);
  border-radius: 8px;
  padding: 0.45rem 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.btn-outline:hover {
  background: var(--bohio-primary);
  color: black;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
}

/* ════════════════════════════════════════════════════════════════════════════════
   NAVIGATION LINKS
   ════════════════════════════════════════════════════════════════════════════════ */
.nav-link {
  color: var(--bohio-text);
  text-decoration: none;
  padding: 0.5rem 0.7rem;
  display: flex;
  align-items: center;
  transition: color 0.2s, background 0.2s;
  border-radius: var(--bohio-radius);
}

.nav-link:hover {
  color: var(--bohio-primary);
}

.notif-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--bohio-primary);
  color: black;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
}

/* ════════════════════════════════════════════════════════════════════════════════
   DESKTOP NAV
   ════════════════════════════════════════════════════════════════════════════════ */
#bohio-nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  margin-left: auto;
}

#bohio-nav-mobile {
  display: none;
  margin-left: auto;
}

/* ════════════════════════════════════════════════════════════════════════════════
   USER DROPDOWN
   ════════════════════════════════════════════════════════════════════════════════ */
#user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: var(--bohio-dark2);
  border: 1px solid var(--bohio-border);
  border-radius: 12px;
  z-index: 2000;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);   /* was a yellow glow */
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  visibility: hidden;
}

#user-dropdown.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
  visibility: visible;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1.25rem;
  color: var(--bohio-text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.15s;
}

.sidebar-link:hover {
  background: rgba(255, 215, 0, 0.1);
  color: var(--bohio-primary);
  padding-left: 1.5rem;
}

.sidebar-link i {
  font-size: 1rem;
  width: 18px;
  text-align: center;
}

/* ════════════════════════════════════════════════════════════════════════════════
   CATEGORIES & NAV CHIPS
   ════════════════════════════════════════════════════════════════════════════════ */
#bohio-nav-cats {
  background: rgba(0, 0, 0, 0.3);
  border-top: 1px solid var(--bohio-border);
}

#bohio-nav-cats .container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
  padding: 0.5rem 1rem;
  align-items: center;
  scroll-behavior: smooth;
}

.nav-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: var(--bohio-primary);
  /* Dark ink on the yellow chip — white text on #FFD700 is a 1.4:1 contrast */
  color: #111111;
  text-decoration: none;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 0.85rem;
  border: 1px solid var(--bohio-primary);
  transition: all 0.2s;
  font-weight: 600;
}

.nav-chip:hover {
  background: var(--bohio-accent);
  border-color: var(--bohio-accent);
  color: #111111;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(255, 215, 0, 0.2);
}

/* ════════════════════════════════════════════════════════════════════════════════
   HAMBURGER BUTTON
   ════════════════════════════════════════════════════════════════════════════════ */
.navbar-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--bohio-border);
  color: var(--bohio-text);
  border-radius: var(--bohio-radius);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.navbar-toggle:hover {
  background: var(--bohio-primary);
  color: black;
  border-color: var(--bohio-primary);
}

/* ════════════════════════════════════════════════════════════════════════════════
   MOBILE NAVIGATION OVERLAY
   ════════════════════════════════════════════════════════════════════════════════ */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1045;
}

.mobile-nav-overlay.open {
  display: block;
}

.mobile-nav-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 88vw);
  height: 100%;
  background: var(--bohio-dark2);
  border-left: 1px solid var(--bohio-border);
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.mobile-nav-overlay.open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(1rem + 10px) 1.25rem 1rem;
  border-bottom: 1px solid var(--bohio-border);
  flex-shrink: 0;
}

.mobile-nav-close {
  background: transparent;
  border: 1px solid var(--bohio-border);
  color: var(--bohio-text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--bohio-radius);
  transition: color 0.2s, background 0.2s;
}

.mobile-nav-close:hover {
  color: var(--bohio-primary);
  background: rgba(255, 215, 0, 0.1);
  border-color: var(--bohio-primary);
}

.mobile-nav-divider {
  border: none;
  border-top: 1px solid var(--bohio-border);
  margin: 0.4rem 0;
}

.mobile-nav-section {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--bohio-text-muted);
  padding: 0.9rem 1.25rem 0.3rem;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.75rem 1.25rem;
  color: var(--bohio-text);
  font-size: 0.92rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.18s;
  text-decoration: none;
}

.mobile-nav-link i {
  width: 18px;
  text-align: center;
  font-size: 1rem;
}

.mobile-nav-link:hover {
  color: var(--bohio-primary);
  background: rgba(255, 215, 0, 0.06);
  border-left-color: var(--bohio-primary);
}

.mobile-nav-link.danger {
  color: #f87d87;
}

.mobile-nav-link.danger:hover {
  background: rgba(220, 53, 69, 0.07);
  border-left-color: #dc3545;
  color: #dc3545;
}

/* ════════════════════════════════════════════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
   ════════════════════════════════════════════════════════════════════════════════ */

/* 1024px - Laptop / Tablet Landscape */
@media (max-width: 1024px) {
  #bohio-nav-search {
    max-width: 300px;
  }
}

/* 992px - Tablet Portrait */
@media (max-width: 992px) {
  .nav-chip {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }
}

/* 768px - Mobile / Small Tablet (MAIN MOBILE BREAKPOINT) */
@media (max-width: 768px) {
  /* Hide desktop elements */
  #bohio-nav-search {
    display: none !important;
  }

  #bohio-nav-desktop {
    display: none !important;
  }

  /* Show mobile elements */
  #bohio-nav-mobile {
    display: flex !important;
  }

  #bohio-nav-cats {
    display: none !important;
  }

  /* Show hamburger */
  .navbar-toggle {
    display: flex;
  }

  .bohio-navbar .container {
    flex-wrap: nowrap !important;
  }

  .navbar-brand {
    font-size: 1.4rem;
  }

  /* Mobile nav panel full-height */
  .mobile-nav-panel {
    width: min(320px, 85vw);
  }

  .nav-chip {
    font-size: 0.75rem;
    padding: 0.4rem 0.6rem;
  }
}

/* 576px - Small Phone */
@media (max-width: 576px) {
  .navbar-brand {
    font-size: 1.2rem;
  }

  .bohio-search-input {
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
  }

  .btn-search {
    padding: 0.5rem 0.8rem;
  }

  #bohio-nav-mobile {
    gap: 0.3rem;
  }

  .navbar-toggle {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .mobile-nav-panel {
    width: min(280px, 90vw);
  }

  .mobile-nav-link {
    font-size: 0.88rem;
    padding: 0.65rem 1rem;
  }

  .mobile-nav-section {
    padding: 0.75rem 1rem 0.25rem;
  }
}

/* 400px - Very Small Phone */
@media (max-width: 400px) {
  .navbar-brand {
    font-size: 1rem;
  }

  .bohio-search-input {
    font-size: 0.8rem;
    padding: 0.45rem 0.7rem;
  }

  .btn-search {
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
  }

  .mobile-nav-panel {
    width: 100vw;
  }
}

/* ════════════════════════════════════════════════════════════════════════════════
   TOUCH TARGETS
   ════════════════════════════════════════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .btn-primary,
  .btn-outline,
  .navbar-toggle {
    min-height: 44px;
    padding-top: 0.7rem;
    padding-bottom: 0.7rem;
  }

  .navbar-toggle {
    min-width: 44px;
    width: 44px;
    height: 44px;
  }
}

/* ══════════════════════════════════════════════════════════════════════════
   NAVBAR v2 — single slim row
   Replaces the two-row navbar (brand+search row, then a category chip bar).
   Appended last so it wins the cascade over the older rules above.
   ══════════════════════════════════════════════════════════════════════════ */

.bohio-navbar {
  background: #0d0d0d;
  border-bottom: 1px solid #232323;
  box-shadow: 0 1px 12px rgba(0, 0, 0, .35);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1050;
  transition: transform .28s ease;
  will-change: transform;
}

/* Slides out of the way when scrolling down and returns on the way back up,
   so a phone screen is not giving 60px to the bar while reading. */
.bohio-navbar.is-hidden {
  transform: translateY(-100%);
}

@media (prefers-reduced-motion: reduce) {
  .bohio-navbar { transition: none; }
}

.bohio-nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
  height: 60px;
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* ── Brand ─────────────────────────────────────────────────────────────── */
.bohio-brand {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  text-decoration: none;
  flex-shrink: 0;
  margin-right: .75rem;
}

.bohio-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: block;
}

.bohio-brand-text {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -.01em;
  color: #ffffff;
  white-space: nowrap;
}

.bohio-brand-text span {
  color: var(--bohio-primary);
}

/* ── Primary links ─────────────────────────────────────────────────────── */
.bohio-nav-links {
  display: flex;
  align-items: center;
  gap: .15rem;
  min-width: 0;
}

.bohio-nav-link {
  display: inline-flex;
  align-items: center;
  padding: .5rem .75rem;
  border-radius: 6px;
  color: #c9c9c9;
  font-size: .9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease;
}

.bohio-nav-link:hover,
.bohio-nav-link:focus-visible {
  color: var(--bohio-primary);
  background: rgba(255, 215, 0, .08);
}

.bohio-nav-spacer {
  flex: 1 1 auto;
}

/* Compact tab row used only when the full desktop navigation is hidden.
 *
 * C'étaient deux libellés soulignés, serrés dans une bande de 26 px : sous la
 * barre des 44 px recommandés pour le doigt, et sans indiquer qu'il s'agissait
 * d'un choix entre deux catalogues. Ils forment maintenant un sélecteur — deux
 * segments de largeur égale, celui de la page courante rempli en or.
 *
 * Les libellés restent écrits. Une étoile et une fusée ne disent pas
 * « Supernovas » et « Launchpad » à quelqu'un qui découvre le site : l'icône
 * accompagne le mot, elle ne le remplace pas.
 */
.bohio-mobile-tabs {
  display: none;
}

.bohio-mobile-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  min-height: 44px;              /* cible tactile réelle */
  padding: .4rem .75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .04);
  color: #d8d8d8;
  font-size: .84rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color .15s ease, background-color .15s ease, border-color .15s ease;
}

.bohio-mobile-tab i {
  font-size: 1rem;
  opacity: .85;
}

.bohio-mobile-tab:hover,
.bohio-mobile-tab:focus-visible {
  color: var(--bohio-primary);
  background: rgba(255, 215, 0, .10);
  border-color: rgba(255, 215, 0, .35);
}

/* La page courante est remplie, pas seulement colorée : sur un petit écran, un
   simple changement de teinte se remarque mal. */
.bohio-mobile-tab.is-active {
  color: #17140a;
  background: var(--bohio-primary);
  border-color: var(--bohio-primary);
}

.bohio-mobile-tab.is-active i { opacity: 1; }

/* ── Icon buttons (search, bell) ───────────────────────────────────────── */
.bohio-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #d5d5d5;
  font-size: 1.05rem;
  cursor: pointer;
  text-decoration: none;
  transition: color .15s ease, background-color .15s ease;
}

.bohio-icon-btn:hover,
.bohio-icon-btn:focus-visible {
  color: var(--bohio-primary);
  background: rgba(255, 255, 255, .07);
}

.bohio-icon-btn.bohio-mobile-explore-btn {
  display: none;
}

.bohio-icon-btn .notif-badge {
  position: absolute;
  top: 4px;
  right: 3px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: #dc3545;
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ── Hamburger ─────────────────────────────────────────────────────────── */
.bohio-burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-right: .1rem;
  flex-shrink: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #e8e8e8;
  font-size: 1.35rem;
  cursor: pointer;
}

.bohio-burger:hover {
  background: rgba(255, 255, 255, .07);
  color: var(--bohio-primary);
}

/* ── Search overlay ────────────────────────────────────────────────────── */
/* Shown/hidden with `display`, not a transition on `visibility`: an animated
   visibility can stay pinned at its start value if the transition never ticks
   (backgrounded tab, reduced motion, throttled compositor), leaving the overlay
   permanently invisible while still carrying the .open class. */
.bohio-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 0, 0, .6);
  backdrop-filter: blur(3px);
  padding: 12vh 1rem 1rem;
}

.bohio-search-overlay.open {
  display: block;
}

.bohio-search-box {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
}

.bohio-search-overlay .bohio-search-form {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .35rem .5rem .35rem .9rem;
  background: #ffffff;
  border: 2px solid var(--bohio-primary);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  /* neutralise the older .bohio-search-form rules further up this file */
  flex: none;
  max-width: none;
  margin-right: 0;
  position: static;
}

.bohio-search-icon {
  color: #6B7280;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.bohio-search-overlay .bohio-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font-size: 1.05rem;
  padding: .6rem 0;
  border-radius: 0;
}

.bohio-search-overlay .bohio-search-input::placeholder {
  color: #9CA3AF;
}

.bohio-search-close {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #F3F4F6;
  color: #4B5563;
  cursor: pointer;
}

.bohio-search-close:hover {
  background: #E5E7EB;
  color: #111827;
}

.bohio-search-overlay .bohio-ac-dropdown {
  position: static;
  margin-top: .6rem;
  max-height: 60vh;
  overflow-y: auto;
  border-radius: 12px;
}

/* ── Search inside the mobile panel ────────────────────────────────────── */
.mobile-nav-search {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .85rem 1.25rem .25rem;
  padding: .55rem .8rem;
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--bohio-border);
  border-radius: 10px;
}

.mobile-nav-search i {
  color: var(--bohio-text-muted);
  flex-shrink: 0;
}

.mobile-nav-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--bohio-text);
  font-size: .9rem;
}

.mobile-nav-search input::placeholder {
  color: var(--bohio-text-muted);
}

/* ── Breakpoints ───────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .bohio-nav-links { display: none; }
  .bohio-burger    { display: inline-flex; }
  .bohio-icon-btn.bohio-mobile-explore-btn { display: inline-flex; }
  /* Deux segments de largeur égale : la grille les répartit d'elle-même, quel
     que soit le nombre de liens (Launchpad peut être désactivé). */
  .bohio-mobile-tabs {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
    gap: .4rem;
    padding: .3rem .65rem .45rem;
    border-top: 1px solid #1d1d1d;
  }

  /* En lecture, la place à l'écran est ce qui compte le plus : la barre coûtait
     près de 60 px de hauteur sur toutes les pages de chapitre, alors que ces
     deux liens figurent déjà dans le menu latéral. L'en-tête y reste donc
     réduit à sa seule barre principale. */
  body.page-read .bohio-mobile-tabs { display: none; }
}

@media (max-width: 768px) {
  /* Account controls live in the slide-out panel at this size, but search and
     notifications stay on the bar — they were unreachable on mobile before. */
  #bohio-nav-desktop { display: none !important; }
  .bohio-nav-inner   { height: 56px; padding: 0 .65rem; }
  .bohio-brand-mark  { width: 30px; height: 30px; }
  .bohio-brand-text  { font-size: 1.05rem; }
  .bohio-search-overlay { padding-top: 6vh; }
}

@media (max-width: 400px) {
  .bohio-brand-text { display: none; }
}

/* ── Avatar button in the always-visible icon group ─────────────────────────
   #user-menu-wrap sits outside #bohio-nav-desktop so the profile picture stays
   in the header at every width. Below 480px only the avatar shows — the name
   and chevron would crowd the burger, logo, search and bell. */
#user-menu-wrap {
    flex-shrink: 0;
}

@media (max-width: 480px) {
    #user-menu-btn span,
    #user-menu-btn .bi-chevron-down {
        display: none;
    }

    /* Collapse to just the avatar: drop the yellow pill fill and the 2px
       border, leaving a hairline outline instead of a thick ring. */
    #user-menu-btn {
        padding: 0 !important;
        border-radius: 50% !important;
        background: transparent !important;
        border: 1px solid rgba(255, 215, 0, .55) !important;
        box-shadow: none !important;
    }

    #user-menu-btn img {
        width: 30px !important;
        height: 30px !important;
        border: 0 !important;
    }

    /* Keep the dropdown inside the viewport on small screens */
    #user-dropdown {
        min-width: min(280px, calc(100vw - 1.5rem)) !important;
        right: 0;
    }
}

/* ── "Mon espace" button ────────────────────────────────────────────────────
   Sits in the always-visible icon group, so it stays in the header on mobile.
   Collapses to an icon-only pill on narrow screens. */
.bohio-space-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
    padding: .38rem .75rem;
    border: 1px solid transparent;   /* the yellow hairline read as template chrome */
    border-radius: 999px;
    background: rgba(255, 215, 0, .12);
    color: var(--bohio-primary);
    font-size: .82rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.bohio-space-btn:hover,
.bohio-space-btn:focus-visible {
    background: var(--bohio-primary);
    border-color: var(--bohio-primary);
    color: #111;
}

.bohio-space-btn .bi { font-size: .95rem; }

/* Icon only once space gets tight */
@media (max-width: 900px) {
    .bohio-space-btn span { display: none; }
    .bohio-space-btn {
        width: 38px;
        height: 38px;
        padding: 0;
        justify-content: center;
        border-radius: 10px;
    }
    .bohio-space-btn .bi { font-size: 1.05rem; }
}

/* ═══════════════════════════════════════════════════════════════════
   ANNOUNCEMENTS — strip under the header, and pop-up
   ═══════════════════════════════════════════════════════════════════ */

.announce-strip {
    position: relative;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .7rem 3rem .7rem 1.25rem;   /* right padding clears the close button */
    font-size: .9rem;
    line-height: 1.45;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    transition: opacity .2s ease, transform .2s ease;
}

.announce-strip.is-closing { opacity: 0; transform: translateY(-6px); }

.announce-strip-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.announce-strip .bi { font-size: 1rem; flex-shrink: 0; }
.announce-strip-text { min-width: 0; }

/* The call to action is a chip, not a link in a sentence: at this size an
   underlined link is easy to miss and hard to hit on a phone. */
.announce-strip-cta {
    display: inline-block;
    padding: .28rem .85rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, .28);
    color: inherit;
    font-weight: 700;
    font-size: .82rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease;
}
.announce-strip-cta:hover { background: rgba(0, 0, 0, .45); color: inherit; }

.announce-dismiss {
    position: absolute;
    top: 50%;
    right: .75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: .65;
    cursor: pointer;
    padding: .35rem;
    line-height: 1;
    font-size: .8rem;
    border-radius: 50%;
    transition: opacity .2s ease, background .2s ease;
}
.announce-dismiss:hover { opacity: 1; background: rgba(0, 0, 0, .2); }

/* ---- Tones. Solid fills, because the strip sits against the dark nav and a
        translucent tint would read as part of it. ---- */
.announce-strip.announce-info    { background: #1E4E6B; color: #EAF4FA; }
.announce-strip.announce-success { background: #14563C; color: #E4F6EE; }
.announce-strip.announce-warning { background: #7A5410; color: #FDF3DF; }
.announce-strip.announce-danger  { background: #7A2020; color: #FDE9E9; }
.announce-strip.announce-promo   { background: linear-gradient(90deg, #7A5F0B, #A57F0D); color: #FFF8E1; }

/* ===== POP-UP ===== */
.announce-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    background: rgba(0, 0, 0, .68);
    backdrop-filter: blur(3px);
    opacity: 0;
    transition: opacity .22s ease;
}
.announce-modal-overlay.is-open   { opacity: 1; }
.announce-modal-overlay.is-closing { opacity: 0; }
.announce-modal-overlay[hidden]   { display: none; }

.announce-modal {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-card, #201D22);
    border: 1px solid var(--border-color, #322D34);
    border-radius: var(--border-radius-lg, 12px);
    padding: 2rem 1.75rem 1.75rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
    transform: translateY(12px) scale(.98);
    transition: transform .22s ease;
}
.announce-modal-overlay.is-open .announce-modal { transform: translateY(0) scale(1); }

/* A coloured hairline carries the tone without tinting the whole dialog. */
.announce-modal::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    border-radius: var(--border-radius-lg, 12px) var(--border-radius-lg, 12px) 0 0;
}
.announce-modal.announce-info::before    { background: #3E9BD1; }
.announce-modal.announce-success::before { background: #2FA97A; }
.announce-modal.announce-warning::before { background: #D9A216; }
.announce-modal.announce-danger::before  { background: #D95757; }
.announce-modal.announce-promo::before   { background: linear-gradient(90deg, #E6C200, #FFD700); }

/* An uploaded image takes the place of the icon and bleeds to the dialog's
   edges: a framed thumbnail floating in padding looks like a mistake. */
.announce-modal-media {
    margin: -2rem -1.75rem 1.25rem;
    border-radius: var(--border-radius-lg, 12px) var(--border-radius-lg, 12px) 0 0;
    overflow: hidden;
    background: var(--bg-secondary, #1A171B);
}

.announce-modal-media img {
    display: block;
    width: 100%;
    max-height: 220px;
    object-fit: cover;
}

.announce-modal-icon { font-size: 2.4rem; margin-bottom: .75rem; line-height: 1; }
.announce-modal.announce-info    .announce-modal-icon { color: #3E9BD1; }
.announce-modal.announce-success .announce-modal-icon { color: #2FA97A; }
.announce-modal.announce-warning .announce-modal-icon { color: #D9A216; }
.announce-modal.announce-danger  .announce-modal-icon { color: #D95757; }
.announce-modal.announce-promo   .announce-modal-icon { color: var(--primary, #FFD700); }

.announce-modal-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary, #F3F0EC);
    margin: 0 0 .6rem;
}

.announce-modal-body {
    color: var(--text-secondary, #B8B0A6);
    font-size: .94rem;
    line-height: 1.6;
}

.announce-modal-actions {
    display: flex;
    gap: .6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.announce-modal-close {
    position: absolute;
    top: .6rem;
    right: .6rem;
    background: none;
    border: none;
    color: var(--text-secondary, #B8B0A6);
    cursor: pointer;
    padding: .4rem;
    line-height: 1;
    border-radius: 50%;
    transition: color .2s ease, background .2s ease;
}
.announce-modal-close:hover {
    color: var(--text-primary, #F3F0EC);
    background: rgba(255, 255, 255, .08);
}

@media (max-width: 600px) {
    .announce-strip { font-size: .84rem; padding: .6rem 2.6rem .6rem 1rem; }
    .announce-strip-inner { justify-content: flex-start; }
    .announce-modal { padding: 1.75rem 1.25rem 1.25rem; }
    .announce-modal-actions .btn { width: 100%; justify-content: center; }
}

/* Respect a reduced-motion preference: the pop-up still appears, it just
   does not slide or fade in. */
@media (prefers-reduced-motion: reduce) {
    .announce-strip,
    .announce-modal-overlay,
    .announce-modal { transition: none; }
    .announce-modal { transform: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   POP-UP FORMAT « POSTER »

   Repris de l'ancien includes/popup-poster.php. L'affiche porte le message :
   pas de carte, pas de titre, angles nets, croix décalée hors du cadre et un
   seul bouton pleine largeur. Les proportions d'origine sont conservées
   (380 → 350 → 320 → 280 px) parce qu'elles cadrent une affiche portrait sans
   la rogner sur les petits écrans.
   ═══════════════════════════════════════════════════════════════════ */

.poster-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, .65);
    opacity: 0;
    transition: opacity .25s ease;
}
.poster-overlay.is-open    { opacity: 1; }
.poster-overlay.is-closing { opacity: 0; }
.poster-overlay[hidden]    { display: none; }

.poster-content {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: transparent;
    transform: scale(.95);
    transition: transform .25s ease;
}
.poster-overlay.is-open .poster-content { transform: scale(1); }

.poster-close {
    position: absolute;
    top: -12px;
    right: -12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    border: 2px solid #fff;
    border-radius: 0;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, .3);
    transition: all .3s ease;
}
.poster-close:hover { background: #ff4757; transform: rotate(90deg) scale(1.1); }
.poster-close svg   { width: 16px; height: 16px; }

.poster-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

.poster-cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin-top: 12px;
    padding: 14px 20px;
    /* Le doré de l'affiche d'origine, et non --primary : la variable du thème
       vaut #FFD700, un jaune plus vif. Le bouton virait donc au citron alors
       que son halo restait sur l'ancien ton — deux dorés côte à côte. */
    background: #F4C542;
    color: #1a1a2e !important;
    border: none;
    border-radius: 0;
    font-weight: 700;
    font-size: .85rem;
    letter-spacing: 1px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(244, 197, 66, .3);
    transition: all .3s ease;
}
.poster-cta:hover {
    background: #e0b032;
    color: #1a1a2e !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(244, 197, 66, .5);
}
.poster-cta svg { flex-shrink: 0; }

@media (max-width: 1024px) { .poster-content { max-width: 350px; } }

@media (max-width: 768px) {
    .poster-overlay { padding: 12px; }
    .poster-content { max-width: 320px; }
    .poster-cta     { padding: 12px 16px; font-size: .75rem; margin-top: 10px; gap: 8px; }
    .poster-cta svg { width: 16px; height: 16px; }
    .poster-close   { width: 32px; height: 32px; top: -10px; right: -10px; }
    .poster-close svg { width: 14px; height: 14px; }
}

@media (max-width: 420px) {
    .poster-overlay { padding: 8px; }
    .poster-content { max-width: 280px; }
    .poster-cta     { padding: 10px 12px; font-size: .65rem; margin-top: 8px; gap: 6px; letter-spacing: .5px; }
    .poster-cta svg { width: 14px; height: 14px; }
    .poster-close   { width: 28px; height: 28px; top: -8px; right: -8px; border-width: 1.5px; }
    .poster-close svg { width: 12px; height: 12px; }
}

/* Écran très bas (paysage) : l'affiche doit rester entièrement visible. */
@media (max-height: 620px) {
    .poster-image { max-height: 62vh; width: auto; margin: 0 auto; }
    .poster-content { max-width: none; width: auto; display: flex; flex-direction: column; align-items: center; }
    .poster-cta { max-width: 380px; }
}

@media (prefers-reduced-motion: reduce) {
    .poster-overlay, .poster-content, .poster-cta, .poster-close { transition: none; }
    .poster-content { transform: none; }
}


/* ===== responsive.css ===== */
/**
 * Bohio MAG — Responsive Utilities
 * Global responsive fixes for ALL pages and ALL roles.
 * Loaded by includes/header.php after style.css — no design changes, only layout fixes.
 * Version: 1.0  |  23 février 2026
 */

/* ═══════════════════════════════════════════════
   1. TABLE RESPONSIVE WRAPPER
   Auto-injected by main.js initResponsiveTables()
   ═══════════════════════════════════════════════ */

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: var(--primary, #8b5a2b) transparent;
}

.table-responsive::-webkit-scrollbar {
    height: 4px;
}

.table-responsive::-webkit-scrollbar-track {
    background: transparent;
}

.table-responsive::-webkit-scrollbar-thumb {
    background-color: var(--primary, #8b5a2b);
    border-radius: 2px;
}

/* Ensure wrapped tables keep full layout */
.table-responsive > table {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════
   2. DASHBOARD — ADMIN / AUTHOR / EDITOR
   ═══════════════════════════════════════════════ */

/* Columns marked as non-essential on mobile */
.hide-mob {
    /* shown on desktop, hidden below 768px */
}

@media (max-width: 900px) {
    /* Stats / KPI grids: 3 cols → 2 cols */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 768px) {
    /* Hide non-essential table columns */
    .hide-mob {
        display: none !important;
    }

    /* Data tables — minimum width so columns don't squash */
    table.data-table,
    table.table,
    table.chapters-table,
    table.works-table {
        min-width: 560px;
    }

    /* KPI / stats: 2-column grid */
    .stats-grid,
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: var(--spacing-sm, 0.5rem) !important;
    }

    /* Dashboard layout: sidebar + content → stacked */
    .dashboard-layout {
        flex-direction: column !important;
    }

    .dashboard-sidebar {
        width: 100% !important;
        min-width: unset !important;
        max-width: unset !important;
    }

    /* Dashboard action button rows → wrap */
    .dashboard-actions,
    .header-actions {
        flex-wrap: wrap;
        gap: var(--spacing-sm, 0.5rem);
    }

    .dashboard-actions .btn,
    .header-actions .btn {
        flex: 1 1 auto;
        min-width: 120px;
    }

    /* Admin/Editor - smaller action buttons in tables */
    td .btn-sm,
    th .btn-sm {
        padding: 3px 8px !important;
        font-size: 0.7rem !important;
        white-space: nowrap;
    }

    /* Breadcrumbs wrap */
    .breadcrumb {
        flex-wrap: wrap;
    }

    /* Tab navigation: horizontal scroll */
    .tabs,
    .tab-nav,
    .nav-tabs {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        scrollbar-width: none;
        padding-bottom: 2px;
    }

    .tabs::-webkit-scrollbar,
    .tab-nav::-webkit-scrollbar,
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }

    /* Page/section titles — fluid size */
    .page-title,
    .section-title {
        font-size: clamp(1rem, 3.5vw, 1.4rem) !important;
    }
}

@media (max-width: 480px) {
    /* KPI → single column on tiny screens */
    .stats-grid,
    .kpi-grid {
        grid-template-columns: 1fr !important;
    }

    /* Score circles — reduced */
    .score-circle {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.72rem !important;
    }

    /* Card padding reduction */
    .card {
        padding: var(--spacing-md, 1rem) !important;
    }

    /* Section headers — stack label + link */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-xs, 0.25rem);
    }
}

/* ═══════════════════════════════════════════════
   3. FORMS — RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Multi-column form grids → 1 column */
    .form-grid,
    .form-row.cols-2,
    .form-row.cols-3 {
        grid-template-columns: 1fr !important;
        flex-direction: column !important;
    }

    /* All inputs full width */
    .form-control,
    input[type="text"],
    input[type="email"],
    input[type="password"],
    input[type="number"],
    input[type="date"],
    input[type="datetime-local"],
    input[type="url"],
    select,
    textarea {
        width: 100%;
        box-sizing: border-box;
        max-width: 100%;
    }

    /* Tag / checkbox grids → 2 cols */
    .tags-grid,
    .checkbox-grid,
    .genre-checkboxes {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 480px) {
    /* Tags → 1 col on tiny phones */
    .tags-grid,
    .checkbox-grid,
    .genre-checkboxes {
        grid-template-columns: 1fr !important;
    }
}

/* ═══════════════════════════════════════════════
   4. MODALS — RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    .modal,
    .modal-content {
        width: 95vw !important;
        max-width: 95vw !important;
        margin: auto !important;
        max-height: 90dvh;
        overflow-y: auto;
    }

    .modal-footer,
    .modal-actions {
        flex-direction: column;
        gap: var(--spacing-sm, 0.5rem);
    }

    .modal-footer .btn,
    .modal-actions .btn {
        width: 100%;
    }
}

/* ═══════════════════════════════════════════════
   5. BUTTON GROUPS & ACTION ROWS
   ═══════════════════════════════════════════════ */

@media (max-width: 640px) {
    .btn-group,
    .action-buttons,
    .button-row {
        flex-direction: column;
        width: 100%;
        gap: var(--spacing-sm, 0.5rem);
    }

    .btn-group .btn,
    .action-buttons .btn,
    .button-row .btn {
        width: 100%;
        text-align: center;
    }
}

/* ═══════════════════════════════════════════════
   6. IMAGES — LAZY & COVER FIXES
   ═══════════════════════════════════════════════ */

/* Prevent cover image overflow in any container */
.work-cover img,
.cover-img,
img.work-cover-img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Avatars always cover their circle */
.user-avatar img,
.avatar img,
img.avatar {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* ═══════════════════════════════════════════════
   7. SIDEBAR — TOUCH IMPROVEMENTS
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Larger tap targets for sidebar links */
    .sidebar .nav-link,
    .sidebar-nav a,
    .sidebar-menu a {
        min-height: 44px;
        display: flex;
        align-items: center;
    }

    /* Smooth sidebar slide */
    #sidebar,
    .sidebar {
        transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
}

/* ═══════════════════════════════════════════════
   8. WALLET & PROFILE PAGES
   ═══════════════════════════════════════════════ */

@media (max-width: 600px) {
    .wallet-summary,
    .profile-stats {
        flex-direction: column;
        gap: var(--spacing-md, 1rem);
    }

    .wallet-balance-card,
    .stat-card {
        width: 100%;
        min-width: unset;
    }
}

/* ═══════════════════════════════════════════════
   9. WORK PAGE — CHAPTER LIST
   ═══════════════════════════════════════════════ */

@media (max-width: 768px) {
    /* Chapter list purchase badges */
    .chapter-item {
        flex-wrap: wrap;
        gap: var(--spacing-xs, 0.25rem);
    }

    .chapter-meta {
        font-size: 0.75rem;
    }

    /* Work header → stack */
    .work-header {
        flex-direction: column;
    }

    .work-cover-container {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }
}

/* ═══════════════════════════════════════════════
   10. READER PAGE — mobile typography
   ═══════════════════════════════════════════════ */

@media (max-width: 600px) {
    .reader-container {
        padding: var(--spacing-sm, 0.5rem) !important;
    }

    .reader-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: var(--spacing-sm, 0.5rem);
        scrollbar-width: none;
    }

    .reader-nav::-webkit-scrollbar {
        display: none;
    }

    .reader-chapter-title {
        font-size: clamp(1rem, 4vw, 1.4rem);
    }
}

/* ═══════════════════════════════════════════════
   12. ADMIN — USERS PAGE
   ═══════════════════════════════════════════════ */

/* Default: show/hide helpers already defined (.hide-mob toggles at 768px)  */
.show-mob { display: none; }

/* Action buttons container in table rows */
.actions-btn-group {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    align-items: center;
}

/* Filter bar: search + role select + button on one row */
.users-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 1rem;
    align-items: end;
}

/* Keep table scrollable without squashing */
.table-users {
    min-width: 520px;
}

/* Email col: break long addresses instead of stretching the column */
.table-users td:nth-child(3) {
    word-break: break-all;
    max-width: 180px;
}

/* Actions column: min-width so buttons don't overflow into adjacent cells */
.table-users .actions-cell {
    min-width: 140px;
}

@media (max-width: 900px) {
    .users-filter-grid {
        grid-template-columns: 1fr 1fr;
    }
    .users-filter-grid button[type="submit"] {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 768px) {
    /* Reveal inline email on mobile (inside user cell) */
    .show-mob { display: block !important; }

    /* Actions buttons: stack vertically for readability */
    .actions-btn-group {
        flex-direction: column;
        align-items: stretch;
        gap: 0.3rem;
        min-width: 100px;
    }

    .actions-btn-group form {
        width: 100%;
    }

    .actions-btn-group .btn-xs {
        width: 100%;
        text-align: center;
        padding: 0.3rem 0.5rem !important;
        font-size: 0.72rem !important;
    }

    /* Suspend form: stack number + button */
    .actions-btn-group form[style*="inline-flex"] {
        display: flex !important;
        flex-direction: column;
        gap: 0.2rem;
    }

    .actions-btn-group input[type="number"] {
        width: 100% !important;
        box-sizing: border-box;
    }

    .users-filter-grid {
        grid-template-columns: 1fr;
    }

    .users-filter-grid button[type="submit"] {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Create user form: single column on phones */
    #create-user-panel > div > form > div[style*="grid"] {
        grid-template-columns: 1fr !important;
    }
}



@media print {
    #sidebar,
    .sidebar,
    .header,
    .navbar,
    .btn,
    .modal-overlay,
    .carousel-btn,
    .notification-badge {
        display: none !important;
    }

    .dashboard-content,
    main {
        margin: 0 !important;
        padding: 0 !important;
    }

    table {
        page-break-inside: avoid;
        font-size: 11pt;
    }
}


/* ===== ui-v2.css ===== */
/* ──────────────────────────────────────────────────────────────────────────
   UI v2 — composants communs (décembre 2026)
   Chargé en dernier dans le paquet socle (core.bundle.css). Utilise les
   échelles définies à la fin de variables.css (--text-*, --radius-*, --space-*).
   ────────────────────────────────────────────────────────────────────────── */

/* ── Barre d'onglets du bas (téléphones et tablettes) ─────────────────── */
.bottom-nav { display: none; }

/* 900px : exactement là où l'en-tête masque ses liens (header-modern.css).
   À 768px, les tablettes (769–900px) n'avaient plus aucun menu. */
@media (max-width: 900px) {
    /* Pilule flottante, décollée des bords : une fois le site installé sur
       l'écran d'accueil, une barre bord à bord se faisait rogner par les
       coins arrondis du téléphone. */
    .bottom-nav {
        position: fixed;
        left: max(var(--space-3), env(safe-area-inset-left, 0px));
        right: max(var(--space-3), env(safe-area-inset-right, 0px));
        bottom: calc(var(--space-3) + env(safe-area-inset-bottom, 0px));
        z-index: 1040;               /* sous les menus et fenêtres (1045+) */
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        gap: 2px;
        max-width: 520px;
        margin: 0 auto;
        padding: 6px;
        border-radius: var(--radius-pill);
        background: rgba(24, 21, 26, .88);
        -webkit-backdrop-filter: saturate(1.5) blur(16px);
                backdrop-filter: saturate(1.5) blur(16px);
        border: 1px solid rgba(255, 255, 255, .09);
        box-shadow: 0 10px 30px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .04) inset;
    }

    .bottom-nav__item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 50px;            /* cible tactile confortable */
        border-radius: var(--radius-pill);
        color: var(--text-light, #8B847B);
        font-size: 0.6875rem;        /* 11px : cinq libellés tiennent sur 320px */
        font-weight: 600;
        line-height: 1.1;
        text-decoration: none;
        transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
        -webkit-tap-highlight-color: transparent;
    }
    .bottom-nav__item i { font-size: 1.3rem; line-height: 1; }
    .bottom-nav__item span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .bottom-nav__item:hover,
    .bottom-nav__item:focus-visible { color: var(--text-primary, #F3F0EC); }
    .bottom-nav__item:focus-visible { outline: 2px solid var(--primary, #FFD700); outline-offset: -2px; }
    .bottom-nav__item:active { background: rgba(255, 255, 255, .05); }
    /* L'onglet actif est sa propre petite pilule, comme dans les applis. */
    .bottom-nav__item.is-active {
        color: var(--primary, #FFD700);
        background: rgba(255, 215, 0, .13);
    }

    /* La barre ne doit rien cacher : on réserve sa hauteur en bas de page. */
    body:has(.bottom-nav) {
        padding-bottom: calc(62px + 2 * var(--space-3) + env(safe-area-inset-bottom, 0px));
    }

    /* Doublons de la barre : l'icône Explorer et le bouton « Mon espace » de
       l'en-tête — sur téléphone, ils vivent dans la barre du bas. */
    .bohio-mobile-explore-btn,
    .bohio-space-btn { display: none !important; }

    /* Pages où la barre n'a pas sa place : le lecteur a ses propres commandes,
       la connexion doit rester sans distraction. */
    body.page-read .bottom-nav,
    body.page-auth .bottom-nav { display: none; }
    body.page-read:has(.bottom-nav),
    body.page-auth:has(.bottom-nav) { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .bottom-nav__item { transition: none; }
}

/* ── Cartes : une seule pastille sur la couverture ────────────────────── */
.card-flag {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
    z-index: 2;
    padding: 3px 7px;
    border-radius: var(--radius-sm);
    background: rgba(12, 10, 13, .78);
    -webkit-backdrop-filter: blur(6px);
            backdrop-filter: blur(6px);
    color: var(--primary, #FFD700);
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: .04em;
    line-height: 1.2;
    text-transform: uppercase;
    white-space: nowrap;
    pointer-events: none;
}
.card-flag--new {
    background: var(--primary, #FFD700);
    color: var(--text-inverse, #1A1419);
}

/* Ligne d'information sous le titre : du texte, pas des pastilles. */
.card-sub {
    margin: 2px 0 0;
    color: var(--text-light, #8B847B);
    font-size: var(--text-xs);
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-sub strong { color: var(--text-secondary, #B7B0A7); font-weight: 600; }

/* ── Pied de page ──────────────────────────────────────────────────────── */
.site-footer {
    margin-top: var(--space-8);
    border-top: 1px solid rgba(255, 255, 255, .07);
    background:
        radial-gradient(80% 120% at 0% 0%, rgba(255, 215, 0, .05), transparent 55%),
        #0f0d10;
    color: var(--text-secondary, #B7B0A7);
    font-size: var(--text-sm);
}
.site-footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
    gap: var(--space-6) var(--space-5);
    padding-top: var(--space-8);
    padding-bottom: var(--space-6);
}

.site-footer__logo {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    color: var(--text-primary, #F3F0EC);
    font-size: var(--text-lg);
    font-weight: 700;
    letter-spacing: -.01em;
    text-decoration: none;
}
.site-footer__logo img { width: 40px; height: 40px; border-radius: var(--radius-md); }
.site-footer__logo strong { color: var(--primary, #FFD700); font-weight: 800; }
.site-footer__tagline {
    max-width: 34ch;
    margin: var(--space-3) 0 var(--space-4);
    line-height: 1.6;
}

.site-footer__socials { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-4); }
.site-footer__socials a {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(255, 255, 255, .1);
    background: rgba(255, 255, 255, .03);
    color: var(--text-primary, #F3F0EC);
    font-size: 1.05rem;
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.site-footer__socials a:hover,
.site-footer__socials a:focus-visible {
    color: var(--primary, #FFD700);
    border-color: rgba(255, 215, 0, .45);
    background: rgba(255, 215, 0, .08);
}

.site-footer__contact,
.site-footer__col ul { list-style: none; margin: 0; padding: 0; }
.site-footer__contact li + li { margin-top: var(--space-2); }

.site-footer__title {
    margin: 0 0 var(--space-3);
    color: var(--text-primary, #F3F0EC);
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.site-footer__col li + li { margin-top: var(--space-2); }

.site-footer a:not(.site-footer__logo):not(.site-footer__socials a) {
    color: var(--text-secondary, #B7B0A7);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease-out);
}
.site-footer__col a:hover,
.site-footer__contact a:hover,
.site-footer a:focus-visible { color: var(--primary, #FFD700) !important; }
.site-footer a:focus-visible { outline: 2px solid var(--primary, #FFD700); outline-offset: 3px; border-radius: 4px; }
.site-footer__contact i { color: var(--text-light, #8B847B); margin-right: .35rem; }

.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .06); }
.site-footer__bottom-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--space-2) var(--space-4);
    padding-top: var(--space-4);
    padding-bottom: var(--space-4);
    color: var(--text-light, #8B847B);
    font-size: var(--text-xs);
}
.site-footer__bottom-inner p { margin: 0; }

/* Tablette : la marque au-dessus, les trois colonnes en dessous. */
@media (max-width: 900px) {
    .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .site-footer__brand { grid-column: 1 / -1; }
}
/* Téléphone : deux colonnes de liens par ligne, tout centré à gauche. */
@media (max-width: 560px) {
    .site-footer { margin-top: var(--space-6); }
    .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-4); padding-top: var(--space-6); }
    .site-footer__bottom-inner { justify-content: center; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .site-footer a { transition: none !important; }
}

