/* ==========================================================================
   magazine.css — БАЗА ЖУРНАЛА: геометрия страниц, сетки разворотов, печать.
   --------------------------------------------------------------------------
   • Страница .mag-page = A4 (210:297), container-type: inline-size.
     ВСЕ размеры внутри — в cqw (1cqw = 1% ширины страницы). Поэтому журнал
     выглядит одинаково на телефоне 390px, на десктопе и на печати A4
     (на печати 1cqw = 2.1 мм).
   • ВАЖНО: cqw на самой .mag-page считались бы от РОДИТЕЛЯ, поэтому отступы
     и сетка живут во вложенном .pg-in (абсолютный слой на всю страницу).
   • Здесь только структура и нейтральные значения. Шрифты, цвета и
     декор задают скины: skins/editorial.css, whimsy.css, opera.css
     (все правила скина начинаются с .mag--<скин>).
   • Сайт (brand.css) сюда НЕ подключается: печать не зависит от сайта.
   ========================================================================== */

/* ---------- 1. Переменные по умолчанию (скины их переопределяют) ---------- */
.mag, .fb {
  --m-paper: #fbf8f2;        /* бумага */
  --m-paper2: #f1ebe0;       /* вторичная плашка */
  --m-ink: #141210;          /* чернила */
  --m-ink2: #5b554d;         /* вторичный текст */
  --m-rule: #d9d0c1;         /* волосяные линии */
  --m-accent: #1f4fd8;       /* акцент */
  --m-accent-ink: #ffffff;   /* текст на акценте */
  --m-inv-bg: #141210;       /* «инверсная» страница */
  --m-inv-ink: #f4efe6;
  --f-mast: "Bodoni Moda", Didot, "Bodoni 72", serif;
  --f-head: "Instrument Serif", "Times New Roman", serif;
  --f-body: "Newsreader", Georgia, serif;
  --f-ui: "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif;
  --f-num: var(--f-mast);
  --f-hand: "Caveat", "Bradley Hand", cursive;
  --f-mono: "Courier Prime", "Courier New", monospace;
  --mast-glyph: .74;         /* средняя ширина буквы мастхеда в em (для автоподбора размера) */
  --mast-track: -.01em;
  --fs: 2.05cqw;             /* кегль основного текста (≈12pt на A4) */
}

/* ---------- 2. Лента страниц на экране ---------- */
.mag {
  display: flex; flex-direction: column; align-items: center;
  gap: 28px; width: 100%;
}
.mag *, .mag *::before, .mag *::after, .fb *, .fb *::before, .fb *::after { box-sizing: border-box; }

.mag-page {
  position: relative;
  width: 100%;
  max-width: var(--mag-max, 860px);
  aspect-ratio: 210 / 297;
  container-type: inline-size;          /* ← cqw внутри = % ширины страницы */
  overflow: hidden;
  background: var(--m-paper);
  color: var(--m-ink);
  box-shadow: 0 1px 2px rgba(0,0,0,.08), 0 18px 40px -20px rgba(0,0,0,.45);
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-kerning: normal;
  font-feature-settings: "kern", "liga";
}
/* внутренний слой: поля страницы + сетка конкретного разворота */
.pg-in {
  position: absolute; inset: 0;
  padding: 9cqw 7.5cqw 9cqw;
  display: grid;
  font-family: var(--f-body);
  font-size: var(--fs);
  line-height: 1.45;
  min-height: 0;
}
/* элементы сетки могут сжиматься уже своего min-content — иначе длинное
   слово раздвигает колонку за край страницы на узких экранах */
.pg-in > * { min-width: 0; }
.nw { white-space: nowrap; }
/* сброс через :where() — нулевая специфичность, чтобы не перебивать
   отрицательные поля «под обрез» и прочие правила страниц */
:where(.mag-page) :where(h1, h2, p, blockquote, figure, ol, ul, dl, dd) { margin: 0; padding: 0; }
:where(.mag-page) :where(ol, ul) { list-style: none; }
.mag-page em { font-style: italic; }
.mag-page a { color: inherit; text-decoration: none; }

/* ---------- 3. Общие элементы: колонтитул, фолио, кикер, фото ---------- */
.rh {
  position: absolute; top: 3.6cqw; left: 7.5cqw; right: 7.5cqw;
  display: flex; justify-content: space-between; gap: 2cqw;
  font: 600 1.05cqw/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase;
  color: var(--m-ink2); z-index: 3; pointer-events: none;
}
.is-left .rh { flex-direction: row; }
.is-right .rh { flex-direction: row-reverse; }   /* на правой странице раздел — к внешнему краю */
.folio {
  position: absolute; bottom: 3.4cqw; left: 7.5cqw; right: 7.5cqw;
  display: flex; align-items: baseline; gap: 1.6cqw;
  font: 500 1cqw/1 var(--f-ui); letter-spacing: .16em; text-transform: uppercase;
  color: var(--m-ink2); z-index: 3; pointer-events: none;
}
.is-right .folio { flex-direction: row-reverse; }
.folio-n { font: 400 1.9cqw/1 var(--f-num); letter-spacing: 0; color: var(--m-ink); }

