/* ============================================================
   La Binette — « l'affiche de fête punaisée »
   3 couleurs (papier, jaune Binette, rouge cochonnet) + encre.
   2 polices : Lilita One (titres), Atkinson Hyperlegible (corps).
   Mobile d'abord.
   ============================================================ */

@font-face {
  font-family: "Lilita One";
  src: url("/assets/fonts/lilita-one-v17-latin-regular.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-v12-latin-regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible";
  src: url("/assets/fonts/atkinson-hyperlegible-v12-latin-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --papier: #f7eeda;
  --papier-clair: #fffdf4;
  --jaune: #f0b62b;
  --rouge: #cf3f2b;
  --encre: #35271a;
  --encre-douce: #6b5946;
  --espace: 1rem;
  --titres: "Lilita One", "Comic Sans MS", cursive;
  --corps: "Atkinson Hyperlegible", Verdana, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: var(--corps);
  font-size: 1.0625rem;
  line-height: 1.6;
}

/* Grain de papier sur toute la page */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2000;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)'/%3E%3C/svg%3E");
}

h1, h2, h3 {
  font-family: var(--titres);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

a { color: var(--rouge); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 4px; }

.evite {
  position: absolute; left: -999px; top: 0; background: var(--jaune);
  padding: 0.5rem 1rem; z-index: 3000;
}
.evite:focus { left: 0; }

/* ——— La guirlande ——— */
.guirlande { line-height: 0; background: transparent; }
.guirlande svg { width: 100%; height: 74px; display: block; }
.guirlande .fil { stroke: var(--encre); stroke-width: 2.5; }
.amp line { stroke: var(--encre); stroke-width: 2; }
.amp .culot { fill: var(--encre); }
.amp .verre {
  fill: #8c7c66;
  animation: allumer 0.45s ease-out forwards;
  animation-delay: calc(var(--i) * 0.17s + 0.4s);
}
.amp .halo {
  opacity: 0;
  filter: blur(7px);
  animation:
    halo-on 0.45s ease-out forwards,
    scintiller 4.5s ease-in-out infinite;
  animation-delay:
    calc(var(--i) * 0.17s + 0.4s),
    calc(var(--i) * 0.6s + 2s);
}
.amp--jaune .halo, .amp--jaune { --ampoule: #ffd257; }
.amp--rouge .halo, .amp--rouge { --ampoule: #ff7a5c; }
.amp--verte .halo, .amp--verte { --ampoule: #8fce70; }
.amp--bleue .halo, .amp--bleue { --ampoule: #74b8dd; }
.amp .halo { fill: var(--ampoule); }
@keyframes allumer { to { fill: var(--ampoule); } }
@keyframes halo-on { to { opacity: 0.55; } }
@keyframes scintiller {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.35; }
}
@media (prefers-reduced-motion: reduce) {
  .amp .verre, .amp .halo { animation: none; }
  .amp .verre { fill: var(--ampoule); }
  .amp .halo { opacity: 0.45; }
}

/* ——— En-tête ——— */
.entete nav {
  max-width: 62rem;
  margin: 0 auto;
  padding: calc(var(--espace) * 0.75) var(--espace);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--espace);
}
.marque {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--titres); font-size: 1.5rem;
  color: var(--encre); text-decoration: none;
}
.marque img { border-radius: 50%; border: 2px solid var(--encre); background: var(--jaune); }
.entete ul {
  list-style: none; display: flex; gap: calc(var(--espace) * 1.25);
  margin: 0 0 0 auto; padding: 0; flex-wrap: wrap;
}
.entete ul a {
  font-family: var(--titres); font-size: 1.05rem;
  color: var(--encre); text-decoration: none;
}
.entete ul a:hover { color: var(--rouge); }
.entete ul a[aria-current="page"] {
  color: var(--rouge);
  box-shadow: 0 4px 0 var(--jaune);
}

main {
  max-width: 62rem;
  margin: 0 auto;
  padding: var(--espace);
}

/* ——— Héros ——— */
.heros {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--espace);
  padding: calc(var(--espace) * 2) 0;
}
.heros-mascotte {
  width: min(46vw, 220px);
  height: auto;
  border: 3px solid var(--encre);
  border-radius: 10px;
  transform: rotate(-3deg);
  box-shadow: 6px 8px 0 rgba(53, 39, 26, 0.18);
  background: var(--papier-clair);
}
.surtitre {
  font-weight: 700;
  color: var(--encre-douce);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  margin: 0;
}
.heros h1 {
  font-size: clamp(3rem, 11vw, 5.5rem);
  margin: 0.2em 0;
  padding: 0.08em 0.45em;
  background: var(--jaune);
  border: 3px solid var(--encre);
  border-radius: 8px;
  transform: rotate(-1.5deg);
  box-shadow: 5px 6px 0 rgba(53, 39, 26, 0.22);
  display: inline-block;
}
.devise { font-size: 1.15rem; max-width: 34rem; margin: 0.4rem auto 0; }

@media (min-width: 44rem) {
  .heros { flex-direction: row; text-align: left; justify-content: center; gap: calc(var(--espace) * 3); }
  .devise { margin-left: 0; }
}

/* ——— Sections ——— */
h2 {
  font-size: clamp(1.6rem, 4.5vw, 2.2rem);
  margin: calc(var(--espace) * 2.5) 0 var(--espace);
}
h2::after {
  content: "";
  display: block;
  width: 4.5rem;
  height: 0.5rem;
  margin-top: 0.35rem;
  background: var(--rouge);
  border-radius: 999px 4px 999px 4px;
  transform: rotate(-1deg);
}
.chapo { font-size: 1.12rem; max-width: 40rem; }

/* Cadre « papier épinglé » pour les blocs de texte */
.polaroid-cadre {
  background: var(--papier-clair);
  border: 2px solid var(--encre);
  border-radius: 8px;
  padding: calc(var(--espace) * 1.25) calc(var(--espace) * 1.5);
  box-shadow: 5px 6px 0 rgba(53, 39, 26, 0.15);
  position: relative;
  margin: var(--espace) 0;
}
.polaroid-cadre::before {
  content: "";
  position: absolute;
  top: -9px; left: 50%;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a70, var(--rouge) 60%, #8f2417);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.3);
}
.edition dl { display: flex; flex-wrap: wrap; gap: var(--espace) calc(var(--espace) * 3); margin: 0 0 var(--espace); }
.edition dt { font-family: var(--titres); font-size: 1.05rem; color: var(--rouge); }
.edition dd { margin: 0; font-size: 1.1rem; }
.edition h2 { margin-top: 0.4rem; }

/* ——— Photos punaisées ——— */
.punaises {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(14rem, 100%), 1fr));
  gap: calc(var(--espace) * 1.75);
}
.polaroid {
  background: var(--papier-clair);
  border: 1px solid rgba(53, 39, 26, 0.25);
  padding: 0.55rem 0.55rem 0.4rem;
  box-shadow: 4px 6px 12px rgba(53, 39, 26, 0.22);
  position: relative;
  transition: transform 0.25s ease;
}
.punaises .polaroid:nth-child(3n+1) { transform: rotate(-2deg); }
.punaises .polaroid:nth-child(3n+2) { transform: rotate(1.4deg); }
.punaises .polaroid:nth-child(3n)   { transform: rotate(2.3deg); }
.punaises .polaroid:hover { transform: rotate(0deg) scale(1.03); z-index: 2; }
.polaroid::before {
  content: "";
  position: absolute;
  top: -8px; left: 50%; margin-left: -8px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff8a70, var(--rouge) 60%, #8f2417);
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.35);
  z-index: 1;
}
.polaroid img { width: 100%; height: auto; display: block; }
.polaroid figcaption, .polaroid figcaption a {
  font-size: 0.86rem;
  color: var(--encre-douce);
  padding: 0.45rem 0.2rem 0.2rem;
  text-align: center;
}
.polaroid a.agrandir { display: block; }

