/* Claremont Music Club — site theme on top of Bootstrap 5.3.
   The --s-* tokens below are the palette. Bootstrap is pointed at them
   through its own --bs-* custom properties, so light mode, dark mode and any
   future re-theme follow along without recompiling Bootstrap. The two font
   stacks the tokens name live in fonts/fonts.css. */

:root {
  /* One narrow column, like the printed programme the site imitates. */
  --s-container: 46rem;

  /* The listing is set in a serif for reading; headings, the nav and the
     small labels take Montserrat, the wordmark's face. */
  --s-font-body: var(--s-font-serif);
  --s-font-heading: var(--s-font-sans);

  /* Cool paper and ink, tinted toward the logo's deepest blue (ramp step 1),
     deepened a shade for the accent so links pass 4.5:1 as body text.
     The other six steps stay in the mark. */
  --s-bg: #f8fbfc;
  --s-surface: #eff4f5;
  --s-card: #ffffff;
  --s-card-section: #eff4f5;
  --s-text: #151c1f;
  --s-muted: #56666c;
  --s-border: #dce6e9;
  --s-border-strong: #c1d0d5;
  --s-primary: #12718e;
  --s-on-primary: #ffffff;

  /* Status colours for the cancelled and postponed badges, Sumi's values
     carried over unchanged when Sumi was dropped. */
  --s-danger: #c62b39;
  --s-warning: #a35f00;
}

/* Dark sits on a blue-black of the same hue, and the accent moves to the
   middle of the ramp (step 3) so it stays legible as text.
   These two blocks mirror how Sumi stored its dark palette: the OS setting
   by default, data-theme on <html> to pin either mode. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --s-bg: #0d1416;
    --s-surface: #131c1f;
    --s-card: #131c1f;
    --s-card-section: #182428;
    --s-text: #e2eaec;
    --s-muted: #93a5ab;
    --s-border: #29393e;
    --s-border-strong: #384a50;
    --s-primary: #52b69a;
    --s-on-primary: #0b1614;
    --s-danger: #f0707b;
    --s-warning: #e3a43c;
  }
}

:root[data-theme="dark"] {
  --s-bg: #0d1416;
  --s-surface: #131c1f;
  --s-card: #131c1f;
  --s-card-section: #182428;
  --s-text: #e2eaec;
  --s-muted: #93a5ab;
  --s-border: #29393e;
  --s-border-strong: #384a50;
  --s-primary: #52b69a;
  --s-on-primary: #0b1614;
  --s-danger: #f0707b;
  --s-warning: #e3a43c;
}

/* ── Bootstrap, pointed at the tokens ─────────────────────────────────────
   Bootstrap reads its colours and type from --bs-* properties on :root.
   Each one here is a var() of a token, or a mix of one, so the dark blocks
   above re-theme Bootstrap too, and Bootstrap's own dark palette (keyed on
   data-bs-theme, which nothing sets) never comes into play.
   The three token blocks above must stay first in this file:
   scripts/build_social_skill.py copies the first block it finds that opens
   with each of their selectors, and the rules below reuse those selectors. */
:root {
  color-scheme: light dark;

  --bs-body-font-family: var(--s-font-body);
  --bs-body-font-size: 1.0625rem;
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--s-text);
  --bs-body-bg: var(--s-bg);
  --bs-emphasis-color: var(--s-text);
  --bs-secondary-color: var(--s-muted);
  --bs-secondary-bg: var(--s-surface);
  --bs-tertiary-bg: var(--s-surface);
  --bs-border-color: var(--s-border);
  --bs-primary: var(--s-primary);
  --bs-link-color: var(--s-primary);
  --bs-link-hover-color: var(--s-primary);
  --bs-focus-ring-color: color-mix(in srgb, var(--s-primary) 35%, transparent);

  /* The one value a var() cannot carry: Bootstrap colours links and the
     -primary utilities from a bare "r, g, b" triplet. So the accent is
     spelled out once per mode (#12718e here), and links borrow it.
     shows/tests/test_theme.py fails if a triplet drifts from --s-primary. */
  --bs-primary-rgb: 18, 113, 142;
  --bs-link-color-rgb: var(--bs-primary-rgb);
  --bs-link-hover-color-rgb: var(--bs-primary-rgb);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bs-primary-rgb: 82, 182, 154;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bs-primary-rgb: 82, 182, 154;
}

/* Bootstrap's stepped container widths give way to the one column above,
   and the gutter is a phone's 16px a side. */
.container {
  --bs-gutter-x: 2rem;
  max-width: calc(var(--s-container) + var(--bs-gutter-x));
}

/* Bootstrap leaves headings in the body face; here they take the
   wordmark's. */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--s-font-heading);
  font-weight: 700;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* Underlines sit back until hovered, so a column of linked titles reads as
   type first and links second. */
a {
  text-decoration-color: color-mix(in srgb, currentcolor 40%, transparent);
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-color: currentcolor;
}

/* Sizes the header brand and the listing intro, which the calendar-views bar
   sits under. Phones shrink them together; kept as variables so the 30rem
   override changes a value, not the rules. */
:root {
  --cmc-brand-logo-height: 2.75rem;
  --cmc-brand-font-size: 1.75rem;
  --cmc-filters-gap: 1.5rem;
  --cmc-intro-font-size: 1.375rem;
}

@media (max-width: 30rem) {
  :root {
    --cmc-brand-logo-height: 2.1rem;
    --cmc-brand-font-size: 1.35rem;
    --cmc-intro-font-size: 1.15rem;
  }
}