.kicker {
  display: block;
  font: 700 1.15cqw/1.2 var(--f-ui); letter-spacing: .24em; text-transform: uppercase;
  color: var(--m-accent);
}
.ph { display: flex; flex-direction: column; min-height: 0; min-width: 0; position: relative; }
.ph img {
  display: block; width: 100%; flex: 1 1 auto; min-height: 0; height: 100%;
  object-fit: cover;                  /* только кадрирование — фото не меняем */
  background: var(--m-paper2);
}
.ph--empty { background: var(--m-paper2); }
.ph-cap {
  flex: none; padding-top: .9cqw;
  font: 500 1cqw/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--m-ink2);
}
/* блок с автоподгонкой текста */
.fit { font-size: calc(var(--fs) * var(--fit, 1)); min-height: 0; overflow: hidden; }
.fit.is-overflow { -webkit-mask-image: linear-gradient(180deg, #000 88%, transparent); mask-image: linear-gradient(180deg, #000 88%, transparent); }
.mag--edit .fit.is-overflow { outline: 2px dashed #d33; outline-offset: 4px; }

/* буквица */
.dropcap > p:first-child::first-letter {
  float: left; font-family: var(--f-mast); font-weight: 400;
  font-size: 4.3em; line-height: .78; padding: .06em .08em 0 0; color: var(--m-accent);
}
.barcode { display: block; width: 100%; height: auto; fill: currentColor; }
.barcode-t { font: 500 7px var(--f-mono); }
.ico { width: 4.2cqw; height: 4.2cqw; color: var(--m-accent); }

/* ==========================================================================
   4. СТРАНИЦЫ
   ========================================================================== */

/* ---------- ОБЛОЖКА ---------- */
.pg-cover { background: #1a1714; color: #fff; }
.pg-cover .pg-in { padding: 0; display: block; }
.cv-photo { position: absolute; inset: 0; }
.cv-photo--none { background: radial-gradient(120% 80% at 50% 30%, #3a3631, #12100e); }
.cv-scrim {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,.42) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 52%, rgba(0,0,0,.58) 100%);
}
.cv-top { position: absolute; top: 3.6cqw; left: 4.5cqw; right: 4.5cqw; text-align: center; }
.cv-issue {
  display: flex; justify-content: space-between; align-items: center;
  font: 600 1.2cqw/1 var(--f-ui); letter-spacing: .24em; text-transform: uppercase;
  padding-bottom: 1.2cqw; border-bottom: .15cqw solid currentColor;
}
.cv-issue i { font-style: normal; opacity: .7; }
.cv-mast {
  margin-top: 2.2cqw;
  font-family: var(--f-mast); font-weight: 400;
  /* первая оценка по числу букв; точную подгонку делает JS (--mast-fit) */
  font-size: calc(min(34cqw, calc(91cqw / (var(--chars) * var(--mast-glyph)))) * var(--mast-fit, 1));
  line-height: .78; letter-spacing: var(--mast-track);
  white-space: nowrap; text-align: center;
}
.cv-mast-in { display: inline-block; white-space: nowrap; }
.ml { display: inline-block; }
.cv-lead {
  position: absolute; left: 5cqw; bottom: 37cqw; width: 52cqw;
  display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 1.4cqw;
}
.cv-lead-k { grid-column: 1 / -1; font: 700 1.5cqw/1 var(--f-ui); letter-spacing: .3em; text-transform: uppercase; }
.cv-lead-n { font: 400 19cqw/.78 var(--f-num); }
.cv-lead-t { font: italic 400 3.5cqw/1 var(--f-head); padding-bottom: .6cqw; }
.cv-lines { position: absolute; left: 5cqw; bottom: 5.5cqw; width: 54cqw; display: grid; gap: 2.2cqw; }
.cl { display: grid; gap: .5cqw; }
.cl-k { font: 700 1.55cqw/1.15 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; }
.cl-s { font: italic 400 2.5cqw/1.1 var(--f-head); }
.cv-badge {
  position: absolute; right: 5cqw; top: 40cqw; width: 15cqw; height: 15cqw; border-radius: 50%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--m-accent); color: var(--m-accent-ink); transform: rotate(-10deg);
  font: 600 1.1cqw/1.1 var(--f-ui); letter-spacing: .2em; text-transform: uppercase; text-align: center;
}
.cv-badge b { font: italic 400 2.9cqw/1 var(--f-head); letter-spacing: 0; text-transform: none; margin: .3cqw 0; }
.cv-code {
  position: absolute; right: 4.5cqw; bottom: 4.5cqw; width: 15cqw;
  background: #fff; color: #111; padding: 1cqw 1cqw .6cqw;
}
.cv-price { display: block; text-align: center; font: 700 .9cqw/1.2 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; }

/* ---------- РЕДАКЦИОННОЕ ПИСЬМО + СОДЕРЖАНИЕ ---------- */
.pg-editor .pg-in { grid-template-columns: 1fr 29cqw; grid-template-rows: auto 1fr; column-gap: 6cqw; }
.ed-head { grid-column: 1 / -1; padding-bottom: 3cqw; border-bottom: .2cqw solid var(--m-ink); margin-bottom: 3.2cqw; }
.ed-title { font: 400 17cqw/.82 var(--f-mast); letter-spacing: -.02em; margin-top: 1.2cqw; }
/* содержание — в em от --fs, чтобы длинный список (групповой выпуск)
   автоматически ужимался подгонкой .fit и не вылезал за поле */
.toc { display: flex; flex-direction: column; min-height: 0; overflow: hidden; --fs: 2cqw; }
.toc-i {
  display: grid; grid-template-columns: 3.75em 1fr; column-gap: .8em;
  padding: .62em 0 .68em; border-bottom: 1px solid var(--m-rule);
}
.toc-n { grid-row: span 2; font: 400 1.7em/1 var(--f-num); color: var(--m-accent); }
.toc-t { font: 400 1.32em/1.05 var(--f-head); }
.toc-d { font: 500 .58em/1.3 var(--f-ui); letter-spacing: .06em; color: var(--m-ink2); margin-top: .15em; }
.ed-letter { display: flex; flex-direction: column; min-height: 0; border-left: 1px solid var(--m-rule); padding-left: 3.2cqw; }
.ed-body { flex: 0 1 auto; margin-top: 2cqw; --fs: 1.85cqw; }
.ed-body p + p { margin-top: .8em; }
.ed-first { font-family: var(--f-head); font-style: italic; font-size: 1.45em; line-height: 1.15; }
.ed-sign { font: 700 6cqw/1 var(--f-hand); margin-top: 3cqw; transform: rotate(-4deg); transform-origin: left; }
.ed-role { font: 600 1cqw/1.3 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--m-ink2); margin-top: 1cqw; }

/* ---------- ГЛАВНАЯ ИСТОРИЯ ---------- */
.pg-story .pg-in { grid-template-columns: 1fr 1fr 24cqw; grid-template-rows: auto auto 1fr; column-gap: 3.4cqw; }
.st-hero { grid-column: 1 / -1; height: 60cqw; margin: -9cqw -7.5cqw 0; }
.st-hero .ph-cap { position: absolute; left: 7.5cqw; bottom: 2cqw; color: #fff; padding: 0; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.pg-story.has-hero .rh { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.st-head { grid-column: 1 / -1; padding: 4.2cqw 0 3cqw; }
.st-title { font: 400 11cqw/.86 var(--f-head); letter-spacing: -.02em; margin-top: 1.2cqw; }
.st-dek { font: italic 400 2.2cqw/1.25 var(--f-body); color: var(--m-ink2); margin-top: 1.6cqw; max-width: 46cqw; }
.st-body { grid-column: 1 / 3; column-count: 2; column-gap: 3.4cqw; column-fill: auto; }
.pg-story:not(.has-side) .st-body { grid-column: 1 / -1; column-count: 3; }
.st-body p { text-indent: 1.2em; }
.st-body p:first-child { text-indent: 0; }
.st-side { grid-column: 3; grid-row: 3; display: flex; flex-direction: column; gap: 2.6cqw; min-height: 0; }
.st-sp { flex: 1 1 0; }
.st-pull {
  position: absolute; right: 7.5cqw; top: 53cqw; width: 33cqw; z-index: 2;
  background: var(--m-paper); padding: 2.4cqw 2.6cqw 2.6cqw;
  font: italic 400 2.7cqw/1.12 var(--f-head);
}

/* ---------- ИНТЕРВЬЮ ---------- */
.pg-interview .pg-in { grid-template-columns: 38cqw 1fr; column-gap: 5.5cqw; }
.pg-interview.no-photo .pg-in { grid-template-columns: 1fr; }
.iv-photo { grid-column: 1; grid-row: 1; margin: -9cqw 0 -9cqw -7.5cqw; }
.pg-interview.has-photo.is-left .rh-a,
.pg-interview.has-photo.is-left .folio, .pg-interview.has-photo.is-left .folio-n { color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.iv-main { display: flex; flex-direction: column; min-height: 0; padding-top: 2cqw; }
.iv-title { font: 400 7.2cqw/.92 var(--f-head); margin: 1.4cqw 0 1.8cqw; letter-spacing: -.01em; }
.iv-dek { font: italic 400 1.9cqw/1.3 var(--f-body); color: var(--m-ink2); padding-bottom: 2.4cqw; border-bottom: 1px solid var(--m-rule); margin-bottom: 2.6cqw; }
.qa { flex: 1 1 0; }
.qa-i + .qa-i { margin-top: 1.5em; }
.qa dt { font: 700 .62em/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--m-accent); margin-bottom: .45em; }
.qa dd p + p { margin-top: .5em; }
.qa-missing { color: #b33; font-style: italic; }
.iv-pull {
  position: absolute; left: 0; bottom: 13cqw; width: 41cqw; z-index: 2;
  background: var(--m-paper); padding: 2.8cqw 3cqw 3cqw 7.5cqw;
  font: italic 400 3.1cqw/1.1 var(--f-head);
}
.pg-interview.no-photo .iv-pull { display: none; }

/* ---------- ТОП-N ПРИЧИН ---------- */
.pg-reasons .pg-in { grid-template-rows: auto 1fr; }
.rs-head { display: grid; grid-template-columns: auto 1fr; align-items: end; column-gap: 4cqw; padding-bottom: 3cqw; border-bottom: .25cqw solid var(--m-ink); }
.rs-num { font: 400 34cqw/.74 var(--f-num); color: var(--m-accent); letter-spacing: -.04em; margin-left: -1cqw; }
.rs-title { font: 400 7.4cqw/.92 var(--f-head); margin-top: 1.4cqw; }
.rs-dek { font: italic 400 1.8cqw/1.3 var(--f-body); color: var(--m-ink2); margin-top: 1.6cqw; }
.rs-list { column-count: 2; column-gap: 5cqw; column-rule: 1px solid var(--m-rule); padding-top: 3.2cqw; column-fill: balance; }
.rs-i { display: grid; grid-template-columns: 2.6em 1fr; break-inside: avoid; padding-bottom: 1.25em; }
.rs-n { font: 400 1.5em/1 var(--f-num); color: var(--m-accent); }
.rs-b { display: flex; flex-direction: column; gap: .25em; }
.rs-h { font: 400 1.55em/1.05 var(--f-head); }
.rs-s { font-style: italic; line-height: 1.35; }
.rs-by { font: 600 .56em/1.3 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--m-ink2); }

/* ---------- CURRENTLY OBSESSED ---------- */
.pg-obsessed .pg-in { grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; column-gap: 5cqw; }
.pg-obsessed.has-photo .pg-in { grid-template-rows: auto auto 1fr; }
.ob-head { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: end; padding-bottom: 2.6cqw; }
.ob-head .kicker { order: 2; }
.ob-title { font: 400 10cqw/.85 var(--f-head); letter-spacing: -.02em; }
.ob-grid { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; border-top: .25cqw solid var(--m-ink); }
.ob-card { position: relative; padding: 3.4cqw 3cqw 3.6cqw 0; border-bottom: 1px solid var(--m-rule); display: flex; flex-direction: column; gap: 1.4cqw; }
.ob-card .ob-v { margin-top: .6cqw; }
.ob-card:nth-child(odd) { border-right: 1px solid var(--m-rule); }
.ob-card:nth-child(even) { padding-left: 3cqw; padding-right: 0; }
/* крупный номер-водяной знак в углу карточки */
.ob-no { position: absolute; bottom: 1.6cqw; right: 3cqw; font: italic 400 11cqw/1 var(--f-num); color: var(--m-rule); opacity: .9; }
.ob-card:nth-child(even) .ob-no { right: 0; }
.ob-card > :not(.ob-no) { position: relative; }
.ob-k { font: 700 1.1cqw/1 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--m-ink2); }
.ob-v { font: italic 400 4.4cqw/1.05 var(--f-head); max-width: 34cqw; }
.ob-chart { grid-column: 1; grid-row: 3; padding-top: 4.4cqw; min-height: 0; }
.ob-chart ol { margin-top: 1.6cqw; }
.ob-chart li { display: grid; grid-template-columns: 4cqw 1fr; align-items: baseline; padding: 1cqw 0; border-bottom: 1px solid var(--m-rule); }
.ob-cn { font: 400 2.6cqw/1 var(--f-num); color: var(--m-accent); }
.ob-ct { font: 400 2.1cqw/1.2 var(--f-body); }
.ob-photo { grid-column: 2; grid-row: 3; margin-top: 4cqw; }
.pg-obsessed:not(.has-chart) .ob-photo { grid-column: 1 / -1; }
.pg-obsessed:not(.has-photo) .ob-chart { grid-column: 1 / -1; }

/* ---------- В ЦИФРАХ ---------- */
.pg-numbers { background: var(--m-inv-bg); color: var(--m-inv-ink); }
.pg-numbers .rh, .pg-numbers .folio, .pg-numbers .folio-n { color: var(--m-inv-ink); opacity: .85; }
.pg-numbers .pg-in { grid-template-rows: auto 1fr auto; }
.nb-title { font: 400 11cqw/.86 var(--f-head); margin-top: 1.4cqw; letter-spacing: -.02em; }
/* первая цифра — «герой» на всю ширину, остальные — в сетке 2 колонки */
.nb-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: 5cqw; align-content: space-evenly; padding-top: 3cqw; }
.nb { position: relative; border-top: 1px solid currentColor; padding: 1.6cqw 0 2.6cqw; display: grid; gap: 1cqw; align-content: start; }
.nb-i { font: 600 1.1cqw/1 var(--f-ui); letter-spacing: .2em; opacity: .55; }
.nb-v { font: 400 min(17cqw, calc(62cqw / var(--len))) / .86 var(--f-num); letter-spacing: -.03em; white-space: nowrap; }
.nb-l { font: 600 1.35cqw/1.3 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; opacity: .82; max-width: 32cqw; }
.nb-0 { grid-column: 1 / -1; grid-template-columns: auto 1fr; column-gap: 4cqw; align-items: end; }
.nb-0 .nb-i { grid-column: 1 / -1; }
.nb-0 .nb-v { font-size: min(34cqw, calc(120cqw / var(--len))); grid-row: span 2; }
.nb-0 .nb-l { font: italic 400 3.6cqw/1.05 var(--f-head); letter-spacing: 0; text-transform: none; max-width: none; padding-bottom: 2cqw; opacity: 1; }
.nb-0 .nb-bar { align-self: end; }
.nb-grid.n-2 .nb-1, .nb-grid.n-4 .nb-3:last-child, .nb-grid.n-6 .nb-5:last-child { grid-column: 1 / -1; }
/* шкала для процентов: тонкая линия + заполненная доля */
.nb-bar { display: block; height: .5cqw; background: color-mix(in srgb, currentColor 22%, transparent); position: relative; margin: .4cqw 0 .6cqw; }
.nb-bar > span { position: absolute; inset: 0 auto 0 0; width: calc(var(--pct) * 1%); background: var(--m-accent); }
.nb-note { font: italic 400 1.6cqw/1.3 var(--f-body); opacity: .7; }

/* ---------- ТАЙМЛАЙН ---------- */
.pg-timeline .pg-in { grid-template-rows: auto 1fr; }
.tl-head { text-align: center; padding-bottom: 2cqw; }
.tl-title { font: 400 9cqw/.9 var(--f-head); margin-top: 1.2cqw; }
.tl { position: relative; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; column-gap: 11cqw; row-gap: 0; min-height: 0; padding-top: 2cqw; }
.tl::before { content: ""; position: absolute; left: 50%; top: 2cqw; bottom: 0; width: 1px; background: var(--m-ink); }
.tl-i { position: relative; display: flex; flex-direction: column; min-height: 0; padding-bottom: 2.4cqw; }
.tl-i:nth-child(odd) { grid-column: 1; text-align: right; }
.tl-i:nth-child(even) { grid-column: 2; }
.tl-i::after {
  content: ""; position: absolute; top: 3cqw; width: 2cqw; height: 2cqw; border-radius: 50%;
  background: var(--m-paper); border: .3cqw solid var(--m-accent);
}
.tl-i:nth-child(odd)::after { right: -6.5cqw; }
.tl-i:nth-child(even)::after { left: -6.5cqw; }
.tl-ph { flex: 1 1 0; }
.tl-cap { flex: none; padding-top: 1.2cqw; font: 500 1.15cqw/1.3 var(--f-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--m-ink2); }
.tl-cap b { display: block; font: italic 400 2.8cqw/1 var(--f-head); letter-spacing: 0; text-transform: none; color: var(--m-ink); margin-bottom: .4cqw; }

/* ---------- ДРУЗЬЯ ---------- */
.pg-friends .pg-in { grid-template-rows: auto 1fr; }
.fr-head { padding-bottom: 3cqw; }
.fr-title { font: 400 8.6cqw/.9 var(--f-head); margin-top: 1.4cqw; max-width: 72cqw; }
.fr-list { display: flex; flex-direction: column; }
.fr { display: grid; grid-template-columns: 32% 1fr; column-gap: 4cqw; padding: 1.5em 0 1.4em; border-top: 1px solid var(--m-rule); }
.fr:first-child { border-top: .25cqw solid var(--m-ink); }
.fr-word { grid-row: span 2; font: 400 2.5em/.95 var(--f-mast); letter-spacing: -.02em; white-space: nowrap; }
.fr-dot { color: var(--m-accent); }
.fr-moment { font-style: italic; line-height: 1.4; }
.fr-moment p::before { content: "“"; }
.fr-moment p:last-child::after { content: "”"; }
.fr-by { display: flex; align-items: center; gap: .6em; margin-top: .9em; font: 600 .58em/1.2 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--m-ink2); }
.fr-by b { color: var(--m-ink); }
.fr-av { width: 2.6em; height: 2.6em; border-radius: 50%; object-fit: cover; }

