/* ============================================================
   The Balochistan Post — Story Reader (shorts-style "خبریں مختصر میں")
   Recreated from the claude.ai/design handoff (the handoff files were removed
   from the repo on 2026-10-24 and are in its git history).
   Tokens come from tokens.css (--tbp-red/-d, --r-pill, --font-*).
   Enqueued on the front page only. Depends on tokens.css.
   Per the red-brand system, the per-category rainbow accents from the
   reference were dropped: every accent here is brand red (--sr-accent
   falls back to --tbp-red, which is never set).
   ============================================================ */

/* Neutralize the site-wide RTL body line-height (1.85) inside the reader: the
   handoff was built against default line-height, so pills / labels / buttons
   (.sr-cat, .sr-read, counters…) otherwise inherit 1.85 and render extra tall.
   Elements that set their own line-height (headline 1.6, excerpt 1.85) keep it. */
.sr-fab, .sr-overlay, .sr-sheet { line-height: normal; }
/* The pattern prints these straight into .wp-site-blocks, whose block gap gave
   each a 24px top margin: the open reader and share sheet started 24px down,
   with the page's top bar showing above them. */
.sr-fab, .sr-overlay, .sr-sheet { margin: 0; }
/* A left-to-right edition (English): the reader's words are in the page's own
   UI font, not the Urdu stack every rule below names. */
html[dir="ltr"] .sr-fab, html[dir="ltr"] .sr-overlay, html[dir="ltr"] .sr-sheet { --font-urdu: var(--font-ui); }

/* ── Launcher FAB ───────────────────────────────────────────── */
/* Its glow is its own colour (--tbp-red, which an accent preset recolours), never a fixed red. */
.sr-fab {
  visibility: visible; /* hidden by the inline first-paint rule until this sheet arrives (functions.php) */
  position: fixed; inset-inline-start: 22px; bottom: 22px; z-index: 200;
  display: inline-flex; align-items: center; gap: 11px;
  background: var(--tbp-red); color: #fff; border: 0; cursor: pointer;
  padding: 11px 18px 11px 13px; border-radius: var(--r-pill);
  font-family: var(--font-urdu); font-weight: 700; font-size: 14.5px;
  box-shadow: 0 10px 34px color-mix(in srgb, var(--tbp-red) 42%, transparent), 0 2px 8px rgba(0,0,0,.3);
  transition: transform .18s ease, box-shadow .18s ease, background .18s;
}
/* Clear the mobile tab bar (app.css): FAB rides above it on phones/tablets. */
@media (max-width: 1024px) { .sr-fab { bottom: calc(72px + env(safe-area-inset-bottom, 0px)); } }
.sr-fab:hover { background: var(--tbp-red-d); transform: translateY(-2px); box-shadow: 0 16px 44px color-mix(in srgb, var(--tbp-red) 50%, transparent); }
.sr-fab .sr-fab-ic { position: relative; width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border-radius: 50%; }
.sr-fab .sr-fab-ic svg { width: 16px; height: 16px; color: #fff; }
.sr-fab .sr-fab-ic::after { content: ""; position: absolute; inset: -5px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.55); animation: srPing 2.2s ease-out infinite; }
@keyframes srPing { 0%{transform:scale(.7);opacity:.9;} 70%,100%{transform:scale(1.35);opacity:0;} }
@media (prefers-reduced-motion: reduce){ .sr-fab .sr-fab-ic::after{ animation:none; } }
@media (max-width: 560px){ .sr-fab .sr-fab-label{ display:none; } .sr-fab{ padding:7px; } } /* 44px: 7 + 30 + 7 */
/* Phones and tablets (the mobile plan): the button waits below the first screen —
   on the homepage it covered the lead headline — and steps aside while the
   reader scrolls down fast (story-reader.js sets .is-away). */
@media (max-width: 1024px) {
  .sr-fab { transition: transform .22s ease, opacity .22s ease, box-shadow .18s ease, background .18s; }
  .sr-fab.is-away { opacity: 0; transform: translateY(14px) scale(.9); pointer-events: none; }
}
@media (max-width: 1024px) and (prefers-reduced-motion: reduce) { .sr-fab { transition: none; } }
.sr-fab-badge { position:absolute; top:-3px; inset-inline-end:-3px; min-width:20px; height:20px; padding:0 5px;
  background:#fff; color:var(--tbp-red); border-radius:10px; font-family:var(--font-mono); font-weight:700; font-size:11px;
  display:flex; align-items:center; justify-content:center; box-shadow:0 2px 8px rgba(0,0,0,.35); }
