/* =========================================================
   JOURNAL 509 — Design system
   Palette officielle : Warm Ivory, Ink Black, Editorial Red,
   White, Paper Gray, Slate Blue.
   ========================================================= */
:root {
  --ivory: #F7F5EF;
  --ink: #171717;
  --red: #B82025;
  --white: #FFFFFF;
  --gray: #D8D2C5;
  --slate: #303A46;

  /* dérivés (mêmes teintes, opacités) */
  --ink-70: rgba(23, 23, 23, .72);
  --ink-50: rgba(23, 23, 23, .55);
  --gray-40: rgba(216, 210, 197, .45);
  --slate-08: rgba(48, 58, 70, .08);
  --red-08: rgba(184, 32, 37, .08);

  --f-mast: "Playfair Display", Georgia, serif;
  --f-head: "Merriweather", Georgia, serif;
  --f-body: "Source Serif 4", Georgia, serif;
  --f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 4px;
  --shadow-book: 0 18px 40px rgba(23, 23, 23, .18), 0 2px 6px rgba(23, 23, 23, .08);
  --gutter: 16px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* Pas de défilement horizontal sur mobile. « clip » sur <html> (et non « hidden » sur <body>) :
   sinon l'animation de page qui déborde fait remonter la page tout en haut à chaque page tournée. */
html { -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--white); padding: 8px 12px; z-index: 1000; font-family: var(--f-ui); }
.skip-link:focus { left: 8px; }

/* ---------- UI primitives ---------- */
.ui { font-family: var(--f-ui); }
.kicker {
  font-family: var(--f-ui); font-size: 11px; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--red);
}
.meta { font-family: var(--f-ui); font-size: 12px; color: var(--ink-50); letter-spacing: .02em; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--f-ui); font-size: 13px; font-weight: 600; letter-spacing: .04em;
  padding: 10px 16px; border-radius: var(--radius); border: 1px solid var(--ink);
  background: var(--white); color: var(--ink); cursor: pointer; text-decoration: none;
  transition: background .15s, color .15s, border-color .15s; white-space: nowrap;
}
.btn:hover { background: var(--ink); color: var(--white); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn[disabled]:hover { background: var(--white); color: var(--ink); }
.btn-red { background: var(--red); border-color: var(--red); color: var(--white); }
.btn-red:hover { background: var(--ink); border-color: var(--ink); }
.btn-slate { background: var(--slate); border-color: var(--slate); color: var(--white); }
.btn-slate:hover { background: var(--ink); border-color: var(--ink); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--slate-08); color: var(--ink); }
.btn-sm { padding: 6px 10px; font-size: 12px; }
.btn-icon { padding: 8px; width: 38px; height: 38px; }
.btn svg, .icon { width: 18px; height: 18px; flex: none; }
.caps { text-transform: uppercase; letter-spacing: .12em; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-ui); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 999px; border: 1px solid var(--gray); background: var(--white); color: var(--slate);
  white-space: nowrap;
}
.badge.st-collected { background: var(--ivory); }
.badge.st-under_review { border-color: var(--slate); }
.badge.st-draft { background: var(--slate-08); }
.badge.st-approved { background: var(--slate); color: var(--white); border-color: var(--slate); }
.badge.st-published { background: var(--ink); color: var(--white); border-color: var(--ink); }
.badge.st-rejected { color: var(--red); border-color: var(--red); background: var(--red-08); }
.badge.st-archived { background: var(--ivory); color: var(--ink-50); }
.badge.flag { color: var(--red); border-color: var(--red); background: var(--red-08); }
.badge.ok { color: var(--slate); }

