/*
 * A deliberately muted, typographic base.
 *
 * The brief for this boilerplate is that it demonstrates functionality without
 * carrying anybody's identity. So the palette is neutral greys with a single
 * accent taken from `radio.stations`.`primary_colour`, and the accent is used
 * only for small marks: the wordmark square, links, the live dot, the focus
 * ring. Nothing is a large field of colour, because a large field of colour
 * reads as branding and this site has none.
 *
 * A tenant replacing this file is the expected outcome, not a failure of it.
 */

:root {
    --bg: #f6f6f4;
    --surface: #ffffff;
    --border: #e3e3df;
    --text: #24272b;
    --text-soft: #5c6167;
    --radius: 6px;
    --wrap: 68rem;

    /* --accent is set inline from the station record. This is the fallback for
       a station with no colour recorded, and it is deliberately dull. */
    --accent: #5a6b7a;

    color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161819;
        --surface: #1e2123;
        --border: #303437;
        --text: #e6e7e8;
        --text-soft: #a2a8ad;
    }
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 16px/1.55 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

.wrap {
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 1.25rem;
}

a { color: inherit; }
a:hover { text-decoration-thickness: 2px; }

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

.skip {
    position: absolute;
    left: -9999px;
}

.skip:focus {
    left: 1rem;
    top: 1rem;
    z-index: 10;
    background: var(--surface);
    padding: 0.6rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.small { font-size: 0.85rem; color: var(--text-soft); }
.sep { margin: 0 0.5rem; color: var(--text-soft); }

/* ---- masthead ---------------------------------------------------------- */

.masthead {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.masthead-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    min-height: 4.25rem;
    flex-wrap: wrap;
}

.wordmark {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    margin-right: auto;
}

.wordmark-mark {
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 4px;
    background: var(--accent);
    flex: none;
}

.wordmark strong { display: block; font-size: 1.02rem; letter-spacing: -0.01em; }
.wordmark small { display: block; font-size: 0.78rem; color: var(--text-soft); }

.masthead nav ul {
    display: flex;
    gap: 1.15rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.masthead nav a {
    text-decoration: none;
    font-size: 0.92rem;
    color: var(--text-soft);
    padding: 0.35rem 0;
    border-bottom: 2px solid transparent;
}

.masthead nav a:hover { color: var(--text); }

.masthead nav a[aria-current="page"] {
    color: var(--text);
    border-bottom-color: var(--accent);
}

/* ---- generic pieces ---------------------------------------------------- */

.button {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0.5rem 0.95rem;
    border-radius: var(--radius);
    border: 0;
    cursor: pointer;
}

.button:hover { filter: brightness(0.93); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

h1 { font-size: 1.6rem; letter-spacing: -0.02em; margin: 2rem 0 0.35rem; }
h2 { font-size: 1.12rem; letter-spacing: -0.01em; margin: 2.25rem 0 0.85rem; }
h3 { font-size: 0.98rem; margin: 0 0 0.3rem; }

.lede { color: var(--text-soft); margin: 0 0 1.5rem; }

.empty {
    color: var(--text-soft);
    font-size: 0.9rem;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}

.columns {
    display: grid;
    gap: 2rem;
    grid-template-columns: 2fr 1fr;
    align-items: start;
}

@media (max-width: 48rem) {
    .columns { grid-template-columns: 1fr; }
}

/* ---- now playing ------------------------------------------------------- */

.now {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.now-body { min-width: 12rem; flex: 1; }

.now .label {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-soft);
    margin-bottom: 0.35rem;
}

.dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--accent);
}

.now .track { font-size: 1.45rem; font-weight: 650; letter-spacing: -0.02em; }
.now .artist { color: var(--text-soft); }

/* ---- lists ------------------------------------------------------------- */

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

.rows li {
    display: flex;
    align-items: baseline;
    gap: 0.9rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
}

.rows li:last-child { border-bottom: 0; }

.rows .when,
.rows .rank {
    color: var(--text-soft);
    font-variant-numeric: tabular-nums;
    font-size: 0.85rem;
    flex: none;
    min-width: 2.6rem;
}

.rows .what { flex: 1; min-width: 0; }
.rows .what .artist { color: var(--text-soft); font-size: 0.88rem; }
.rows .meta { color: var(--text-soft); font-size: 0.82rem; flex: none; }

/* ---- schedule ---------------------------------------------------------- */

.day + .day { margin-top: 1.75rem; }

.day h2 {
    margin: 0 0 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--border);
}

.slot-desc { color: var(--text-soft); font-size: 0.88rem; margin: 0.2rem 0 0; }

.on-air {
    display: inline-block;
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 0 0.45rem;
    margin-left: 0.5rem;
    vertical-align: 0.1em;
}

/* ---- player ------------------------------------------------------------ */

.player { margin-top: 2rem; }
.player audio { width: 100%; margin-top: 1rem; }
.player .format { margin-top: 0.75rem; }