.sr-card.holding .sr-segs { opacity:.35; }
.sr-card.holding { cursor: grabbing; }
.sr-live { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; }
.sr-dlall { display:flex; align-items:center; justify-content:center; gap:8px; width:calc(100% - 40px); margin:2px 20px 18px;
  background:transparent; color:#cfcfcf; border:1px solid rgba(255,255,255,.14); border-radius:var(--r-pill); cursor:pointer;
  padding:11px; font-family:var(--font-urdu); font-weight:600; font-size:13.5px; transition:background .15s,color .15s; }
.sr-dlall:hover { background:rgba(255,255,255,.08); color:#fff; }
.sr-dlall svg { width:15px; height:15px; }
.sr-nav button:focus-visible, .sr-iconbtn:focus-visible, .sr-read:focus-visible, .sr-pp:focus-visible, .sr-close:focus-visible, .sr-fab:focus-visible { outline:2px solid #fff; outline-offset:2px; }

/* ── Overlay ────────────────────────────────────────────────── */
.sr-overlay {
  position: fixed; inset: 0; z-index: 300; display: none;
  align-items: center; justify-content: center;
  background: rgba(6,6,8,.82); backdrop-filter: blur(16px) saturate(1.1); -webkit-backdrop-filter: blur(16px) saturate(1.1);
  padding: 22px;
}
.sr-overlay.open { display: flex; animation: srFade .26s ease both; }
@keyframes srFade { from{opacity:0;} to{opacity:1;} }

.sr-close {
  position: fixed; top: 20px; inset-inline-end: 20px; z-index: 4;
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07); color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, transform .15s; }
.sr-close:hover { background: rgba(255,255,255,.16); transform: rotate(90deg); }
.sr-close svg { width: 18px; height: 18px; }

/* counter + autoplay control top-leading of overlay */
.sr-meta-top { position: fixed; top: 24px; inset-inline-start: 24px; z-index: 4;
  display: flex; align-items: center; gap: 12px; }
.sr-pp { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.18);
  background: rgba(255,255,255,.07); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.sr-pp:hover { background: rgba(255,255,255,.16); }
.sr-pp svg { width: 15px; height: 15px; }
.sr-counter { font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; color: rgba(255,255,255,.7); }
.sr-counter b { color: #fff; }

/* ── Card stack ─────────────────────────────────────────────── */
.sr-stack { position: relative; width: min(94vw, calc(94vh - 96px), 640px); }
.sr-peek { position: absolute; inset: 0; border-radius: 20px; background: #151515;
  border: 1px solid rgba(255,255,255,.06); }
.sr-peek.p1 { transform: translateY(14px) scale(.945); opacity: .55; }
.sr-peek.p2 { transform: translateY(27px) scale(.89);  opacity: .3; }

/* The card is a size container: the --card-* tokens (Studio ▸ Design ▸ Share
   card & Stories, printed by inc/card-design.php) are canvas pixels on the
   1200px card, and 1cqw / 12 is one of those pixels at this card's width. So
   the same numbers size the canvas and the screen, at any card width. */
.sr-card { container-type: inline-size; }
.sr-card { position: relative; z-index: 2; border-radius: 20px; overflow: hidden;
  background: #0d0d0d; box-shadow: 0 30px 80px rgba(0,0,0,.6);
  max-height: 94vh; display: flex; flex-direction: column; }

/* segmented progress */
.sr-segs { position: absolute; top: 0; inset-inline: 0; z-index: 6; display: flex; gap: 4px; padding: 12px 12px 0; }
.sr-seg { flex: 1; height: 3px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.sr-seg .fill { display: block; height: 100%; width: 0; background: #fff; border-radius: 3px; }
.sr-seg.done .fill { width: 100%; }

/* media poster (square) */
.sr-media { position: relative; aspect-ratio: 1/1; flex: 0 1 auto; min-height: 0; overflow: hidden; }
.sr-media .bg { position: absolute; inset: 0; width: 100%; height: 100%; background-size: cover; background-position: center;
  object-fit: cover; transform-origin: 60% 40%; }
/* <img class="bg"> is a replaced element: inset:0 alone won't stretch its height,
   so a landscape photo would leave a gap below. Force it to fill + cover-crop. */
.sr-card.kb .sr-media .bg { animation: srKen 11s ease-out both; }
@keyframes srKen { from{ transform: scale(1.01); } to{ transform: scale(1.13); } }
@media (prefers-reduced-motion: reduce){ .sr-card.kb .sr-media .bg{ animation:none; } }
.sr-media::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.3) 0%, rgba(0,0,0,0) 11%); }
.sr-brand { position: absolute; top: 26px; inset-inline-start: 16px; z-index: 3;
  display: inline-flex; align-items: baseline; gap: 2px; direction: ltr;
  font-family: var(--font-display); font-weight: 900; font-style: italic; font-size: clamp(14px, calc(var(--card-mark-h, 92) * 1cqw / 12 * .74), 40px); letter-spacing: -.03em;
  color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.sr-brand .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--tbp-red); align-self: flex-end; margin-bottom: 3px; }
