/* TayTV Guides + contrast guard
   Keeps dark interactive surfaces readable while preserving the shared TayTV system. */

/* ---------- Contrast guard for the Games family ---------- */
body[data-page="games"] .site-header,
body[data-page="games"] .site-header a,
body[data-page="games"] .site-header button,
body[data-page="games"] .site-header .desktop-nav a,
body[data-page="games"] .site-header .icon-button {
  color: #17161c;
}

body[data-page="games"] .site-header .brand,
body[data-page="games"] .site-header .brand small {
  color: #17161c;
}

body[data-page="games"] .site-header .brand i {
  background: #17161c;
  color: #fff8e9;
}

body[data-page="games"] .publisher-content {
  position: relative;
  z-index: 2;
  margin-block: clamp(3rem, 7vw, 7rem);
  padding: clamp(2rem, 5vw, 4.5rem);
  border: 1px solid rgba(23, 22, 28, 0.13);
  border-radius: clamp(1.25rem, 3vw, 2.25rem);
  background:
    radial-gradient(circle at 100% 0%, rgba(183, 168, 229, 0.18), transparent 24rem),
    radial-gradient(circle at 0% 100%, rgba(214, 181, 92, 0.12), transparent 22rem),
    #fffaf0;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.28);
  color: #17161c;
}

body[data-page="games"] .publisher-content :where(h1,h2,h3,h4,strong,a,p,li,span,time,small) {
  color: inherit;
}

body[data-page="games"] .publisher-content .eyebrow,
body[data-page="games"] .publisher-content__meta,
body[data-page="games"] .publisher-content__meta :where(a,span,time) {
  color: #4a4650;
}

body[data-page="games"] .publisher-content__lede {
  color: #29262e;
}

body[data-page="games"] .publisher-content__card,
body[data-page="games"] .publisher-list li,
body[data-page="games"] .static-directory {
  border-color: rgba(23, 22, 28, 0.16);
  background: rgba(255, 255, 255, 0.68);
  color: #17161c;
}

body[data-page="games"] .publisher-content a {
  text-decoration-color: rgba(23, 22, 28, 0.48);
}

body[data-page="games"] .publisher-content a:hover {
  text-decoration-color: currentColor;
}

/* The dark game runtime can keep light text; only its light sticky header is forced dark above. */
body[data-page="games"][data-game] .game-runtime,
body[data-page="games"][data-game] .game-runtime :where(h1,h2,h3,p,span,strong,small,label,output,summary) {
  color: inherit;
}

/* ---------- Guide system ---------- */
.guide-page {
  --guide-ink: #17161c;
  --guide-soft: #57515d;
  --guide-paper: #f6f0e5;
  --guide-surface: #fffaf2;
  --guide-night: #11121a;
  --guide-lilac: #b7a8e5;
  --guide-gold: #d6b55c;
  --guide-sky: #8ebbd0;
  background: var(--guide-paper);
  color: var(--guide-ink);
}

.guide-page .site-header,
.guide-page .site-header a,
.guide-page .site-header button {
  color: var(--guide-ink);
}

.guide-shell {
  width: min(1160px, calc(100% - 3rem));
  margin-inline: auto;
}

.guide-reading {
  width: min(790px, calc(100% - 3rem));
  margin-inline: auto;
}

.guide-hero {
  position: relative;
  overflow: clip;
  padding: clamp(5rem, 10vw, 9rem) 0 clamp(4rem, 8vw, 7rem);
  background:
    radial-gradient(circle at 88% 14%, rgba(183, 168, 229, 0.38), transparent 24rem),
    radial-gradient(circle at 12% 82%, rgba(142, 187, 208, 0.25), transparent 28rem),
    #f6f0e5;
}

.guide-hero::after {
  position: absolute;
  inset: auto 5% 0 auto;
  width: 24rem;
  height: 24rem;
  border: 1px solid rgba(23,22,28,.12);
  border-radius: 50%;
  content: "";
  transform: translateY(54%);
}

.guide-kicker,
.guide-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.guide-kicker {
  margin-bottom: 1.25rem;
  color: #514c56;
}

.guide-hero h1 {
  max-width: 13ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 9vw, 8rem);
  font-weight: 500;
  letter-spacing: -.07em;
  line-height: .88;
}

.guide-hero h1 em {
  color: #7752a3;
  font-weight: 400;
}

.guide-hero__intro {
  max-width: 48rem;
  margin: 2rem 0 0;
  color: #3e3943;
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  line-height: 1.75;
}

.guide-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 2rem;
}

.guide-pills {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: 2rem;
}

