/* =====================================================
   STYLE TEXTE — style_texte.css
   Pour les fichiers de texte individuel (type Sur_les_femmes.htm)
   Dans le style de Times New Roma
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&family=IM+Fell+English:ital@0;1&display=swap');

/* =====================================================
   RESET & VARIABLES
   ===================================================== */

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

:root {
    --ink:       #1a1208;
    --parch:     #f7f2e8;
    --cream:     #ede7d3;
    --gold:      #b8892a;
    --gold-lt:   #d4a84b;
    --grec:      #0e6e4a;
    --grec-lt:   #13976a;
    --latin:     #9e2035;
    --latin-lt:  #c72b44;
    --blue:      #3a5f72;
    --blue-lt:   #4e7d96;
    --rule:      rgba(26, 18, 8, 0.18);
    --shadow:    rgba(26, 18, 8, 0.08);
    --ink-faded: #7a6a50;
}

html { scroll-behavior: smooth; }

/* =====================================================
   BODY & FOND
   ===================================================== */

body {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    background-color: var(--parch);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 17px;
    line-height: 1.7;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
    opacity: 0.6;
}

/* =====================================================
   LIGNE DORÉE HAUTE
   ===================================================== */

body::after {
    content: '';
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: repeating-linear-gradient(
        to right,
        var(--gold) 0px,
        var(--gold) 6px,
        transparent 6px,
        transparent 10px
    );
    z-index: 200;
}

/* =====================================================
   NAVIGATION (optionnelle si ajoutée au HTML)
   ===================================================== */

nav {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    padding: 20px 40px 10px;
    background: transparent;
}

.nav-btn {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.88em;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 8px 20px;
    border-radius: 2px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
}

.nav-btn.accueil {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}
.nav-btn.accueil:hover {
    background: var(--blue-lt);
    border-color: var(--blue-lt);
}

/* =====================================================
   CONTENEUR
   ===================================================== */

body > div.texte,
.texte {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 48px auto 80px;
    padding: 48px 56px 52px;
    background: white;
    border: 1px solid var(--cream);
    border-radius: 2px;
    box-shadow: 0 8px 40px var(--shadow), 0 1px 4px rgba(26, 18, 8, 0.06);
}

/* Barre de couleur haute selon la langue */
.texte[data-langue="grc"] { border-top: 4px solid var(--grec); }
.texte[data-langue="la"] { border-top: 4px solid var(--latin); }

/* =====================================================
   BADGES (niveau, type)
   ===================================================== */

.badge {
    display: inline-block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 12px;
    border-radius: 2px;
    margin: 0 6px 14px 0;
    float: none;
}

.badge.type {
    background: transparent;
    border: 1px solid;
}

.texte[data-langue="grc"] .badge.type {
    color: var(--grec);
    border-color: var(--grec);
}
.texte[data-langue="la"] .badge.type {
    color: var(--latin);
    border-color: var(--latin);
}

.badge.niveau {
    background: var(--cream);
    border: 1px solid var(--rule);
    color: var(--ink-faded);
}

/* Conteneur des badges en haut */
.texte > .badge:first-of-type,
.badge + .badge {
    display: inline-block;
}

/* Zone badges regroupée */
.badges-zone {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

/* =====================================================
   NOTICE (titre du texte)
   ===================================================== */

p.notice {
    font-family: 'Playfair Display', serif;
    font-size: 1.25em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ink);
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--rule);
}

p.notice strong {
    font-weight: 700;
}

/* Auteur mis en avant */
p.notice strong::first-line {
    font-size: 1.05em;
}

/* =====================================================
   PARAGRAPHES (texte original + traduction)
   ===================================================== */

.texte p {
    margin-bottom: 24px;
    font-weight: 300;
    color: #2a1e0e;
    text-align: justify;
    hyphens: auto;
}

.texte p strong {
    font-weight: 600;
    color: var(--ink);
    font-size: 0.9em;
    letter-spacing: 0.03em;
    margin-bottom: 10px;
    font-family: 'Cormorant Garamond', serif;
    text-transform: uppercase;
}

/* =====================================================
   TEXTE ORIGINAL GREC / LATIN
   ===================================================== */

/* Le premier <p> après .notice contient l'original */
p.notice ~ p:first-of-type,
.texte p:has(strong:first-child) {
    /* styles communs */
}

/* Lignes de poésie (séparées par <br>) */
.texte[data-type="poesie"] p:nth-of-type(2),
.texte[data-type="poésie"] p:nth-of-type(2) {
    font-size: 1.08em;
    line-height: 2;
    text-align: left;
    font-style: normal;
    color: #1a1208;
    letter-spacing: 0.01em;
    padding-left: 16px;
    border-left: 2px solid var(--cream);
    margin-bottom: 28px;
}

/* Texte original en grec : légère mise en forme */
.texte[data-langue="grc"] p:nth-of-type(2) {
    border-left-color: var(--grec);
    color: #0d2b1e;
   font-family: auto;
}

/* Texte original en latin */
.texte[data-langue="la"] p:nth-of-type(2) {
    border-left-color: var(--latin);
    color: #2b0d10;
    font-family: auto;   
}

/* Traduction : fond légèrement distinct */
.texte p:nth-of-type(3) {
    background: #fdfaf4;
    border-radius: 2px;
    padding: 18px 20px;
    border: 1px solid var(--cream);
    font-style: italic;
    color: #3a2e1e;
    font-size: 1.02em;
    line-height: 1.75;
    text-align: justify;
}

.texte p:nth-of-type(3) strong {
    text-transform: none;
    font-size: 0.82em;
    color: var(--ink-faded);
    font-style: normal;
}

/* =====================================================
   MOTS-CLÉS
   ===================================================== */

p.keywords {
    font-size: 0.82em;
    color: var(--ink-faded);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--cream);
}

p.keywords strong {
    display: inline;
    font-style: normal;
    font-size: 1em;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-faded);
    font-weight: 600;
}

/* =====================================================
   PEDAGOGIE
   ===================================================== */

p.pedagogy {
    font-size: 0.82em;
    color: var(--ink-faded);
    font-style: italic;
    line-height: 1.6;
    margin-bottom: 14px;
    padding-top: 20px;
    border-top: 1px solid var(--cream);
}

p.pedagogy strong {
    display: inline;
    font-style: normal;
    font-size: 1em;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-faded);
    font-weight: 600;
}

/* =====================================================
   CONTRIBUTION
   ===================================================== */

.texte p:last-of-type {
    font-size: 0.82em;
    color: var(--ink-faded);
    font-style: italic;
    margin-bottom: 0;
    margin-top: -10px;
}

.texte p:last-of-type strong {
    display: inline;
    font-size: 1em;
    text-transform: none;
    letter-spacing: 0;
    color: var(--ink-faded);
    font-weight: 600;
    font-style: normal;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 860px) {
    body > div.texte,
    .texte {
        margin: 24px 16px 48px;
        padding: 32px 28px 36px;
    }
    nav { padding: 16px 18px 8px; flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 540px) {
    body > div.texte,
    .texte {
        margin: 12px 8px 32px;
        padding: 24px 18px 28px;
    }
    p.notice { font-size: 1.1em; }
}

/* =====================================================
   IMPRESSION
   ===================================================== */

@media print {
    body { background: white; }
    body::before, body::after { display: none; }
    .texte {
        box-shadow: none;
        border: 1px solid #ccc;
        margin: 0;
        padding: 24px;
    }
    nav { display: none; }
}