.sr-cat { position: absolute; top: 24px; inset-inline-end: 16px; z-index: 3;
  background: var(--sr-accent, var(--tbp-red)); color: #fff; font-family: var(--font-urdu); font-weight: 700; font-size: clamp(10px, calc(var(--card-cat-px, 34) * 1cqw / 12), 22px);
  padding: .4em 1.1em; border-radius: var(--r-pill); white-space: nowrap; }
/* headline on a custom patterned backdrop band (lower third) */
.sr-media .sr-poster-tx { position: absolute; inset-inline: 0; bottom: 0; z-index: 3;
  padding: 40px 26px 22px;
  /* RTL: -webkit-box line-clamp ignores `start`, so short lines drift left and the
     trailing comma jumps. Force explicit right alignment (pos-center/quote override). */
  direction: rtl; text-align: right;
  /* The line motif (story-reader-card.js HATCH): "\" at 45°, 24px pitch,
     3.6px strokes, ink .28 at .7 opacity — here as 1cqw/12 canvas px. */
  background:
    repeating-linear-gradient(45deg, rgba(240,238,232,.2) 0 calc(3.6cqw / 12), transparent calc(3.6cqw / 12) calc(24cqw / 12)),
    linear-gradient(180deg, rgba(10,10,12,.20) 0%, rgba(10,10,12,.82) 46%, rgba(10,10,12,.95) 100%); }
html[dir="ltr"] .sr-poster-tx { direction: ltr; text-align: left; }
/* short brand accent tab at the band's top-left — not a full-width rule across the photo */
.sr-media .sr-poster-tx::before { content: ""; position: absolute; top: 0; inset-inline-start: 26px;
  width: 46px; height: 3px; background: var(--sr-accent, var(--tbp-red)); border-radius: 0 0 3px 3px; }