/* ---------- Header (masthead) ---------- */
.site-header { background: var(--ivory); border-bottom: 1px solid var(--gray); }
.topbar {
  max-width: 1280px; margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-family: var(--f-ui); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate);
  border-bottom: 1px solid var(--gray);
}
.topbar .tb-date { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a {
  text-decoration: none; padding: 4px 8px; border-radius: var(--radius); font-weight: 600;
}
.topnav a:hover, .topnav a[aria-current="page"] { background: var(--slate); color: var(--white); }
.masthead { max-width: 1280px; margin: 0 auto; padding: 18px var(--gutter) 10px; text-align: center; }
.masthead a { display: inline-block; text-decoration: none; }
.masthead img { height: 74px; width: auto; margin: 0 auto; }
.masthead h1 { margin: 0; }
.tagline {
  margin: 8px 0 0; font-family: var(--f-body); font-style: italic; color: var(--ink-70); font-size: 15px;
}
.edition-strip {
  max-width: 1280px; margin: 0 auto; padding: 6px var(--gutter);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-family: var(--f-ui); font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  border-top: 3px double var(--ink);
}
.edition-strip strong { color: var(--red); font-weight: 700; }
@media (max-width: 640px) {
  .topbar { padding: 6px 12px; font-size: 10px; letter-spacing: .1em; }
  .topbar .tb-date { flex: 1 1 auto; min-width: 0; }
  .topnav a { padding: 4px 6px; }
  .masthead { padding: 12px 12px 6px; }
  .masthead img { height: auto; width: 100%; max-width: 330px; }
  .tagline { font-size: 13px; margin-top: 4px; }
  .edition-strip { justify-content: center; gap: 4px 12px; font-size: 10px; letter-spacing: .1em; padding: 6px 12px; }
  .edition-strip span:last-child { display: none; }
}

/* ---------- Layout ---------- */
.container { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: 40px; padding-bottom: 40px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  border-top: 3px solid var(--ink); padding-top: 10px; margin-bottom: 20px;
}
.section-head h2 { font-family: var(--f-head); font-weight: 900; font-size: 26px; margin: 0; line-height: 1.2; }
.site-footer {
  border-top: 1px solid var(--gray); margin-top: 40px; padding: 28px 0 40px; text-align: center;
  font-family: var(--f-ui); font-size: 12px; color: var(--ink-50);
}
.site-footer img { height: 44px; width: auto; margin: 0 auto 10px; }

.empty {
  text-align: center; padding: 48px 16px; border: 1px dashed var(--gray); background: var(--white);
  border-radius: var(--radius); font-family: var(--f-ui); color: var(--ink-70);
}
.empty h3 { font-family: var(--f-head); color: var(--ink); margin: 0 0 6px; }
.loading { display: grid; place-items: center; padding: 80px 0; font-family: var(--f-ui); color: var(--ink-50); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--gray); border-top-color: var(--red); border-radius: 50%; animation: spin 0.9s linear infinite; margin-bottom: 10px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reader shell ---------- */
.reader { padding: 18px 0 8px; }
.reader-toolbar {
  max-width: 1280px; margin: 0 auto 12px; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  font-family: var(--f-ui);
}
.reader-toolbar .rt-left { display: flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; }
.reader-toolbar .rt-right { display: flex; gap: 6px; flex-wrap: wrap; }
.page-counter { color: var(--ink); }
.page-counter b { color: var(--red); }
.reader-stage { position: relative; display: flex; justify-content: center; align-items: center; padding: 0 56px; min-height: 200px; }
.book { margin: 0 auto; transition: transform .55s cubic-bezier(.3,.7,.3,1); }
.book-shadow { filter: drop-shadow(0 18px 30px rgba(23,23,23,.16)); }
.nav-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--gray); background: var(--white);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 8px rgba(23,23,23,.1);
}
.nav-arrow:hover { border-color: var(--ink); }
.nav-arrow[disabled] { opacity: .35; cursor: default; }
.nav-arrow.prev { left: 6px; }
.nav-arrow.next { right: 6px; }
.reader-bottom {
  max-width: 1280px; margin: 14px auto 0; padding: 0 var(--gutter);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-family: var(--f-ui); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
}
.reader-bottom button { background: none; border: 0; cursor: pointer; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; display: inline-flex; gap: 6px; align-items: center; padding: 6px 0; }
.reader-bottom button[disabled] { opacity: .35; cursor: default; }
.dots { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.dots button { width: 8px; height: 8px; border-radius: 4px; background: var(--gray); padding: 0; transition: width .2s, background .2s; }
.dots button.on { background: var(--red); width: 22px; }
.reader-hint { text-align: center; font-family: var(--f-ui); font-size: 12px; color: var(--ink-50); margin: 8px 0 0; }
.reader.is-fullscreen { background: var(--ivory); padding: 12px 0; overflow: auto; height: 100vh; }
@media (max-width: 640px) {
  .reader-stage { padding: 0 4px; }
  .nav-arrow { display: none; }
  .reader-toolbar .btn .lbl { display: none; }
}

/* ---------- Newspaper page (scales with container query units) ---------- */
.np-page {
  background: var(--white);
  container-type: size;
  overflow: hidden;
  color: var(--ink);
  position: relative;
  font-size: 2cqw; line-height: 1.4;
}
:where(.np-page) button { font-size: inherit; line-height: inherit; color: inherit; }
.np-page .icon { width: 1.9cqw; height: 1.9cqw; }
.np-page.cover { background: var(--white); }
.np-inner { position: absolute; inset: 0; padding: 4.2cqw 4.6cqw; display: flex; flex-direction: column; }
.np-head {
  display: flex; justify-content: space-between; align-items: baseline;
  border-bottom: .3cqw solid var(--ink); padding-bottom: 1cqw; margin-bottom: 2.2cqw;
  font-family: var(--f-ui); font-size: 1.9cqw; letter-spacing: .16em; text-transform: uppercase;
}
.np-head .sec { color: var(--red); font-weight: 700; }
.np-head .pg { color: var(--ink-70); }
.np-foot {
  margin-top: auto; padding-top: 1cqw; border-top: .15cqw solid var(--gray);
  display: flex; justify-content: space-between; font-family: var(--f-ui); font-size: 1.7cqw; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-50);
}
.np-body { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 2.4cqw; }
.np-body.split-h { flex-direction: row; }
.np-art { min-height: 0; display: flex; flex-direction: column; position: relative; }
.np-art + .np-art { border-top: .15cqw solid var(--gray); padding-top: 2.2cqw; }
.np-body.split-h .np-art + .np-art { border-top: 0; padding-top: 0; border-left: .15cqw solid var(--gray); padding-left: 2.4cqw; }
.np-art .kick { font-family: var(--f-ui); font-weight: 700; font-size: 1.8cqw; letter-spacing: .16em; text-transform: uppercase; color: var(--red); margin-bottom: .8cqw; }
.np-art h2, .np-art h3 { font-family: var(--f-head); font-weight: 900; margin: 0; line-height: 1.12; letter-spacing: -.005em; }
.np-art .hl-xl { font-size: 5.2cqw; }
.np-art .hl-l { font-size: 4.1cqw; }
.np-art .hl-m { font-size: 3.3cqw; }
.np-art .hl-s { font-size: 2.6cqw; }
.np-art .stand { font-family: var(--f-body); font-style: italic; color: var(--ink-70); font-size: 2.15cqw; line-height: 1.4; margin: 1cqw 0 1.4cqw; }
.np-fig { margin: 0 0 1.2cqw; }
.np-fig img { width: 100%; object-fit: cover; background: var(--ivory); }
.np-fig figcaption span:first-child { flex: 1 1 60%; }
.np-fig figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .2cqw 2cqw; font-family: var(--f-ui); font-size: 1.45cqw; color: var(--ink-50); margin-top: .6cqw; line-height: 1.35; }
.np-fig figcaption .cr { text-transform: uppercase; letter-spacing: .1em; white-space: nowrap; }
.np-text {
  flex: 1; min-height: 0; overflow: hidden; position: relative;
  font-family: var(--f-body); font-size: 1.95cqw; line-height: 1.5; text-align: justify; hyphens: auto;
  column-gap: 2.4cqw; column-rule: .12cqw solid var(--gray); column-fill: auto;
}
.np-text.cols-2 { column-count: 2; }
.np-text.cols-3 { column-count: 3; }
.np-text p { margin: 0 0 .9em; }
.np-text h4 { font-family: var(--f-head); font-weight: 700; font-size: 2.15cqw; line-height: 1.25; margin: .4em 0 .4em; text-align: left; break-after: avoid; }
.np-text ul { padding-left: 1.2em; margin: 0 0 .9em; }
.np-text::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5cqw;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--white));
}
.np-more {
  align-self: flex-start; margin-top: 1cqw; background: none; border: 0; padding: .4cqw 0; cursor: pointer;
  font-family: var(--f-ui); font-weight: 700; font-size: 1.75cqw; letter-spacing: .14em; text-transform: uppercase; color: var(--red);
  display: inline-flex; align-items: center; gap: .8cqw;
}
.np-more:hover { text-decoration: underline; }
.np-tags { display: flex; gap: 1cqw; margin-top: .8cqw; }
.np-tag { font-family: var(--f-ui); font-size: 1.5cqw; color: var(--slate); border: .12cqw solid var(--gray); padding: .2cqw .9cqw; border-radius: 99px; display: inline-flex; gap: .5cqw; align-items: center; }
.np-tag svg { width: 1.8cqw; height: 1.8cqw; }

