/* Standalone styling for the static per-show pages and the /shows/
   browse index. Intentionally light — no Google Fonts, no jQuery, no
   dependency on the marketing-site shell. Optimized for fast First
   Contentful Paint since these are SEO landing destinations. */

* { box-sizing: border-box; }

:root {
  --bg: #0b0d12;
  --bg-2: #131722;
  --panel: #1a1f2e;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e6e8ee;
  --muted: #9aa3b5;
  --accent: #7aa2ff;
  --accent-2: #5cd1c5;
  --gold: #f5c518; /* the Rising Shows app's amber accent; footer links match it */
  --curve-line: #7aa2ff;
  --curve-area: rgba(122, 162, 255, 0.18);
  --shape: #1f2c4d;
  --shape-text: #c8d4f6;
}

html, body { margin: 0; padding: 0; }

/* Visible page scrollbar. With meta color-scheme:dark Chrome paints a dark
   native scrollbar that vanishes against the dark page; style it explicitly
   so it reads clearly. Mirrors the .cast-list treatment below. */
html {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
html::-webkit-scrollbar { width: 10px; }
html::-webkit-scrollbar-track { background: transparent; }
html::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28); border-radius: 999px;
}
html::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.45); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); }
a:hover { color: #a3c0ff; }

.skip-link {
  position: absolute; left: -9999px; top: -9999px;
  background: var(--accent); color: #0b0d12; padding: 8px 12px; border-radius: 4px;
}
.skip-link:focus { left: 12px; top: 12px; z-index: 1000; }

.page-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg-2);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.brand {
  font-weight: 600; font-size: 17px; text-decoration: none; color: var(--text);
  display: inline-flex; align-items: center; gap: 8px;
}
.page-header-right { display: flex; align-items: center; gap: 20px; }
.page-nav { display: flex; gap: 18px; }
.page-nav a { text-decoration: none; color: var(--muted); font-size: 14px; }
.page-nav a:hover, .page-nav a[aria-current="page"] { color: var(--text); }

.header-launch-btn {
  display: inline-block; padding: 7px 14px; border-radius: 8px;
  background: var(--accent-2); color: #0b1814;
  text-decoration: none; font-size: 13px; font-weight: 600;
  white-space: nowrap; flex-shrink: 0;
}
.header-launch-btn:hover { background: #7de8db; color: #0b1814; }

main { max-width: 1080px; margin: 0 auto; padding: 24px; }

.crumbs {
  font-size: 13px; color: var(--muted); margin-bottom: 20px;
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); text-decoration: underline; }

/* --- Show hero --- */
.show-hero {
  display: grid; grid-template-columns: 220px 1fr; gap: 28px;
  margin-bottom: 32px;
}
.show-poster {
  width: 220px; height: auto; border-radius: 10px; display: block;
  background: var(--panel); box-shadow: 0 12px 36px rgba(0,0,0,0.45);
}
.poster-placeholder {
  width: 220px; height: 330px;
  background: linear-gradient(135deg, #1f2c4d 0%, #2d1f4d 100%);
  border-radius: 10px;
}

/* Sensitive (adult) poster — CSS-only blur + click-to-reveal. These static
   pages carry no app JS, so the reveal is a hidden checkbox toggled by the
   overlay label. The overlay is light: a small corner badge flags the content
   and a centred "Tap to reveal" pill is the action, so the blurred artwork
   stays visible for context. Social/search previews are handled server-side
   (the poster is swapped for the neutral site card, which can't be blurred). */
.poster-sensitive {
  position: relative;
  display: inline-block;
  line-height: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45);
}
.poster-sensitive > img {
  display: block;
  box-shadow: none;
  border-radius: 0;
  filter: blur(16px);
  transform: scale(1.08);
}
.poster-reveal-toggle {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}
.poster-reveal-toggle:checked ~ img {
  filter: none;
  transform: none;
}
.poster-reveal {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  cursor: pointer;
  transition: background 0.18s ease;
}
.poster-reveal:hover { background: rgba(7, 9, 15, 0.22); }
.poster-reveal-toggle:checked ~ .poster-reveal { display: none; }
.poster-reveal-toggle:focus-visible ~ .poster-reveal {
  outline: 2px solid var(--gold);
  outline-offset: -3px;
}