/* ---------- ЧАТЫ («Friendship, wrapped») ---------- */
.pg-chats .pg-in { grid-template-rows: auto auto 1fr auto; }
.ch-head { padding-bottom: 3.4cqw; border-bottom: .25cqw solid var(--m-ink); }
.ch-title { font: 400 12cqw/.86 var(--f-head); letter-spacing: -.02em; margin-top: 1.2cqw; }
.ch-first { display: grid; justify-items: center; gap: 1.8cqw; padding: 5cqw 0 4.4cqw; border-bottom: 1px solid var(--m-rule); text-align: center; }
.ch-k { font: 700 1.25cqw/1.2 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; color: var(--m-ink2); }
.ch-who { font: italic 400 1.9cqw/1 var(--f-body); color: var(--m-ink2); }
/* «пузырь» сообщения: у дарителя — справа и акцентом, у второй стороны — слева */
.bub { position: relative; display: inline-block; max-width: 100%; padding: .7em 1.05em .8em; border-radius: 1.15em 1.15em 1.15em .3em; background: var(--m-paper2); color: var(--m-ink); text-align: left; }
.bub p + p { margin-top: .4em; }
.is-mine > .bub, .bub.is-mine { background: var(--m-accent); color: var(--m-accent-ink); border-radius: 1.15em 1.15em .3em 1.15em; }
.bub--first { font: italic 400 4.6cqw/1.12 var(--f-head); padding: .55em .9em .65em; max-width: 70cqw; }
.ch-thread { display: flex; flex-direction: column; justify-content: center; gap: 1.4em; padding: 4cqw 0 2cqw; --fs: 2.35cqw; }
.ch-msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 74%; }
.ch-msg.is-mine { align-self: flex-end; align-items: flex-end; }
.ch-msg .bub { font-family: var(--f-head); font-size: 1.35em; line-height: 1.18; }
.ch-meta { margin-top: .55em; font: 600 .5em/1.2 var(--f-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--m-ink2); }
.ch-note { font: italic 400 1.5cqw/1.3 var(--f-body); color: var(--m-ink2); text-align: center; }
.pg-chats.no-first .pg-in { grid-template-rows: auto 1fr auto; }

