/* shorts.css — the rail card and the lightbox. docs/SHORTS.md §10
   The card is FRONT-PATTERN §4 measured, not reinterpreted: 170x283 (3:5),
   12px radius, badge bottom-left at 12/12, 10px/500 with 1px 4px padding and a
   4px radius. Only the badge's background is .7 where the big card's is .75,
   and it carries a view count instead of a duration. */

/* THE CARD IS NOT SCOPED TO ITS CONTAINER. It was, and /shorts rendered blank
   posters because every rule lived under .shstrp while that page's container is
   .shgrid — the <span> never got display:block, so it had no height at all.
   Only the SIZE belongs to the container; everything else belongs to the card. */
.shtile { position: relative; display: block; text-decoration: none; color: inherit; }
.shcov {
  position: relative;              /* the badge sits on the poster, not under the card */
  display: block; border-radius: 9px;
  background: #3a3936 center/cover no-repeat;
}
.shbadge {
  position: absolute; inset-inline-start: 6px; bottom: 6px;
  background: rgba(0,0,0,.7); color: #fff;
  font-size: 10px; font-weight: 500; line-height: 16px;
  padding: 1px 4px; border-radius: 4px;
  /* a count is a number: it must not be reordered by the paragraph around it */
  direction: ltr; unicode-bidi: isolate;
}
.shtri { font-size: 8px; }
.shtt {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; margin-top: 6px;
  font-size: 10px; font-weight: 500; line-height: 16px; color: var(--ink);
}
.shcr { display: block; font-size: 10px; line-height: 16px; color: var(--muted); }

/* the rail's size. FRONT-PATTERN §4 measured 170x283 on a 375px screen, where
   the card is one of two columns; the same pixels in a desktop rail made this
   band more than twice as tall as every neighbour — the song tiles beside it
   are 132x132. The phone keeps the measured size, further down. */
.shstrp .shtile { flex: 0 0 92px; width: 92px; }
.shstrp .shcov  { width: 92px; height: 153px; }
/* main.css sizes EVERY rail tile — `.v3 .lsect .strp > *` is flex-basis 42vw
   below 760px and 186px above it. At (0,3,0) that beat the rule above, so a
   92px poster sat inside a 186px tile and the rail looked like it had enormous
   gaps: ninety-four pixels of dead space per card, not a gap at all. */
.v3 .lsect .shstrp .shtile { flex: 0 0 92px; width: 92px; max-width: 92px; }

/* the closing tile: the operator asked for a way in at the end of the rail as
   well as the «بیشتر» in the header */
.shstrp .shall .shallin {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  width: 92px; height: 153px; border-radius: 9px;
  background: var(--wash-2); color: var(--ink);
  font-size: 13px; font-weight: 500; text-align: center;
}
.shstrp .shallar { font-size: 18px; }

/* ── the lightbox ──────────────────────────────────────────────────────── */
html.shlock, html.shlock body { overflow: hidden; }

.shov {
  position: fixed; inset: 0; z-index: 9000;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.92);
}
.shov.on { display: flex; }
.shov-box { position: relative; display: flex; flex-direction: column; align-items: center; }
.shov-v {
  display: block; max-width: 100vw; max-height: 82vh;
  background: #000; border-radius: 8px;
}
.shov-cap {
  max-width: min(92vw, 520px); margin-top: 10px; text-align: center; color: #fff;
}
.shov-cap b { display: block; font-size: 14px; font-weight: 500; line-height: 1.7; }
.shov-cap span { display: block; font-size: 12px; color: rgba(255,255,255,.62); }
.shov-x {
  position: absolute; top: 14px; inset-inline-end: 14px; z-index: 2;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; font-size: 16px; cursor: pointer;
}
.shov-x:hover { background: rgba(255,255,255,.26); }

/* share sits opposite ✕: the close button is pinned to inline-end, which in an
   rtl document is the left edge, so this takes the right. */
.shov-sh {
  position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2;
  width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.14); color: #fff; cursor: pointer;
  display: grid; place-items: center;
}
.shov-sh:hover { background: rgba(255,255,255,.26); }

/* the two tap halves. NEXT is the LEFT one: the page is rtl and the deck runs
   that way, which is also how the magazine carousel's arrows behave. They are
   real buttons so a keyboard and a screen reader reach them, but invisible —
   a shorts player with furniture over the picture is not a shorts player. */
.shov-stage { position: relative; display: block; }
.shov-z {
  position: absolute; top: 0; bottom: 0; width: 34%;
  border: 0; background: transparent; cursor: pointer; padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.shov-next { left: 0; }
.shov-prev { right: 0; }
.shov-z:focus-visible { background: rgba(255,255,255,.08); outline: none; }

/* the clipboard fallback says so here rather than in an alert() */
.shov-note {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 26px; z-index: 3; max-width: 86vw;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(0,0,0,.8); color: #fff; font-size: 12px;
  opacity: 0; transition: opacity .18s ease; pointer-events: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.shov-note.on { opacity: 1; }

/* the phone, where the pattern's own measurement belongs */
@media (max-width: 560px) {
  .v3 .lsect .shstrp .shtile { flex: 0 0 140px; width: 140px; max-width: 140px; }
  .shstrp .shtile, .shstrp .shcov, .shstrp .shall .shallin { flex-basis: 140px; width: 140px; }
  .shstrp .shcov, .shstrp .shall .shallin { height: 233px; border-radius: 12px; }
  .shstrp .shbadge { inset-inline-start: 12px; bottom: 12px; }
  .shov-v { max-height: 76vh; }
}

/* ── /shorts and /shorts/<id> ──────────────────────────────────────────── */
.shpage { max-width: 680px; margin: 0 auto; padding: 16px 12px 40px; }
.shpg-h { margin: 0 0 16px; font-size: 20px; font-weight: 700; color: var(--ink); }
.shpg-empty { color: var(--muted); font-size: 14px; }
/* the two columns FRONT-PATTERN §4 asks for; the rail is the deviation, not this */
/* two columns is the phone's shape; in a 680px column it drew 334px cards */
.shgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 12px; }
@media (max-width: 560px) { .shgrid { grid-template-columns: repeat(2, 1fr); } }
.shgrid .shtile, .shgrid .shcov { width: 100%; }
.shgrid .shcov { height: auto; aspect-ratio: 3 / 5; }
.shpg-more {
  display: block; margin: 22px auto 0; width: max-content;
  padding: 9px 20px; border-radius: 999px;
  background: var(--wash-2); color: var(--ink); font-size: 13px; text-decoration: none;
}
.shsingle .shone { width: 100%; height: auto; border-radius: 12px; background: #000; display: block; }
.shone-t { margin: 14px 0 4px; font-size: 17px; font-weight: 500; line-height: 1.7; color: var(--ink); }
.shone-c, .shone-src { font-size: 12px; color: var(--muted); }
.shone-x { margin: 10px 0 0; font-size: 14px; line-height: 2; color: var(--ink); }
.shgone { padding: 40px 0; text-align: center; color: var(--muted); font-size: 14px; }