/* Brand mark in the header. The blue→green mountain reads as part of the
   wordmark, so it is sized to the text rather than to a box, and the
   <picture> source swaps to the white-border art in dark mode. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--s-text);
  font-family: var(--s-font-sans);
  text-decoration: none;
}

.brand picture {
  display: flex;
}

.brand img {
  display: block;
  width: auto;
  height: var(--cmc-brand-logo-height);
}

.brand strong {
  font-size: var(--cmc-brand-font-size);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Lead sentence under the page title: set larger than body so it reads as
   the page's one-line pitch, balanced so it never strands a word. */
.page-intro {
  font-size: var(--cmc-intro-font-size);
  line-height: 1.45;
  text-wrap: balance;
}

/* Calendar views sit between the intro and the listing, ruled off from it.
   On phones only Past shows and Subscribe fit on one row, so the two
   forward-looking views drop out there. */
.calendar-filters {
  margin-bottom: var(--cmc-filters-gap);
  border-bottom: 1px solid var(--s-border);
}

.calendar-filters .nav {
  row-gap: 0.25rem;
}

@media (max-width: 30rem) {
  .calendar-filters .filter-wide {
    display: none;
  }
}

/* The nav is Bootstrap's underline nav, in ink, with the current page in the
   accent over the rule. Bootstrap keys that on an .active class, but
   aria-current already marks the page, so the style hangs off that instead
   of a class that repeats it. */
.nav-underline {
  --bs-nav-link-color: var(--s-text);
  --bs-nav-link-hover-color: var(--s-primary);
  --bs-nav-link-padding-y: 0.375rem;
  --bs-nav-link-font-size: 0.9375rem;
  --bs-nav-link-font-weight: 500;
  --bs-nav-underline-gap: 0 1.25rem;
  --bs-nav-underline-link-active-color: var(--s-primary);
  font-family: var(--s-font-sans);
}

.nav-underline .nav-link[aria-current="page"] {
  color: var(--bs-nav-underline-link-active-color);
  border-bottom-color: currentcolor;
}

/* Bootstrap compiles this focus ring to its own blue; this is the accent's. */
.nav-link:focus-visible {
  box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}

/* Day separators and the show page's labels are one quiet eyebrow, never a
   second page title. */
.day,
.facts dt {
  color: var(--s-muted);
  font-family: var(--s-font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.day {
  margin: 1.75rem 0 0.35rem;
}

/* A listing row: time on the left, show on the right, one rule between
   shows. The flush list group draws the rules; the grid keeps every title on
   one left edge and lines the time up with the title's baseline. */
.shows {
  --bs-list-group-bg: transparent;
  --bs-list-group-item-padding-x: 0;
  --bs-list-group-item-padding-y: 0.55rem;
}

.shows > li {
  display: grid;
  grid-template-columns: 5.2rem 1fr;
  gap: 0.1rem 0.9rem;
  align-items: baseline;
}

.shows time {
  color: var(--s-muted);
  font-family: var(--s-font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.shows strong {
  font-weight: 600;
}

@media (max-width: 30rem) {
  .shows > li {
    grid-template-columns: 4.4rem 1fr;
  }
}

/* Status and lane tags: Bootstrap's badge, quietened to a tinted pill. Each
   modifier sets only the colour and the tint underneath is mixed from it,
   so a label and its ground always match. */
.badge {
  --bs-badge-padding-x: 0.5em;
  --bs-badge-padding-y: 0.3em;
  --bs-badge-font-size: 0.72rem;
  --bs-badge-font-weight: 600;
  --bs-badge-color: var(--s-muted);
  --bs-badge-border-radius: var(--bs-border-radius-pill);
  vertical-align: 0.1em;
  background-color: color-mix(in srgb, var(--bs-badge-color) 12%, transparent);
  font-family: var(--s-font-sans);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.badge.club {
  --bs-badge-color: var(--s-primary);
}

.badge.cancelled {
  --bs-badge-color: var(--s-danger);
}

.badge.postponed,
.badge.rescheduled {
  --bs-badge-color: var(--s-warning);
  background-color: color-mix(in srgb, var(--bs-badge-color) 14%, transparent);
}

/* The show page's facts: eyebrow labels over values in ink. */
.facts dd {
  margin: 0.2rem 0 1rem;
}

/* The Tickets link is Bootstrap's primary button. Bootstrap compiles that
   button's colours to literal hex on .btn-primary itself, so pointing
   --bs-primary at the accent would leave it blue; every state is set here.
   Hover and press lean toward the ink, which deepens the accent on paper
   and lightens it on the dark ground, so the label's contrast only grows. */
.btn {
  --bs-btn-font-family: var(--s-font-sans);
  --bs-btn-font-weight: 600;
}

.btn-primary {
  --bs-btn-color: var(--s-on-primary);
  --bs-btn-bg: var(--s-primary);
  --bs-btn-border-color: var(--s-primary);
  --bs-btn-hover-color: var(--s-on-primary);
  --bs-btn-hover-bg: color-mix(in srgb, var(--s-primary) 85%, var(--s-text));
  --bs-btn-hover-border-color: var(--bs-btn-hover-bg);
  --bs-btn-active-color: var(--s-on-primary);
  --bs-btn-active-bg: color-mix(in srgb, var(--s-primary) 75%, var(--s-text));
  --bs-btn-active-border-color: var(--bs-btn-active-bg);
  --bs-btn-disabled-color: var(--s-on-primary);
  --bs-btn-disabled-bg: var(--s-primary);
  --bs-btn-disabled-border-color: var(--s-primary);
  --bs-btn-focus-box-shadow: 0 0 0 0.25rem var(--bs-focus-ring-color);
}
