/* =============================================================
   THEOLOGIA REFORMATA — STYLES GLOBAUX
   Direction esthétique : éditorial-académique
   Inspiration : reliures patristiques, éditions critiques (Cerf, Brill)
   ============================================================= */

/* --- 1. RESET & BOX-SIZING --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body, h1, h2, h3, h4, h5, h6, p, ul, ol, figure, blockquote { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* --- 2. VARIABLES --- */
:root {
    /* Palette — encre, vélin, sanguine, sapin */
    --encre:        #1a1a1a;
    --encre-doux:   #2c2c2c;
    --velin:        #f5f1e8;
    --velin-clair:  #faf6ed;
    --sanguine:     #8b2c2c;
    --sanguine-vif: #a83434;
    --sapin:        #2d4a3e;
    --sapin-clair:  #3d6253;
    --or:           #b08d57;
    --or-pale:      #d4b783;
    --gris:         #6b6b6b;
    --gris-clair:   #999;
    --gris-tres-clair: #d8d3c4;
    --bordure:      #c9c2b0;

    /* Typographie */
    --serif-titre:  'Cormorant Garamond', 'EB Garamond', Garamond, 'Times New Roman', serif;
    --serif-texte:  'Crimson Text', 'EB Garamond', Georgia, 'Times New Roman', serif;
    --sans-ui:      -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, sans-serif;
    --grec:         'SBL Greek', 'Cardo', 'New Athena Unicode', 'Times New Roman', serif;
    --hebreu:       'SBL Hebrew', 'Ezra SIL', 'Cardo', 'Times New Roman', serif;
    --syriaque:     'Estrangelo Edessa', 'Serto Jerusalem', serif;

    /* Échelle modulaire (1.25 minor third) */
    --texte-xs:     0.75rem;
    --texte-sm:     0.875rem;
    --texte-base:   1rem;
    --texte-md:     1.125rem;
    --texte-lg:     1.375rem;
    --texte-xl:     1.75rem;
    --texte-2xl:    2.25rem;
    --texte-3xl:    3rem;

    /* Espacement */
    --espace-1:     0.25rem;
    --espace-2:     0.5rem;
    --espace-3:     0.75rem;
    --espace-4:     1rem;
    --espace-6:     1.5rem;
    --espace-8:     2rem;
    --espace-12:    3rem;
    --espace-16:    4rem;

    /* Layout */
    --largeur-max:  1280px;
    --largeur-texte: 72ch;
    --largeur-nav:  280px;

    /* Effets */
    --ombre-douce:  0 1px 3px rgba(26, 26, 26, 0.06), 0 1px 2px rgba(26, 26, 26, 0.04);
    --ombre-medium: 0 4px 12px rgba(26, 26, 26, 0.08), 0 2px 4px rgba(26, 26, 26, 0.04);
    --ombre-forte:  0 12px 32px rgba(26, 26, 26, 0.12), 0 4px 12px rgba(26, 26, 26, 0.06);
    --transition:   0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 3. TYPOGRAPHIE DE BASE --- */
body {
    font-family: var(--serif-texte);
    font-size: var(--texte-base);
    line-height: 1.65;
    color: var(--encre);
    background: var(--velin);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-feature-settings: "kern" 1, "liga" 1, "onum" 1;
}

h1, h2, h3, h4 {
    font-family: var(--serif-titre);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--encre);
}

h1 { font-size: var(--texte-3xl); }
h2 { font-size: var(--texte-2xl); }
h3 { font-size: var(--texte-xl); }
h4 { font-size: var(--texte-lg); font-weight: 700; }

p { margin-bottom: var(--espace-4); max-width: var(--largeur-texte); }

strong { font-weight: 700; color: var(--encre); }
em { font-style: italic; }

/* Polices spécialisées par lang */
:lang(grc), .grec     { font-family: var(--grec); }
:lang(he), .hebreu   { font-family: var(--hebreu); direction: rtl; unicode-bidi: embed; }
:lang(syc), .syriaque{ font-family: var(--syriaque); direction: rtl; unicode-bidi: embed; }
:lang(la)            { font-style: italic; }

/* --- 4. LIENS --- */
a {
    color: var(--sanguine);
    transition: color var(--transition);
    border-bottom: 1px solid transparent;
}
a:hover, a:focus-visible {
    color: var(--sanguine-vif);
    border-bottom-color: currentColor;
}
a:focus-visible {
    outline: 2px solid var(--or);
    outline-offset: 2px;
    border-radius: 2px;
}

