/* ==========================================================================
   French Will — design system "Rouge et noir éditorial"
   Magazine indépendant : passion du football, vie amoureuse, mémoire du club.
   Registre : soir de match élégant, jamais tribune bruyante.
   ========================================================================== */

/* ---------- Reset minimal ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { margin: 0; padding: 0; }

/* ---------- Tokens ---------- */
:root {
  /* Palette 70/20/10 */
  --papier: #F6F1E9;
  --encre: #141213;
  --carmin: #B3122E;
  --carmin-profond: #7A0E20;
  --pierre: #8A8580;
  --or-pale: #C9A96E;

  --blanc: #FFFFFF;
  --papier-teinte: #EFE8DA;
  --ligne: rgba(20, 18, 19, 0.12);

  /* Typographie */
  --police-titre: 'Fraunces', Georgia, serif;
  --police-corps: 'Source Serif 4', Georgia, serif;
  --police-kicker: 'Oswald', 'Arial Narrow', sans-serif;

  /* Echelle */
  --taille-h1: clamp(2.1rem, 1.4rem + 3vw, 3.6rem);
  --taille-h2: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem);
  --taille-h3: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --taille-corps: 1.0625rem;

  /* Espacement */
  --espace-section: clamp(3rem, 2.4rem + 3vw, 6rem);
  --largeur-max: 1160px;
  --largeur-lecture: 68ch;

  --rayon: 3px;
  --ombre: 0 8px 24px rgba(20, 18, 19, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --papier: #1C1A17;
    --papier-teinte: #242220;
    --encre: #F1ECE3;
    --ligne: rgba(241, 236, 227, 0.14);
  }
}
:root[data-theme='dark'] {
  --papier: #1C1A17;
  --papier-teinte: #242220;
  --encre: #F1ECE3;
  --ligne: rgba(241, 236, 227, 0.14);
}

body {
  background: var(--papier);
  color: var(--encre);
  font-family: var(--police-corps);
  font-size: var(--taille-corps);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.enveloppe {
  max-width: var(--largeur-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

h1, h2, h3 {
  font-family: var(--police-titre);
  font-weight: 600;
  line-height: 1.15;
  margin: 0 0 0.6em;
}
h1 { font-size: var(--taille-h1); }
h2 { font-size: var(--taille-h2); }
h3 { font-size: var(--taille-h3); }

p { margin: 0 0 1.2em; max-width: var(--largeur-lecture); }

a { color: var(--carmin); text-decoration: none; }
a:hover, a:focus-visible { color: var(--carmin-profond); text-decoration: underline; }

:focus-visible {
  outline: 2px solid var(--carmin);
  outline-offset: 2px;
}

.saut-contenu {
  position: absolute;
  left: -9999px;
}
.saut-contenu:focus {
  left: 1rem;
  top: 1rem;
  background: var(--encre);
  color: var(--papier);
  padding: 0.5em 1em;
  z-index: 200;
}

/* ---------- Signature : bande diagonale rouge/noir ---------- */
/* Écho discret de l'écharpe de supporter, sans logo de club. Un seul geste
   fort, utilisé comme séparateur entre le hero et le contenu — jamais répété
   ailleurs sur la page. */
.bande-diagonale {
  height: 10px;
  background: repeating-linear-gradient(
    -45deg,
    var(--carmin) 0 22px,
    var(--encre) 22px 44px
  );
}

/* ---------- Filigrane hermine ---------- */
/* Motif héraldique breton très discret, en arrière-plan de sections clés.
   Jamais plus qu'un tramage — ne doit jamais concurrencer le texte. */
.filigrane-hermine {
  position: relative;
}
.filigrane-hermine::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23141213'%3E%3Ccircle cx='20' cy='16' r='2'/%3E%3Ccircle cx='14' cy='24' r='2'/%3E%3Ccircle cx='26' cy='24' r='2'/%3E%3Cpath d='M20 26 L16 34 L24 34 Z'/%3E%3C/g%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 90px 90px;
  pointer-events: none;
}
.filigrane-hermine > * { position: relative; z-index: 1; }

/* ---------- Wrappers anti-distorsion (OBLIGATOIRE réseau) ---------- */
/* Object-fit sans wrapper à hauteur résolue ne fait rien — jamais poser
   object-fit sur un <img> seul. */
.img-hero { aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--rayon); }
.img-card { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--rayon); }
.img-body { aspect-ratio: 3 / 2; overflow: hidden; border-radius: var(--rayon); }
.img-portrait { aspect-ratio: 1 / 1; overflow: hidden; border-radius: 50%; }