/* Corner flag. */
.poster-reveal-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(7, 9, 15, 0.7);
  color: rgba(255, 255, 255, 0.9);
  line-height: 0;
}
.poster-reveal-badge svg { width: 15px; height: 15px; }

/* Prominent action pill. */
.poster-reveal-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(13, 15, 20, 0.82);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.poster-reveal:hover .poster-reveal-cta {
  background: var(--gold);
  color: #1a1500;
  border-color: var(--gold);
}

/* Compact variant — related-shows thumbnails: corner badge only. */
.poster-sensitive-sm { border-radius: 8px; box-shadow: none; }
.poster-sensitive-sm > img { filter: blur(12px); transform: scale(1.12); }
.poster-sensitive-sm .poster-reveal-cta { display: none; }
.poster-sensitive-sm .poster-reveal-badge { top: 4px; left: 4px; width: 18px; height: 18px; }
.poster-sensitive-sm .poster-reveal-badge svg { width: 11px; height: 11px; }
.show-meta h1 {
  font-size: clamp(28px, 4.5vw, 40px); margin: 0 0 6px; line-height: 1.15;
}
.show-year { color: var(--muted); font-weight: 400; }
.show-genres { color: var(--muted); margin: 0 0 14px; font-size: 14px; }
.show-overview { margin: 0 0 18px; max-width: 60ch; }