/* --- 5. LAYOUT GLOBAL --- */
.layout {
    display: grid;
    grid-template-columns: var(--largeur-nav) 1fr;
    min-height: 100vh;
}

.contenu-principal {
    padding: var(--espace-12) var(--espace-16);
    max-width: 100%;
    overflow-x: hidden;
}

.bandeau-page {
    border-bottom: 1px solid var(--bordure);
    padding-bottom: var(--espace-8);
    margin-bottom: var(--espace-12);
}

.bandeau-page .surtitre {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--sanguine);
    margin-bottom: var(--espace-3);
    font-weight: 600;
}

.bandeau-page h1 {
    font-size: var(--texte-3xl);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: var(--espace-3);
}

.bandeau-page .sous-titre {
    font-family: var(--serif-titre);
    font-style: italic;
    font-size: var(--texte-lg);
    color: var(--gris);
    max-width: 60ch;
}

/* --- 6. NAVIGATION LATÉRALE --- */
.nav-laterale {
    background: var(--encre);
    color: var(--velin);
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    padding: var(--espace-8) var(--espace-6);
    border-right: 4px solid var(--or);
    scrollbar-width: thin;
    scrollbar-color: var(--gris) transparent;
}

.nav-laterale::-webkit-scrollbar { width: 6px; }
.nav-laterale::-webkit-scrollbar-thumb { background: var(--gris); border-radius: 3px; }

.nav-marque {
    margin-bottom: var(--espace-12);
    padding-bottom: var(--espace-6);
    border-bottom: 1px solid rgba(245, 241, 232, 0.15);
}

.nav-marque .croix {
    font-family: var(--serif-titre);
    font-size: var(--texte-2xl);
    color: var(--or);
    line-height: 1;
}

.nav-marque .titre {
    font-family: var(--serif-titre);
    font-size: var(--texte-lg);
    font-weight: 500;
    letter-spacing: 0.02em;
    margin-top: var(--espace-2);
    color: var(--velin);
}

.nav-marque .sous-titre {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--or-pale);
    margin-top: var(--espace-1);
}

.nav-section {
    margin-bottom: var(--espace-8);
}

.nav-section h3 {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--or-pale);
    margin-bottom: var(--espace-3);
    padding-bottom: var(--espace-2);
    border-bottom: 1px solid rgba(176, 141, 87, 0.25);
    font-weight: 600;
}

.nav-section ul li {
    margin-bottom: var(--espace-1);
}

.nav-section ul a {
    display: flex;
    align-items: center;
    gap: var(--espace-3);
    padding: var(--espace-2) var(--espace-3);
    color: rgba(245, 241, 232, 0.85);
    font-family: var(--serif-texte);
    font-size: var(--texte-sm);
    line-height: 1.4;
    border-radius: 2px;
    border-bottom: none;
    transition: all var(--transition);
}

.nav-section ul a:hover,
.nav-section ul a:focus-visible {
    background: rgba(245, 241, 232, 0.08);
    color: var(--velin);
    padding-left: var(--espace-4);
}

.nav-section ul a.actif {
    background: rgba(176, 141, 87, 0.15);
    color: var(--or-pale);
    border-left: 2px solid var(--or);
    padding-left: calc(var(--espace-3) - 2px);
}

.nav-section .glyphe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5em;
    text-align: center;
    color: var(--or);
    font-size: var(--texte-base);
    flex-shrink: 0;
}

