/* Matteo Bernabei — site d'auteur
   Palette : romanité — pourpre impérial (murex) + or ancien + rouge pompéien,
   sur base de travertin (le marbre chaud de Rome).
   De la Carta della figura : l'accent rouge récurrent devient ici pourpre
   structurel et jaillissement pompéien (le losange, le fil de lumière) ;
   l'or reste lumière et bijou ; grading chaud jamais clinique, sprezzatura.
   Une revue littéraire — élégance Gallimard Blanche, dark academia romaine.
   L'énergie vient de la composition et de la couleur, jamais du bruit.
   Écho à « Rome n'est pas tombée » : la pierre, la pourpre, l'or. */

:root {
  /* --- base : travertin, le marbre chaud de Rome --- */
  --paper:     #f1e7d1;   /* travertin clair — le sol */
  --paper-2:   #ebe0c9;   /* travertin un ton plus profond (cartouches) */
  --ink:       #2a1b1f;   /* encre noir-chaud (13:1 sur travertin) */
  --ink-dim:   #6b5a52;   /* secondaire, lisible (5.4:1) */

  /* --- pourpre impérial (murex) : couleur structurelle --- */
  --wine:      #661a37;   /* pourpre — titres, liens, filets (9.7:1) */
  --wine-deep: #4d1426;   /* pourpre profond — fond du pied de page */

  /* --- rouge pompéien : l'accent chaud, rare (le jaillissement) --- */
  --pompeii:   #9c2b22;   /* rouge de fresque — losange, fil de lumière (6.1:1) */

  /* --- or ancien, opaque — lumière et bijou, jamais néon --- */
  --gold:      #b8924a;   /* or pour filets, ornements, hover */
  --gold-ink:  #80631f;   /* or assez foncé pour porter du texte sur travertin (4.8:1) */
  --gold-soft: #cdb079;   /* hairline ténue, simple décor */
  --gold-warm: #c19a4e;   /* or sur fond pourpre (pied de page) */
  --on-wine:   #efe5d1;   /* crème claire sur pourpre (11:1) */

  --display: 'Cormorant', Georgia, 'Times New Roman', serif;   /* didone, haut contraste */
  --text:    'EB Garamond', Georgia, 'Times New Roman', serif; /* corps littéraire */
  --label:   ui-sans-serif, system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  /* lumière chaude diffuse, jamais clinique : un halo d'ivoire en haut */
  background-image: radial-gradient(135% 120% at 50% 0%, #faf2df 0%, #f1e7d1 46%, #e7dcc2 100%);
  background-attachment: fixed;
  font-family: var(--text);
  font-size: 20px;
  line-height: 1.72;
  font-feature-settings: "liga" 1, "kern" 1, "onum" 1;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---------- le cadre (passe-partout) : filet bordeaux fin ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 16px;
  border: 1px solid var(--gold-soft);
  box-shadow: inset 0 0 0 0.5px rgba(110,31,59,0.10);
  pointer-events: none;
  z-index: 50;
}

/* ---------- en-tête et navigation ---------- */

.site-header {
  text-align: center;
  padding: 3rem 1.5rem 0;
  width: 100%;
  min-width: 0;   /* flex item : la nav peut revenir à la ligne sans déborder */
}

.site-name {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  margin: 0;
  text-indent: 0.34em; /* compense le tracking, centre optiquement */
}
.site-name a { color: var(--wine); text-decoration: none; }

nav {
  margin-top: 1.8rem;
  font-family: var(--label);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}
nav a {
  color: var(--ink-dim);
  text-decoration: none;
  margin: 0 0.95rem;
  display: inline-block;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
nav a:hover { color: var(--wine); border-bottom-color: var(--gold); }
nav a[aria-current="page"] {
  color: var(--wine);
  border-bottom-color: var(--gold);
}

/* ---------- corps ---------- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 38rem;
  min-width: 0;   /* flex item : autorise la réduction sous le viewport (évite le débordement) */
  margin: 0 auto;
  padding: 4rem 2rem 4.5rem;
}

.page-title {
  font-family: var(--label);
  font-size: 0.68rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--wine);
  text-align: center;
  margin: 0 0 0.6rem;
}
.page-title + .ornament { margin-top: 0; }

/* fregio : filet doré avec losange central */
.ornament {
  width: 100%;
  max-width: 11rem;
  margin: 0 auto 3.2rem;
  text-align: center;
  color: var(--gold);
  position: relative;
}
.ornament::before {
  content: "";
  position: absolute;
  top: 50%; left: 0; right: 0;
  border-top: 1px solid var(--gold);
}
.ornament span {
  position: relative;
  display: inline-block;
  padding: 0 0.85rem;
  font-size: 0.7rem;
  /* masque le filet derrière le losange — couleur = le travertin du fond */
  background-color: #efe4cd;
}
.ornament span::after { content: "\2666"; color: var(--pompeii); } /* ◆ rouge pompéien */

