/* Feuille unique, partagée par l'accueil et les mentions légales.
   Une copie par page en <style> divergerait au premier changement de teinte —
   c'est ce qui était arrivé au script de francoisfournier.fr.

   Palette de la Montagne Bourbonnaise : papier, granit, forêt, cuivre.
   Mode sombre par prefers-color-scheme, sans script. */

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

:root {
  --papier: #f6f2ea;
  --carte: #fffdf8;
  --encre: #1f2622;
  --granit: #5f655f;
  --ligne: #ddd5c6;
  --foret: #2f5a45;
  --foret-voile: rgba(47, 90, 69, 0.09);
  --cuivre: #a8541f;
  --cuivre-voile: rgba(168, 84, 31, 0.10);
  --sommeil: #7a7468;
  --sommeil-voile: rgba(122, 116, 104, 0.12);
  --largeur: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papier: #141816;
    --carte: #1b201d;
    --encre: #ece7dc;
    --granit: #a3a89f;
    --ligne: #2d3430;
    --foret: #7fbf9c;
    --foret-voile: rgba(127, 191, 156, 0.12);
    --cuivre: #e0955f;
    --cuivre-voile: rgba(224, 149, 95, 0.13);
    --sommeil: #a39d90;
    --sommeil-voile: rgba(163, 157, 144, 0.14);
  }
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Raleway', system-ui, sans-serif;
  background: var(--papier);
  color: var(--encre);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--foret); text-underline-offset: 0.18em; }
a:hover { color: var(--cuivre); }

.evitement {
  position: absolute; left: -9999px; top: 0;
  background: var(--encre); color: var(--papier); padding: 0.6rem 1rem;
}
.evitement:focus { left: 1rem; top: 1rem; z-index: 10; }

.conteneur { max-width: var(--largeur); margin: 0 auto; padding: 0 1.5rem; }

/* ── Navigation ── */
.entete {
  border-bottom: 1px solid var(--ligne);
}
.entete .conteneur {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4.25rem; flex-wrap: wrap;
}
.marque {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.45rem; color: var(--encre); text-decoration: none;
  letter-spacing: 0.01em;
}
.marque span { color: var(--cuivre); }
.entete nav ul { display: flex; gap: 1.5rem; list-style: none; flex-wrap: wrap; }
.entete nav a {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--granit); text-decoration: none;
}
.entete nav a:hover { color: var(--encre); }

/* ── Accroche ── */
.accroche { padding: 5.5rem 0 4rem; }
.surtitre {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.22em;
  text-transform: uppercase; color: var(--cuivre); margin-bottom: 1.25rem;
}
h1 {
  font-family: 'DM Serif Display', Georgia, serif; font-weight: 400;
  font-size: clamp(2.3rem, 5.5vw, 3.9rem); line-height: 1.08;
  max-width: 22ch; margin-bottom: 1.5rem;
}
.chapeau { font-size: 1.2rem; color: var(--granit); max-width: 60ch; }
.chapeau + .chapeau { margin-top: 0.9rem; }

/* ── Sections de projets ── */
.bloc { padding: 3.5rem 0; border-top: 1px solid var(--ligne); }
.bloc-tete {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  gap: 1rem 3rem; margin-bottom: 2.25rem; align-items: end;
}
h2 {
  font-family: 'DM Serif Display', Georgia, serif; font-weight: 400;
  font-size: clamp(1.7rem, 3vw, 2.2rem); line-height: 1.15;
}
.bloc-tete p { color: var(--granit); max-width: 58ch; }

.grille {
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  list-style: none;
}

.projet {
  background: var(--carte); border: 1px solid var(--ligne); border-radius: 10px;
  padding: 1.6rem 1.6rem 1.4rem; display: flex; flex-direction: column; gap: 0.8rem;
}
.projet h3 {
  font-family: 'DM Serif Display', Georgia, serif; font-weight: 400;
  font-size: 1.5rem; line-height: 1.2;
}
.projet .role {
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--granit);
}
.projet p { color: var(--granit); font-size: 0.98rem; }
.projet .lien {
  margin-top: auto; padding-top: 0.4rem; font-weight: 700; font-size: 0.92rem;
  text-decoration: none;
}
.projet .lien::after { content: " →"; }
.projet .lien:hover { text-decoration: underline; }
.projet .sans-lien { margin-top: auto; padding-top: 0.4rem; font-size: 0.9rem; color: var(--sommeil); font-style: italic; }

.etat {
  align-self: flex-start; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  padding: 0.28rem 0.6rem; border-radius: 999px;
}
.etat-actif { color: var(--foret); background: var(--foret-voile); }
.etat-lancement { color: var(--cuivre); background: var(--cuivre-voile); }
.etat-sommeil { color: var(--sommeil); background: var(--sommeil-voile); }