/* layout: lead + image side by side */
.np-row { display: flex; gap: 2.4cqw; min-height: 0; flex: 1; }
.np-row > .np-col { flex: 1; min-width: 0; display: flex; flex-direction: column; min-height: 0; }
.np-row > .np-col.w2 { flex: 2; }

/* Cover */
.np-cover-top { display: flex; justify-content: space-between; font-family: var(--f-ui); font-size: 1.75cqw; letter-spacing: .16em; text-transform: uppercase; border-top: .3cqw solid var(--ink); border-bottom: .15cqw solid var(--ink); padding: .8cqw 0; }
.np-logo { text-align: center; padding: 2.2cqw 0 1.4cqw; }
.np-logo img { width: 62%; margin: 0 auto; }
.np-logo .tg { font-family: var(--f-body); font-style: italic; font-size: 2.1cqw; color: var(--ink-70); margin-top: .6cqw; }
.np-cover-sub { display: flex; justify-content: space-between; font-family: var(--f-ui); font-size: 1.6cqw; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-70); border-top: .15cqw solid var(--ink); border-bottom: .45cqw double var(--ink); padding: .7cqw 0; margin-bottom: 2cqw; }
.np-cover-lead { overflow: hidden; }
.np-cover-lead h2 { font-size: 4.3cqw; }
.np-cover-lead .np-fig { flex: 1; min-height: 0; display: flex; flex-direction: column; margin-bottom: .6cqw; }
.np-cover-lead .np-fig img { flex: 1; min-height: 0; height: 100%; aspect-ratio: auto !important; }
.np-cover-lead .lede { font-family: var(--f-body); font-size: 2cqw; line-height: 1.45; margin: 0 0 1cqw; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.np-features { display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; border-top: .45cqw solid var(--ink); padding-top: 1.6cqw; margin-top: 1.2cqw; }
.np-feature + .np-feature { border-left: .15cqw solid var(--gray); padding-left: 2.4cqw; }
.np-feature .label { display: inline-block; background: var(--red); color: var(--white); font-family: var(--f-ui); font-weight: 700; font-size: 1.55cqw; letter-spacing: .14em; text-transform: uppercase; padding: .4cqw 1cqw; margin-bottom: 1cqw; }
.np-feature .label.slate { background: var(--slate); }
.np-feature h3 { font-family: var(--f-head); font-size: 2.5cqw; font-weight: 900; line-height: 1.15; margin: 0 0 .5cqw; }
.np-feature p { margin: 0; font-style: italic; font-size: 1.8cqw; color: var(--ink-70); line-height: 1.35; }
.np-briefs { display: grid; grid-template-columns: auto 1fr 1fr 1fr; gap: 1.6cqw; align-items: stretch; margin-top: 1.8cqw; border-top: .15cqw solid var(--gray); padding-top: 1.6cqw; }
.np-briefs .eb { background: var(--slate); color: var(--white); font-family: var(--f-ui); font-weight: 700; font-size: 1.6cqw; letter-spacing: .14em; text-transform: uppercase; display: grid; place-items: center; padding: 0 1.6cqw; text-align: center; }
.np-brief { display: flex; gap: 1cqw; text-align: left; background: none; border: 0; padding: 0; cursor: pointer; }
.np-brief + .np-brief { border-left: .15cqw solid var(--gray); padding-left: 1.6cqw; }
.np-brief .n { background: var(--red); color: var(--white); font-family: var(--f-ui); font-weight: 700; font-size: 1.5cqw; height: 2.8cqw; min-width: 3.2cqw; display: grid; place-items: center; }
.np-brief .t { display: block; font-family: var(--f-head); font-weight: 700; font-size: 1.7cqw; line-height: 1.3; text-transform: uppercase; }
.np-brief .p { display: block; font-family: var(--f-ui); font-size: 1.45cqw; color: var(--red); font-weight: 700; margin-top: .6cqw; letter-spacing: .1em; }
.page-ref { font-family: var(--f-ui); font-weight: 700; font-size: 1.55cqw; color: var(--red); letter-spacing: .12em; text-transform: uppercase; margin-top: .8cqw; display: block; }
.np-hl-btn { all: unset; cursor: pointer; }
.np-hl-btn:hover { text-decoration: underline; text-decoration-thickness: .2cqw; }
.np-hl-btn:focus-visible { outline: 2px solid var(--red); }
button.np-feature { background: none; border: 0; text-align: left; cursor: pointer; padding: 0; }

/* Rubriques page */
.np-rub { display: flex; gap: 2.4cqw; min-height: 0; }
.np-rub .np-fig { flex: 0 0 38%; }
.np-rub .np-fig img { aspect-ratio: 1; }
.np-rub-box { border: .3cqw solid var(--ink); padding: 2.2cqw; position: relative; display: flex; flex-direction: column; min-height: 0; flex: 1; }
.np-rub-box .rlabel { position: absolute; top: -1.6cqw; left: 2cqw; background: var(--red); color: var(--white); font-family: var(--f-ui); font-weight: 700; font-size: 1.6cqw; letter-spacing: .14em; text-transform: uppercase; padding: .4cqw 1.2cqw; }
.np-rub-box .rlabel.slate { background: var(--slate); }
.np-video-thumb { position: relative; background: var(--ink); aspect-ratio: 16 / 9; display: grid; place-items: center; color: var(--white); overflow: hidden; }
.np-video-thumb img, .np-video-thumb video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .75; }
.np-video-thumb .play { position: relative; width: 9cqw; height: 9cqw; border-radius: 50%; background: var(--red); display: grid; place-items: center; }
.np-video-thumb .play svg { width: 4cqw; height: 4cqw; fill: var(--white); }