.guide-pills span {
  padding: .45rem .75rem;
  border: 1px solid rgba(23,22,28,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.45);
  font-family: var(--font-mono);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.guide-section {
  padding-block: clamp(4rem, 8vw, 7rem);
}

.guide-section--night {
  background:
    radial-gradient(circle at 15% 12%, rgba(183,168,229,.12), transparent 22rem),
    radial-gradient(circle at 90% 72%, rgba(142,187,208,.11), transparent 25rem),
    var(--guide-night);
  color: #f8f4eb;
}

.guide-section--night :where(p,li) {
  color: #d8d3dc;
}

.guide-section__head {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(16rem,.42fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: end;
  margin-bottom: clamp(2.25rem, 5vw, 4rem);
}

.guide-section__head h2,
.guide-reading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 5vw, 5rem);
  font-weight: 500;
  letter-spacing: -.055em;
  line-height: .95;
}

.guide-section__head > p {
  margin: 0;
  color: #5b5660;
  line-height: 1.75;
}

.guide-section--night .guide-section__head > p {
  color: #c8c3cd;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(12,minmax(0,1fr));
  gap: 1rem;
}

.guide-card {
  grid-column: span 4;
  min-height: 22rem;
  padding: clamp(1.4rem, 3vw, 2rem);
  border: 1px solid rgba(23,22,28,.14);
  border-radius: 1.4rem;
  background: rgba(255,250,242,.86);
  box-shadow: 0 18px 60px rgba(23,22,28,.07);
  color: #17161c;
}

.guide-card--wide { grid-column: span 6; }
.guide-card--full { grid-column: 1 / -1; }

.guide-card__number {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  place-content: center;
  margin-bottom: 3rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 800;
}