.show-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px 24px;
  margin: 0 0 22px;
}
.show-stats > div { border-left: 2px solid var(--border); padding-left: 12px; }
.show-stats dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.show-stats dd { margin: 2px 0 0; font-size: 15px; }
.show-stats .muted { color: var(--muted); font-size: 13px; }

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.primary-btn, .secondary-btn, .app-btn {
  display: inline-block; padding: 10px 16px; border-radius: 8px;
  text-decoration: none; font-size: 14px; font-weight: 500;
}
.primary-btn { background: var(--accent); color: #0b0d12; }
.primary-btn:hover { background: #a3c0ff; color: #0b0d12; }
.app-btn {
  background: transparent; color: var(--accent-2);
  border: 1.5px solid var(--accent-2);
}
.app-btn:hover { background: rgba(92, 209, 197, 0.12); color: var(--accent-2); }
.secondary-btn { background: var(--panel); color: var(--text); border: 1px solid var(--border); }
.secondary-btn:hover { background: #232838; }

/* --- Seasons --- */
.seasons h2 { font-size: 22px; margin: 0 0 16px; }
.season-section {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
}
.season-head { margin-bottom: 12px; }
.season-head h3 { margin: 0 0 6px; font-size: 18px; }
.season-head h3 .muted { color: var(--muted); font-weight: 400; }
.season-summary {
  margin: 0; color: var(--muted); font-size: 14px;
  display: flex; gap: 18px; flex-wrap: wrap;
}
.season-summary strong { color: var(--text); }

.season-shapes {
  list-style: none; margin: 10px 0 0; padding: 0;
  display: flex; gap: 6px; flex-wrap: wrap;
}
.season-shapes li { display: contents; }
.shape-badge {
  background: var(--shape); color: var(--shape-text);
  padding: 3px 10px; border-radius: 999px; font-size: 12px;
  text-decoration: none; display: inline-block;
}
a.shape-badge:hover {
  background: #2a3e6a; color: #e0eaff;
}

.season-curve {
  display: block; width: 100%; height: auto; margin: 14px 0;
  background: var(--bg-2); border-radius: 8px;
}
.season-curve .curve-line {
  fill: none; stroke: var(--curve-line); stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.season-curve .curve-area { fill: var(--curve-area); stroke: none; }
.season-curve .curve-dots circle { fill: var(--curve-line); }

.episode-table {
  width: 100%; border-collapse: collapse; font-size: 14px;
  margin-top: 6px;
}
.episode-table caption { text-align: left; color: var(--muted); padding: 6px 0; font-size: 13px; }
.episode-table th, .episode-table td {
  text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--border);
}
.episode-table th { color: var(--muted); font-weight: 500; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.episode-table td:first-child, .episode-table th:first-child { width: 50px; color: var(--muted); }
.episode-table td:nth-child(3), .episode-table td:nth-child(4),
.episode-table th:nth-child(3), .episode-table th:nth-child(4) { text-align: right; }
.episode-table td strong { color: var(--text); }

.page-footer-meta {
  margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 14px;
}
.page-footer-meta a { color: var(--accent); }

.page-footer {
  max-width: 1080px; margin: 36px auto 60px; padding: 24px;
  color: var(--muted); font-size: 13px;
  border-top: 1px solid var(--border);
}
.page-footer a { color: var(--muted); }
.page-footer a:hover { color: var(--text); }

.footer-more { margin-bottom: 18px; }
.footer-more-heading {
  margin: 0 0 10px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted); font-weight: 600;
}
.footer-more ul {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 6px 18px;
}
.footer-more li a {
  display: block; padding: 6px 0; text-decoration: none; color: var(--text);
  border-bottom: 1px solid transparent;
}
.footer-more li a:hover { color: var(--accent); }
.footer-more li a strong { font-weight: 600; }
.footer-more li a span { color: var(--muted); font-size: 12px; }
.page-footer .copyright { margin: 0; text-align: center; font-size: 12px; }

/* Data-source attribution (TMDB logo + disclaimer, JustWatch, IMDb).
   Required by the TMDB API terms. */
.page-footer .data-attribution {
  margin: 0 0 14px; text-align: center; font-size: 11.5px; color: var(--muted);
}
.page-footer .data-attribution .tmdb-logo {
  height: 13px; width: auto; vertical-align: middle; opacity: 1;
}
.page-footer .data-attribution p { margin: 6px auto 0; max-width: 640px; line-height: 1.5; }
.page-footer .data-attribution a { color: var(--gold); text-decoration: underline; }
.page-footer .data-attribution a:hover { color: var(--text); }

/* --- Shows browse index --- */
.shows-index .index-hero { margin-bottom: 20px; }
.shows-index .index-hero h1 { margin: 0 0 8px; font-size: clamp(28px, 4vw, 36px); }
.shows-index .lede { color: var(--muted); margin: 0; }

.alpha-jump {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 18px 0 26px; padding: 12px 16px;
  background: var(--panel); border-radius: 10px; border: 1px solid var(--border);
}
.alpha-jump a {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  text-decoration: none; font-weight: 500; font-size: 14px;
  background: var(--bg-2); color: var(--text);
}
.alpha-jump a:hover { background: var(--shape); }

.alpha-group { margin-bottom: 28px; }
.alpha-group h2 {
  margin: 0 0 10px; font-size: 22px; padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.shows-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 4px 16px;
}
.shows-list li a {
  display: inline-block; width: fit-content; padding: 6px 0; text-decoration: none;
  color: var(--text); border-bottom: 1px solid transparent;
}
.shows-list li a:hover { color: var(--accent); }
.shows-list .muted { color: var(--muted); font-size: 13px; }

.index-footer { margin-top: 28px; color: var(--muted); font-size: 14px; }

/* --- Freshness line --- */
.hero-freshness {
  margin: 10px 0 0; font-size: 13px; color: var(--muted);
}

/* --- Season jump nav (Feature 8) --- */
.season-jump-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 20px;
  padding: 10px 14px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.season-jump-nav a {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-2);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.season-jump-nav a:hover {
  background: var(--shape);
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Related shows --- */
.related-shows {
  margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--border);
}
.related-shows h2 { font-size: 20px; margin: 0 0 14px; }
.rec-strip {
  display: flex; gap: 14px; flex-wrap: wrap;
}
.rec-card {
  display: flex; flex-direction: column; gap: 8px;
  text-decoration: none; color: var(--text);
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; width: 108px;
  transition: border-color 0.15s;
}
.rec-card:hover { border-color: var(--accent); color: var(--text); }
.rec-poster {
  width: 108px; height: 162px; object-fit: cover; display: block;
  background: var(--panel);
}
.rec-poster-placeholder {
  width: 108px; height: 162px;
  background: linear-gradient(135deg, #1f2c4d 0%, #2d1f4d 100%);
}
.rec-info {
  padding: 6px 8px 8px; display: flex; flex-direction: column; gap: 4px;
}
.rec-title { font-size: 12px; font-weight: 500; line-height: 1.3; }
.rec-year { color: var(--muted); font-weight: 400; }
.rec-shape-badge { font-size: 11px; }
.rec-see-all { margin: 14px 0 0; font-size: 14px; }

/* --- Cast strip --- */
.show-cast {
  margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--border);
}
.show-cast h2 { font-size: 20px; margin: 0 0 14px; }
.cast-list {
  display: flex; gap: 14px; overflow-x: auto;
  margin: 0; padding: 4px 0 10px; list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.cast-list::-webkit-scrollbar { height: 6px; }
.cast-list::-webkit-scrollbar-track { background: transparent; }
.cast-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18); border-radius: 999px;
}
.cast-card { flex: 0 0 90px; }
.cast-card-inner {
  display: flex; flex-direction: column; gap: 6px; text-align: center;
  text-decoration: none; color: var(--text);
  transition: transform 0.15s;
}
a.cast-card-inner:hover { transform: translateY(-2px); color: var(--text); }
a.cast-card-inner:hover .cast-name { color: var(--accent); }
.cast-photo {
  width: 90px; aspect-ratio: 2 / 3; border-radius: 10px;
  background: var(--panel); position: relative; overflow: hidden;
  box-shadow: 0 0 0 1px var(--border) inset;
}
.cast-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cast-photo-fallback {
  position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; font-size: 24px; font-weight: 600;
  color: var(--muted);
  background: linear-gradient(135deg, #1f2c4d 0%, #2d1f4d 100%);
}
.cast-name {
  font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cast-character {
  font-size: 12px; color: var(--muted); line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* --- Sticky CTA banner --- */
.sticky-cta-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--bg-2); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0,0,0,0.4);
}
.sticky-cta-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 10px 24px;
}
.sticky-cta-title { font-size: 14px; font-weight: 500; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sticky-cta-badge { flex-shrink: 0; }
.sticky-cta-btn { flex-shrink: 0; padding: 8px 14px; font-size: 13px; }
.sticky-cta-close {
  background: none; border: none; color: var(--muted); font-size: 20px;
  cursor: pointer; padding: 0 4px; line-height: 1; flex-shrink: 0;
}
.sticky-cta-close:hover { color: var(--text); }

/* Lift the shared back-to-top button above the fixed CTA banner while it is
   shown, so the 44px circle never lands on the banner. Scoped with :has() so
   the button drops back to its default corner once the banner is dismissed
   (the dismiss handler sets the banner's [hidden] attribute). The offset is
   the banner's rendered height (~57px desktop) plus a small gap. */
body:has(.sticky-cta-banner:not([hidden])) .back-to-top,
body:has(.sticky-cta-banner:not([hidden])) .back-to-top:link,
body:has(.sticky-cta-banner:not([hidden])) .back-to-top:visited,
body:has(.sticky-cta-banner:not([hidden])) .back-to-top:hover,
body:has(.sticky-cta-banner:not([hidden])) .back-to-top:focus,
body:has(.sticky-cta-banner:not([hidden])) .back-to-top:active,
body:has(.sticky-cta-banner:not([hidden])) .back-to-top:hover:active {
  bottom: calc(57px + env(safe-area-inset-bottom, 0px) + 0.75rem);
}

/* --- Mobile --- */
@media (max-width: 700px) {
  main { padding: 16px; }
  .show-hero { grid-template-columns: 1fr; gap: 18px; }
  .show-poster, .poster-placeholder { width: 160px; }
  .episode-table { font-size: 13px; }
  .episode-table th, .episode-table td { padding: 6px 8px; }
  .sticky-cta-inner { padding: 10px 16px; gap: 8px; }
  .sticky-cta-title { font-size: 13px; }
  .page-nav { display: none; }
  .page-header { padding: 10px 16px; }
}