/* ——— Teaser accueil ——— */
.teaser {
  display: grid;
  gap: calc(var(--espace) * 2);
  align-items: center;
  margin: calc(var(--espace) * 3) 0;
}
@media (min-width: 44rem) { .teaser { grid-template-columns: 1fr 1.2fr; } }
.teaser-photo { max-width: 26rem; }

/* ——— Musiques ——— */
.groupes { list-style: none; padding: 0; display: grid; gap: calc(var(--espace) * 1.5); }
.groupe h2 { margin-top: 0; }
.groupe-annee { color: var(--encre-douce); font-size: 0.7em; }
.video { aspect-ratio: 16 / 9; }
.video iframe { width: 100%; height: 100%; border: 2px solid var(--encre); border-radius: 6px; }
.groupe-sans-video { color: var(--encre-douce); font-style: italic; }

/* ——— Cartes années : grand polaroïd + mini-mosaïque ——— */
.annees {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
  gap: calc(var(--espace) * 2.25);
  align-items: start; /* chaque carte à sa taille, pas d'étirement */
}
.annees .polaroid { padding: 0.7rem 0.7rem 0.5rem; }
.annee-carte a { display: block; text-decoration: none; color: inherit; }
.mosaique {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  aspect-ratio: 1 / 1;
}
.mosaique img { width: 100%; height: 100%; min-height: 0; object-fit: cover; display: block; }
.mosaique img:only-child { grid-column: 1 / -1; grid-row: 1 / -1; }
.annee-legende {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 0.55rem 0.2rem 0.1rem;
}
.annee-legende strong { font-family: var(--titres); font-size: 1.8rem; color: var(--rouge); }
.annee-legende span { font-size: 0.85rem; color: var(--encre-douce); }
.annee-carte:hover { transform: rotate(0deg) scale(1.03); z-index: 2; }