.img-hero img, .img-card img, .img-body img, .img-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

/* ---------- Kicker de rubrique (chaton) ---------- */
.chaton {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4em;
  font-family: var(--police-kicker);
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--papier);
  background: var(--encre);
  padding: 0.3em 0.7em;
  border-radius: var(--rayon);
}
.chaton--or { background: var(--or-pale); color: var(--encre); }
.chaton__cle { opacity: 0.7; }

/* ---------- En-tête ---------- */
.entete {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--papier);
  border-bottom: 1px solid var(--ligne);
  transition: box-shadow 0.2s ease;
}
.entete.defile { box-shadow: var(--ombre); }

.entete__interieur {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  gap: 1.5rem;
}

.marque {
  font-family: var(--police-titre);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--encre);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.marque:hover { color: var(--carmin); text-decoration: none; }
.marque__fanion {
  width: 14px;
  height: 18px;
  background: linear-gradient(180deg, var(--carmin) 0 50%, var(--encre) 50% 100%);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 50% 100%, 0 70%);
}

.nav {
  display: flex;
  gap: 1.6rem;
  flex-wrap: wrap;
}
.nav a {
  font-family: var(--police-kicker);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--encre);
  position: relative;
  padding-bottom: 0.2em;
}
.nav a:hover { color: var(--carmin); text-decoration: none; }
.nav a[aria-current='page'] { color: var(--carmin); }
.nav a[aria-current='page']::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 2px;
  background: var(--carmin);
}

.burger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.4rem;
}
.burger span { width: 22px; height: 2px; background: var(--encre); }

@media (max-width: 720px) {
  .burger { display: flex; }
  .nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 1rem 0;
    gap: 1rem;
  }
  body.nav-ouverte .nav { display: flex; }
  .entete__interieur { flex-wrap: wrap; }
}

/* ---------- Hero ---------- */
.hero {
  padding-top: clamp(2.5rem, 2rem + 2vw, 4.5rem);
  padding-bottom: clamp(2rem, 1.6rem + 1.5vw, 3rem);
  background: var(--papier-teinte);
}
.hero__interieur {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(1.5rem, 1rem + 2vw, 3.5rem);
  align-items: center;
}
.hero__kicker {
  font-family: var(--police-kicker);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carmin);
  margin-bottom: 0.6em;
}
.hero__texte { max-width: 42ch; }
.hero__titre { margin-bottom: 0.5em; }
.hero__accroche {
  font-style: italic;
  font-size: 1.15rem;
  color: var(--pierre);
  max-width: 34ch;
}
.hero__media { box-shadow: var(--ombre); }

@media (max-width: 860px) {
  .hero__interieur { grid-template-columns: 1fr; }
  .hero__media { order: -1; }
}

/* Hero plein cadre : l'image occupe toute la section, le texte est incruste
   en bas a gauche sur un degrade sombre (les visages restent dans le haut du
   cadre, marge haute >= 15 % a la generation). */
.hero--plein {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  /* hauteur calee sur le ratio 16:9 des images (plafonnee a l'ecran) pour ne pas rogner les tetes */
  min-height: max(420px, min(56.25vw, 86vh));
  padding: 0;
  background: var(--encre);
  overflow: hidden;
}
.hero--plein.hero--grand { min-height: max(520px, min(56.25vw, 92vh)); }
.hero--plein .hero__media.img-hero {
  position: absolute;
  inset: 0;
  z-index: -2;
  aspect-ratio: auto;
  border-radius: 0;
  box-shadow: none;
}
.hero--plein .hero__media img { object-position: center 20%; }
.hero--plein::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(to top, rgba(20, 18, 19, 0.88) 0%, rgba(20, 18, 19, 0.55) 32%, rgba(20, 18, 19, 0) 62%),
    linear-gradient(to right, rgba(20, 18, 19, 0.45) 0%, rgba(20, 18, 19, 0) 55%);
}
.hero--plein .hero__interieur {
  display: block;
  width: 100%;
  padding-top: clamp(6rem, 4rem + 8vw, 12rem);
  padding-bottom: clamp(2rem, 1.6rem + 2vw, 3.5rem);
}
.hero--plein .hero__texte { max-width: 44rem; }
.hero--plein .hero__titre {
  color: #FFFFFF;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}
.hero--plein .hero__kicker {
  display: inline-block;
  color: #FFFFFF;
  background: var(--carmin);
  padding: 0.25em 0.6em;
}
.hero--plein .hero__accroche {
  color: rgba(255, 255, 255, 0.92);
  max-width: 40ch;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.5);
}
.hero--plein .bande-diagonale { position: relative; }