.nav-section .badge-new {
    margin-left: auto;
    font-family: var(--sans-ui);
    font-size: 0.625rem;
    background: var(--sanguine);
    color: var(--velin);
    padding: 1px 6px;
    border-radius: 2px;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* Barre de progression dans la nav */
.nav-progression {
    margin-top: auto;
    padding-top: var(--espace-6);
    border-top: 1px solid rgba(245, 241, 232, 0.15);
}

.nav-progression .label {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    color: var(--or-pale);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    margin-bottom: var(--espace-2);
    display: block;
}

.nav-progression .piste {
    height: 4px;
    background: rgba(245, 241, 232, 0.15);
    border-radius: 2px;
    overflow: hidden;
}

.nav-progression .barre {
    height: 100%;
    background: linear-gradient(90deg, var(--or) 0%, var(--or-pale) 100%);
    border-radius: 2px;
    transition: width 0.6s ease;
}

.nav-progression .pct {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    color: var(--gris-tres-clair);
    margin-top: var(--espace-2);
    display: block;
}

/* --- 7. PIED DE PAGE --- */
.pied-page {
    border-top: 1px solid var(--bordure);
    margin-top: var(--espace-16);
    padding: var(--espace-8) 0 var(--espace-6);
    color: var(--gris);
    font-size: var(--texte-sm);
    line-height: 1.5;
}

.pied-page p {
    margin-bottom: var(--espace-2);
    max-width: none;
}

.pied-page em {
    color: var(--sanguine);
}

/* --- 8. RESPONSIVE --- */
@media (max-width: 900px) {
    .layout { grid-template-columns: 1fr; }
    .nav-laterale {
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 4px solid var(--or);
        padding: var(--espace-6) var(--espace-4);
    }
    .contenu-principal {
        padding: var(--espace-8) var(--espace-4);
    }
    h1 { font-size: var(--texte-2xl); }
    h2 { font-size: var(--texte-xl); }
}

@media (max-width: 600px) {
    .bandeau-page h1 { font-size: var(--texte-2xl); }
    .bandeau-page .sous-titre { font-size: var(--texte-base); }
}

/* --- 9. UTILITAIRES --- */
.lecteur-seul {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

.bouton-saut {
    position: absolute;
    top: -40px;
    left: var(--espace-4);
    background: var(--sanguine);
    color: var(--velin);
    padding: var(--espace-2) var(--espace-4);
    z-index: 100;
    transition: top var(--transition);
}
.bouton-saut:focus { top: var(--espace-2); }

/* --- 10. SÉLECTEUR DE LANGUE --- */
.selecteur-langue {
    margin: var(--espace-4) 0 var(--espace-6);
    padding: var(--espace-4) var(--espace-3);
    border: 1px solid rgba(176, 141, 87, 0.2);
    border-radius: 3px;
    background: rgba(255,255,255,0.03);
}

.langue-label {
    display: block;
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--or-pale);
    margin-bottom: var(--espace-3);
    font-weight: 600;
}

.langue-boutons {
    display: flex;
    gap: var(--espace-2);
    flex-wrap: wrap;
}

.langue-btn {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: var(--espace-1) var(--espace-3);
    border: 1px solid rgba(176, 141, 87, 0.3);
    border-radius: 2px;
    color: rgba(245, 241, 232, 0.6);
    background: transparent;
    cursor: pointer;
    transition: all var(--transition);
}

.langue-btn:hover {
    border-color: var(--or);
    color: var(--or-pale);
    background: rgba(176, 141, 87, 0.08);
}

.langue-btn.actif {
    border-color: var(--or);
    color: var(--encre);
    background: var(--or);
    font-weight: 700;
}

.langue-btn:focus-visible {
    outline: 2px solid var(--or);
    outline-offset: 2px;
}

/* --- 11. INDICATEURS DE NIVEAU PARCOURS --- */
.niveau-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--espace-2);
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: var(--espace-1) var(--espace-3);
    border-radius: 2px;
    margin-bottom: var(--espace-4);
}

.niveau-propedeutique { background: #e8f4e8; color: #2d6a2d; border: 1px solid #a8d5a8; }
.niveau-licence       { background: #e8eef8; color: #2d4a8a; border: 1px solid #a8c0e0; }
.niveau-maitrise      { background: #f8f0e8; color: #8a4a1a; border: 1px solid #d4a878; }
.niveau-doctorat      { background: #f0e8f8; color: #5a2d8a; border: 1px solid #c0a0d8; }
.niveau-postdoc       { background: #1a1a1a; color: var(--or-pale); border: 1px solid var(--or); }

/* --- 12. CARTE DE MODULE PARCOURS --- */
.parcours-grille {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--espace-6);
    margin: var(--espace-8) 0;
}

.parcours-carte {
    border: 1px solid var(--bordure);
    border-radius: 4px;
    padding: var(--espace-6);
    background: var(--velin-clair);
    transition: box-shadow var(--transition);
}

.parcours-carte:hover {
    box-shadow: var(--ombre-medium);
}

.parcours-carte .carte-niveau {
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--sanguine);
    margin-bottom: var(--espace-2);
    font-weight: 600;
}

.parcours-carte h3 {
    font-size: var(--texte-lg);
    margin-bottom: var(--espace-3);
}

.parcours-carte p {
    font-size: var(--texte-sm);
    color: var(--gris);
    margin-bottom: var(--espace-4);
}

.parcours-carte .carte-meta {
    display: flex;
    gap: var(--espace-3);
    flex-wrap: wrap;
    font-family: var(--sans-ui);
    font-size: var(--texte-xs);
    color: var(--gris-clair);
}