/* Back cover / generic grid */
.np-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: 2.4cqw; flex: 1; min-height: 0; }
.np-grid .np-art + .np-art { border-top: 0; padding-top: 0; }

/* ---------- Simple (accessible) reading mode ---------- */
.simple-reader { max-width: 820px; margin: 0 auto; padding: 0 var(--gutter); display: grid; gap: 24px; }
.simple-reader .np-page { width: 100%; aspect-ratio: 1 / 1.4142; box-shadow: var(--shadow-book); border: 1px solid var(--gray); }
.simple-reader .sr-label { font-family: var(--f-ui); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--slate); margin-bottom: 6px; }

/* ---------- Editions grid ---------- */
.ed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.ed-card { background: var(--white); border: 1px solid var(--gray); border-top: 3px solid var(--ink); display: flex; flex-direction: column; text-decoration: none; transition: transform .15s, box-shadow .15s; min-width: 0; }
.ed-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(23,23,23,.1); }
.ed-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--ivory); position: relative; border-bottom: 1px solid var(--gray); }
.ed-img img { width: 100%; height: 100%; object-fit: cover; }
.ed-img img.ph { object-fit: contain; padding: 18%; }
.ed-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.ed-meta .no { font-family: var(--f-ui); font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--red); }
.ed-meta .dt { font-family: var(--f-head); font-weight: 900; font-size: 16px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ed-meta .ds { font-size: 14px; color: var(--ink-70); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 640px) {
  .ed-grid { grid-template-columns: 1fr; gap: 12px; }
  .ed-card { flex-direction: row; }
  .ed-img { flex: 0 0 112px; aspect-ratio: auto; min-height: 112px; border-bottom: 0; border-right: 1px solid var(--gray); }
  .ed-meta { padding: 10px 12px; gap: 4px; }
  .ed-meta .dt { font-size: 15px; }
  .ed-meta .ds { display: none; }
  .ed-card .now { font-size: 10px; }
}
.ed-meta .open { margin-top: auto; font-family: var(--f-ui); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; display: inline-flex; gap: 6px; align-items: center; }
.ed-card.current { border-color: var(--ink); }
.ed-card .now { position: absolute; top: 8px; left: 8px; z-index: 2; }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.input, .select, .textarea {
  font-family: var(--f-ui); font-size: 14px; padding: 9px 11px; border: 1px solid var(--gray); border-radius: var(--radius);
  background: var(--white); color: var(--ink); width: 100%;
}
.textarea { font-family: var(--f-body); font-size: 15px; line-height: 1.55; resize: vertical; min-height: 90px; }
.textarea.code { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--slate); box-shadow: 0 0 0 3px var(--slate-08); }
.filters .input, .filters .select { width: auto; min-width: 160px; flex: 1 1 160px; }