p { margin: 0 0 1.5rem; }
.lead {
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--ink);
}
/* initiale en petites capitales bordeaux : un détail de revue */
.lead .first {
  font-variant: small-caps;
  letter-spacing: 0.02em;
  color: var(--wine);
  font-weight: 500;
}
em, i { font-style: italic; }

a.link {
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid var(--gold);
  transition: border-color .25s, color .25s, background-color .25s;
}
a.link:hover {
  color: var(--wine-deep);
  border-bottom-color: var(--wine);
  background-color: rgba(184,146,74,0.12);
}

/* ---------- œuvres ---------- */

.entry { margin: 0 0 3rem; text-align: center; }
.entry:last-child { margin-bottom: 0; }

.entry-title {
  font-family: var(--display);
  font-size: 2.6rem;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.01em;
  margin: 0 0 0.3rem;
  line-height: 1.12;
  color: var(--wine);
}

.entry-orig {
  font-family: var(--label);
  font-size: 0.64rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 1.1rem;
}

.entry-line {
  margin: 0 auto 0.9rem;
  max-width: 27rem;
  color: var(--ink);
  font-size: 1.12rem;
}

.entry-meta {
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.entry-meta .sep { color: var(--gold); margin: 0 0.55em; }

/* diviseur entre œuvres */
.div {
  width: 4rem; height: 1px; border: 0;
  background: var(--gold);
  margin: 3rem auto;
}

/* ---------- contact ---------- */

.contact-list { line-height: 2.4; text-align: center; }
.contact-list .label {
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
  display: block;
  margin-bottom: 0.1rem;
}
.contact-list .val {
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  display: block;
  margin-bottom: 1.6rem;
}

/* ---------- pied de page : bloc bordeaux profond ---------- */

.site-footer {
  flex-shrink: 0;
  text-align: center;
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--on-wine);
  background-color: var(--wine-deep);
  border-top: 1px solid var(--gold-warm);
  padding: 2.6rem 1.5rem 2.8rem;
  margin: 4rem 16px 16px;   /* reste à l'intérieur du cadre fixe */
}
.site-footer .dot { color: var(--gold-warm); margin: 0 0.6em; }

/* ---------- home ---------- */

body.home main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;   /* les enfants prennent toute la largeur ; le texte est centré */
  text-align: center;
  width: 100%;
  /* large assez pour que le nom (nowrap, jusqu'à 6.2rem) tienne sur une ligne SANS
     déborder : sinon il s'appuie au bord gauche et n'est plus centré optiquement. */
  max-width: 48rem;
  min-width: 0;           /* flex item : autorise la réduction sous le viewport */
  padding-top: 2rem;
}
body.home .site-header { display: none; }

/* surtitre ténu au-dessus du nom — donne de l'air et du rythme */
.home-eyebrow {
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.46em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 1.6rem;
  text-indent: 0.46em;
}
.home-name {
  font-family: var(--display);
  font-size: clamp(3.2rem, 13vw, 6.2rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  margin: 0;
  line-height: 1;
  color: var(--wine);
  white-space: nowrap;   /* sur desktop le nom tient sur une ligne */
}
.home-role {
  font-family: var(--label);
  font-size: 0.72rem;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 2rem 0 0;
  text-indent: 0.42em;
}
/* trait vertical — un fil de lumière : jaillissement pompéien fondu dans l'or */
.home-accent {
  width: 1px; height: 3.4rem;
  border: 0;
  background: linear-gradient(var(--pompeii), var(--gold) 55%, transparent);
  margin: 2.4rem auto 0;
}
body.home nav { margin-top: 2.8rem; }

/* ---------- bio italienne (à propos) ---------- */

.lang-rule { margin: 3.2rem auto 2.4rem; }
.lang-label {
  font-family: var(--label);
  font-size: 0.6rem;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--gold-ink);
  text-align: center;
  margin: 0 0 1.6rem;
}
.lang-it { color: var(--ink-dim); }
.lang-it em { color: var(--ink); }

/* ---------- index des textes ---------- */

.entry-text .entry-title { font-style: normal; font-size: 2.2rem; }
.text-link {
  color: var(--wine);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .25s, border-color .25s;
}
.text-link:hover { color: var(--wine-deep); border-bottom-color: var(--gold); }
.entry-meta .status { color: var(--ink-dim); font-style: italic; text-transform: none; letter-spacing: 0.04em; }

/* ---------- page article : lecture longue ----------
   Mesure ~62-68 caractères, interligne généreux, alignement à gauche
   (la justification sans césure abîme le texte long). */

body.reading main { max-width: 40rem; }