.guide-card h3 {
  margin: 0 0 .9rem;
  font-family: var(--font-display);
  font-size: clamp(2rem, 3vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -.04em;
}

.guide-card p {
  color: #4d4852;
  line-height: 1.75;
}

.guide-card a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.guide-reading {
  padding-block: clamp(3rem, 7vw, 6rem);
}

.guide-reading > p,
.guide-reading > ul,
.guide-reading > ol {
  color: #38343d;
  font-size: 1.03rem;
  line-height: 1.85;
}

.guide-reading h2 {
  margin-top: 3.6rem;
  margin-bottom: 1.2rem;
  font-size: clamp(2.2rem, 4vw, 3.8rem);
}

.guide-reading h3 {
  margin-top: 2.5rem;
  margin-bottom: .8rem;
  font-size: 1.35rem;
}

.guide-callout {
  margin-block: 2.5rem;
  padding: 1.5rem;
  border-left: 4px solid #7752a3;
  border-radius: 0 1rem 1rem 0;
  background: #fffaf2;
  box-shadow: 0 14px 40px rgba(23,22,28,.06);
}

.guide-callout strong {
  display: block;
  margin-bottom: .35rem;
}

.guide-sources {
  margin-top: 4rem;
  padding: 2rem;
  border: 1px solid rgba(23,22,28,.14);
  border-radius: 1.25rem;
  background: #fffaf2;
}

.guide-sources h2 {
  margin-top: 0;
  font-size: 2rem;
}

.guide-sources li + li { margin-top: .8rem; }

/* ---------- Stadium production visual ---------- */
.production-stack {
  display: grid;
  gap: .75rem;
  margin-block: 2.5rem;
}

.production-layer {
  display: grid;
  grid-template-columns: 9rem minmax(0,1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 1rem;
  background: rgba(255,255,255,.055);
}

.production-layer b {
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.production-layer span {
  color: #d8d3dc;
}

.cue-board {
  display: grid;
  grid-template-columns: repeat(4,minmax(0,1fr));
  gap: .75rem;
  margin-top: 2rem;
}

.cue {
  min-height: 12rem;
  padding: 1.1rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 1rem;
  background: rgba(255,255,255,.055);
}

.cue i {
  display: block;
  width: .75rem;
  height: .75rem;
  margin-bottom: 2.8rem;
  border-radius: 50%;
  background: var(--cue,#b7a8e5);
  box-shadow: 0 0 24px var(--cue,#b7a8e5);
}

.cue strong { display: block; margin-bottom: .4rem; }
.cue p { margin: 0; font-size: .86rem; line-height: 1.6; }

/* ---------- Metadata map ---------- */
.metadata-demo {
  display: grid;
  grid-template-columns: .75fr 1.25fr;
  gap: 1rem;
  margin-block: 2.5rem;
}

.metadata-release,
.metadata-fields {
  padding: 1.5rem;
  border: 1px solid rgba(23,22,28,.14);
  border-radius: 1.25rem;
  background: #fffaf2;
}

.metadata-disc {
  display: grid;
  width: 10rem;
  aspect-ratio: 1;
  place-content: center;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle,rgba(255,255,255,.13) 0 1px,transparent 1px 5px),
    #17161c;
  color: #fff8e9;
  text-align: center;
}

.metadata-disc span {
  display: grid;
  width: 4.5rem;
  aspect-ratio: 1;
  place-content: center;
  border-radius: 50%;
  background: #b7a8e5;
  color: #17161c;
  font-family: var(--font-mono);
  font-weight: 900;
}

.metadata-fields dl { margin: 0; }
.metadata-fields div {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1rem;
  padding-block: .8rem;
  border-bottom: 1px solid rgba(23,22,28,.1);
}
.metadata-fields div:last-child { border-bottom: 0; }
.metadata-fields dt { font-weight: 850; }
.metadata-fields dd { margin: 0; color: #514c56; }

/* ---------- Source Detective ---------- */
.detective-shell {
  width: min(900px,calc(100% - 3rem));
  margin-inline: auto;
  padding-block: clamp(3rem,7vw,6rem);
}

.detective-game {
  padding: clamp(1.4rem,4vw,2.5rem);
  border: 1px solid rgba(23,22,28,.14);
  border-radius: 1.5rem;
  background: #fffaf2;
  box-shadow: 0 20px 60px rgba(23,22,28,.09);
}

.detective-score {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.detective-case {
  padding: 1.25rem;
  border-radius: 1rem;
  background: #f0eadf;
}

.detective-case h3 {
  margin: 0 0 .65rem;
  font-size: clamp(1.6rem,3vw,2.4rem);
}

.detective-options {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: .75rem;
  margin-top: 1rem;
}

.detective-options button {
  min-height: 60px;
  border: 1px solid rgba(23,22,28,.24);
  border-radius: .9rem;
  background: #fff;
  padding: .9rem 1rem;
  text-align: left;
  font-weight: 800;
}

.detective-options button:hover { transform: translateY(-1px); }
.detective-options button.is-correct { border-color: #1f6a4a; background: #e4f2e9; }
.detective-options button.is-wrong { border-color: #9f2638; background: #f8e5e8; }

.detective-feedback {
  min-height: 4rem;
  margin: 1rem 0 0;
  color: #38343d;
  line-height: 1.65;
}

/* ---------- Palette contrast lab ---------- */
.palette-lab {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-block: 2.5rem;
}

.palette-control,
.palette-preview {
  padding: 1.5rem;
  border: 1px solid rgba(23,22,28,.14);
  border-radius: 1.25rem;
  background: #fffaf2;
}

.palette-control label { display: block; margin-top: 1rem; }
.palette-control input[type="color"] { min-height: 3.4rem; padding: .2rem; }

.palette-preview__sample {
  display: grid;
  min-height: 15rem;
  place-content: center;
  padding: 2rem;
  border-radius: 1rem;
  background: var(--palette-bg,#101117);
  color: var(--palette-fg,#fff8e9);
  text-align: center;
}

.palette-preview__sample strong {
  font-family: var(--font-display);
  font-size: clamp(2rem,5vw,4rem);
  line-height: 1;
}

.palette-result {
  margin-top: 1rem;
  padding: 1rem;
  border-radius: .9rem;
  background: #f0eadf;
}

.palette-result b { font-size: 1.4rem; }

/* ---------- Editorial promo strip ---------- */
.guide-promo {
  width: min(1160px,calc(100% - 3rem));
  margin: clamp(3rem,7vw,6rem) auto;
  padding: clamp(1.5rem,4vw,2.5rem);
  border: 1px solid rgba(23,22,28,.14);
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at 100% 0,rgba(183,168,229,.2),transparent 20rem),
    #fffaf2;
}

.guide-promo h2 {
  margin: 0 0 .8rem;
  font-family: var(--font-display);
  font-size: clamp(2.1rem,4vw,4rem);
  font-weight: 500;
  letter-spacing: -.05em;
}

.guide-promo p { max-width: 50rem; color: #4d4852; }

@media (max-width: 900px) {
  .guide-card,
  .guide-card--wide { grid-column: span 6; }
  .guide-section__head { grid-template-columns: 1fr; }
  .cue-board { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .metadata-demo,
  .palette-lab { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .guide-shell,
  .guide-reading,
  .detective-shell,
  .guide-promo { width: min(100% - 1.5rem,1160px); }
  .guide-card,
  .guide-card--wide { grid-column: 1 / -1; min-height: auto; }
  .cue-board,
  .detective-options { grid-template-columns: 1fr; }
  .production-layer,
  .metadata-fields div { grid-template-columns: 1fr; }
  body[data-page="games"] .publisher-content { width: min(100% - 1.5rem, var(--shell)); padding: 1.4rem; }
}

@media (prefers-reduced-motion: reduce) {
  .guide-page *,
  .guide-page *::before,
  .guide-page *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