.projet.discret { background: transparent; }

/* ── À propos ── */
.apropos { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 1rem 3rem; }
.apropos p { color: var(--granit); max-width: 62ch; }
.apropos p + p { margin-top: 1rem; }
.apropos strong { color: var(--encre); font-weight: 700; }

/* ── Pied de page ── */
.pied { border-top: 1px solid var(--ligne); padding: 2.5rem 0 3rem; font-size: 0.88rem; color: var(--granit); }
.pied .conteneur { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem 2rem; }
.pied a { color: var(--granit); }
.pied a:hover { color: var(--encre); }

/* ── Mentions légales ── */
.legal { max-width: 760px; }
.legal section { padding: 2.25rem 0; border-top: 1px solid var(--ligne); }
.legal h2 { font-size: 1.5rem; margin-bottom: 1.1rem; }
.legal p { color: var(--granit); margin-bottom: 0.9rem; }
.legal p:last-child { margin-bottom: 0; }
.legal dl { display: grid; grid-template-columns: 13rem 1fr; gap: 0.55rem 1.5rem; }
.legal dt {
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--granit); padding-top: 0.2rem;
}
.legal dd { color: var(--encre); }
.maj { font-size: 0.85rem; color: var(--sommeil); padding-bottom: 4rem; }

@media (max-width: 720px) {
  .accroche { padding: 3.5rem 0 3rem; }
  .bloc-tete, .apropos { grid-template-columns: 1fr; }
  .grille { grid-template-columns: 1fr; }
  .legal dl { grid-template-columns: 1fr; gap: 0.15rem; }
  .legal dd { margin-bottom: 0.7rem; }
}

/* ── Écrits : mis en avant par un filet cuivre et un fond de carte ── */
.ecrits .projet { border-top: 3px solid var(--cuivre); }
.ecrits .projet h3 { font-size: 1.75rem; }
.projet .lien { overflow-wrap: anywhere; }

.a-lire {
  margin-top: 1.6rem; padding-top: 1.1rem; border-top: 1px solid var(--ligne);
  max-width: 60ch; font-weight: 600; color: var(--encre);
}
.a-lire a { font-weight: 700; }


/* Grilles à trois colonnes : sections de trois cartes, sans carte orpheline. */
.grille.trois { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grille.trois { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) { .grille.trois { grid-template-columns: 1fr; } }

/* Drapeau en CSS : l'émoji 🇫🇷 s'affiche « FR » sous Windows. */
.drapeau {
  display: inline-block; width: 1.35em; height: 0.9em; vertical-align: -0.1em;
  border-radius: 2px; box-shadow: 0 0 0 1px var(--ligne);
  background: linear-gradient(90deg, #002395 0 33.4%, #ffffff 33.4% 66.6%, #ed2939 66.6%);
}

/* ── Accroche avec photo : texte à gauche, paysage à droite ── */
.accroche { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 2.5rem 3.5rem; align-items: center; }
.accroche-photo img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover;
  object-position: 38% center; border-radius: 12px;
}
@media (max-width: 900px) {
  .accroche { grid-template-columns: 1fr; }
  .accroche-photo img { aspect-ratio: 16 / 9; }
}

/* ── Derniers articles des blogs (tools/derniers-articles.py) ── */
.derniers { list-style: none; border-top: 1px solid var(--ligne); padding-top: 0.8rem; display: grid; gap: 0.55rem; }
.derniers li { font-size: 0.92rem; line-height: 1.4; }
.derniers time {
  display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cuivre);
}
.derniers a { color: var(--encre); text-decoration: none; font-weight: 600; }
.derniers a:hover { color: var(--foret); text-decoration: underline; }

/* ── Photos des cartes et de « À propos » ── */
.projet-image {
  display: block; width: calc(100% + 3.2rem); max-width: none; height: auto;
  aspect-ratio: 3 / 2; object-fit: cover;
  margin: -1.6rem -1.6rem 0.4rem; border-radius: 9px 9px 0 0;
}
.apropos-tete { display: flex; flex-direction: column; gap: 1.5rem; }
.apropos-photo { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 10px; }
.projet p a { color: var(--foret); }
.accroche-photo.paysage img { aspect-ratio: 3 / 2; object-position: center; }

/* Logos de partenaires : posés sur un plateau clair, jamais recadrés.
   Le plateau reste clair en mode sombre — un logo n'est pas conçu pour
   un fond sombre. */
.projet-logo {
  object-fit: contain; background: #fbf8f1; padding: 1.4rem 2rem;
  border-bottom: 1px solid var(--ligne);
}
