/* cfb-site shared stylesheet. The class names are a contract with tenant repos: see CLAUDE.md. */

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/barlow-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/barlow-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-latin-500-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/barlow-condensed-latin-600-normal.woff2") format("woff2");
}

:root {
  color-scheme: light dark;

  --font-body: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;

  --bg: #eceef2;
  --surface: #ffffff;
  --surface-hover: #f5f6f8;
  --text: #12161c;
  --muted: #5d6673;
  --border: #d9dde3;
  --track: #e5e8ed;

  --mast-bg: #10141a;
  --mast-bg-2: #1b2129;
  --mast-text: #f4f6f8;
  --mast-muted: #9aa5b3;
  --mast-control: #262e38;
  --mast-control-border: #3a4450;

  --accent: #e0302f;
  --live: #c9252c;
  --up: #16803a;
  --down: #cc2a2a;
  --focus: #2764e7;
  --logo-tile: transparent;
  --tint: 7%;

  --content: 56rem;
  --gutter: 0.75rem;
  --radius: 6px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11;
    --surface: #15191f;
    --surface-hover: #1b2028;
    --text: #e7eaee;
    --muted: #97a1ad;
    --border: #272d36;
    --track: #262c35;

    --mast-bg: #050608;
    --mast-bg-2: #10141a;
    --mast-control: #1b2129;
    --mast-control-border: #333c47;

    --accent: #ff4a44;
    --up: #3fbf62;
    --down: #ff6159;
    --focus: #6ea2ff;
    --logo-tile: #eef0f3;
    --tint: 14%;
  }
}

