/*
 * Copyright 2020 Adobe. All rights reserved.
 * This file is licensed to you under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License. You may obtain a copy
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software distributed under
 * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
 * OF ANY KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */

/* Design tokens — measured from source (see migration-work/fox-design-tokens.md) */
:root {
  /* Colors (brand base is dark) */
  --background-color: #000; /* body background */
  --surface-color: #1a1a1a; /* cards / panels */
  --surface-light: #f7f4f0; /* light "Pick Your Plan" band */
  --light-color: #f1f1f1; /* light surfaces / dividers */
  --dark-color: #333; /* muted dark */
  --text-color: #fff; /* primary text on dark */
  --text-invert-color: #041129; /* text on light surfaces / CTA label (FOX One navy) */
  --text-on-light-color: #000; /* pure black on light chips (active pill) */
  --text-invert-muted-color: rgb(0 0 0 / 69%); /* muted body copy on light surfaces */
  --text-muted-color: rgb(255 255 255 / 70%); /* secondary text */
  --text-faint-color: rgb(255 255 255 / 50%); /* fine print / disclaimers */
  --border-color: #cdcfd4; /* dividers / control borders */
  --border-muted-color: #b2b2b2;
  --border-faint-color: rgb(255 255 255 / 10%); /* faint divider on dark surfaces */
  --footer-divider-color: #222b3c; /* footer app-block divider (mobile/tablet) */

  /* brand accents (measured; brand red is the FOX accent) */
  --brand-red: #d70935;
  --accent-green: #28f14a; /* savings / positive price */
  --badge-yellow: #fec800; /* "Most Popular" badge */
  --overlay-badge-bg: #656b77; /* clip duration overlay */
  --overlay-flag-bg: rgb(21 29 38 / 92%); /* "New Episode" overlay */
  --overlay-flag-pad-x: 6px; /* overlay badge horizontal padding (source) */
  --menu-surface: #222b3c; /* dropdown menu option background */
  --scrim-color: rgb(21 27 38 / 60%); /* full-screen modal scrim (mobile season picker) */
  --link-color: #fff;
  --link-hover-color: rgb(255 255 255 / 70%);

  /* header/nav colors (FOX One: black bar, near-white text) */
  --nav-background-color: #000;
  --nav-text-color: #f1f1f1;

  /* rail arrow control (source: white translucent pill) */
  --rail-control-bg: rgb(255 255 255 / 30%);
  --rail-control-bg-hover: rgb(255 255 255 / 45%);

  /* collage mosaic base tokens (cells re-scaled per viewport in cards.css) */
  --collage-rotation: -5deg;
  --collage-cell-w: 94px;
  --collage-cell-h: 128px;
  --collage-gap: 11px;

  /* dark section theme (see section metadata `theme: dark`); themes re-declare */
  --dark-section-background: #000;
  --dark-section-color: #fff;

  /* fonts */
  --body-font-family: 'FoxOneAero', roboto-fallback, helvetica, arial, sans-serif;
  --heading-font-family: 'FoxOneAero', roboto-fallback, helvetica, arial, sans-serif;
  --ui-font-family: 'FoxOneAero', roboto-fallback, helvetica, arial, sans-serif;
  --display-font-family: 'Hellix Black', 'FoxOneAero', arial-fallback, helvetica, arial, sans-serif;
  --meta-font-family: 'Inter Tight', arial-fallback, helvetica, arial, sans-serif;

  /* Body sizes (mobile-first base) */
  --body-font-size-m: 16px;
  --body-font-size-s: 14px;
  --body-font-size-xs: 12px;

  /* Heading sizes (mobile-first base) */
  --heading-font-size-xxl: 34px;
  --heading-font-size-xl: 32px;
  --heading-font-size-l: 24px;
  --heading-font-size-m: 20px;
  --heading-font-size-s: 18px;
  --heading-font-size-xs: 16px;

  /* Layout */
  --content-max-width: 1200px;
  --nav-height: 64px; /* source header bar: 64px mobile, 70px desktop (see 1024 query) */

  /* Breakpoints: Mobile <768 · Tablet 768 · Desktop 1024 · Wide 1440 */
  --breakpoint-tablet: 768px;
  --breakpoint-desktop: 1024px;
  --breakpoint-wide: 1440px;

  /* Spacing (8px grid, measured from source) */
  --space-3xs: 4px;
  --space-2xs: 8px;
  --space-xs: 12px;
  --space-s: 16px;
  --space-sm: 18px; /* half-step (hero heading -> subtitle gap) */
  --space-ml: 20px; /* half-step (source hero gap ramp 16/20/24) */
  --space-m: 24px;
  --space-l: 32px;
  --space-xl: 40px;
  --space-2xl: 48px;
  --space-3xl: 80px;
  --space-4xl: 96px;

  /* Border radius */
  --radius-xs: 2px;
  --radius-s: 4px;
  --radius-m: 5px;
  --radius-l: 8px;
  --radius-xl: 16px;
  --radius-pill: 9999px;

  /* Shadows */
  --shadow-card: -2px 6px 12px 0 rgb(0 0 0 / 80%);

  /* layered drop-shadow for floating device art (source "Inside Look" cards) */
  --shadow-float: drop-shadow(-2px 3px 9px rgb(0 0 0 / 29%))
    drop-shadow(-9px 14px 16px rgb(0 0 0 / 25%))
    drop-shadow(-19px 30px 22px rgb(0 0 0 / 15%))
    drop-shadow(-33px 55px 26px rgb(0 0 0 / 4%));

  /* Transitions */
  --transition-fast: 0.15s cubic-bezier(0, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0, 0, 0.2, 1);
  --transition-card: 0.3s cubic-bezier(0, 0, 0.2, 1); /* ease-out card hover-scale */
}