.article-head { text-align: center; margin-bottom: 0.4rem; }
.article-kicker {
  font-family: var(--label);
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold-ink);
  margin: 0 0 1.2rem;
}
.article-kicker .sep { color: var(--gold); margin: 0 0.5em; }
.article-kicker .status { color: var(--ink-dim); text-transform: none; letter-spacing: 0.08em; font-style: italic; }

.article-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(2.4rem, 8vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: 0.005em;
  margin: 0 0 1.1rem;
  color: var(--wine);
}
.article-sub {
  display: block;
  font-style: italic;
  font-weight: 400;
  font-size: 0.6em;
  color: var(--gold-ink);
  margin-top: 0.4rem;
}
.article-byline {
  font-family: var(--label);
  font-size: 0.64rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin: 0;
}

/* corps de l'article : drapeau à gauche */
.article > p,
.article .to-publish p,
.article .a-paraitre p { text-align: left; }

/* lettrine : première lettre du premier paragraphe du corps publié */
.article .to-publish > p:first-of-type::first-letter {
  font-family: var(--display);
  font-weight: 500;
  font-style: normal;
  float: left;
  color: var(--wine);
  font-size: 3.4em;
  line-height: 0.82;
  padding: 0.05em 0.12em 0 0;
}

.article-credit {
  font-family: var(--label);
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  color: var(--ink-dim);
  text-align: center !important;
  margin: 0 0 2.6rem;
}

/* épigraphe */
.epigraph {
  margin: 0 0 2.6rem;
  padding-left: 1.4rem;
  border-left: 2px solid var(--gold);
}
.epigraph p {
  font-style: italic;
  font-size: 1.14rem;
  color: var(--ink);
  margin: 0 0 0.6rem;
}
.epigraph cite {
  font-family: var(--label);
  font-style: normal;
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  color: var(--ink-dim);
}

.article-refs {
  font-size: 0.94rem;
  color: var(--ink-dim);
  margin-top: 2.4rem;
}
.article-refs strong { color: var(--wine); font-weight: 600; }

/* pied d'article */
.article-foot { margin-top: 2.6rem; }
.article-foot .div { background: var(--gold); }
.article-note {
  font-size: 0.98rem;
  color: var(--ink-dim);
  text-align: center;
}
.article-note .first { font-variant: small-caps; letter-spacing: 0.03em; color: var(--wine); }
.article-back {
  text-align: center;
  font-family: var(--label);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 1.8rem;
}

/* état "à paraître" */
.a-paraitre { text-align: center; padding: 1rem 0 0; }
.a-paraitre .lead { color: var(--ink); }
.cream-dim { color: var(--ink-dim); }

/* bascule de publication (voir commentaires dans rome.html) */
.is-hidden { display: none; }

/* ---------- responsive ---------- */

@media (max-width: 600px) {
  body { font-size: 19px; }
  body::before { inset: 11px; }
  main { padding: 3rem 1.4rem 3.5rem; min-width: 0; }

  /* sur petit écran les blocs à max-width fixe ne doivent pas dépasser le viewport :
     sans cela, le flex item « main » garde leur largeur intrinsèque (min-width:auto)
     et la page déborde à droite. */
  .entry-line { max-width: 100%; }
  .ornament  { max-width: min(11rem, 70%); }

  /* nom du site dans l'en-tête : moins de tracking pour tenir dans le cadre */
  .site-name { font-size: 1.15rem; letter-spacing: 0.18em; text-indent: 0.18em; }

  /* navigation : tracking et marges réduits pour que les 4 entrées tiennent */
  nav { line-height: 2.4; }
  nav a { margin: 0 0.45rem; letter-spacing: 0.14em; }

  /* hero : sur mobile le nom passe sur deux lignes, centré, dans le cadre */
  .home-name {
    /* sur mobile, le nom tient sur une seule ligne, centré dans le cadre */
    font-size: clamp(1.9rem, 8.4vw, 2.9rem);
    white-space: nowrap;
    line-height: 1.08;
  }
  .home-eyebrow { letter-spacing: 0.34em; text-indent: 0.34em; }
  body.home main { max-width: 100%; }

  /* en-tête : flex item — min-width:0 pour qu'il ne dépasse pas du viewport */
  .site-header { min-width: 0; }

  .entry-title { font-size: 2.1rem; }
  .entry-text .entry-title { font-size: 1.8rem; }
  .article-title { font-size: clamp(2rem, 9vw, 2.6rem); }
  .lead { font-size: 1.18rem; }
  .epigraph { padding-left: 1rem; }
  .epigraph p { font-size: 1.05rem; }
  .site-footer { margin: 3rem 11px 11px; padding: 2.2rem 1.2rem; }
}

@media (max-width: 380px) {
  .site-name { font-size: 1.05rem; letter-spacing: 0.12em; text-indent: 0.12em; }
  nav a { margin: 0 0.4rem; font-size: 0.6rem; letter-spacing: 0.12em; }
}