/* ---------- MOMENTS ---------- */
.pg-moments .pg-in { grid-template-rows: auto 1fr; }
.mo-head { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 2.4cqw; }
.mo-title { font: italic 400 10cqw/.85 var(--f-head); order: -1; }
.mo-grid { display: grid; gap: 2.2cqw; min-height: 0; }
.mo-grid.n-3 { grid-template: "a a" 1.25fr "b c" 1fr / 1fr 1fr; }
.mo-grid.n-4 { grid-template: "a b" 1fr "a c" 1fr "d d" 1fr / 1.15fr 1fr; }
.mo-grid.n-5 { grid-template: "a a b" 1fr "a a c" 1fr "d e e" 1.1fr / 1fr 1fr 1fr; }
.mo-grid.n-6 { grid-template: "a a b" 1fr "c d b" 1fr "e f f" 1fr / 1fr 1fr 1fr; }
.mo-0 { grid-area: a; } .mo-1 { grid-area: b; } .mo-2 { grid-area: c; }
.mo-3 { grid-area: d; } .mo-4 { grid-area: e; } .mo-5 { grid-area: f; }

/* ---------- СЛОВАРЬ ---------- */
.pg-dictionary .pg-in { grid-template-rows: auto auto 1fr; }
.dc-head { text-align: center; padding-bottom: 2.6cqw; }
.dc-title { font: 400 9.4cqw/.9 var(--f-head); margin-top: 1.2cqw; }
.dc-dek { font: italic 400 1.9cqw/1.3 var(--f-body); color: var(--m-ink2); margin-top: 1.4cqw; }
.dc-guide { display: flex; justify-content: space-between; margin-top: 3cqw; padding: .9cqw 0; border-top: .25cqw solid var(--m-ink); border-bottom: 1px solid var(--m-ink); font: 700 1.25cqw/1 var(--f-ui); letter-spacing: .1em; text-transform: uppercase; }
.dc-main { padding: 1cqw 0 3cqw; border-bottom: 1px solid var(--m-rule); margin-bottom: 3cqw; font-size: 2.2cqw; }
.dc-main .dc-hw { font: 700 2em/1 var(--f-head); }
.dc-hw { font-style: normal; font-family: var(--f-head); font-weight: 700; font-size: 1.22em; }
.dc-pr { font: 400 .78em/1 var(--f-mono); color: var(--m-ink2); white-space: nowrap; }
.dc-pos { font-style: italic; color: var(--m-accent); }
.dc-def { margin-top: .3em; }
.dc-src { font: 600 .62em/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; color: var(--m-ink2); }
.dc-x { font-variant: small-caps; letter-spacing: .03em; }
.dc-cols { column-count: 2; column-gap: 5cqw; column-rule: 1px solid var(--m-rule); }
.dc-e { break-inside: avoid; padding-bottom: 1.1em; }

