/* Top 10 Movies Today / Top 10 Series Today below 992 px: one row of poster cards.
 * From 992 px the original sections are shown instead (Rio, 2026-12-02: "for
 * desktop keep the orignal designs"), so nothing here styles a desktop.
 *
 * sections/top-today.blade.php; plan docs/plans/top-ten-of-the-day.md; ADR 0039.
 * An override file (ADR 0001): the Streamit template's CSS is not edited.
 *
 * Rio, 2026-12-02: "keep this Badge but this time be with the real number";
 * "don't let these new designs be so foreign ... keep the same theme and feeling
 * we don't want to feel ai slopy"; "all the homepage section should be having a
 * clean minimal spacing".
 *
 * So nothing here is a new look. Every value was read off the rendered site
 * (headless Edge, getComputedStyle, 2026-12-02) and is named with where it came from:
 *   the card     = the series "All Episode" panel (.tab-block): #141314, radius 8,
 *                  no border, no shadow; its thumbnails radius 4; titles 16px/500
 *                  white, capitalised; the runtime line .episode-time with ph-clock
 *   the tags     = .movie-tag: a 5.25 px #1A98FF dot between items
 *   the arrows   = the rails' swiper arrows: 30 px, transparent, 1 px solid #fff, round
 *   the heading  = the rails' h4.main-title row
 *   the crest    = trending-label.webp, rebuilt in CSS to carry the real rank
 *   the spacing  = every rail's .swiper margin-bottom (pages/_swiper.scss)
 */
.jambo-top-today {
  --jtt-muted: rgba(255, 255, 255, .66);
  --jtt-faint: rgba(255, 255, 255, .5);
  --w: clamp(272px, 84vw, 440px);
  /* The page's rhythm is every rail's `.swiper { margin-bottom }`: 3.125em up to
     1024, 1.875em at 767 and below (50 / 30 px). The same values at the same
     breakpoints; the track's 8 px bottom padding is part of it. */
  --after: 3.125em;
  position: relative;
  padding-bottom: calc(var(--after) - 8px);
}
@media (max-width: 767px) { .jambo-top-today { --after: 1.875em; } }

/* ---- the heading row: the rails' own; the arrows where other rails put "View All".
   The controls take no height of their own: the 30 px arrows sit centred on the
   heading without making the row taller than it (a phone's h4 is 21 px, and a
   30 px row put the heading 5 px off the rails' rhythm). */
.jtt-controls { display: flex; align-items: center; gap: 8px; height: 0; }
.jtt-ctl {
  position: relative; width: 30px; height: 30px; padding: 0;
  display: inline-grid; place-items: center; border-radius: 50%;
  background: transparent; border: 1px solid #fff; color: #fff; font-size: 14px;
  touch-action: manipulation; cursor: pointer;
}
.jtt-ctl::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; } /* 44 px to touch */
.jtt-ctl:disabled { opacity: .35; cursor: default; }
.jtt-ctl:focus-visible { outline: 2px solid var(--bs-primary); outline-offset: 2px; }

/* ---- the row: the card in focus in the middle, the neighbours peeking */
.jtt-track {
  display: flex; gap: 12px; margin: 0;
  padding: 4px calc((100% - var(--w)) / 2) 8px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none;
}
.jtt-track::-webkit-scrollbar { display: none; }
.jtt-card { flex: 0 0 var(--w); scroll-snap-align: center; container-type: inline-size; }
/* Tablets: the neighbours are wide enough to carry text, so they fade at the
   screen edges instead of being cut. */
