/* EEST TV e-Paper (Phase 17.7, phase-17 §6 EP1–EP11; reference: epaper.aajtak.in). Loaded only on /epaper/ pages.
   A floating header card with page tabs, a 1200 px newspaper sheet scaled to the screen (site.js), page-turn arrows,
   a right toolbar, the navy thumbnails strip, the calendar and menu dialogs. The sheet keeps newspaper colours in both
   themes (it is a page of paper); everything around it follows the site theme. */

.ee-epaper { background: var(--bg-panel); }

/* ---------- Header card ---------- */
.ep-bar { position: sticky; top: 0; z-index: var(--z-sticky); max-width: 1270px; margin: 0 auto; padding: 0 28px; background: var(--bg); border-radius: 0 0 24px 24px; box-shadow: 0 6px 24px rgb(19 31 73 / .12); }
.ep-bar__row { display: flex; align-items: center; gap: 14px; min-height: 72px; }
.ep-bar__btn { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--fg-strong); cursor: pointer; }
.ep-bar__btn:hover { background: var(--bg-panel); }
.ep-bar__logo { display: inline-flex; flex-direction: column; align-items: center; color: var(--fg-strong); font-family: var(--font-head); font-size: .75rem; font-weight: 800; line-height: 1.1; }
.ep-bar__logo img { width: 44px; height: 44px; }
.ep-bar__date { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 6px; background: var(--bg); color: var(--fg-strong); font: inherit; font-size: .875rem; cursor: pointer; }
.ep-bar__date:hover { background: var(--bg-panel); }
.ep-bar__icons { display: flex; gap: 4px; margin-left: auto; }
.ep-bar__live span { padding: 1px 4px; border: 1.5px solid currentColor; border-radius: 3px; font-size: .625rem; font-weight: 800; }
.ep-bar__sub { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 6px; background: var(--c-red-700); color: #fff; font-size: .875rem; font-weight: 700; }
.ep-bar__sub:hover { background: var(--c-red-800); }
.ep-bar__site { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border: 1.5px solid var(--fg-strong); border-radius: 999px; color: var(--fg-strong); font-size: .8125rem; font-weight: 700; }
.ep-tabs { display: flex; align-items: center; gap: 6px; border-top: 1px solid var(--border); }
.ep-tabs__arrow { flex: none; display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--bg); color: var(--fg-strong); cursor: pointer; }
.ep-tabs__track { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.ep-tabs__track::-webkit-scrollbar { display: none; }
.ep-tabs__tab { flex: none; padding: 12px 14px; color: var(--fg); font-size: 1rem; white-space: nowrap; }
.ep-tabs__tab:hover { color: var(--fg-strong); }
.ep-tabs__tab[aria-current] { color: var(--fg-strong); font-weight: 800; text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 8px; }

/* ---------- Stage, sheet scaling ---------- */
.ep-main { padding: 28px 16px 40px; }
.ep-stage { position: relative; max-width: 1200px; margin: 0 auto; }
.ep-fit { position: relative; overflow: hidden; }
.ep-fit.is-zoomed { overflow-x: auto; }
.ep-scale { width: 1200px; transform-origin: top left; }
html.js .ep-fit:not(.is-ready) .ep-scale { visibility: hidden; }
.ep-turn { position: absolute; top: 260px; z-index: 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--c-navy-800); color: #fff; box-shadow: var(--shadow-1); }
.ep-turn--prev { left: -20px; }
.ep-turn--next { right: -20px; }
.ep-turn:hover { background: var(--c-red-700); }

/* ---------- The sheet (paper: fixed colours in both themes) ---------- */
.ep-sheet { --ep-ink: #111; --ep-mute: #555; --ep-red: #C8202B; --ep-rule: #222; --ep-soft: #F1F3F8;
  /* paper colours in both themes: the site tokens are pinned inside the sheet */
  --fg: #222; --fg-strong: #111; --fg-muted: #555; --fg-meta: #555; --link-hover: #C8202B; --accent-text: #C8202B; --border: #ccc; --bg: #fff; --bg-panel: #F1F3F8; color-scheme: light;
  padding: 48px 34px 24px; background: #fff; color: var(--ep-ink); border-radius: 18px; box-shadow: 0 10px 40px rgb(19 31 73 / .14); font-family: var(--font-body); }
.ep-sheet a { color: inherit; }
.ep-sheet a:hover { color: var(--ep-red); }
.ep-mast__line { display: flex; justify-content: space-between; font-size: 14px; color: #222; }
.ep-mast__row { display: grid; grid-template-columns: 1fr 300px 1fr; gap: 16px; align-items: stretch; margin-top: 10px; }
.ep-mast__logo { display: grid; justify-items: center; align-content: center; gap: 2px; text-align: center; }
.ep-mast__logo img { width: 120px; height: 120px; }
.ep-mast__name { font-family: var(--font-head); font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -.02em; color: #131F49; }
.ep-mast__sub { font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ep-red); }
.ep-ear { display: grid; align-content: center; gap: 6px; padding: 18px 22px; background: #FFD34E; color: #111 !important; }
.ep-ear--r { background: #131F49; color: #fff !important; text-align: right; }
.ep-ear strong { font-family: var(--font-head); font-size: 26px; font-weight: 900; line-height: 1.1; }
.ep-ear span { font-size: 15px; line-height: 1.4; }
.ep-ear em { font-style: normal; font-weight: 800; font-size: 14px; text-decoration: underline; }
.ep-head { display: grid; grid-template-columns: 56px auto 1fr auto 44px; align-items: end; gap: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--ep-rule); }
.ep-head__host { font-size: 15px; }
.ep-head__name { justify-self: center; font-family: var(--font-head); font-size: 44px; font-weight: 900; line-height: 1; }
.ep-head__date { font-size: 15px; }
.ep-head__n { font-family: var(--font-head); font-size: 24px; font-weight: 900; text-align: right; border-left: 2px solid var(--ep-rule); }

.ep-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 22px 24px; margin-top: 22px; }
.ep-a { min-width: 0; }
.ep-a--lead { grid-column: 1 / 9; }
.ep-a--second { grid-column: 9 / 13; padding-left: 22px; border-left: 1px solid #bbb; }
.ep-a--s { grid-column: span 4; padding-top: 16px; border-top: 2px solid var(--ep-rule); }
.ep-inside { grid-column: 1 / 5; }
.ep-briefs { grid-column: 5 / 9; display: grid; gap: 14px; align-content: start; }
.ep-briefs--row { grid-column: 1 / 13; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; padding-top: 16px; border-top: 2px solid var(--ep-rule); }
.ep-cartoon, .ep-games { grid-column: 9 / 13; }
.ep-box { grid-column: span 6; padding: 14px 16px; background: var(--ep-soft); border-top: 4px solid #131F49; }
.ep-a--edlead { grid-column: 1 / 13; padding-bottom: 18px; border-bottom: 2px solid var(--ep-rule); }
.ep-a--edlead .ep-text { column-count: 3; column-gap: 28px; }
.ep-a--col { grid-column: span 6; }

.ep-story { display: grid; gap: 10px; align-content: start; }
.ep-kicker { color: var(--ep-red); font-family: var(--font-head); font-size: 20px; font-weight: 800; }
.ep-h { font-family: var(--font-head); font-weight: 900; line-height: 1.12; letter-spacing: -.01em; }
.ep-story--lead .ep-h { font-size: 52px; }
.ep-story--second .ep-h { font-size: 34px; }
.ep-story--s1 .ep-h, .ep-story--s2 .ep-h, .ep-story--s3 .ep-h, .ep-story--box1 .ep-h, .ep-story--box2 .ep-h { font-size: 24px; line-height: 1.2; }
.ep-story--b1 .ep-h, .ep-story--b2 .ep-h, .ep-story--b3 .ep-h { font-size: 21px; line-height: 1.22; }
.ep-story--col1 .ep-h, .ep-story--col2 .ep-h { font-size: 28px; }
.ep-sheet--editorial .ep-story--lead .ep-h { font-size: 44px; }
.ep-byline { color: var(--ep-red); font-weight: 800; font-size: 15px; padding-bottom: 6px; border-bottom: 1px solid #bbb; }
.ep-text p { font-size: 17px; line-height: 1.55; margin: 0 0 8px; text-align: justify; hyphens: auto; }
.ep-story--lead .ep-text { column-count: 3; column-gap: 22px; }
.ep-photo { margin: 0; }
.ep-photo img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.ep-more { display: inline-grid; place-items: center; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; vertical-align: -4px; }
.ep-inside { padding: 16px; background: var(--ep-soft); border-top: 6px solid var(--ep-red); }
.ep-inside__h { font-family: var(--font-head); font-size: 26px; font-weight: 900; color: var(--ep-red); }
.ep-inside ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 12px; }
.ep-inside li { padding-bottom: 10px; border-bottom: 1px solid #ccd; }
.ep-inside strong { display: block; font-family: var(--font-head); font-size: 19px; line-height: 1.25; }
.ep-inside span { font-size: 14px; color: var(--ep-mute); }
.ep-cartoon__h, .ep-games__h { padding: 8px 12px; background: #131F49; color: #fff; font-family: var(--font-head); font-size: 22px; font-weight: 900; }
.ep-cartoon img { display: block; width: 100%; height: auto; border: 1px solid #ccc; margin-top: 8px; }
.ep-cartoon p, .ep-games p { margin-top: 8px; font-size: 15px; }
.ep-games { padding-bottom: 16px; background: var(--ep-soft); }
.ep-games p { padding: 0 12px; }
.ep-games__play { display: inline-block; margin: 10px 12px 0; padding: 8px 20px; background: var(--ep-red); color: #fff !important; font-weight: 800; border-radius: 4px; }
.ep-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 26px; padding-top: 10px; border-top: 1px solid #ccc; font-size: 13px; color: var(--ep-mute); }
.ep-reg { display: inline-flex; gap: 6px; }
.ep-reg i { width: 12px; height: 12px; border-radius: 50%; background: #00AEEF; }
.ep-reg i:nth-child(2) { background: #EC008C; }
.ep-reg i:nth-child(3) { background: #FFF200; outline: 1px solid #ddd; }
.ep-reg i:nth-child(4) { background: #111; }

/* ---------- Toolbar, thumbnails ---------- */
.ep-tools { position: fixed; right: 16px; top: 50%; z-index: var(--z-sticky); display: grid; gap: 4px; padding: 8px; background: var(--bg); border-radius: 12px; box-shadow: var(--shadow-2); transform: translateY(-50%); }
.ep-tools__btn { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--fg-strong); cursor: pointer; }
.ep-tools__btn:hover, .ep-tools__btn[aria-pressed="true"] { background: var(--bg-panel); color: var(--accent-text); }
.ep-thumbs { max-width: 1200px; margin: 28px auto 0; padding: 18px 16px; background: var(--c-navy-800); border-radius: 12px; }
.ep-thumbs__track { display: flex; gap: 14px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 6px; }
.ep-thumb { flex: none; width: 128px; display: grid; gap: 8px; color: #fff; }
.ep-thumb__sheet { display: grid; align-content: start; gap: 6px; height: 168px; padding: 8px; background: #fff; color: #111; border-radius: 4px; overflow: hidden; outline: 3px solid transparent; }
.ep-thumb__sheet img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.ep-thumb__h { font-family: var(--font-head); font-size: 11px; font-weight: 800; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.ep-thumb__name { font-size: .8125rem; font-weight: 600; text-align: center; }
.ep-thumb:hover .ep-thumb__sheet, .ep-thumb.is-current .ep-thumb__sheet { outline-color: var(--c-red-600); }
.ep-disclaimer { max-width: 1200px; margin: 20px auto 0; font-size: .875rem; line-height: 1.55; color: var(--fg-muted); text-align: center; }
.ep-disclaimer a { color: inherit; text-decoration: underline; }

/* ---------- Article view ---------- */
.ep-article { max-width: 820px; margin: 0 auto; padding: 32px 40px 40px; background: var(--bg); border-radius: 18px; box-shadow: 0 10px 40px rgb(19 31 73 / .1); }
.ep-article .ep-kicker { margin-top: 18px; font-size: 1rem; color: var(--accent-text); }
.ep-article__back { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-strong); font-weight: 700; }
.ep-article__title { margin-top: 6px; font-family: var(--font-head); font-size: 2.25rem; font-weight: 900; line-height: 1.2; color: var(--fg-strong); }
.ep-article__meta { margin-top: 10px; font-size: .875rem; color: var(--fg-muted); }
.ep-article__fig { margin: 18px 0 0; }
.ep-article__fig img { display: block; width: 100%; height: auto; }
.ep-article__body { margin-top: 18px; }
.ep-article__body p { margin: 0 0 14px; font-size: 1.1875rem; line-height: 1.65; color: var(--fg-strong); }
.ep-article__orig { margin-top: 22px; }

/* ---------- Dialogs ---------- */
.ep-dialog { width: min(420px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; background: var(--bg); color: var(--fg); box-shadow: var(--shadow-2); }
.ep-dialog::backdrop { background: rgb(11 16 34 / .55); }
.ep-dialog__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px 20px; border-bottom: 1px solid var(--border); }
.ep-dialog__head h2 { font-family: var(--font-head); font-size: 1.125rem; font-weight: 800; color: var(--fg-strong); }
.ep-cal { padding: 14px 18px 4px; display: grid; gap: 6px; }
.ep-cal__row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; }
.ep-cal__wd { font-size: .75rem; font-weight: 700; color: var(--fg-muted); }
.ep-cal__day { display: grid; place-items: center; height: 40px; border-radius: 8px; font-weight: 700; color: var(--fg-strong); }
a.ep-cal__day { background: var(--bg-panel); }
a.ep-cal__day:hover { background: var(--c-navy-800); color: #fff; }
.ep-cal__day.is-current { background: var(--c-red-700); color: #fff; }
.ep-cal__day.is-off { color: var(--fg-muted); font-weight: 400; opacity: .7; }
.ep-dialog__note { padding: 6px 20px 18px; font-size: .8125rem; color: var(--fg-muted); }
.ep-dialog--menu { margin: 0 auto 0 0; height: 100dvh; max-height: none; width: min(340px, 90vw); border-radius: 0; background: var(--c-navy-800); color: #fff; }
.ep-dialog--menu .ep-dialog__head { border-color: rgb(255 255 255 / .15); }
.ep-dialog--menu .ep-dialog__head h2, .ep-dialog--menu .ep-bar__btn { color: #fff; }
.ep-dialog--menu .ep-bar__btn:hover { background: rgb(255 255 255 / .1); }
.ep-menu { list-style: none; margin: 0; padding: 8px 0; }
.ep-menu a, .ep-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 20px; border: 0; background: none; color: #fff; font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
.ep-menu a:hover, .ep-menu button:hover { background: rgb(255 255 255 / .08); }

/* ---------- Small screens ---------- */
@media (max-width: 1100px) {
  .ep-site--long { display: none; } /* Phase 20: the website button stays, with a short label */
  .ep-site--short { display: inline; }
}
@media (max-width: 767px) {
  .ep-bar { padding: 0 10px; border-radius: 0; }
  .ep-bar__row { gap: 8px; min-height: 60px; }
  .ep-bar__date span:first-of-type { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ep-bar__sub { display: none; }
  .ep-bar__icons .ep-bar__btn:not(.ep-bar__live) { display: none; }
  .ep-main { padding: 16px 8px 96px; }
  .ep-turn { display: none; }
  .ep-tools { top: auto; bottom: 0; left: 0; right: 0; display: flex; justify-content: space-around; border-radius: 0; transform: none; padding: 6px 8px max(6px, env(safe-area-inset-bottom)); }
  .ep-sheet { border-radius: 8px; }
  .ep-article { padding: 20px 18px 28px; border-radius: 10px; }
  .ep-article__title { font-size: 1.625rem; }
  .ep-article__body p { font-size: 1.0625rem; }
}
@media print {
  .ep-bar, .ep-tools, .ep-thumbs, .ep-turn { display: none; }
  .ep-scale { transform: none !important; width: auto; }
}

/* ---------- Phase 17.8: article tools, summary, story navigation ---------- */
.ep-tools-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 16px; padding: 10px 12px; background: var(--bg-panel); border-radius: 10px; }
.ep-tools-bar__btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--bg); color: var(--fg-strong); font: inherit; font-size: .875rem; font-weight: 700; cursor: pointer; }
.ep-tools-bar__btn:hover, .ep-tools-bar__btn[aria-pressed="true"], .ep-tools-bar__btn[aria-expanded="true"] { border-color: var(--c-red-700); color: var(--accent-text); }
.ep-tools-bar__share { display: inline-flex; gap: 2px; margin-left: auto; }
.ep-tools-bar__icon { display: inline-grid; place-items: center; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--fg-strong); cursor: pointer; }
.ep-tools-bar__icon:hover { background: var(--bg); }
.ep-summary { margin-top: 14px; padding: 16px 18px; border: 1px solid var(--border); border-top: 3px solid var(--c-navy-800); }
.ep-summary h3 { font-family: var(--font-head); font-size: 1rem; font-weight: 800; color: var(--fg-strong); }
.ep-summary ul { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 6px; line-height: 1.55; color: var(--fg-strong); }
.ep-storynav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--border); }
.ep-storynav a { display: grid; gap: 4px; color: var(--fg-strong); }
.ep-storynav span { display: inline-flex; align-items: center; gap: 4px; font-size: .8125rem; font-weight: 700; color: var(--fg-muted); }
.ep-storynav strong { font-family: var(--font-head); line-height: 1.3; }
.ep-storynav a:hover strong { color: var(--link-hover); }
.ep-storynav__next { grid-column: 2; text-align: right; justify-items: end; }

/* ---------- Phase 17.8: Clip and Crop ---------- */
.ep-main.is-clipping [data-ep-story] { cursor: copy; outline: 2px dashed transparent; outline-offset: 6px; transition: outline-color var(--d-fast) var(--ease-out); }
.ep-main.is-clipping [data-ep-story]:hover, .ep-main.is-clipping [data-ep-story]:focus-visible { outline-color: var(--c-red-600); }
.ep-cropzone { position: absolute; inset: 0; z-index: 3; cursor: crosshair; background: rgb(11 16 34 / .08); touch-action: none; }
.ep-cropzone__box { position: absolute; border: 2px dashed var(--c-red-600); background: rgb(229 46 46 / .08); }
.ep-cliphint { position: fixed; left: 50%; top: 140px; z-index: calc(var(--z-sticky) + 1); max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--c-navy-800); color: #fff; font-size: .875rem; font-weight: 600; transform: translateX(-50%); box-shadow: var(--shadow-2); }
.ep-dialog--clip { width: min(720px, calc(100vw - 32px)); }
.ep-clip__body { padding: 16px 20px 20px; display: grid; gap: 14px; }
.ep-clip__status { color: var(--fg-muted); }
.ep-clip__img { display: block; max-width: 100%; max-height: 60vh; margin: 0 auto; border: 1px solid var(--border); object-fit: contain; }
.ep-clip__acts { display: flex; flex-wrap: wrap; gap: 10px; }
@media (max-width: 767px) {
  .ep-tools__crop { display: none; } /* drag-to-crop needs a pointer and room; Clip works everywhere */
  .ep-tools-bar__share { margin-left: 0; }
  .ep-cliphint { top: auto; bottom: 76px; border-radius: 12px; }
}

/* ---------- Phase 17.9: ads in the e-paper (ears, under the page) ---------- */
.ep-ear--ad { position: relative; padding: 0; background: #F1F3F8; align-content: stretch; }
.ep-ear--ad .ee-ad__slide { position: static; display: block; height: 100%; }
.ep-ear--ad img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ep-ear__label { position: absolute; left: 6px; top: 6px; z-index: 1; padding: 1px 6px; background: rgb(255 255 255 / .9); color: #333; font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.ep-adbottom { max-width: 1200px; margin: 20px auto 0; }
.ep-adbottom:empty { display: none; }

/* ---------- Phase 20 (D39-D41): reading desk, paper sheet, page flip, folded corners, phone reader ---------- */
.ee-epaper { background: linear-gradient(180deg, var(--bg-panel) 0, color-mix(in srgb, var(--bg-panel) 82%, var(--c-navy-300)) 100%) fixed; }
.ep-date--short, .ep-site--short { display: none; }
/* The way back to the main site: always visible, a solid brand button */
.ep-bar__site { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--c-navy-800); color: #fff; font-size: .8125rem; font-weight: 700; white-space: nowrap; transition: background var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out); }
.ep-bar__site:hover { background: var(--c-red-700); color: #fff; }
.ep-bar__site:active { transform: scale(.97); }
.ep-tabs__tab { position: relative; text-decoration: none; }
.ep-tabs__tab[aria-current] { text-decoration: none; }
.ep-tabs__tab::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 3px; border-radius: 2px; background: var(--c-red-700); transform: scaleX(0); transition: transform var(--d-base) var(--ease-out); }
.ep-tabs__tab:hover::after { transform: scaleX(.5); }
.ep-tabs__tab[aria-current]::after { transform: scaleX(1); }
/* Desktop: keep the sheet clear of the fixed tool bar (right) and the turn arrows (both sides) */
@media (min-width: 768px) { .ep-stage, .ep-pager, .ep-onpage { max-width: min(1200px, calc(100vw - 224px)); } }
/* Page counter and progress */
.ep-pager { display: grid; gap: 8px; max-width: 1200px; margin: 0 auto 16px; }
@media (min-width: 768px) { .ep-pager { max-width: min(1200px, calc(100vw - 224px)); } }
.ep-pager__count { display: flex; align-items: baseline; gap: 8px; color: var(--fg-strong); font-family: var(--font-head); font-size: .9375rem; font-weight: 800; }
.ep-pager__count span { color: var(--fg-muted); font-family: var(--font-body); font-weight: 600; }
.ep-pager__bar { height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--fg-muted) 22%, transparent); overflow: hidden; }
.ep-pager__bar span { display: block; height: 100%; border-radius: inherit; background: var(--c-red-700); transform: scaleX(var(--ep-p, 0)); transform-origin: left center; }
/* The sheet: paper with depth and a spine shadow on the left */
.ep-sheet { position: relative; border-radius: 6px 14px 14px 6px; box-shadow: 0 1px 2px rgb(19 31 73 / .08), 0 14px 34px rgb(19 31 73 / .16), 0 44px 90px -24px rgb(19 31 73 / .3); }
.ep-sheet::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 28px; border-radius: 6px 0 0 6px; background: linear-gradient(90deg, rgb(0 0 0 / .12), transparent); pointer-events: none; }
.ep-turn { width: 48px; height: 48px; box-shadow: 0 6px 18px rgb(19 31 73 / .28); transition: background var(--d-base) var(--ease-out), transform var(--d-base) var(--ease-out); }
.ep-turn--prev { left: -24px; }
.ep-turn--next { right: -24px; }
.ep-turn:hover { transform: scale(1.08); }
.ep-turn:active { transform: scale(.92); }
/* Folded page corners: a peel that grows on hover; clicking it turns the page */
.ep-curl { position: absolute; bottom: 0; z-index: 3; display: block; width: 78px; height: 78px; }
.ep-curl--next { right: 0; }
.ep-curl--prev { left: 0; }
.ep-curl__fold { position: absolute; bottom: 0; width: 78px; height: 78px; filter: drop-shadow(-3px -3px 5px rgb(19 31 73 / .25)); transform: scale(.48); transition: transform 380ms var(--ease-out); }
.ep-curl--next .ep-curl__fold { right: 0; transform-origin: bottom right; border-top-left-radius: 10px; background: linear-gradient(315deg, var(--bg-panel) 50%, #DCE1EC 50%, #FFFFFF 66%, #C9D0DE 100%); }
.ep-curl--prev .ep-curl__fold { left: 0; transform-origin: bottom left; border-top-right-radius: 10px; filter: drop-shadow(3px -3px 5px rgb(19 31 73 / .25)); background: linear-gradient(45deg, var(--bg-panel) 50%, #DCE1EC 50%, #FFFFFF 66%, #C9D0DE 100%); }
.ep-curl:hover .ep-curl__fold, .ep-curl:focus-visible .ep-curl__fold { transform: scale(1); }
.ep-curl:active .ep-curl__fold { transform: scale(1.12); }
/* First arrival (not a flip): the sheet settles onto the desk */
html.js:not([data-ep-flip]) .ep-fit.is-ready { animation: ep-settle 520ms var(--ease-out) backwards; }
@keyframes ep-settle { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
/* Swipe feedback (site.js sets --ep-drag while a finger drags the page) */
.ep-fit.is-dragging { transform: translateX(var(--ep-drag, 0)) rotate(calc(var(--ep-drag, 0) / 900)); transition: none; }
.ep-fit.is-released { transition: transform 260ms var(--ease-out); }
/* "On this page": the page's stories as a list (phones) */
.ep-onpage { display: none; }
.ep-onpage h2 { font-family: var(--font-head); font-size: 1.125rem; font-weight: 800; color: var(--fg-strong); }
.ep-onpage ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; }
.ep-onpage a { display: grid; grid-template-columns: 88px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; background: var(--bg); color: var(--fg-strong); box-shadow: 0 1px 2px rgb(19 31 73 / .08); transition: transform var(--d-base) var(--ease-out); }
.ep-onpage a:active { transform: scale(.98); }
.ep-onpage img { width: 88px; height: 66px; border-radius: 8px; object-fit: cover; background: var(--bg-panel); }
.ep-onpage a:not(:has(img)) { grid-template-columns: 1fr; }
.ep-onpage span { display: grid; gap: 3px; min-width: 0; }
.ep-onpage em { color: var(--accent-text); font-size: .75rem; font-style: normal; font-weight: 700; }
.ep-onpage strong { font-family: var(--font-head); font-size: .9375rem; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* The page flip: cross-document View Transitions (D39). Only e-paper pages load this file, so only they opt in. */
@view-transition { navigation: auto; }
.ep-bar { view-transition-name: ep-bar; }
.ep-fit { view-transition-name: ep-page; }
::view-transition-group(ep-bar), ::view-transition-old(ep-bar), ::view-transition-new(ep-bar) { animation: none; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
::view-transition-group(ep-page) { animation-duration: 800ms; animation-timing-function: cubic-bezier(.4, .1, .25, 1); }
html:active-view-transition-type(ep-next)::view-transition-old(ep-page) { z-index: 2; mix-blend-mode: normal; transform-origin: left center; animation: 800ms cubic-bezier(.45, .05, .25, 1) both ep-flip-out; }
html:active-view-transition-type(ep-next)::view-transition-new(ep-page) { mix-blend-mode: normal; animation: 800ms ease both ep-reveal; }
html:active-view-transition-type(ep-prev)::view-transition-new(ep-page) { z-index: 2; mix-blend-mode: normal; transform-origin: left center; animation: 800ms cubic-bezier(.45, .05, .25, 1) both ep-flip-in; }
html:active-view-transition-type(ep-prev)::view-transition-old(ep-page) { mix-blend-mode: normal; animation: 800ms ease both ep-cover; }
@keyframes ep-flip-out { from { transform: perspective(2600px) rotateY(0); filter: brightness(1); } 55% { filter: brightness(.86); } to { transform: perspective(2600px) rotateY(-104deg); filter: brightness(.55); } }
@keyframes ep-flip-in { from { transform: perspective(2600px) rotateY(-104deg); filter: brightness(.55); } to { transform: perspective(2600px) rotateY(0); filter: brightness(1); } }
@keyframes ep-reveal { from { filter: brightness(.7); } to { filter: brightness(1); } }
@keyframes ep-cover { from { filter: brightness(1); } to { filter: brightness(.7); } }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  html.js:not([data-ep-flip]) .ep-fit.is-ready { animation: none; }
  .ep-curl__fold, .ep-turn, .ep-tabs__tab::after, .ep-onpage a { transition: none; }
}
@media (max-width: 767px) {
  .ep-date--long, .ep-site--long { display: none; }
  .ep-date--short, .ep-site--short { display: inline; }
  .ep-bar__date { padding: 0 10px; }
  .ep-bar__site { height: 34px; padding: 0 12px; }
  .ep-bar__logo span { display: none; }
  .ep-pager { margin-bottom: 10px; }
  .ep-fit { touch-action: pan-y; }
  .ep-curl { width: 56px; height: 56px; }
  .ep-curl__fold { width: 56px; height: 56px; transform: scale(.7); }
  .ep-onpage { display: block; max-width: 640px; margin: 22px auto 0; }
}