/* ---------- ПРОГНОЗЫ ---------- */
.pg-predictions { background: var(--m-accent); color: var(--m-accent-ink); }
.pg-predictions .rh, .pg-predictions .folio, .pg-predictions .folio-n, .pg-predictions .kicker { color: var(--m-accent-ink); }
.pg-predictions .pg-in { grid-template-rows: auto 1fr; justify-items: center; }
.pd-head { text-align: center; padding-bottom: 4cqw; }
.pd-title { font: 400 10cqw/.88 var(--f-head); margin-top: 1.2cqw; }
.slip-wrap { width: 72cqw; min-height: 0; display: flex; filter: drop-shadow(0 2cqw 2.4cqw rgba(0,0,0,.28)); transform: rotate(-1.6deg); align-self: center; max-height: 100%; }
.slip {
  --slip: #fdfbf5;
  width: 100%; background: var(--slip); color: #1b1916;
  padding: 4.4cqw 4.6cqw 3.6cqw; display: flex; flex-direction: column; min-height: 0;
  font-family: var(--f-mono);
  /* перфорация сверху и снизу — как у настоящего купона */
  -webkit-mask: radial-gradient(circle at 50% 0, transparent .9cqw, #000 .95cqw) 50% 0 / 2.6cqw 51% repeat-x,
                radial-gradient(circle at 50% 100%, transparent .9cqw, #000 .95cqw) 50% 100% / 2.6cqw 51% repeat-x;
          mask: radial-gradient(circle at 50% 0, transparent .9cqw, #000 .95cqw) 50% 0 / 2.6cqw 51% repeat-x,
                radial-gradient(circle at 50% 100%, transparent .9cqw, #000 .95cqw) 50% 100% / 2.6cqw 51% repeat-x;
}
.slip-top { display: flex; justify-content: space-between; gap: 1.5cqw; font-size: 1.25cqw; letter-spacing: .08em; text-transform: uppercase; padding-bottom: 1.6cqw; border-bottom: .2cqw dashed currentColor; }
.slip-bets { flex: 1 1 auto; --fs: 1.75cqw; }
.sb { display: grid; grid-template-columns: 2.4em 1fr auto; column-gap: 1em; padding: 1.1em 0; border-bottom: 1px dashed rgba(0,0,0,.35); align-items: start; }
.sb-n { font-weight: 700; }
.sb-p { font-family: var(--f-body); font-size: 1.12em; line-height: 1.3; }
.sb-by { display: block; margin-top: .5em; font-size: .7em; letter-spacing: .1em; text-transform: uppercase; opacity: .7; }
.sb-st { font-size: .62em; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; border: 1.5px solid var(--m-accent); color: var(--m-accent); padding: .35em .6em; transform: rotate(-6deg); margin-top: .2em; }
.slip-foot { display: flex; justify-content: space-between; gap: 1.5cqw; font-size: 1.1cqw; letter-spacing: .08em; text-transform: uppercase; padding: 1.8cqw 0 2cqw; border-top: .2cqw dashed currentColor; margin-top: 1cqw; }
.slip .barcode { width: 42%; margin: 0 auto; }

/* ---------- РАЗВОРОТ «THE ONE WE'LL NEVER FORGET» ---------- */
.pg-unfPhoto { background: #111; color: #fff; }
.pg-unfPhoto .pg-in { padding: 0; display: block; }
.uf-photo { position: absolute; inset: 0; }
.pg-unfPhoto .pg-in::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(180deg, transparent, rgba(0,0,0,.55)); pointer-events: none; }
.uf-tag { position: absolute; left: 7.5cqw; right: 7.5cqw; bottom: 8cqw; z-index: 2; display: grid; gap: 1.2cqw; }
.uf-tag .kicker { color: #fff; }
.uf-tag b { font: italic 400 5.4cqw/1 var(--f-head); }
.uf-cap { font: 500 1.1cqw/1 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; opacity: .85; }
.pg-unfPhoto .folio, .pg-unfPhoto .folio-n { color: #fff; }
.pg-unfQuote .pg-in { padding: 13cqw 11cqw 14cqw; grid-template-rows: auto auto minmax(0, 1fr) auto; }
.pg-unfQuote .uf-mark { grid-row: 2; } .pg-unfQuote .uf-q { grid-row: 3; } .pg-unfQuote .uf-by { grid-row: 4; }
.uf-k { margin-bottom: 2cqw; }
.uf-mark { font: 400 34cqw/.6 var(--f-mast); color: var(--m-accent); height: 15cqw; margin-left: -2cqw; }
.uf-q { --fs: 4.2cqw; font-family: var(--f-head); line-height: 1.14; letter-spacing: -.005em; }
.uf-q p + p { margin-top: .6em; }
.uf-by { display: flex; align-items: center; gap: 2cqw; padding-top: 3cqw; font: 700 1.3cqw/1 var(--f-ui); letter-spacing: .24em; text-transform: uppercase; }
.uf-rule { width: 9cqw; height: .2cqw; background: currentColor; }

/* ---------- ПИСЬМО ---------- */
.pg-letter .pg-in { grid-template-rows: auto 1fr; }
.lt-head { padding-bottom: 3.4cqw; }
.lt-title { font: 400 7.6cqw/.95 var(--f-head); margin-top: 1.4cqw; }
.lt-paper { display: flex; flex-direction: column; min-height: 0; }
.lt-body { flex: 1 1 0; --fs: 2.3cqw; line-height: 1.55; }
.lt-body p + p { margin-top: .9em; }
.lt-sign { flex: none; font: 700 8cqw/1 var(--f-hand); transform: rotate(-5deg); transform-origin: left; margin-top: 2cqw; color: var(--m-accent); }
/* опция «рукописное письмо» */
.letter--hand .lt-body { font-family: var(--f-hand); --fs: 3.5cqw; line-height: 1.22; font-weight: 500; }
.letter--type .lt-body { font-family: var(--f-body); }

/* ---------- ГОЛОСА ---------- */
.pg-voices .pg-in { align-content: center; justify-items: center; text-align: center; }
.vc-wrap { display: flex; flex-direction: column; align-items: center; width: 100%; }
.vc-title { font: 400 11cqw/.88 var(--f-head); margin-top: 1.6cqw; }
.vc-dek { font: italic 400 2.2cqw/1.35 var(--f-body); color: var(--m-ink2); max-width: 58cqw; margin-top: 2.4cqw; }
.vc-qr { display: block; width: 42cqw; margin-top: 5cqw; padding: 2cqw; background: #fff; border: 1px solid var(--m-rule); }
.qr { display: block; width: 100%; height: auto; }
.qr-bg { fill: #fff; } .qr-fg { fill: #111; }
.vc-wave { width: 52cqw; height: 9cqw; margin-top: 4cqw; fill: var(--m-accent); }
.vc-url { font: 500 1.2cqw/1 var(--f-mono); color: var(--m-ink2); margin-top: 2.4cqw; letter-spacing: .04em; }

/* ---------- ЗАДНЯЯ ОБЛОЖКА ---------- */
.pg-back .pg-in { padding: 8cqw 7.5cqw 5.5cqw; grid-template-rows: 1fr auto auto auto; }
.bk-photo { min-height: 0; margin-bottom: 5cqw; }
.pg-back.no-photo .pg-in { grid-template-rows: 1fr auto auto auto; }
.bk-mid { padding-bottom: 5cqw; }
.bk-big { font: 400 9.6cqw/.9 var(--f-mast); letter-spacing: -.02em; margin-top: 1.6cqw; }
.bk-foot { display: flex; justify-content: space-between; align-items: end; padding-top: 2.4cqw; border-top: .25cqw solid var(--m-ink); }
.bk-meta { display: grid; gap: .6cqw; font: 600 1.2cqw/1.2 var(--f-ui); letter-spacing: .18em; text-transform: uppercase; }
.bk-meta b { font: 400 4cqw/1 var(--f-num); letter-spacing: 0; text-transform: none; }
.pg-back .barcode { width: 18cqw; }
.bk-made { font: 500 1.05cqw/1.4 var(--f-ui); letter-spacing: .08em; color: var(--m-ink2); margin-top: 2.4cqw; }

/* ---------- КАРТОЧКА ПРОПУЩЕННОЙ СТРАНИЦЫ (edit) ---------- */
.pg-missing { background: repeating-linear-gradient(135deg, var(--m-paper) 0 1.4cqw, var(--m-paper2) 1.4cqw 2.8cqw); }
.pg-missing .pg-in { place-items: center; }
.ms-card {
  width: 70cqw; padding: 7cqw 6cqw; text-align: center; cursor: pointer;
  background: var(--m-paper); border: .25cqw dashed var(--m-ink2);
  display: grid; gap: 2.4cqw; justify-items: center;
}
.ms-card:hover, .ms-card:focus-visible { border-color: var(--m-accent); outline: none; }
.ms-k { font: 700 1.2cqw/1.2 var(--f-ui); letter-spacing: .22em; text-transform: uppercase; color: var(--m-ink2); }
.ms-t { font: italic 400 5.4cqw/1.05 var(--f-head); }
.ms-s { font: 400 1.8cqw/1.4 var(--f-body); color: var(--m-ink2); }
.ms-btn { font: 700 1.5cqw/1 var(--f-ui); letter-spacing: .12em; text-transform: uppercase; background: var(--m-ink); color: var(--m-paper); padding: 1.6cqw 2.6cqw; }
.mag--edit [data-field]:not(.ms-card):hover { outline: 1px dashed var(--m-accent); outline-offset: 2px; cursor: pointer; }

/* ---------- вкус получателя: лёгкий тон на двух тихих страницах ---------- */
.has-taste:not(.mag--opera) .pg-unfQuote { background: var(--m-tint1, var(--m-paper)); }
.has-taste:not(.mag--opera) .pg-chats { background: var(--m-tint2, var(--m-paper)); }

/* ---------- режим «print» на экране: листы как на столе ---------- */
.mag--print { gap: 10mm; }
.mag--print .mag-page { max-width: min(210mm, 100%); box-shadow: 0 0 0 1px rgba(0,0,0,.06), 0 4px 24px rgba(0,0,0,.25); }

/* ==========================================================================
   5. ЛИСТАЛКА (flipbook)
   ========================================================================== */
.fb-host { position: relative; }
.fb-pool { position: absolute !important; left: -20000px; top: 0; width: 600px; visibility: hidden; pointer-events: none; display: block; }
.fb-pool .mag-page { margin-bottom: 20px; }
.fb { position: relative; display: flex; flex-direction: column; align-items: center; width: 100%; height: 100%; outline: none; user-select: none; -webkit-user-select: none; }
.fb-stage { position: relative; flex: 1 1 auto; width: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; perspective: 2400px; overflow: hidden; }
.fb-book { position: relative; transition: transform .6s cubic-bezier(.45,.05,.2,1); transform-style: preserve-3d; }
.fb-slot { position: absolute; top: 0; left: 0; height: 100%; }
.fb-slot .mag-page, .fb-face .mag-page { max-width: none; width: 100%; box-shadow: none; }
.fb-slot:not(.is-empty) { box-shadow: 0 20px 50px -24px rgba(0,0,0,.55); }
.is-spread .fb-l .mag-page::after, .is-spread .fb-r .mag-page::after {     /* мягкая тень у корешка */
  content: ""; position: absolute; top: 0; bottom: 0; width: 7%; pointer-events: none; z-index: 5;
}
.is-spread .fb-l .mag-page::after { right: 0; background: linear-gradient(90deg, transparent, rgba(0,0,0,.16)); }
.is-spread .fb-r .mag-page::after { left: 0; background: linear-gradient(270deg, transparent, rgba(0,0,0,.18)); }
.fb-spine { display: none; }
.fb-leaf { position: absolute; top: 0; transform-style: preserve-3d; z-index: 10; will-change: transform; }
.fb-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; background: var(--m-paper); }
.fb-face.is-paper { background: linear-gradient(90deg, #e9e3d7, #f6f2ea); }
.fb-back { transform: rotateY(180deg); }
.fb-shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(90deg, rgba(0,0,0,.35), rgba(0,0,0,.05) 60%, rgba(255,255,255,.08)); z-index: 6; }
.fb-bar { flex: none; display: flex; align-items: center; gap: 14px; width: min(100%, 560px); padding: 14px 16px 6px; font: 600 13px/1 "Schibsted Grotesk", "Helvetica Neue", Arial, sans-serif; color: #6b655c; }
.fb-btn { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); background: rgba(255,255,255,.8); font: 400 26px/1 Georgia, serif; color: #1b1916; cursor: pointer; display: grid; place-items: center; padding: 0 0 3px; }
.fb-btn:disabled { opacity: .3; cursor: default; }
.fb-prog { flex: 1; height: 2px; background: rgba(0,0,0,.12); border-radius: 2px; overflow: hidden; }
.fb-prog-in { height: 100%; background: #1b1916; transition: width .5s; }
.fb-count { min-width: 64px; text-align: center; font-variant-numeric: tabular-nums; letter-spacing: .06em; }
.fb-hint { position: absolute; left: 50%; bottom: 74px; transform: translateX(-50%); background: rgba(20,18,16,.82); color: #fff; font: 600 13px/1 "Schibsted Grotesk", Arial, sans-serif; letter-spacing: .04em; padding: 10px 16px; border-radius: 99px; pointer-events: none; transition: opacity .6s; }
.fb-hint.is-gone { opacity: 0; }

/* ==========================================================================
   6. ПЕЧАТЬ: каждая страница = один лист A4, без полей, цвета как на экране
   ========================================================================== */
@page { size: A4; margin: 0; }
@media print {
  html, body { margin: 0 !important; padding: 0 !important; background: #fff !important; }
  .mag { display: block !important; gap: 0 !important; padding: 0 !important; margin: 0 !important; }
  .mag-page {
    width: 210mm !important; height: 297mm !important; max-width: none !important; aspect-ratio: auto !important;
    margin: 0 !important; box-shadow: none !important; border-radius: 0 !important;
    break-after: page; page-break-after: always; break-inside: avoid; page-break-inside: avoid;
  }
  .mag-page:last-child { break-after: auto; page-break-after: auto; }
  .mag .pg-missing, .fb, .fb-host { display: none !important; }
  .mag *, .mag *::before, .mag *::after { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
}
@media (prefers-reduced-motion: reduce) { .fb-book, .fb-prog-in { transition: none; } }