/* fallback font — Arial metrics, matches the source's *Fallback faces */
@font-face {
  font-family: arial-fallback;
  size-adjust: 100%;
  src: local('Arial'), local('ArialMT');
}

/* Tablet: 768–1023 */
@media (width >= 768px) {
  :root {
    --body-font-size-m: 18px;
    --body-font-size-s: 16px;
    --body-font-size-xs: 14px;
    --heading-font-size-xxl: 48px;
    --heading-font-size-xl: 40px;
    --heading-font-size-l: 28px;
    --heading-font-size-m: 22px;
    --heading-font-size-s: 20px;
    --heading-font-size-xs: 18px;
  }
}

/* Desktop: 1024–1439 */
@media (width >= 1024px) {
  :root {
    --nav-height: 70px; /* source header grows from 64px to 70px on desktop */
    --heading-font-size-xxl: 56px;
    --heading-font-size-xl: 44px;
    --heading-font-size-l: 32px;
    --heading-font-size-m: 24px;
  }
}

/* Wide desktop: >=1440 */
@media (width >= 1440px) {
  :root {
    --content-max-width: 1280px;
    --heading-font-size-xxl: 64px;
    --heading-font-size-xl: 48px;
  }
}

body {
  display: none;
  margin: 0;
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: var(--body-font-family);
  font-size: var(--body-font-size-m);
  line-height: 1.6;

  /* clip the ~half-scrollbar overflow from 100vw full-bleed blocks (clip keeps sticky/scroll) */
  overflow-x: clip;
}

body.appear {
  display: block;
}

header {
  height: var(--nav-height);
}

/* legal-doc template: hide nav menu + search (logo + Sign In + TV Provider remain) */
body.legal-doc header nav .nav-sections,
body.legal-doc header nav .search {
  display: none;
}

/* watch-video: player-only page — suppress header + footer entirely. */
body.watch-video header,
body.watch-video footer {
  display: none;
}

header .header,
footer .footer {
  visibility: hidden;
}

header .header[data-block-status="loaded"],
footer .footer[data-block-status="loaded"] {
  visibility: visible;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
  font-family: var(--heading-font-family);
  font-weight: 400;
  line-height: 1.1;
  scroll-margin: 40px;
}

/* h1 — Hellix Black display, uppercase (source) */
h1 {
  font-family: var(--display-font-family);
  font-size: var(--heading-font-size-xxl);
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

/* h2 — Inter Tight bold (source) */
h2 {
  font-family: var(--body-font-family);
  font-size: var(--heading-font-size-xl);
  font-weight: 700;
  line-height: 1;
}

/* h3 — FoxOneAero Bold (source) */
h3 {
  font-family: var(--ui-font-family);
  font-size: var(--heading-font-size-l);
  font-weight: 700;
}

h4 { font-size: var(--heading-font-size-m); }
h5 { font-size: var(--heading-font-size-s); }
h6 { font-size: var(--heading-font-size-xs); }

p,
dl,
ol,
ul,
pre,
blockquote {
  margin-top: 0.8em;
  margin-bottom: 0.25em;
}

code,
pre {
  font-size: var(--body-font-size-s);
}

pre {
  padding: var(--space-s);
  border-radius: var(--radius-l);
  background-color: var(--light-color);
  overflow-x: auto;
  white-space: pre;
}

main > div {
  margin: 40px 16px;
}

input,
textarea,
select,
button {
  font: inherit;
}

/* links */
a:any-link {
  color: var(--link-color);
  text-decoration: none;
  overflow-wrap: break-word;
}

a:hover {
  color: var(--link-hover-color);
  text-decoration: underline;
}

/* buttons */
p.button-wrapper {
  margin: 12px 0;
}

a.button:any-link,
button.button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  margin: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  font-family: var(--meta-font-family); /* source CTAs use Inter Tight */
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast), background-color var(--transition-fast), border-color var(--transition-fast);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.button[aria-disabled="true"],
button.button:disabled {
  cursor: not-allowed;
  pointer-events: none;
}