/* ---- footer ------------------------------------------------------------ */

.footer {
    margin-top: 4rem;
    border-top: 1px solid var(--border);
    background: var(--surface);
    padding: 1.75rem 0;
}

.footer p { margin: 0 0 0.4rem; }
.footer-inner { max-width: 44rem; }

/* ---- station switcher --------------------------------------------------- */

/*
 * A thin bar above the masthead. It is deliberately quieter than the site's own
 * navigation: it is used once, on arrival, and then it should get out of the
 * way. Making it the loudest thing on the page would say the group matters more
 * than the station, which for a listener is the wrong way round.
 */
.switcher {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.switcher-inner {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 2.9rem;
}

.switcher-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--text-soft);
    flex: none;
}

.switcher ul {
    display: flex;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.switcher a {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    font-size: 0.85rem;
    color: var(--text-soft);
    padding: 0.25rem 0.6rem 0.25rem 0.3rem;
    border: 1px solid transparent;
    border-radius: 999px;
}

.switcher a:hover {
    color: var(--text);
    border-color: var(--border);
}

/* The current station is stated by the border and the weight rather than by a
   filled pill, so it does not compete with the accent used for links. */
.switcher a[aria-current] {
    color: var(--text);
    font-weight: 600;
    border-color: var(--accent);
}

.switcher img,
.wordmark-logo,
.tuner-option img,
.player-station img {
    object-fit: contain;
    flex: none;
}

.switcher img { width: 1.5rem; height: 1.5rem; }
.wordmark-logo { width: 2.1rem; height: 2.1rem; border-radius: 4px; }

/* ---- artwork ------------------------------------------------------------ */

/*
 * A record sleeve is square and should stay square whatever falcon returns, so
 * the aspect is enforced here rather than trusted. `object-fit: cover` crops
 * rather than distorts, which for a sleeve is the lesser damage.
 */
.rows .art {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 4px;
    object-fit: cover;
    background: var(--border);
    flex: none;
    align-self: center;
}

.now-art {
    width: 7rem;
    height: 7rem;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--border);
    flex: none;
}

/* ---- artist and title --------------------------------------------------- */

/*
 * The house pairing, and it is a pairing rather than two separate decisions:
 * the title in bold and the artist in italic beneath it is how a track is set
 * everywhere in the product, so a listener reads the same shape on the website
 * as in the app. Italic is reserved for an artist name; secondary text that is
 * not one uses .sub.
 */
.rows .what .title {
    display: block;
    font-weight: 650;
}

.rows .what .artist,
.rows .what .sub {
    display: block;
    color: var(--text-soft);
    font-size: 0.88rem;
}

.rows .what .artist,
.now .artist,
.player .artist {
    font-style: italic;
}

.now .track,
.player .track {
    font-weight: 700;
}

.sub { color: var(--text-soft); font-size: 0.88rem; }

/* ---- presenters --------------------------------------------------------- */

.person {
    display: flex;
    align-items: flex-start;
    gap: 0.9rem;
}

.person-body { min-width: 0; }

/*
 * The monogram sits underneath the photograph rather than instead of it. The
 * photograph endpoint substitutes its own generic portrait when a presenter has
 * none, so this layer is not for that case - it is for falcon being unreachable,
 * where the <img> fails to paint and the initials show through.
 */
.portrait {
    position: relative;
    display: grid;
    place-items: center;
    width: 4.5rem;
    height: 4.5rem;
    flex: none;
    border-radius: 50%;
    overflow: hidden;
    background: var(--border);
}

.portrait .monogram {
    font-size: 1.2rem;
    font-weight: 650;
    letter-spacing: 0.02em;
    color: var(--text-soft);
}

.portrait img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---- events ------------------------------------------------------------- */

.event { display: flex; flex-direction: column; }

.event-image {
    width: calc(100% + 2.5rem);
    margin: -1.25rem -1.25rem 0.9rem;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--border);
}

/* ---- the player --------------------------------------------------------- */

.player-now {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.player-now-body { min-width: 0; flex: 1; }
.player .track { font-size: 1.3rem; letter-spacing: -0.02em; }
.player .artist { color: var(--text-soft); }

.player-art {
    width: 6rem;
    height: 6rem;
    border-radius: var(--radius);
    object-fit: cover;
    background: var(--border);
    flex: none;
}

.player-station {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.5rem 0 0;
}

.player-station img { width: 1.25rem; height: 1.25rem; }

.tuner {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    margin-top: 1rem;
}

.tuner-option {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    text-decoration: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.tuner-option:hover { border-color: var(--text-soft); }

.tuner-option.is-current {
    border-color: var(--accent);
    box-shadow: inset 0 0 0 1px var(--accent);
}

.tuner-option img { width: 3rem; height: 3rem; }
.tuner-option strong { display: block; font-size: 0.95rem; }
.tuner-option small { display: block; font-size: 0.8rem; color: var(--text-soft); }