@media (max-width: 860px) {
  .hero--plein { min-height: clamp(420px, 72vh, 600px); }
  .hero--plein.hero--grand { min-height: clamp(480px, 84vh, 700px); }
  .hero--plein .hero__media img { object-position: var(--hero-focale, center 15%); }
  .hero--plein .hero__titre { font-size: clamp(1.7rem, 1.2rem + 3vw, 2.4rem); }
}

/* ---------- Cartes d'article ---------- */
.grille-cartes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
  margin: var(--espace-section) 0;
}

.carte { height: 100%; }
.carte__lien {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: var(--encre);
}
.carte__lien:hover { text-decoration: none; }
.carte__lien:hover .carte__titre { color: var(--carmin); }

.carte__corps { padding-top: 1rem; }
.carte__kicker {
  font-family: var(--police-kicker);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--carmin);
  margin: 0 0 0.4em;
}
.carte__titre {
  font-size: 1.15rem;
  margin-bottom: 0.4em;
  transition: color 0.15s ease;
}
.carte__resume {
  color: var(--pierre);
  font-size: 0.95rem;
  margin-bottom: 0.6em;
}
.carte__date {
  font-family: var(--police-kicker);
  font-size: 0.78rem;
  color: var(--pierre);
  letter-spacing: 0.02em;
}

/* ---------- Filtre de catégorie ---------- */
.filtre-categorie {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 1.5rem 0 0.5rem;
}
.filtre-categorie__bouton {
  font-family: var(--police-kicker);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--ligne);
  color: var(--encre);
  padding: 0.5em 1em;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filtre-categorie__bouton:hover { border-color: var(--carmin); color: var(--carmin); }
.filtre-categorie__bouton[aria-pressed='true'] {
  background: var(--encre);
  border-color: var(--encre);
  color: var(--papier);
}

/* ---------- Sommaire d'article ---------- */
.article-sommaire {
  background: var(--papier-teinte);
  border-left: 3px solid var(--carmin);
  border-radius: var(--rayon);
  padding: 1.2rem 1.5rem;
  margin: 1.5rem 0 2rem;
  max-width: var(--largeur-lecture);
}
.article-sommaire p:first-child {
  font-family: var(--police-kicker);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--carmin);
  margin-bottom: 0.6em;
}
.article-sommaire ol {
  list-style: none;
  counter-reset: sommaire;
  padding: 0;
  margin: 0;
}
.article-sommaire li {
  counter-increment: sommaire;
  margin-bottom: 0.4em;
}
.article-sommaire li::before {
  content: counter(sommaire, decimal-leading-zero);
  font-family: var(--police-kicker);
  color: var(--pierre);
  margin-right: 0.6em;
}

/* ---------- Listes éditoriales ---------- */
.contenu ul:not(.article-sommaire ol):not([class]) { padding-left: 0; }
.contenu li { margin-bottom: 0.5em; }
.contenu ul > li {
  list-style: none;
  position: relative;
  padding-left: 1.4em;
}
.contenu ul > li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--carmin);
}
.contenu ol {
  padding-left: 1.4em;
}
.contenu ol > li::marker {
  font-family: var(--police-kicker);
  color: var(--carmin);
  font-weight: 600;
}

/* ---------- Tableaux ---------- */
.contenu table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.95rem;
}
.contenu th, .contenu td {
  border-bottom: 1px solid var(--ligne);
  padding: 0.7em 0.9em;
  text-align: left;
}
.contenu th {
  font-family: var(--police-kicker);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--pierre);
}

