/* Page News : les nouvelles en polaroïds, scotchés ou punaisés sur le même mur blanc que l'accueil.
   - Chaque polaroïd « se développe » la première fois qu'il apparaît à l'écran (photo sombre et verdâtre
     qui monte en couleurs, ~3 s), comme une vraie photo instantanée.
   - Rotation, décalage, scotch ou punaise, couleur de l'encre : tirés une fois pour toutes d'après
     l'identifiant de la nouvelle (le mur ne change pas d'une visite à l'autre). Cf. assets/js/news/news.js.
   - Le grand format reprend la fiche du disque (.info, dans photo.css). */

.page-news {
  --wall: #efedf0;
  --ink: #1c1c1e;
  --ink-dim: #6e6e73;
  background: var(--wall);
  color: var(--ink);
  color-scheme: light;
}

/* ---------- En-tête de page ---------- */
.news { padding: 0 clamp(16px, 4vw, 56px) 96px; }
.news-intro { max-width: 1280px; margin: 0 auto; padding: 28px 0 8px; display: flex; align-items: baseline; gap: 24px; flex-wrap: wrap; }
.news-title { margin: 0; font-size: clamp(44px, 7vw, 88px); line-height: .95; font-weight: 600; letter-spacing: -0.035em; }

/* ---------- Barre collante : filtres + années ---------- */
.news-bar {
  position: sticky; top: 0; z-index: 10;
  max-width: 1280px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0;
  background: color-mix(in srgb, var(--wall) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.news-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(0,0,0,.06); opacity: 0; transition: opacity .2s; }
.news-bar.is-stuck::after { opacity: 1; }
.news-filters, .news-years { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.news-filters::-webkit-scrollbar, .news-years::-webkit-scrollbar { display: none; }
.news-filters button {
  flex: none; font: inherit; font-size: 14px; font-weight: 500;
  padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(0,0,0,.12);
  background: transparent; color: var(--ink); cursor: pointer;
}
.news-filters button:hover { border-color: rgba(0,0,0,.3); }
.news-filters button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.news-years a {
  flex: none; font-size: 14px; color: var(--ink-dim); text-decoration: none;
  padding: 7px 6px; font-variant-numeric: tabular-nums;
}
.news-years a:hover, .news-years a.is-here { color: var(--ink); }
.news-years a.is-here { text-decoration: underline; text-underline-offset: .3em; text-decoration-thickness: 1px; }

/* ---------- Le mur, année par année ---------- */
.news-wall { max-width: 1280px; margin: 0 auto; }
.news-loading { color: var(--ink-dim); padding: 80px 0; text-align: center; }
.news-year {
  display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 24px;
  padding: 40px 0 24px; scroll-margin-top: 64px;
  border-top: 1px solid rgba(0,0,0,.07);
}
.news-year:first-child { border-top: 0; }
.news-year[hidden] { display: none; }
.news-year-label {
  position: sticky; top: 76px; align-self: start;
  margin: 0; font-size: 40px; font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
}
.news-year-label small { display: block; margin-top: 8px; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--ink-dim); }

.news-grid {
  list-style: none; margin: 0; padding: 12px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 52px 40px;
}
.news-grid > li { display: flex; justify-content: center; }
.news-grid > li[hidden] { display: none; }

/* ---------- Le polaroïd (format 600 : 88 × 107 mm, image carrée 79 × 79) ---------- */
.pola-slot {
  --r: 0deg; --dx: 0px; --dy: 0px;
  position: relative; width: 100%; max-width: 250px;
  transform: translate(var(--dx), var(--dy)) rotate(var(--r));
}
.pola-slot:hover, .pola-slot:focus-within { z-index: 3; }
.pola {
  position: relative; display: block; width: 100%;
  aspect-ratio: 88 / 107;
  padding: 0; border: 0; cursor: pointer; text-align: left;
  font: inherit; color: var(--pola-ink, #1f2024);
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .07 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(160deg, #fdfcf8, #f3f1ea);
  border-radius: 2px;
  box-shadow:
    0 0 0 .5px rgba(0,0,0,.08),
    0 1px 1px rgba(0,0,0,.08),
    0 10px 18px -8px rgba(40,30,20,.32),
    0 22px 36px -22px rgba(40,30,20,.28);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s;
}
/* au survol, il se redresse et avance vers nous */
.pola:hover, .pola:focus-visible {
  transform: translateY(-8px) rotate(calc(var(--r) * -.65)) scale(1.045);
  box-shadow:
    0 0 0 .5px rgba(0,0,0,.08),
    0 2px 3px rgba(0,0,0,.08),
    0 24px 36px -12px rgba(40,30,20,.38),
    0 40px 60px -30px rgba(40,30,20,.3);
}
.pola:focus-visible { outline-offset: 6px; }

/* fenêtre de la photo */
.pola-photo {
  position: absolute; left: 6.8%; right: 6.8%; top: 5.6%;
  aspect-ratio: 1; overflow: hidden;
  background: #1d1f1a;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.25);
}
.pola-emulsion { position: absolute; inset: 0; }
.pola-emulsion img, .pola-emulsion video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* flyers très larges ou très hauts : l'image entière, posée sur sa propre version floutée */
.pola-bg { filter: blur(14px) brightness(.85); transform: scale(1.25); }
.is-fit .pola-img { object-fit: contain; }

/* rendu « instantané » : couleurs un peu passées, chaudes, contraste doux, vignettage */
.pola-emulsion {
  filter: saturate(.88) contrast(1.04) sepia(.12) brightness(1.02);
  transition: filter 3.2s cubic-bezier(.3,.1,.3,1), opacity 1.2s;
}
.pola-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 75% 75% at 50% 45%, transparent 55%, rgba(30,20,10,.28)),
    linear-gradient(125deg, rgba(255,255,255,.22) 0, rgba(255,255,255,0) 32%, rgba(255,255,255,0) 68%, rgba(255,255,255,.08));
  mix-blend-mode: normal;
}
/* voile de développement : laiteux, bleu-vert, qui se dissipe */
.pola-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(160deg, #6f7c72, #4b5650);
  opacity: 0; transition: opacity 3.6s cubic-bezier(.3,.1,.3,1);
}

/* avant développement (JS présent seulement) */
.js .pola:not(.is-dev) .pola-emulsion { filter: brightness(.35) contrast(.5) sepia(.6) hue-rotate(115deg) saturate(.5) blur(1.5px); opacity: .55; transition: none; }
.js .pola:not(.is-dev) .pola-photo::before { opacity: .92; transition: none; }
.pola.is-dev .pola-emulsion { transition-delay: var(--dev-delay, 0s); }
.pola.is-dev .pola-photo::before { transition-delay: var(--dev-delay, 0s); }

/* polaroïd sans photo : film resté noir, le titre écrit dessus au marqueur argent */
.pola-photo.is-blank { background: radial-gradient(ellipse at 30% 25%, #34332f, #121210 70%); display: grid; place-items: center; }
.pola-blank-text {
  position: relative; z-index: 2; padding: 12%;
  font-family: "Permanent Marker", "Caveat", cursive; font-size: clamp(15px, 1.35vw, 19px); line-height: 1.15;
  color: #d9d9d4; text-align: center; transform: rotate(-4deg);
  text-shadow: 0 0 1px rgba(255,255,255,.3);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

/* légende écrite à la main dans la bande blanche */
.pola-caption {
  position: absolute; left: 7%; right: 6%; top: calc(5.6% + 86.4% * 88 / 107 + 2.5%); bottom: 3.5%;
  display: flex; align-items: center; gap: 6px;
}
.pola-title {
  font-family: "Caveat", cursive; font-weight: 600;
  font-size: clamp(17px, 1.6vw, 22px); line-height: 1;
  flex: 1; min-width: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transform: rotate(-1deg);
}
.pola-date {
  order: 2; flex: none; align-self: flex-end; margin-bottom: 2px;
  font-family: "Caveat", cursive; font-weight: 500; font-size: 14px; opacity: .7;
  transform: rotate(-3deg);
}
.pola-video {
  position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%;
  width: 22%; aspect-ratio: 1; border-radius: 50%;
  background: rgba(255,255,255,.85); box-shadow: 0 2px 8px rgba(0,0,0,.3);
  display: grid; place-items: center;
}
.pola-video::after { content: ""; margin-left: 12%; border: solid transparent; border-width: 7px 0 7px 11px; border-left-color: #1d1f22; }
/* photo qui n'est pas la vignette de la vidéo : petite pastille dans le coin */
.pola-video.is-corner { left: auto; top: auto; right: 6%; bottom: 6%; translate: none; width: 17%; }
.pola-video.is-corner::after { border-width: 5px 0 5px 8px; }
.pola-more {   /* plusieurs photos : un 2ᵉ polaroïd dépasse derrière */
  position: absolute; inset: 0; border-radius: 2px;
  background: linear-gradient(160deg, #fbfaf5, #eeece4);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.08), 0 6px 12px -6px rgba(40,30,20,.3);
  transform: rotate(5deg) translate(6px, 4px);
}

/* ---------- Ce qui tient le polaroïd au mur ---------- */
.tape {
  position: absolute; z-index: 2; pointer-events: none;
  width: 42%; height: 26px; left: 29%; top: -12px;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,.08) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, rgba(240,232,205,.78), rgba(228,218,188,.72));
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  /* bords déchirés */
  clip-path: polygon(2% 0, 98% 0, 100% 12%, 97% 26%, 100% 41%, 98% 57%, 100% 72%, 97% 86%, 99% 100%, 1% 100%, 3% 85%, 0 70%, 2% 55%, 0 40%, 3% 26%, 0 12%);
  transform: rotate(var(--t, -3deg));
  -webkit-backdrop-filter: blur(.4px); backdrop-filter: blur(.4px);
}
.tape--l { width: 34%; left: -9%; top: 1%; transform: rotate(-42deg); }
.tape--r { width: 34%; left: auto; right: -9%; top: 1%; transform: rotate(42deg); }
/* écrans tactiles : pas de flou d'arrière-plan sous le scotch (29/11/2026) : ~200 morceaux sur la page News, chacun
   un calque et une copie floutée de ce qu'il y a derrière, pour un flou de 0,4 px invisible ; trop lourd pour
   Safari sur iPhone (même famille que la page Scène rechargée faute de mémoire) */
@media (hover: none) {
  .tape { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.pin {
  position: absolute; z-index: 2; left: calc(50% - 9px); top: -4px; width: 18px; height: 18px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255,255,255,.7), transparent 35%), var(--pin, #ff0006);
  box-shadow: inset -2px -3px 4px rgba(0,0,0,.28), 2px 5px 5px -1px rgba(0,0,0,.35);
  pointer-events: none;
}

/* ---------- Grand format ---------- */
.nd { width: min(94vw, 1040px); }
.nd .info-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
.nd[open] { animation: nd-in .45s cubic-bezier(.2,.8,.2,1); }
@keyframes nd-in { from { opacity: 0; transform: translateY(24px) rotate(-1.5deg) scale(.97); } }
.nd-visual { display: grid; justify-items: center; gap: 16px; padding-top: 8px; }
.nd-stack { position: relative; width: 100%; display: grid; }
.nd-pola {
  grid-area: 1 / 1; justify-self: center;
  position: relative; width: 100%; max-width: 460px;
  padding: 5.5% 5.5% 3%; border: 0; cursor: default; font: inherit; color: var(--pola-ink, #1f2024);
  background: linear-gradient(160deg, #fdfcf8, #f2f0e8);
  border-radius: 2px;
  box-shadow: 0 0 0 .5px rgba(0,0,0,.1), 0 18px 40px -14px rgba(40,30,20,.45);
  transform: rotate(var(--r, 0deg)) translate(var(--dx, 0), var(--dy, 0));
  transition: transform .45s cubic-bezier(.2,.8,.2,1), opacity .3s;
}
.nd-stack.is-multi .nd-pola { cursor: pointer; width: 91%; justify-self: start; } /* place pour les photos décalées derrière, sans mordre sur le texte */
.nd-stack.is-multi { padding-bottom: 9%; }   /* les photos décalées et tournées dépassent en bas : l'aide « Touchez la photo… » reste visible */
.nd-stack.is-multi.is-playing { padding-bottom: 0; }
.nd-pola img { display: block; width: 100%; height: auto; max-height: 58dvh; object-fit: contain; background: #1d1f1a; }
.nd-pola .nd-blank { aspect-ratio: 1; display: grid; place-items: center; background: radial-gradient(ellipse at 30% 25%, #34332f, #121210 70%); }
.nd-pola .nd-blank span { font-family: "Permanent Marker", cursive; color: #dcdcd6; font-size: 26px; line-height: 1.15; text-align: center; padding: 14%; transform: rotate(-4deg); }
.nd-pola figcaption {
  min-height: 2.6em; padding: 4% 1% 0;
  display: flex; align-items: center;
  font-family: "Caveat", cursive; font-weight: 600; font-size: clamp(20px, 2.4vw, 28px); line-height: 1;
  transform: rotate(-1deg);
}
.nd-pola figcaption span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nd-pola .nd-photo { position: relative; overflow: hidden; background: #1d1f1a; }
/* image très large : posée entière dans un cadre 4:3, sur sa version floutée (comme sur le mur) */
.nd-photo.is-fit { aspect-ratio: 4 / 3; }
.nd-photo.is-fit img { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; object-fit: contain; background: none; }
.nd-photo.is-fit img.nd-bg { object-fit: cover; filter: blur(16px) brightness(.85); transform: scale(1.25); }
.nd-pola .nd-photo::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(125deg, rgba(255,255,255,.18), transparent 30%, transparent 70%, rgba(255,255,255,.06));
}
.nd-pola img { filter: saturate(.92) contrast(1.03) sepia(.08); }
.nd-pola.is-leaving { transform: translate(60%, -8%) rotate(14deg); opacity: 0; }

/* vidéo : jouée dans le polaroïd, à la place de la photo */
.nd-play {
  position: absolute; z-index: 2; left: 50%; top: 50%; translate: -50% -50%;
  width: 76px; height: 76px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.9); box-shadow: 0 6px 20px rgba(0,0,0,.35);
  display: grid; place-items: center; transition: scale .2s, background .2s;
}
.nd-play::after { content: ""; margin-left: 8px; border: solid transparent; border-width: 14px 0 14px 22px; border-left-color: #1d1f22; }
.nd-play:hover { scale: 1.08; background: #fff; }
.nd-pola.is-playing { max-width: 640px; transform: rotate(0deg); }
/* pendant la lecture, les autres photos de la pile s'effacent (elles dépassaient sous la vidéo, plus basse) */
.nd-stack.is-playing .nd-pola:not(.is-playing) { display: none; }
.nd-visual:has(.nd-stack.is-playing) .nd-hint { display: none; }
.nd-photo.is-video { aspect-ratio: 16 / 9; background: #000; }
.nd-photo.is-video::after { display: none; }
.nd-photo.is-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.nd-vbtn {
  font: inherit; font-size: 14px; font-weight: 500; padding: 10px 16px; border-radius: 999px; cursor: pointer;
  border: 0; background: #1d1f22; color: #fff;
}
.nd-vbtn:hover { background: #000; }
.nd-vbtn[aria-pressed="true"] { background: #c4470e; }
.nd-content a.is-video::before { content: "▶ "; font-size: .8em; }
/* vidéo verticale (reel Instagram, fichier filmé au téléphone) : polaroïd plus étroit */
.nd-pola.is-playing.is-tall { max-width: min(400px, 100%); }
/* lecteur Instagram : sa hauteur vient d'Instagram (--ig-h), en attendant un cadre vertical */
.nd-photo.is-video.is-instagram { aspect-ratio: auto; height: min(var(--ig-h, 620px), 76dvh); overflow-y: auto; background: #fff; }
.nd-photo.is-video.is-instagram iframe { position: static; display: block; height: var(--ig-h, 620px); }
/* fichier envoyé sur le site : lecteur du navigateur */
.nd-photo.is-video.is-file { aspect-ratio: auto; }
.nd-photo.is-video.is-file video { display: block; width: 100%; max-height: 70dvh; background: #000; }

.nd-text { min-width: 0; padding-right: 8px; }
.nd-date { margin: 4px 0 0; font-size: 14px; color: #6a6e73; }
.nd-tags { margin: 6px 0 18px; display: flex; flex-wrap: wrap; gap: 6px; }
.nd-tags span { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(0,0,0,.06); color: #4a4e53; }
.nd-content { font-size: 16px; line-height: 1.55; overflow-wrap: anywhere; }
.nd-content p { margin: 0 0 .9em; }
.nd-content a { color: #c4470e; text-underline-offset: .15em; }
.nd-content ul, .nd-content ol { padding-left: 1.2em; }
.nd-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.nd-links a {
  display: inline-block; padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 500; text-decoration: none;
  background: #1d1f22; color: #fff;
}
.nd-links a.is-quiet { background: transparent; color: #4a4e53; border: 1px solid rgba(0,0,0,.14); }
.nd-links a:hover { background: #000; color: #fff; }
.nd-nav {
  position: sticky; bottom: 0; display: flex; justify-content: space-between; gap: 8px;
  padding: 10px 16px 14px; pointer-events: none;
}
.nd-nav button {
  pointer-events: auto; width: 44px; height: 44px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.06); font: inherit; font-size: 18px; cursor: pointer; color: #1d1f22;
}
.nd-nav button:hover { background: rgba(0,0,0,.12); }
.nd-nav button:disabled { opacity: .3; cursor: default; }

/* ---------- Écrans moyens et téléphones ---------- */
@media (max-width: 1040px) {
  .news-bar { flex-direction: column; align-items: stretch; gap: 6px; }
}
@media (max-width: 900px) {
  .news-year { grid-template-columns: 1fr; gap: 8px; padding-top: 28px; }
  .news-year-label { position: static; display: flex; align-items: baseline; gap: 12px; font-size: 32px; }
  .news-year-label small { margin: 0; }
}
@media (max-width: 760px) {
  .news { padding: 0 16px 72px; }
  .news-intro { padding-top: 16px; gap: 6px 16px; }
  .news-bar { flex-direction: column; align-items: stretch; gap: 6px; padding: 10px 0 8px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
  .news-filters button { font-size: 13px; padding: 6px 12px; }
  .news-years a { font-size: 13px; padding: 4px 6px; }
  .news-year { scroll-margin-top: 104px; }
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; }
  .pola-title { font-size: clamp(15px, 4.4vw, 19px); }
  .pola-date { font-size: 12px; }
  .pola-blank-text { font-size: clamp(13px, 3.8vw, 17px); }
  .tape { height: 20px; top: -9px; }
  .nd { width: 100vw; max-width: 100vw; }
  .nd .info-body { grid-template-columns: 1fr; }
  .nd-nav { background: linear-gradient(rgba(244,243,241,0), #f4f3f1 45%); padding-top: 22px; }
  .nd-pola img { max-height: 50dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .js .pola:not(.is-dev) .pola-emulsion { filter: saturate(.88) contrast(1.04) sepia(.12) brightness(1.02); opacity: 1; }
  .js .pola:not(.is-dev) .pola-photo::before { opacity: 0; }
  .pola, .pola-emulsion, .pola-photo::before, .nd-pola { transition: none; }
  .nd[open] { animation-duration: .01s; }
}

/* ---------- Typo des titres : Josefin Sans (cf. --font-titres dans photo.css) ----------
   Titre de la page, années, filtres et titre du grand format. Écriture manuscrite des polaroïds
   (Caveat, Permanent Marker) et texte des news inchangés. */
.news-title, .news-year-label, .news-filters button, .news-years a, .nd .info-title, .nd-date { font-family: var(--font-titres); }
.news-title { font-weight: 300; letter-spacing: 0.02em; text-transform: uppercase; }
.news-year-label { font-weight: 300; letter-spacing: 0.02em; }
.news-year-label small { font-family: var(--font-titres); letter-spacing: 0.08em; text-transform: uppercase; font-size: 11px; }
.news-filters button, .news-years a { font-weight: 400; font-size: 12.5px; letter-spacing: 0.14em; text-transform: uppercase; }
.nd .info-title { font-weight: 400; letter-spacing: 0; }