.sr-poster-tx h3 { font-family: var(--font-urdu); font-weight: 800; font-size: clamp(calc(var(--card-title-min, 44) * 1cqw / 12), calc(var(--card-title-px, 74) * 1cqw / 12), 48px); line-height: 1.5;
  margin: 0; color: #fff; text-shadow: 0 2px 14px rgba(0,0,0,.55); letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: var(--card-title-lines, 4); line-clamp: var(--card-title-lines, 4); -webkit-box-orient: vertical; overflow: hidden; }

/* ── The reader's card: the short read ──────────────────────────
   The rules above draw the poster: the share picture's design, which Stories
   Studio previews with them (tbp-stories/admin/stories-admin.js). In the reader
   (.sr-overlay) the photo fills the card, then a band under a red line, with
   fine diagonal lines: the headline, the story in a few lines (its excerpt),
   its date and the buttons. On a computer the card is 4:5 (2026-10-31, the
   owner's choice of three: the story shape read as a phone's, and the picture
   it shares is square), as tall as the screen allows up to 780px; on a phone
   (below) it fills the screen, as a story is held. */
.sr-overlay .sr-stack { height: min(calc(100vh - 64px), 780px); height: min(calc(100dvh - 64px), 780px);
  width: min(94vw, calc(min(calc(100vh - 64px), 780px) * 4 / 5)); width: min(94vw, calc(min(calc(100dvh - 64px), 780px) * 4 / 5)); }
@media (max-width: 760px) {
  .sr-overlay { padding: 72px 10px 10px; }
  .sr-overlay .sr-stack { width: 100%; max-width: 480px; height: 100%; }
  .sr-overlay .sr-peek { display: none; }
}
.sr-overlay .sr-card { height: 100%; max-height: none; }
/* The photo is the card's background, filling it (cover), behind the band. */
.sr-overlay .sr-card > .sr-pic { position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; max-width: none;
  object-fit: cover; transform-origin: 60% 40%; pointer-events: none; }
.sr-overlay .sr-card.kb > .sr-pic { animation: srKen 11s ease-out both; }
@media (prefers-reduced-motion: reduce) { .sr-overlay .sr-card.kb > .sr-pic { animation: none; } }
.sr-overlay .sr-card.flt-dark > .sr-pic { filter: brightness(.62); }
.sr-overlay .sr-card.flt-bw > .sr-pic { filter: grayscale(1) contrast(1.05); }
.sr-overlay .sr-card.flt-duo > .sr-pic { filter: grayscale(1) brightness(.9) sepia(.5) hue-rotate(310deg) saturate(2.4); }
/* The area above the band: the category, the badge and the tap zones. */
.sr-overlay .sr-media { aspect-ratio: auto; flex: 1 1 0; min-height: 34%; z-index: 1; }
/* the progress bars read on any photo */
.sr-overlay .sr-media::after { z-index: 2; pointer-events: none; }
.sr-overlay .sr-cat { top: auto; inset-inline-end: auto; bottom: 76px; inset-inline-start: 20px; /* above the band */
  font-size: clamp(12px, calc(var(--card-cat-px, 34) * 1cqw / 12), 16px); }
.sr-overlay .sr-tap { bottom: 0; }
.sr-overlay .sr-share-tray { position: relative; z-index: 1; background: #0d0d0d; }
/* The band lies over the photo's lower part, from 64px above the words: its
   lines are see-through, the photo shows through them and the band darkens down. Fine "\"
   lines (1.2px every 8px); a red line across its top, a white mark at its
   start. On a short screen the words give way before the buttons do. */
.sr-low { position: relative; z-index: 1; flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column; margin-top: -64px;
  background:
    repeating-linear-gradient(45deg, rgba(240,238,232,.2) 0 1.2px, transparent 1.2px 8px),
    linear-gradient(180deg, rgba(10,10,12,.1) 0%, rgba(10,10,12,.45) 30%, rgba(10,10,12,.82) 62%, rgba(10,10,12,.94) 100%); }
.sr-low::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--sr-accent, var(--tbp-red)); }
.sr-low::after { content: ""; position: absolute; top: 0; inset-inline-start: 20px; width: 27%; height: 2px; background: #fff; }
/* the round buttons stay solid on the lines */
.sr-low .sr-iconbtn { background-color: #18181a; }
.sr-low .sr-iconbtn:hover { background-color: #2a2a2d; }
.sr-low .sr-iconbtn.img { background-color: #261012; }
.sr-low .sr-iconbtn.img:hover { background-color: #3a1417; }
.sr-body { flex: 0 1 auto; min-height: 0; overflow: hidden; padding: 20px 20px 0;
  display: flex; flex-direction: column; gap: 10px; text-align: right; } /* a clamped (-webkit-box) line ignores start */
html[dir="ltr"] .sr-body { text-align: left; }
.sr-body .sr-kicker { position: static; display: block; flex: none; margin: 0; font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(9px, calc(var(--card-kicker-px, 26) * 1cqw / 12), 20px); letter-spacing: .14em; text-transform: uppercase; color: var(--sr-accent, var(--tbp-red)); }
.sr-body h3 { font-family: var(--font-urdu); font-weight: 800; font-size: clamp(calc(var(--card-title-min, 44) * 1cqw / 12), calc(var(--card-title-px, 74) * 1cqw / 12), 32px); line-height: 1.55;
  margin: 0; color: #fff; letter-spacing: -.005em; flex: none; text-shadow: 0 2px 12px rgba(0,0,0,.6);
  display: -webkit-box; -webkit-line-clamp: var(--card-title-lines, 4); line-clamp: var(--card-title-lines, 4); -webkit-box-orient: vertical; overflow: hidden; }
.sr-excerpt { font-family: var(--font-urdu); font-size: 16px; line-height: 1.9; color: #c9c9c9; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 4; line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.sr-byline { flex: none; font-family: var(--font-urdu); font-size: 13px; color: #8d8d8d; }
/* An updated story: the cards' badge (app.css .tbp-upd), light on the dark band. */
.sr-byline .sr-upd { color: #0a0a0a; background: #fff; }
html[dir="ltr"] .sr-body h3 { line-height: 1.3; }   /* Latin words sit closer than Naskh */
html[dir="ltr"] .sr-excerpt { line-height: 1.6; }
@media (max-height: 640px) { .sr-excerpt { -webkit-line-clamp: 2; line-clamp: 2; } }
@media (max-height: 480px) { .sr-excerpt { display: none; } }
/* Studio's headline choices, on this headline too */
.sr-card.fnt-nastaliq .sr-body h3 { font-family: var(--font-urdu-disp); font-weight: 400; line-height: 2.0; }
.sr-card.tpl-bold .sr-body h3 { font-size: clamp(24px, 7.4cqw, 36px); line-height: 1.45; }
.sr-card.tpl-minimal .sr-body h3 { font-size: clamp(17px, 5cqw, 22px); font-weight: 700; }
.sr-card.tpl-quote .sr-body h3::before { content: "\201D"; display: block; font-family: var(--font-display); font-weight: 900; font-size: 46px; line-height: .4; color: var(--sr-accent, var(--tbp-red)); margin: 14px 0 10px; }
html[dir="ltr"] .sr-card.tpl-quote .sr-body h3::before { content: "\201C"; }

/* primary CTA */
.sr-cta { display: flex; gap: 10px; padding: 14px 16px 14px; flex: none; }
.sr-read { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  background: var(--tbp-red); color: #fff; border: 0; border-radius: var(--r-pill); cursor: pointer;
  padding: 14px; font-family: var(--font-urdu); font-weight: 700; font-size: 15.5px; transition: background .15s; text-decoration: none; }
.sr-read:hover { background: var(--tbp-red-d); }
.sr-read:active { transform: scale(.975); }
.sr-read svg { width: 15px; height: 15px; }
html[dir="rtl"] .sr-read svg { transform: scaleX(-1); }
.sr-iconbtn { width: 52px; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); color: #e8e8e8; border-radius: var(--r-pill);
  cursor: pointer; transition: background .15s, color .15s, transform .12s; position: relative; }
.sr-iconbtn:hover { background: rgba(255,255,255,.16); color: #fff; }
.sr-iconbtn:active { transform: scale(.94); }
.sr-iconbtn svg { width: 17px; height: 17px; }
.sr-iconbtn.img { background: color-mix(in srgb, var(--red) 14%, transparent); border-color: color-mix(in srgb, var(--red) 45%, transparent); color: var(--red-lift); }
.sr-iconbtn.img:hover { background: color-mix(in srgb, var(--red) 24%, transparent); color: #fff; }
.sr-iconbtn.busy { pointer-events: none; }
/* The share picture could not be made: said on the card, not a silent button. */
.sr-toast { position: absolute; z-index: 5; inset-inline: 16px; bottom: 84px; padding: 10px 14px; border-radius: 10px; background: rgba(10,10,12,.92); color: #fff; font-family: var(--font-urdu); font-size: 14px; text-align: center; }
.sr-iconbtn.busy svg { opacity: 0; }
.sr-iconbtn.busy::after { content:""; position:absolute; width:18px; height:18px; border-radius:50%;
  border:2px solid rgba(255,255,255,.3); border-top-color:#fff; animation: srSpin .7s linear infinite; }
@keyframes srSpin { to{ transform: rotate(360deg); } }

/* share tray (slides up) */
.sr-share-tray { border-top: 1px solid rgba(255,255,255,.08); padding: 14px 18px 18px; display: none; }
.sr-share-tray.show { display: block; animation: srSlideUp .22s ease both; }
@keyframes srSlideUp { from{opacity:0;transform:translateY(8px);} to{opacity:1;transform:none;} }
.sr-share-lbl { font-family: var(--font-urdu); font-size: 12.5px; color: #8a8a8a; margin: 0 0 12px; }
.sr-share-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.sr-share-row a, .sr-share-row button {
  display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer;
  background: none; border: 0; font-family: var(--font-urdu); font-size: 10.5px; color: #9a9a9a; text-decoration: none; transition: color .15s; }
.sr-share-row a:hover, .sr-share-row button:hover { color: #fff; }
.sr-share-ic { width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08); transition: transform .15s, background .15s; }
.sr-share-row a:hover .sr-share-ic, .sr-share-row button:hover .sr-share-ic { transform: translateY(-2px); }
.sr-share-ic svg { width: 19px; height: 19px; color: #fff; }
.sr-share-ic.wa { background: #25d366; } .sr-share-ic.x { background: #1a1a1a; border:1px solid #333; }
.sr-share-ic.fb { background: #1877f2; } .sr-share-ic.tg { background: #2aabee; }
.sr-share-ic.cp { background: var(--tbp-red); }

/* nav arrows — docked to the card's right edge */
.sr-nav { position: absolute; right: -60px; top: 50%; transform: translateY(-50%); z-index: 4;
  display: flex; flex-direction: column; gap: 12px; }
.sr-nav button { width: 46px; height: 46px; border-radius: 50%; border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.07); color: #fff; cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s, opacity .15s; }
.sr-nav button:hover { background: var(--tbp-red); border-color: var(--tbp-red); }
.sr-nav button:disabled { opacity: .32; cursor: not-allowed; }
.sr-nav button:disabled:hover { background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.16); }
.sr-nav svg { width: 18px; height: 18px; }
/* On a phone they sit on the photo: high on it, clear of the headline at its foot. */
@media (max-width: 760px){ .sr-nav{ right: 8px; top: 30%; } .sr-nav button{ width:40px; height:40px; background:rgba(0,0,0,.4); } }

/* tap zones */
.sr-tap { position: absolute; top: 0; bottom: 38%; width: 32%; z-index: 5; cursor: pointer; }
.sr-tap.prev { inset-inline-start: 0; } .sr-tap.next { inset-inline-end: 0; }

/* enter animation on card swap */
.sr-card.enter-next { animation: srInNext .42s cubic-bezier(.2,.75,.2,1) both; }
.sr-card.enter-prev { animation: srInPrev .42s cubic-bezier(.2,.75,.2,1) both; }
@keyframes srInNext { from{opacity:0;transform:translateY(34px) scale(.97);} to{opacity:1;transform:none;} }
@keyframes srInPrev { from{opacity:0;transform:translateY(-34px) scale(.97);} to{opacity:1;transform:none;} }
@media (prefers-reduced-motion: reduce){ .sr-card.enter-next, .sr-card.enter-prev{ animation:none; } }

/* first-run coach */
.sr-tut { position: absolute; inset: 0; z-index: 7; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; background: rgba(0,0,0,.6); border-radius: 20px; text-align: center; padding: 30px; }
.sr-tut .hand { width: 50px; height: 50px; color: #fff; animation: srSwipe 1.6s ease-in-out infinite; }
@keyframes srSwipe { 0%,100%{transform:translateX(14px);opacity:.5;} 50%{transform:translateX(-14px);opacity:1;} }
.sr-tut p { font-family: var(--font-urdu); font-weight: 700; font-size: 16px; color: #fff; margin: 0; }
.sr-tut span { font-family: var(--font-urdu); font-size: 13px; color: #bbb; }

/* ══ Per-card DESIGN variants (set by the Stories Studio editor) ══════════
   Applied as classes/vars on .sr-card: --sr-accent, ov-*, flt-*, fnt-*, pos-*,
   tpl-*. The canvas share-image mirrors these in story-reader-card.js. */
.sr-kicker { position: absolute; inset-inline-start: 26px; bottom: calc(100% - 0px); display: none; }
.sr-poster-tx .sr-kicker { position: static; display: block; font-family: var(--font-mono); font-size: clamp(9px, calc(var(--card-kicker-px, 26) * 1cqw / 12), 20px);
  letter-spacing: .14em; text-transform: uppercase; color: var(--sr-accent, var(--tbp-red)); margin: 0 0 8px; font-weight: 700; }
.sr-poster-tx .sr-kicker:empty { display: none; }

/* Overlay styles behind the headline */
.sr-card.ov-scrim .sr-poster-tx { background: linear-gradient(180deg, rgba(10,10,12,.10) 0%, rgba(10,10,12,.86) 55%, rgba(10,10,12,.96) 100%); }
.sr-card.ov-gradient .sr-poster-tx { background: linear-gradient(180deg, transparent 0%, rgba(10,10,12,.55) 55%, rgba(10,10,12,.92) 100%); border-top-color: transparent; }
.sr-card.ov-gradient .sr-poster-tx::before { display: none; }
.sr-card.ov-none .sr-poster-tx { background: none; border-top-color: transparent; }
.sr-card.ov-none .sr-poster-tx::before { display: none; }
.sr-card.ov-none .sr-poster-tx h3 { text-shadow: 0 2px 16px rgba(0,0,0,.9), 0 1px 3px rgba(0,0,0,.8); }

/* Image filters */
.sr-card.flt-dark .sr-media .bg { filter: brightness(.62); }
.sr-card.flt-bw .sr-media .bg { filter: grayscale(1) contrast(1.05); }
.sr-card.flt-duo .sr-media .bg { filter: grayscale(1) brightness(.9) sepia(.5) hue-rotate(310deg) saturate(2.4); }

/* Headline font */
.sr-card.fnt-nastaliq .sr-poster-tx h3 { font-family: var(--font-urdu-disp); font-weight: 400; line-height: 2.0; }

/* Text position */
.sr-card.pos-center .sr-poster-tx { top: 0; bottom: 0; display: flex; flex-direction: column; justify-content: center;
  text-align: center; padding: 30px 30px; }
.sr-card.pos-center .sr-poster-tx::before { inset-inline-start: 50%; transform: translateX(-50%); }

/* Template presets — layout-level tweaks (most styling comes from the params above) */
.sr-card.tpl-bold .sr-poster-tx h3 { font-size: clamp(26px, 3.4vw, 40px); font-weight: 800; line-height: 1.45; }
.sr-card.tpl-minimal .sr-poster-tx { padding: 26px 26px 20px; }
.sr-card.tpl-minimal .sr-poster-tx h3 { font-size: clamp(18px, 2vw, 24px); font-weight: 700; }
.sr-card.tpl-quote .sr-poster-tx { text-align: center; }
.sr-card.tpl-quote .sr-poster-tx h3::before { content: "\201D"; display: block; font-family: var(--font-display); font-weight: 900; font-size: 46px; line-height: .4; color: var(--sr-accent, var(--tbp-red)); margin-bottom: 10px; }
html[dir="ltr"] .sr-card.tpl-quote .sr-poster-tx h3::before { content: "\201C"; }

/* ══ DESIGN ELEMENTS (Stories Studio "Elements" library) ═════════════════ */
/* Badge — top-leading pill (separate from the category pill). */
.sr-badge { position: absolute; top: 24px; inset-inline-start: 16px; z-index: 4; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-urdu); font-weight: 800; font-size: 12px; letter-spacing: .02em; padding: 5px 12px; border-radius: var(--r-pill); }
.sr-badge.bdg-breaking { background: var(--tbp-red); color: #fff; }
.sr-badge.bdg-live { background: var(--tbp-red); color: #fff; }
.sr-badge.bdg-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: livepulse 1.3s ease-in-out infinite; }
.sr-badge.bdg-exclusive { background: #fff; color: var(--ink-900); }
.sr-badge.bdg-analysis { background: var(--surface-inverse); color: var(--on-inverse); }
.sr-badge.bdg-important { background: #fff; color: var(--tbp-red); }
.sr-badge.bdg-video { background: rgba(0,0,0,.6); color: #fff; backdrop-filter: blur(3px); }

/* Bottom lines / dividers — injected under the headline (the "bottom part"). */
.sr-fline { margin-top: 14px; }
.sr-fline.bl-rule { border-top: 1px solid rgba(255,255,255,.55); }
.sr-fline.bl-double { border-top: 3px double rgba(255,255,255,.6); }
.sr-fline.bl-gold { border-top: 2px solid rgba(255,255,255,.85); width: 84px; } /* legacy slug; gold retired → white */
.sr-fline.bl-accent { border-top: 3px solid var(--sr-accent, var(--tbp-red)); width: 64px; }
.sr-fline.bl-dashed { border-top: 1px dashed rgba(255,255,255,.55); }
.sr-fline.bl-dotted { border-top: 2px dotted rgba(255,255,255,.6); }
.sr-fline.bl-ticks { height: 7px; background-image: repeating-linear-gradient(90deg, rgba(255,255,255,.6) 0 2px, transparent 2px 9px); }
.sr-fline.bl-fade { height: 2px; background: linear-gradient(90deg, var(--sr-accent, var(--tbp-red)), transparent); }
.sr-fline.bl-dots3 { height: 6px; display: flex; gap: 7px; }
.sr-fline.bl-dots3::before, .sr-fline.bl-dots3::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--sr-accent, var(--tbp-red)); box-shadow: 12px 0 0 rgba(255,255,255,.7); }

/* Frame / edge treatments on the media. */
.sr-card.frm-inset .sr-media::before { content: ""; position: absolute; inset: 12px; border: 1px solid rgba(255,255,255,.45); z-index: 3; pointer-events: none; }
.sr-card.frm-edge .sr-media::before { content: ""; position: absolute; top: 0; bottom: 0; inset-inline-start: 0; width: 6px; background: var(--sr-accent, var(--tbp-red)); z-index: 4; pointer-events: none; }
.sr-card.frm-border .sr-media::before { content: ""; position: absolute; inset: 0; border: 4px solid var(--sr-accent, var(--tbp-red)); z-index: 4; pointer-events: none; }
/* The Atlas frame: a 1px rule 26 canvas px in, with 15px corner ticks. */
.sr-card.frm-atlas .sr-media::before { content: ""; position: absolute; inset: calc(26cqw / 12); border: 1px solid rgba(240,238,232,.28); z-index: 3; pointer-events: none; }
.sr-card.frm-atlas .sr-media::after { content: ""; position: absolute; inset: calc(26cqw / 12); z-index: 3; pointer-events: none; --tk: calc(15cqw / 12); --tw: calc(2.4cqw / 12);
  background:
    linear-gradient(#fff, #fff) left top / var(--tk) var(--tw) no-repeat, linear-gradient(#fff, #fff) left top / var(--tw) var(--tk) no-repeat,
    linear-gradient(#fff, #fff) right top / var(--tk) var(--tw) no-repeat, linear-gradient(#fff, #fff) right top / var(--tw) var(--tk) no-repeat,
    linear-gradient(#fff, #fff) left bottom / var(--tk) var(--tw) no-repeat, linear-gradient(#fff, #fff) left bottom / var(--tw) var(--tk) no-repeat,
    linear-gradient(#fff, #fff) right bottom / var(--tk) var(--tw) no-repeat, linear-gradient(#fff, #fff) right bottom / var(--tw) var(--tk) no-repeat; }

/* ── Share sheet (full share fallback) ──────────────────────── */
.sr-sheet { position: fixed; inset: 0; z-index: 360; display: none;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(4,4,6,.78); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sr-sheet.open { display: flex; animation: srFade .22s ease both; }
.sr-sheet-card { width: min(94vw, 460px); background: #121214; border: 1px solid rgba(255,255,255,.09);
  border-radius: 22px; overflow: hidden; box-shadow: 0 36px 90px rgba(0,0,0,.65);
  animation: srSlideUp .26s cubic-bezier(.2,.7,.2,1) both; }
.sr-sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; }
.sr-sheet-head h4 { margin: 0; font-family: var(--font-urdu); font-weight: 800; font-size: 17px; color: #fff; }
.sr-sheet-x { width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.08); color: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; }
.sr-sheet-x:hover { background: rgba(255,255,255,.18); }
.sr-sheet-x svg { width: 16px; height: 16px; }
.sr-sheet-preview { margin: 0 20px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,.08);
  background: #000; height: min(44vh, 400px); display: flex; align-items: center; justify-content: center; }
.sr-sheet-preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; }
.sr-fmt { display: flex; gap: 6px; margin: 14px 20px 0; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08); border-radius: var(--r-pill); padding: 4px; }
.sr-fmt button { flex: 1; border: 0; background: transparent; color: #cfcfcf; cursor: pointer; padding: 9px;
  border-radius: var(--r-pill); font-family: var(--font-urdu); font-weight: 700; font-size: 13px; transition: background .15s, color .15s; }
.sr-fmt button.active { background: var(--tbp-red); color: #fff; }
.sr-sheet-primary .share { background: #fff; color: #0b0b0b; }
.sr-sheet-primary .share:hover { background: #ededed; }
.sr-sheet-primary { display: flex; gap: 10px; padding: 16px 20px 6px; }
.sr-sheet-primary button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; cursor: pointer; border-radius: var(--r-pill); padding: 13px; font-family: var(--font-urdu); font-weight: 700; font-size: 14.5px;
  transition: transform .12s, background .15s, color .15s; }
.sr-sheet-primary button:active { transform: scale(.96); }
.sr-sheet-primary .copy { background: var(--tbp-red); color: #fff; }
.sr-sheet-primary .copy:hover { background: var(--tbp-red-d); }
.sr-sheet-primary .dl { background: rgba(255,255,255,.09); color: #fff; border: 1px solid rgba(255,255,255,.14); }
.sr-sheet-primary .dl:hover { background: rgba(255,255,255,.16); }
.sr-sheet-primary svg { width: 16px; height: 16px; }
.sr-sheet-div { display: flex; align-items: center; gap: 12px; padding: 12px 22px 4px; }
.sr-sheet-div span { flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.sr-sheet-div b { font-family: var(--font-urdu); font-weight: 600; font-size: 11.5px; color: #7a7a7a; }
.sr-sheet-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; padding: 12px 20px 22px; }
.sr-sheet-row a { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none;
  font-family: var(--font-urdu); font-size: 10.5px; color: #9a9a9a; transition: color .15s; }
.sr-sheet-row a:hover { color: #fff; }
.sr-sheet-row .ic { width: 46px; height: 46px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .15s; }
.sr-sheet-row a:hover .ic { transform: translateY(-2px); }
.sr-sheet-row .ic svg { width: 20px; height: 20px; color: #fff; }
.sr-sheet-row .ic.wa { background: #25d366; } .sr-sheet-row .ic.x { background: #1a1a1a; border:1px solid #333; }
.sr-sheet-row .ic.fb { background: #1877f2; } .sr-sheet-row .ic.tg { background: #2aabee; }