/* ---------- Article (full) ---------- */
.article-view { background: var(--white); max-width: 860px; margin: 0 auto; padding: 32px clamp(16px, 5vw, 56px) 48px; border: 1px solid var(--gray); }
.article-view .crumbs { font-family: var(--f-ui); font-size: 12px; margin-bottom: 20px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.article-view .crumbs a { color: var(--slate); }
.article-view h1 { font-family: var(--f-head); font-weight: 900; font-size: clamp(28px, 4.4vw, 44px); line-height: 1.12; margin: 8px 0 12px; }
.article-view .subtitle { font-style: italic; font-size: clamp(18px, 2.2vw, 21px); color: var(--ink-70); line-height: 1.45; margin: 0 0 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; border-top: 1px solid var(--gray); border-bottom: 1px solid var(--gray); padding: 10px 0; margin-bottom: 20px; }
.article-view figure { margin: 0 0 22px; }
.article-view figure img { width: 100%; }
.article-view figcaption { display: flex; justify-content: space-between; gap: 12px; font-family: var(--f-ui); font-size: 12px; color: var(--ink-50); padding-top: 6px; }
.article-body { font-size: 19px; line-height: 1.7; }
.article-body p { margin: 0 0 1.05em; }
.article-body h3 { font-family: var(--f-head); font-weight: 700; font-size: 22px; line-height: 1.3; margin: 1.5em 0 .5em; }
.article-body blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--red); font-style: italic; }
.article-body ul { padding-left: 1.2em; }
.article-body li { margin-bottom: .35em; }
.box { border: 1px solid var(--gray); background: var(--ivory); padding: 18px 20px; margin: 26px 0; }
.box h2 { font-family: var(--f-ui); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 10px; color: var(--red); }
.box.dark { background: var(--slate); color: var(--white); border-color: var(--slate); }
.box.dark h2 { color: var(--white); }
.box ul { margin: 0; padding-left: 1.1em; }
.box li { margin-bottom: .4em; }
.box p:last-child { margin-bottom: 0; }
.sources-list { font-family: var(--f-ui); font-size: 14px; }
.sources-list li { margin-bottom: 6px; }
.share { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.lang-tabs { display: flex; gap: 4px; }
.lang-tabs button { font-family: var(--f-ui); font-size: 12px; font-weight: 600; padding: 4px 10px; border: 1px solid var(--gray); background: var(--white); border-radius: 99px; cursor: pointer; }
.lang-tabs button.on { background: var(--ink); color: var(--white); border-color: var(--ink); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }

/* Video facade */
.video { margin: 22px 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--ink); overflow: hidden; }
.video-frame.vertical { aspect-ratio: 9 / 16; max-width: 360px; margin: 0 auto; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-facade { position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer; background: var(--slate); display: grid; place-items: center; color: var(--white); width: 100%; }
.video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.video-facade .play { position: relative; width: 68px; height: 68px; border-radius: 50%; background: var(--red); display: grid; place-items: center; box-shadow: 0 4px 18px rgba(0,0,0,.3); }
.video-facade .play svg { width: 28px; height: 28px; fill: var(--white); margin-left: 4px; }
.video-facade .vlabel { position: absolute; left: 12px; bottom: 10px; font-family: var(--f-ui); font-size: 12px; font-weight: 600; background: rgba(23,23,23,.7); padding: 4px 8px; }
.video-credit { font-family: var(--f-ui); font-size: 12px; color: var(--ink-50); padding-top: 6px; display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; justify-content: center; align-items: flex-start; overflow-y: auto; background: rgba(23,23,23,.55); padding: 24px 12px 90px; }
.modal[hidden] { display: none; }
.modal-panel { position: relative; width: 100%; max-width: 900px; }
.modal-close { position: sticky; top: 0; float: right; margin: 0 -6px -44px 0; z-index: 3; background: var(--ink); color: var(--white); border: 0; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; }
.modal-panel.wide { max-width: 1400px; }
body.modal-open { overflow: hidden; }

/* ---------- Audio player bar ---------- */
.player {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 300;
  background: var(--slate); color: var(--white); font-family: var(--f-ui);
  box-shadow: 0 -6px 20px rgba(23,23,23,.2);
}
.player[hidden] { display: none; }
.player-inner { max-width: 1280px; margin: 0 auto; padding: 10px var(--gutter); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.player .p-title { flex: 1 1 220px; min-width: 0; }
.player .p-title .k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.player .p-title .t { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player .p-note { font-size: 11px; opacity: .8; }
.player button { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.35); border-radius: 50%; width: 38px; height: 38px; display: grid; place-items: center; cursor: pointer; }
.player button.main { background: var(--red); border-color: var(--red); width: 44px; height: 44px; }
.player button:hover { border-color: var(--white); }
.player .p-ctrls { display: flex; gap: 8px; align-items: center; }
.player .p-opts { display: flex; gap: 10px; align-items: center; font-size: 12px; }
.player select { background: transparent; color: var(--white); border: 1px solid rgba(255,255,255,.35); border-radius: var(--radius); padding: 4px 6px; font-family: var(--f-ui); }
.player select option { color: var(--ink); }
.player input[type=range] { width: 90px; accent-color: var(--red); }
.player .p-progress { height: 3px; background: rgba(255,255,255,.2); }
.player .p-progress i { display: block; height: 100%; background: var(--red); width: 0; transition: width .3s; }
body.has-player { padding-bottom: 76px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 14px; right: 14px; z-index: 500; display: grid; gap: 8px; max-width: min(380px, calc(100vw - 28px)); }
.toast { background: var(--ink); color: var(--white); font-family: var(--f-ui); font-size: 14px; padding: 12px 14px; border-left: 4px solid var(--red); box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.ok { border-left-color: var(--gray); }

/* =========================================================
   ADMINISTRATION
   ========================================================= */
body.admin-mode { background: var(--ivory); }
body.admin-mode .site-header, body.admin-mode .site-footer { display: none; }
.admin { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-side { background: var(--slate); color: var(--white); font-family: var(--f-ui); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.admin-side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.15); margin-bottom: 10px; text-decoration: none; }
.admin-side .brand img { width: 40px; height: 40px; background: var(--ivory); border-radius: 6px; padding: 3px; }
.admin-side .brand b { font-family: var(--f-mast); font-size: 18px; display: block; line-height: 1.1; }
.admin-side .brand span { font-size: 11px; opacity: .7; letter-spacing: .1em; text-transform: uppercase; }
.admin-side a.nav { color: var(--white); text-decoration: none; padding: 9px 10px; border-radius: var(--radius); font-size: 14px; display: flex; align-items: center; gap: 10px; opacity: .85; }
.admin-side a.nav:hover { background: rgba(255,255,255,.08); opacity: 1; }
.admin-side a.nav.on { background: var(--white); color: var(--slate); opacity: 1; font-weight: 600; }
.admin-side a.nav .cnt { margin-left: auto; font-size: 11px; background: var(--red); color: var(--white); padding: 1px 7px; border-radius: 99px; }
.admin-side .grow { flex: 1; }
.admin-side .who { font-size: 12px; opacity: .8; padding: 10px; border-top: 1px solid rgba(255,255,255,.15); }
.admin-main { padding: 24px clamp(16px, 3vw, 36px) 60px; min-width: 0; font-family: var(--f-ui); }
.admin-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.admin-top h1 { font-family: var(--f-head); font-size: 26px; margin: 0; font-weight: 900; }
.admin-top .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-burger { display: none; }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .admin-side { position: fixed; z-index: 400; left: 0; top: 0; bottom: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .admin-side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.3); }
  .admin-burger { display: inline-flex; }
}
.card { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); padding: 18px; }
.card h2 { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 12px; color: var(--slate); }
.card h3 { font-size: 15px; margin: 0 0 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--white); border: 1px solid var(--gray); border-top: 3px solid var(--slate); padding: 14px; border-radius: var(--radius); text-decoration: none; display: block; }
.stat.red { border-top-color: var(--red); }
.stat .v { font-family: var(--f-head); font-size: 30px; font-weight: 900; line-height: 1.1; }
.stat .l { font-size: 12px; color: var(--ink-70); margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.table-wrap { overflow-x: auto; background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--slate); padding: 10px 12px; border-bottom: 1px solid var(--gray); background: var(--ivory); white-space: nowrap; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--gray-40); vertical-align: top; }
.tbl tr:hover td { background: rgba(247,245,239,.6); }
.tbl .ttl { font-family: var(--f-head); font-weight: 700; font-size: 14px; line-height: 1.35; }
.tbl a.ttl { text-decoration: none; }
.tbl a.ttl:hover { color: var(--red); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { padding: 9px 0; border-bottom: 1px solid var(--gray-40); font-size: 13px; display: flex; gap: 10px; }
.feed li .when { color: var(--ink-50); white-space: nowrap; font-size: 12px; }
.field { display: grid; gap: 5px; margin-bottom: 14px; }
.field > label, .lbl { font-size: 12px; font-weight: 600; color: var(--slate); letter-spacing: .02em; }
.field .help { font-size: 12px; color: var(--ink-50); }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .field { flex: 1 1 180px; }
.repeat-item { border: 1px solid var(--gray); border-radius: var(--radius); padding: 10px; margin-bottom: 8px; background: var(--ivory); display: grid; gap: 8px; }
.repeat-item .row .input { flex: 1 1 160px; width: auto; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--gray); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--ink-70); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--red); }
.notice { border-left: 4px solid var(--slate); background: var(--white); padding: 12px 14px; font-size: 13px; margin-bottom: 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.notice.warn { border-left-color: var(--red); background: var(--red-08); }
.score-row { display: grid; grid-template-columns: 1fr 120px 54px; gap: 10px; align-items: center; font-size: 13px; padding: 4px 0; }
.score-row input[type=range] { width: 100%; accent-color: var(--slate); }
.score-total { display: flex; align-items: baseline; gap: 10px; border-top: 1px solid var(--gray); padding-top: 10px; margin-top: 8px; }
.score-total .v { font-family: var(--f-head); font-size: 34px; font-weight: 900; }
.score-pill { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; padding: 2px 8px; border-radius: 99px; font-weight: 700; font-size: 12px; background: var(--slate-08); color: var(--slate); }
.score-pill.blocked { background: var(--red-08); color: var(--red); }
.flag-item { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--gray-40); font-size: 13px; }
.flag-item.resolved { opacity: .6; }
.wf-steps { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.wf-steps span { font-size: 11px; padding: 4px 8px; border-radius: 99px; background: var(--ivory); border: 1px solid var(--gray); }
.wf-steps span.on { background: var(--slate); color: var(--white); border-color: var(--slate); }
.wf-steps span.done { color: var(--slate); }
.ai-out { background: var(--ivory); border: 1px solid var(--gray); border-radius: var(--radius); padding: 12px; font-size: 13px; }
.ai-out h4 { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--slate); }
.ai-out ul { margin: 0; padding-left: 1.1em; }