.fil-ariane { margin: 0 0 0.5rem; }
.fil-ariane a { font-family: var(--titres); }

/* ——— Galerie d'une année : petits polaroïds encadrés ——— */
.galerie {
  grid-template-columns: repeat(auto-fill, minmax(min(11rem, 44vw), 1fr));
  gap: calc(var(--espace) * 1.6);
}
.galerie .polaroid { padding: 0.5rem 0.5rem 1.1rem; } /* bas plus épais = vrai polaroïd */
.galerie .polaroid img { aspect-ratio: 1 / 1; object-fit: cover; }

/* ——— Barre de lecture panorama ——— */
.lecture-barre { display: flex; gap: 0.75rem; flex-wrap: wrap; margin: 0 0 calc(var(--espace) * 1.5); }
.bouton-lecture {
  font-family: var(--titres);
  font-size: 1.05rem;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--encre);
  border-radius: 999px 6px 999px 6px;
  background: var(--jaune);
  color: var(--encre);
  cursor: pointer;
  box-shadow: 3px 3px 0 rgba(53, 39, 26, 0.2);
}
.bouton-lecture:hover { background: var(--rouge); color: var(--papier-clair); }
#lightbox-pause {
  position: fixed; bottom: 4vh; left: 50%; transform: translateX(-50%);
  width: 48px; height: 48px; border-radius: 50%;
  border: 2px solid var(--encre); background: var(--jaune);
  font-size: 1.2rem; cursor: pointer; z-index: 10;
}

/* ——— Lightbox galerie ——— */
dialog#lightbox {
  border: none;
  background: transparent;
  padding: 0;
  max-width: 96vw;
  overflow: visible;
}
dialog#lightbox::backdrop { background: rgba(30, 20, 10, 0.85); }
dialog#lightbox img {
  max-width: 92vw; max-height: 86vh; display: block; margin: 0 auto;
  border: 4px solid var(--papier-clair);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
#lightbox-fermer, #lightbox-prec, #lightbox-suiv {
  position: fixed;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 2px solid var(--encre);
  background: var(--jaune);
  font-size: 1.6rem; line-height: 1;
  cursor: pointer;
  font-family: var(--titres);
  z-index: 10;
}
#lightbox-fermer { top: 4vh; right: 4vw; }
#lightbox-prec { left: 3vw; top: 50%; transform: translateY(-50%); }
#lightbox-suiv { right: 3vw; top: 50%; transform: translateY(-50%); }
@media (max-width: 40rem) {
  #lightbox-prec { left: 2vw; }
  #lightbox-suiv { right: 2vw; }
}

/* ——— Pied ——— */
.pied {
  margin-top: calc(var(--espace) * 4);
  padding: calc(var(--espace) * 2) var(--espace) calc(var(--espace) * 2.5);
  text-align: center;
  border-top: 3px dashed var(--encre-douce);
}
.pied-devise { font-family: var(--titres); font-size: 1.15rem; margin: 0 0 0.4rem; }

/* ——— 404 ——— */
.heros--404 { min-height: 45vh; }