a.button.primary,
button.button.primary {
  border-color: var(--light-color);
  background-color: var(--light-color);
  color: var(--text-invert-color);
}

a.button.primary:hover,
a.button.primary:focus-visible,
button.button.primary:hover,
button.button.primary:focus-visible {
  border-color: var(--border-color);
  background-color: var(--border-color);
  color: var(--text-invert-color);
}

a.button.primary[aria-disabled="true"],
a.button.primary[aria-disabled="true"]:hover,
a.button.primary[aria-disabled="true"]:focus-visible,
button.button.primary:disabled,
button.button.primary:disabled:hover,
button.button.primary:disabled:focus-visible {
  background-color: var(--light-color);
  border-color: var(--light-color);
  color: var(--dark-color);
}

/* outlined button (source: 1px light-color border, Inter Tight 500, transparent) */
a.button.secondary,
button.button.secondary {
  border-width: 1px;
  border-color: var(--light-color);
  background-color: transparent;
  color: var(--light-color);
  font-family: var(--meta-font-family);
  font-weight: 500;
}

a.button.secondary:hover,
a.button.secondary:focus-visible,
button.button.secondary:hover,
button.button.secondary:focus-visible {
  border-color: var(--dark-color);
  background-color: var(--light-color);
  color: var(--dark-color);
}

a.button.secondary[aria-disabled="true"],
a.button.secondary[aria-disabled="true"]:hover,
a.button.secondary[aria-disabled="true"]:focus-visible,
button.button.secondary:disabled,
button.button.secondary:disabled:hover,
button.button.secondary:disabled:focus-visible {
  background-color: var(--light-color);
  border-color: var(--light-color);
  color: var(--dark-color);
}

/* high-impact call-to-action */
a.button.accent,
button.button.accent {
  border-color: var(--link-color);
  background-color: var(--link-color);
  color: var(--background-color);
}

a.button.accent:hover,
a.button.accent:focus-visible,
button.button.accent:hover,
button.button.accent:focus-visible {
  border-color: var(--link-hover-color);
  background-color: var(--link-hover-color);
}

a.button.accent[aria-disabled="true"],
a.button.accent[aria-disabled="true"]:hover,
a.button.accent[aria-disabled="true"]:focus-visible,
button.button.accent:disabled,
button.button.accent:disabled:hover,
button.button.accent:disabled:focus-visible {
  background-color: var(--light-color);
  border-color: var(--light-color);
  color: var(--dark-color);
}

main img {
  max-width: 100%;
  width: auto;
  height: auto;
}

.icon {
  display: inline-block;
  height: 24px;
  width: 24px;
}

.icon img {
  height: 100%;
  width: 100%;
}

/* sections */
main > .section {
  margin: 40px 0;
}

main > .section > div {
  max-width: var(--content-max-width);
  margin: auto;
  padding: 0 var(--space-m);
}

/* empty sections (e.g. trailing page-metadata) carry no margin */
main > .section:not(:has(> div)) {
  margin: 0;
}

main > .section:first-of-type {
  margin-top: 0;
}

@media (width >= 1024px) {
  main > .section > div {
    padding: 0 var(--space-l);
  }
}

/* detail template: full-bleed on mobile; shared capped inset from desktop so tabs line up with hero */
main > .section:has(.hero.detail) {
  margin: 0;
}

main > .section:has(.hero.detail) .hero-wrapper,
main > .section:has(.hero.detail) .detail-tabs-wrapper {
  max-width: none;
  margin: 0;
  padding: 0;
}

@media (width >= 1024px) {
  main > .section:has(.hero.detail) {
    margin-top: var(--space-m);
  }

  main > .section:has(.hero.detail) .hero-wrapper,
  main > .section:has(.hero.detail) .detail-tabs-wrapper {
    max-width: 1728px;
    margin: 0 auto;
    padding: 0 var(--space-m);
  }
}

/* section metadata */
main .section.light,
main .section.highlight {
  background-color: var(--light-color);
  margin: 0;
  padding: 40px 0;
}

