/*
 * A competition's page: a header across the page in the competition's colour
 * (a wash with a stripe in dark, a stripe alone in high contrast), then the
 * fixtures by month with Next up beside them, or above them on narrow screens.
 * League pages share the header and the fixture rows.
 */

.comp-head {
  background: var(--c);
  color: var(--c-ink);
}

.comp-head-inner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 20px 28px;
  align-items: center;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px var(--gutter) 32px;
}

.comp-logo {
  height: 60px;
  padding: 8px 14px;
  border-radius: var(--radius-control);
}

.comp-logo img {
  max-width: 112px;
  height: 44px;
}

.comp-title {
  display: grid;
  gap: 6px;
}

.comp-sport {
  font-size: 17px;
  font-weight: 700;
}

.comp-name {
  font: 800 clamp(40px, 6vw, 88px) / 0.9 var(--font-display);
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.comp-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.comp-subscribe {
  min-height: 52px;
  padding: 0 22px;
  border-color: var(--c-ink);
  background: var(--c-ink);
  color: var(--c-button-ink);
  font-size: 18px;
}

.comp-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 18px;
}

.comp-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

/* Dark: the colour washes into the page, with a stripe of the full colour. */
@media (prefers-color-scheme: dark) {
  .comp-head {
    background: linear-gradient(90deg, color-mix(in srgb, var(--c) 40%, var(--bg)), var(--bg) 85%);
    color: var(--ink);
    box-shadow: inset 0 -4px var(--c);
  }

  .comp-subscribe {
    border-color: var(--button);
    background: var(--button);
    color: var(--button-ink);
  }
}

/* High contrast: the page's own colours, with a thicker stripe. */
@media (prefers-contrast: more) {
  .comp-head {
    background: var(--bg);
    color: var(--ink);
    box-shadow: inset 0 -8px var(--c);
  }

  .comp-head-inner {
    padding-bottom: 40px;
  }

  .comp-subscribe {
    border-color: var(--button);
    background: var(--button);
    color: var(--button-ink);
  }
}

@media (width <= 760px) {
  .comp-head-inner {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    padding-top: 24px;
  }

  .comp-logo {
    height: 52px;
    padding: 6px 10px;
  }

  .comp-logo img {
    max-width: 88px;
    height: 40px;
  }

  .comp-name {
    font-size: 40px;
  }

  .comp-actions {
    grid-column: 1 / -1;
    justify-items: stretch;
  }
}

@media (width <= 360px) {
  .comp-head-inner {
    grid-template-columns: minmax(0, 1fr);
  }

  .comp-logo {
    justify-self: start;
  }
}

/* The fixtures, with Next up in a column beside them that stays in view. */
.comp-body {
  display: grid;
  grid-template-areas: "list next";
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 32px 40px;
  align-items: start;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 40px var(--gutter) 64px;
}

.comp-body > .next-up {
  position: sticky;
  top: 24px;
  grid-area: next;
}

.fixture-list {
  grid-area: list;
}

.comp-body-empty {
  grid-template-areas: "next";
  grid-template-columns: minmax(0, 626px);
}

@media (width <= 1000px) {
  .comp-body {
    grid-template-areas:
      "next"
      "list";
    grid-template-columns: minmax(0, 1fr);
  }

  .comp-body > .next-up {
    position: static;
  }
}

.fixture-group + .fixture-group {
  margin-top: 44px;
}

.group-title {
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
  font: 800 34px/1 var(--font-display);
  text-transform: uppercase;
}

.fixtures {
  margin: 0;
  padding: 0;
  list-style: none;
}

.fixture {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 4px 20px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule);
}

.when-stacked {
  display: grid;
  gap: 2px;
  align-content: start;
}

.when-stacked .when-date {
  font-size: 20px;
  line-height: 1.1;
}

.when-stacked :is(.when-time, .when-allday) {
  font-size: 28px;
  font-weight: 800;
  line-height: 1;
}

.fixture-text {
  display: grid;
  gap: 4px;
  align-content: start;
  overflow-wrap: anywhere;
}

.fixture-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.fixture-details {
  color: var(--muted);
}

@media (width <= 640px) {
  .fixture {
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 4px 14px;
  }

  .when-stacked .when-date {
    font-size: 17px;
  }

  .when-stacked :is(.when-time, .when-allday) {
    font-size: 24px;
  }

  .fixture-title {
    font-size: 17px;
  }

  .group-title {
    font-size: 30px;
  }
}