@media (min-width: 640px) {
  .jtt-track { -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%);
               mask-image: linear-gradient(90deg, transparent 0, #000 14%, #000 86%, transparent 100%); }
}

/* ---- the card: the episodes panel's surface. The slide is the snap target and never
   moves; the visual card is this inner box (a snap area is the transformed box). */
.jtt-card__in {
  position: relative; height: 100%;
  display: grid; grid-template-columns: 38% minmax(0, 1fr); gap: 14px;
  padding: 8px; border-radius: 8px; background: var(--bs-gray-900);
}
.jtt-card__media { position: relative; }
/* Series mirror the card: the poster on the right, its crest on the outer corner
   (Rio, 2026-12-02: "for the series we need to show the image on the right and keep
   for the movies on the left"). Only the placement moves; the reading order is the
   markup's, the same as a movie card's. */
.jambo-top-today[data-kind="series"] .jtt-card__in { grid-template-columns: minmax(0, 1fr) 38%; }
.jambo-top-today[data-kind="series"] .jtt-card__media { grid-column: 2; grid-row: 1; }
.jambo-top-today[data-kind="series"] .jtt-card__body { grid-column: 1; grid-row: 1; padding: 4px 0 2px 4px; }
.jambo-top-today[data-kind="series"] .jtt-badge { left: auto; right: 6px; }
.jtt-card__poster { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 4px; background: #0b0b0c; }
.jtt-card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 4px 4px 2px 0; }
.jtt-card__title {
  margin: 0; color: #fff; font-size: 16px; font-weight: 500; line-height: 1.3; text-transform: capitalize;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .2s ease;
}
/* The whole card is the title's link (Bootstrap's .stretched-link); its focus ring
   is drawn on the card it covers, not around the title's text. */
.jtt-card__title a { color: inherit; text-decoration: none; }
.jtt-card__title a:focus-visible { outline: none; }
.jtt-card__title a:focus-visible::after { outline: 2px solid var(--bs-primary); outline-offset: 2px; border-radius: 8px; }
@media (hover: hover) { .jtt-card:hover .jtt-card__title { color: var(--bs-primary); } } /* the site's link hover */
.jtt-popular { margin: 0; color: var(--jtt-muted); font-size: 13px; font-weight: 600; }
/* .movie-tag's dots, as .verticle-slider draws them (scoped there, so restated here),
   at the same spacing: 0.7875em, the dot (0.375em), 0.5625em. Each dot is drawn before
   the tag it leads to rather than after the one it follows, so a tag that wraps out of
   the one line takes its dot with it: no line ends on a dot ("2026 • Comedy •"). */
.jtt-tags { flex-wrap: wrap; max-height: 20px; overflow: hidden; line-height: 20px; color: var(--bs-body-color); font-size: 13px; font-weight: 600; letter-spacing: .02em; text-transform: capitalize; }
.jtt-tags li { position: relative; }
.jtt-tags li + li { padding-left: 1.725em; }
.jtt-tags li + li::before { content: ""; position: absolute; top: 50%; left: .7875em; width: .375em; height: .375em; border-radius: 50%; background: var(--bs-primary); transform: translateY(-50%); }
.jtt-time { color: var(--bs-body-color); font-size: 13px; line-height: 18px; }
.jtt-time i { font-size: 14px; }
.jtt-card__syn { display: none; margin: 0; color: var(--bs-body-color); font-size: 14px; line-height: 20px; }
.jtt-extra { margin-top: auto; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.jtt-extra__label { color: var(--jtt-faint); font-size: 12px; line-height: 16px; }
.jtt-extra__row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.jtt-stack { display: flex; flex: none; }
.jtt-stack > * {
  width: 30px; height: 30px; flex: none; border-radius: 50%; object-fit: cover;
  background: #2a292a; color: #fff; box-shadow: 0 0 0 2px var(--bs-gray-900);
  display: inline-grid; place-items: center; font-size: 11px; font-weight: 600;
}
.jtt-stack > * + * { margin-left: -9px; }
.jtt-stack--seasons > * { border-radius: 4px; } /* the panel's thumbnail radius: content, not people */
.jtt-extra__text { color: #fff; font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.jtt-eps { display: none; }

/* ---- the site's Top crest (trending-label.webp, 72 px), rebuilt so it can carry the
   real rank. All in em of --s / 4.5, so the original's proportions hold at any size. */
.jtt-badge {
  --s: 40px;
  position: absolute; top: 6px; left: 6px; z-index: 1;
  width: var(--s); height: var(--s); padding: .375em; box-sizing: border-box;
  font-size: calc(var(--s) / 4.5); border-radius: .5em;
  /* Sampled off the image: a 1 px dark edge (#836910), bright on top (#FFEE7A),
     deeper at the middle of the sides (#D4AD4B), bright again at the bottom (#FAE173) */
  background: linear-gradient(180deg, #FFEE7A 0%, #E4C55E 28%, #D4AD4B 52%, #CCAE52 78%, #FAE173 100%);
  box-shadow: inset 0 0 0 .0625em #836910;
  display: grid;
}
.jtt-badge__in {
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
  border-radius: .25em;
  background: linear-gradient(180deg, #474747 0%, #2D2D2D 55%, #0A0A0A 100%);
  box-shadow: inset 0 0 0 .0625em #0B0800, inset 0 0 0 .125em rgba(223, 197, 104, .55);
}
.jtt-badge__top { color: #fff; font-size: 1.05em; font-weight: 500; }
.jtt-badge__num { margin-top: .08em; color: #DFC568; font-size: 1.7em; font-weight: 700; }

@container (max-width: 300px) {
  .jtt-card__in { gap: 10px; }
  .jtt-card__title { font-size: 15px; }
  .jtt-tags, .jtt-time, .jtt-extra__text { font-size: 12px; }
  .jtt-stack > * { width: 26px; height: 26px; }
  .jtt-badge { --s: 36px; }
}
@container (min-width: 370px) { .jtt-eps { display: inline; } }
@container (min-width: 400px) {
  .jtt-card__title { font-size: 18px; }
  .jtt-card__body { gap: 8px; padding-top: 8px; }
  .jtt-stack > * { width: 34px; height: 34px; }
  .jtt-badge { --s: 46px; top: 8px; left: 8px; }
  .jambo-top-today[data-kind="series"] .jtt-badge { right: 8px; }
}
@container (min-width: 420px) {
  .jtt-card__syn { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---- the focus: the focused card is whole, the rest sit back. Decorative, so
   progressive and motion-gated (modern-web-guidance: carousel-slide-effects). */
@keyframes jtt-focus {
  0%, 100% { scale: .92; opacity: .55; }
  42%, 58% { scale: 1; opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  @supports ((animation-timeline: view()) and (animation-range: entry)) {
    .jtt-card__in { animation: jtt-focus linear both; animation-timeline: view(inline); }
  }
}