@media (min-width: 40rem) {
  :root {
    --gutter: 1.25rem;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1rem var(--gutter) 2rem;
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Masthead: the dark broadcast bar. */

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem 0.875rem;
  padding: 0.875rem max(var(--gutter), calc((100% - var(--content)) / 2));
  background: linear-gradient(180deg, var(--mast-bg-2), var(--mast-bg));
  color: var(--mast-text);
  border-bottom: 3px solid var(--accent);
  --focus: #8db4ff;
}

.masthead-title {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.125rem 0.625rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1;
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

.masthead-sub {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--mast-muted);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.1875rem 0.5625rem;
  border-radius: 999px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.status-final {
  color: var(--mast-muted);
  box-shadow: inset 0 0 0 1px var(--mast-control-border);
}

.status-live {
  color: #fff;
  background: var(--live);
}

.status-live::before {
  content: "";
  width: 0.4375rem;
  height: 0.4375rem;
  border-radius: 50%;
  background: currentColor;
  animation: live-pulse 1.6s ease-in-out infinite;
}

@keyframes live-pulse {
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-live::before {
    animation: none;
  }
}

.pickers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.625rem;
  width: 100%;
}

.picker {
  appearance: none;
  -webkit-appearance: none;
  min-height: 2.25rem;
  padding: 0.3125rem 2rem 0.3125rem 0.75rem;
  border: 1px solid var(--mast-control-border);
  border-radius: var(--radius);
  background-color: var(--mast-control);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%239aa5b3' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  color: var(--mast-text);
  font: 500 0.9375rem/1.2 var(--font-body);
  cursor: pointer;
}

.picker:hover {
  border-color: var(--mast-muted);
}

.picker option {
  background: var(--mast-control);
  color: var(--mast-text);
}

.picker-season {
  flex: 0 0 auto;
}

.picker-week {
  flex: 1 1 8rem;
  max-width: 14rem;
}

.picker-fallback {
  margin-left: auto;
  color: var(--mast-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.picker-fallback:hover {
  color: var(--mast-text);
  text-decoration: underline;
}

@media (min-width: 40rem) {
  .masthead {
    padding-top: 1.125rem;
    padding-bottom: 1.125rem;
  }

  .masthead-title {
    font-size: 2.5rem;
  }

  .pickers {
    width: auto;
    margin-left: auto;
  }

  .picker-week {
    flex: 0 0 auto;
  }

  .picker-fallback {
    margin-left: 0.25rem;
  }
}

/* Rankings list. */

.ranking-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.team-row {
  --team: var(--team-color, var(--muted));
  position: relative;
  background: var(--surface);
  border-left: 5px solid var(--team);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 1px 0 var(--border);
}

@supports (color: color-mix(in srgb, red, blue)) {
  .team-row {
    background: linear-gradient(90deg, color-mix(in srgb, var(--team) var(--tint), var(--surface)), var(--surface) 45%);
  }

  /* Many team colors are deep navies and maroons; lift them so strips and bars read on a dark surface. */
  @media (prefers-color-scheme: dark) {
    .team-row {
      --team: color-mix(in oklab, var(--team-color, var(--muted)) 72%, #fff);
    }
  }
}

.team {
  margin: 0;
}

.team-summary {
  display: grid;
  grid-template-columns: 2.625rem 32px minmax(0, 1fr) auto 3.25rem 0.75rem;
  grid-template-areas:
    "rank logo name record points chev"
    "move logo conf prev   prev   chev";
  align-items: center;
  column-gap: 0.625rem;
  row-gap: 0.0625rem;
  padding: 0.5rem 0.75rem 0.5rem 0.5rem;
  list-style: none;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  -webkit-tap-highlight-color: transparent;
}

.team-summary::-webkit-details-marker {
  display: none;
}

.team-summary::marker {
  content: "";
}

.team-summary:hover {
  background: color-mix(in srgb, var(--surface-hover) 70%, transparent);
}

.team-summary:focus-visible {
  outline-offset: -2px;
}

.team-summary::after {
  content: "";
  grid-area: chev;
  justify-self: end;
  width: 0.4375rem;
  height: 0.4375rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-25%) rotate(45deg);
  opacity: 0.7;
  transition: transform 0.15s ease;
}

.team[open] > .team-summary::after {
  transform: translateY(25%) rotate(-135deg);
}

.team[open] > .team-summary {
  border-bottom: 1px solid var(--border);
  border-radius: 0 var(--radius) 0 0;
}

@media (prefers-reduced-motion: reduce) {
  .team-summary::after {
    transition: none;
  }
}

.rank {
  grid-area: rank;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.625rem;
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.move {
  grid-area: move;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  color: var(--muted);
}

.move-up {
  color: var(--up);
}

.move-down {
  color: var(--down);
}

.move-same,
.move-none {
  color: var(--muted);
}

.logo {
  grid-area: logo;
  display: block;
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 5px;
  background: var(--logo-tile);
}

img.logo {
  padding: 1px;
}

@media (prefers-color-scheme: dark) {
  img.logo {
    padding: 3px;
  }
}

.logo-fallback {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--team);
  color: #fff;
  box-shadow: inset 0 0 0 2px var(--team-alt, transparent);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.6875rem;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-shadow: 0 1px 1px rgb(0 0 0 / 0.35);
  overflow: hidden;
  white-space: nowrap;
}

.team-name {
  grid-area: name;
  min-width: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1875rem;
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.conf {
  grid-area: conf;
  min-width: 0;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prev {
  grid-area: prev;
  justify-self: end;
  font-size: 0.75rem;
  line-height: 1.2;
  color: var(--muted);
  white-space: nowrap;
}

.record {
  grid-area: record;
  justify-self: end;
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
}

.points {
  grid-area: points;
  justify-self: end;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3125rem;
  line-height: 1;
  white-space: nowrap;
}

@media (min-width: 40rem) {
  .team-summary {
    column-gap: 0.75rem;
    padding: 0.5625rem 1rem 0.5625rem 0.75rem;
  }

  .rank {
    font-size: 1.875rem;
  }

  .move {
    font-size: 0.8125rem;
  }

  .team-name {
    font-size: 1.375rem;
  }

  .conf,
  .prev {
    font-size: 0.8125rem;
  }

  .conf {
    justify-self: start;
  }

  .points {
    font-size: 1.5rem;
  }
}

/* One line per team only when there is room for the longest names ("Mississippi State")
   beside the conference and "LW T-25"; narrower, the two-line layout above applies. */
@media (min-width: 64rem) {
  .team-summary {
    grid-template-columns: 3rem 3rem 32px minmax(0, 1fr) 7.5rem 4.5rem 3rem 4.5rem 0.75rem;
    grid-template-areas: "rank move logo name conf prev record points chev";
  }
}

/* Per-team breakdown inside <details>. */

.breakdown {
  display: grid;
  gap: 1rem;
  padding: 0.875rem 0.75rem 1rem;
}

.levels,
.wins {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}

.levels::before,
.wins::before {
  display: block;
  margin-bottom: 0.375rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.levels::before {
  content: "Points by level";
}

.wins::before {
  content: "Wins, by points they brought in";
}

.levels {
  gap: 0.3125rem;
}

.level {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr) 3.25rem;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
}

.level-label {
  color: var(--muted);
  white-space: nowrap;
}

.level-bar {
  display: block;
  height: 0.625rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--team) var(--pct, 0%), var(--track) var(--pct, 0%));
}

.level-points {
  justify-self: end;
  font-weight: 500;
}

.wins {
  gap: 0;
}

.win {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    "result opponent points"
    "week   week     points";
  align-items: baseline;
  column-gap: 0.5rem;
  padding: 0.4375rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
}

.win:first-child {
  border-top: 0;
}

.win-result {
  grid-area: result;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.win-opponent {
  grid-area: opponent;
  min-width: 0;
}

.win-week {
  grid-area: week;
  font-size: 0.8125rem;
  color: var(--muted);
}

.win-points {
  grid-area: points;
  align-self: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
}

@media (min-width: 40rem) {
  .breakdown {
    gap: 1.25rem;
    padding: 1rem 1rem 1.125rem calc(3rem + 32px + 2 * 0.75rem + 0.75rem);
  }

  .level {
    grid-template-columns: 6.75rem minmax(0, 1fr) 3.5rem;
  }

  .win {
    grid-template-columns: 4.25rem minmax(0, 1fr) auto 3.5rem;
    grid-template-areas: "result opponent week points";
  }

  .win-points {
    justify-self: end;
  }
}

@media (min-width: 64rem) {
  .breakdown {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.5rem;
    padding-left: calc(3rem + 3rem + 32px + 3 * 0.75rem + 0.75rem);
  }
}

/* "How it works" and other prose blocks. */

.how-it-works {
  margin-top: 1.75rem;
  padding: 1.125rem 1.25rem 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
  border-top: 3px solid var(--accent);
  box-shadow: 0 1px 0 var(--border);
}

.how-it-works h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.how-it-works p {
  margin: 0.5rem 0 0;
  max-width: 44rem;
  color: var(--muted);
}

.how-it-works p:first-of-type {
  margin-top: 0;
}

/* Seasons index. */

.season-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr));
  gap: 0.5rem;
}

.season-list a {
  display: block;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-left: 5px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  box-shadow: 0 1px 0 var(--border);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.1;
  text-decoration: none;
}

.season-list a:hover {
  background: var(--surface-hover);
}

/* 404. */

.not-found {
  padding-top: 2.5rem;
}

.not-found p {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  color: var(--muted);
}

.button {
  display: inline-block;
  padding: 0.5625rem 1rem;
  border-radius: var(--radius);
  background: var(--mast-bg);
  color: var(--mast-text);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: inset 0 -3px 0 var(--accent);
}

.button:hover {
  background: var(--mast-bg-2);
}

@media (prefers-color-scheme: dark) {
  .button {
    background: var(--mast-control);
  }

  .button:hover {
    background: var(--surface-hover);
  }
}

/* Footer. */

.site-footer {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: 1rem var(--gutter) 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.8125rem;
  color: var(--muted);
}

.site-footer a {
  color: inherit;
}