/* ---------- Figures / légendes ---------- */
figure { margin: 1.8em 0; }
figcaption {
  display: block;
  font-family: var(--police-kicker);
  font-size: 0.8rem;
  color: var(--pierre);
  margin-top: 0.5em;
  font-style: normal;
}

/* ---------- FAQ ---------- */
.faq { margin: var(--espace-section) 0; }
.faq__item { border-bottom: 1px solid var(--ligne); }
.faq__question {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  font-family: var(--police-titre);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--encre);
  padding: 1.1em 0;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 1em;
}
.faq__question::after {
  content: '+';
  color: var(--carmin);
  font-family: var(--police-kicker);
  flex-shrink: 0;
}
.faq__item.ouvert .faq__question::after { content: '−'; }
.faq__reponse {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
}
.faq__item.ouvert .faq__reponse { max-height: 60em; }
.faq__reponse p { padding-bottom: 1.1em; color: var(--pierre); }

/* ---------- Fil d'Ariane ---------- */
.ariane { padding: 1rem 0; }
.ariane ol { display: flex; gap: 0.5em; flex-wrap: wrap; list-style: none; }
.ariane li {
  font-family: var(--police-kicker);
  font-size: 0.78rem;
  color: var(--pierre);
}
.ariane li:not(:last-child)::after { content: '/'; margin-left: 0.5em; }

/* ---------- Formulaire de contact ---------- */
.formulaire { max-width: 44ch; }
.champ { margin-bottom: 1.2em; }
.champ label {
  display: block;
  font-family: var(--police-kicker);
  font-size: 0.8rem;
  letter-spacing: 0.03em;
  margin-bottom: 0.4em;
}
.champ input, .champ select, .champ textarea {
  width: 100%;
  font-family: var(--police-corps);
  font-size: 1rem;
  padding: 0.7em 0.9em;
  border: 1px solid var(--ligne);
  border-radius: var(--rayon);
  background: var(--papier);
  color: var(--encre);
}
.champ input:focus, .champ select:focus, .champ textarea:focus {
  border-color: var(--carmin);
  outline: none;
}

.bouton {
  font-family: var(--police-kicker);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: var(--carmin);
  color: var(--papier);
  border: none;
  padding: 0.8em 1.8em;
  border-radius: var(--rayon);
  cursor: pointer;
  transition: background 0.15s ease;
}
.bouton:hover { background: var(--carmin-profond); }

.etat-envoi { font-size: 0.9rem; margin-top: 0.8em; }
.etat-envoi[data-etat='ok'] { color: #2E6B3E; }
.etat-envoi[data-etat='erreur'] { color: var(--carmin); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

/* ---------- Pied de page ---------- */
.pied {
  background: var(--encre);
  color: var(--papier);
  padding: var(--espace-section) 0 2rem;
  margin-top: var(--espace-section);
}
.pied__grille {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.pied__titre {
  font-family: var(--police-kicker);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--or-pale);
  margin-bottom: 0.8em;
}
.pied ul { list-style: none; display: flex; flex-direction: column; gap: 0.5em; }
.pied a { color: var(--papier); opacity: 0.85; }
.pied a:hover { color: var(--or-pale); opacity: 1; }

.pied__mention {
  border-top: 1px solid rgba(246, 241, 233, 0.15);
  padding-top: 1.5rem;
  margin-bottom: 1.5rem;
}
.pied__mention p {
  font-size: 0.82rem;
  color: rgba(246, 241, 233, 0.65);
  max-width: 70ch;
}

.pied__bas {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.82rem;
  color: rgba(246, 241, 233, 0.6);
}

/* ---------- Contenu article (largeur de lecture) ---------- */
.contenu { max-width: var(--largeur-lecture); }

.article-meta {
  max-width: var(--largeur-lecture);
  font-family: var(--police-kicker);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--pierre);
  margin: 0 0 1.4em;
}
.article-meta__auteur { color: var(--pierre); }

.a-lire-aussi {
  margin: var(--espace-section) 0 0;
  padding-top: var(--espace-section);
  border-top: 1px solid rgba(20, 18, 19, 0.1);
}
.a-lire-aussi h2 { margin-bottom: 1rem; }

/* ---------- Reveal (apparition progressive) ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