/* Edition builder */
.builder { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 1100px) { .builder { grid-template-columns: 1fr; } }
.pool { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
.pool-item { border: 1px solid var(--gray); border-radius: var(--radius); padding: 8px 10px; margin-bottom: 6px; background: var(--white); cursor: grab; font-size: 13px; display: grid; gap: 4px; }
.pool-item.used { opacity: .5; }
.pool-item .ttl { font-family: var(--f-head); font-weight: 700; line-height: 1.3; }
.pages-list { display: grid; gap: 12px; }
.bpage { background: var(--white); border: 1px solid var(--gray); border-radius: var(--radius); }
.bpage-head { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--gray); flex-wrap: wrap; background: var(--ivory); }
.bpage-head .num { font-family: var(--f-head); font-weight: 900; font-size: 18px; width: 30px; }
.bpage-head .input, .bpage-head .select { width: auto; flex: 1 1 140px; padding: 6px 8px; font-size: 13px; }
.bpage-slots { padding: 10px 12px; min-height: 60px; display: grid; gap: 6px; }
.bpage-slots.drag-over { background: var(--slate-08); outline: 2px dashed var(--slate); outline-offset: -4px; }
.slot { display: flex; gap: 8px; align-items: center; border: 1px solid var(--gray); padding: 6px 8px; border-radius: var(--radius); font-size: 13px; }
.slot .role { font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--red); min-width: 64px; }
.slot .t { flex: 1; min-width: 0; }
.slot .t input { width: 100%; border: 1px solid transparent; padding: 3px 5px; font-family: var(--f-head); font-weight: 700; font-size: 13px; background: transparent; border-radius: 3px; }
.slot .t input:hover, .slot .t input:focus { border-color: var(--gray); background: var(--white); outline: none; }
.slot-hint { font-size: 12px; color: var(--ink-50); padding: 6px 0; }
.check-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.check-list li { padding: 5px 0; display: flex; gap: 8px; }
.check-list .ok { color: var(--slate); }
.check-list .ko { color: var(--red); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--ivory); }
.login { width: 100%; max-width: 400px; background: var(--white); border: 1px solid var(--gray); padding: 28px; font-family: var(--f-ui); }
.login img { width: 84px; margin: 0 auto 10px; }
.login h1 { font-family: var(--f-mast); text-align: center; font-size: 26px; margin: 0 0 4px; }
.login p.sub { text-align: center; color: var(--ink-70); font-size: 13px; margin: 0 0 20px; }

@media print {
  .site-header, .reader-toolbar, .nav-arrow, .reader-bottom, .player, .site-footer { display: none !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