/* section color themes (metadata theme: dark/light); recolor via --dark-section-* (R6) */
main .section[data-theme='dark'] {
  background-color: var(--dark-section-background);
  color: var(--dark-section-color);
}

main .section[data-theme='dark'] :is(h1, h2, h3, h4, h5, h6),
main .section[data-theme='dark'] a:any-link:not(.button),
main .section[data-theme='dark'] time {
  color: var(--dark-section-color);
}

main .section[data-theme='light'] {
  background-color: var(--light-color);
}

main .section.faq {
  margin: 0;
  padding: calc(var(--space-3xl) - var(--space-ml)) var(--space-ml);
  background-color: var(--background-color);
}

main .section.faq > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 820px;
  padding: 0;
}

main .section.faq > div > p {
  margin: 0;
  font-family: var(--meta-font-family); /* source eyebrow is Inter Tight, not body */
  font-size: 18px; /* source eyebrow: 18px mobile → 20px @768 → 24px @1024 */
  line-height: 24px;
  text-align: center;
}

main .section.faq h2 {
  margin: var(--space-2xs) 0 0;
  font-family: var(--meta-font-family);
  font-size: 28px;
  font-weight: 600;
  line-height: 34px;
  text-align: center;
}

main .section.faq .accordion-wrapper {
  width: 100%;
  margin-top: var(--space-m);
}

main .section.faq .accordion {
  width: 100%;
}

@media (width >= 768px) {
  main .section.faq {
    padding: var(--space-3xl) var(--space-xl);
  }

  main .section.faq > div > p {
    font-size: 20px; /* source tablet eyebrow */
    line-height: 28px;
  }

  main .section.faq h2 {
    font-size: 32px; /* source tablet FAQ heading */
    line-height: 38px;
  }
}

@media (width >= 1024px) {
  main .section.faq {
    padding: calc(var(--space-3xl) + var(--space-s)) var(--space-3xl);
  }

  main .section.faq > div > p {
    font-size: 24px;
    line-height: 32px;
  }

  main .section.faq h2 {
    font-size: 40px;
    line-height: 40px;
  }
}

main .section.supported-devices {
  margin: 0;
  padding: calc(var(--space-3xl) - var(--space-m)) var(--space-ml);
  background-color: var(--background-color);
  text-align: center;
}

main .section.supported-devices > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2xs);
  max-width: 739px;
  margin-inline: auto;
  padding: 0;
}

main .section.supported-devices .cards-wrapper {
  margin-top: var(--space-xl);
}

main .section.supported-devices h2 {
  margin: 0;
  font-family: var(--meta-font-family);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

main .section.supported-devices .default-content-wrapper p {
  margin: 0;
  max-width: 600px;
  font-family: var(--meta-font-family);
  font-weight: 400;
}

main .section.supported-devices .default-content-wrapper h2 + p {
  max-width: calc(100% - 2 * var(--space-ml));
  margin-inline: auto;
  font-size: 16px;
  line-height: 20px;
  color: var(--text-muted-color); /* source: white 69% -> grey */
}

main .section.supported-devices .default-content-wrapper p:first-child {
  font-size: 14px;
  line-height: 16px;
}

main .section.supported-devices .cards-wrapper + .default-content-wrapper {
  margin-top: var(--space-xl);
}

main .section.supported-devices .cards-wrapper + .default-content-wrapper p:first-child {
  max-width: none;
  font-size: 12px;
  line-height: 16px;
  color: var(--text-faint-color);
}

@media (width >= 768px) {
  main .section.supported-devices {
    padding: var(--space-3xl) var(--space-xl);
  }

  main .section.supported-devices h2 {
    font-size: 40px;
    line-height: 40px;
  }

  main .section.supported-devices .default-content-wrapper h2 + p {
    font-size: 24px;
    line-height: 32px;
    max-width: 600px;
  }

  main .section.supported-devices .default-content-wrapper p:first-child {
    font-size: 16px;
    line-height: 20px;
  }

  main .section.supported-devices .cards-wrapper + .default-content-wrapper p:first-child {
    font-size: 14px;
    line-height: 18px;
  }

  /* 80px text→logos and logos→disclaimer gap at tablet+ */
  main .section.supported-devices .cards-wrapper,
  main .section.supported-devices .cards-wrapper + .default-content-wrapper {
    margin-top: var(--space-3xl);
  }
}

@media (width >= 1024px) {
  main .section.supported-devices {
    padding: calc(var(--space-3xl) + var(--space-s)) var(--space-3xl);
  }
}
