/*
Theme Name: Stamford Rocks
Theme URI: https://stamfordrocks.uk
Author: Stamford Creative
Description: Bespoke theme for Stamford Rocks internet radio. Live AzuraCast player, today's shows as a setlist, Request House, and a Website menu for editing content without a page builder.
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: stamford-rocks
*/

/* Layout: a stage at night. The player is the hero, then today's shows written out as a gig setlist
   taped to the stage (played shows crossed off) beside Request House, then history, listening options,
   about. A mini player docks at the bottom once the main one scrolls away. Dark first. */
:root {
	--ground: #141314;
	--panel: #1D1B1D;
	--ink: #F1EDE6;
	--muted: #A49D95;
	--rule: #363236;
	--lamp: #FF5A2B;
	--lamp-soft: rgba(255, 90, 43, 0.18);
	--glow: rgba(255, 90, 43, 0.10);
	--hot: #E3261C;
	--paper: #EEE7DA;
	--paper-ink: #1F1B17;
	--paper-muted: #6E655B;
	--marker: #C8321B;
	--tape: rgba(222, 212, 186, 0.78);
	--font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", system-ui, sans-serif;
	--font-body: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-hand: "Caveat Brush", "Marker Felt", "Bradley Hand", cursive;
	--font-data: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;
	--radius: 12px;
	color-scheme: dark;
}
@media (prefers-color-scheme: light) {
	:root {
		--ground: #E9E5DF; --panel: #F8F6F2; --ink: #171517; --muted: #5F5852; --rule: #D0C9C1;
		--lamp: #D63E14; --lamp-soft: rgba(214, 62, 20, 0.14); --glow: rgba(214, 62, 20, 0.08); --hot: #B81D14;
		--paper: #FBF8F1; --tape: rgba(206, 194, 165, 0.8); color-scheme: light;
	}
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 16px; }
body {
	margin: 0;
	background: radial-gradient(1100px 520px at 20% -120px, var(--glow), transparent 70%), var(--ground);
	background-repeat: no-repeat;
	background-color: var(--ground);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.55;
	padding-inline: 16px;
	-webkit-font-smoothing: antialiased;
}
p { margin: 0; }
a { color: inherit; text-decoration-color: var(--lamp); text-underline-offset: 3px; }
a:hover { color: var(--lamp); }
:focus-visible { outline: 3px solid var(--lamp); outline-offset: 3px; }
img { max-width: 100%; height: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--lamp); color: var(--ground); padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 16px; }
.wrap { max-width: 1080px; margin: 0 auto; padding-block: 24px 120px; display: grid; gap: 32px; }
main { display: grid; gap: 40px; min-width: 0; }

/* Header */
.site-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; }
.brand { display: grid; gap: 6px; min-width: 0; }
.wordmark {
	font-family: var(--font-display); font-variation-settings: "opsz" 96; font-weight: 800;
	font-size: clamp(2rem, 6vw, 3.1rem); letter-spacing: -0.035em; line-height: 1; text-decoration: none; color: var(--ink);
}
.wordmark:hover { color: var(--ink); }
.wordmark .rocks { position: relative; color: var(--lamp); white-space: nowrap; }
.wordmark .rocks svg { position: absolute; left: -2%; bottom: -0.2em; width: 104%; height: 0.32em; overflow: visible; }
.wordmark .rocks path { fill: none; stroke: var(--lamp); stroke-width: 3; stroke-linecap: round; }
.tagline { color: var(--muted); font-size: 1.02rem; }
.site-nav { display: flex; align-items: center; gap: 12px 22px; flex-wrap: wrap; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px 18px; flex-wrap: wrap; }
.site-nav ul a { text-decoration: none; font-weight: 600; color: var(--ink); padding: 4px 0; border-bottom: 2px solid transparent; }
.site-nav ul a:hover { color: var(--ink); border-bottom-color: var(--lamp); }
.onair {
	display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-data); font-size: 0.8rem;
	border: 1px solid var(--rule); border-radius: 999px; padding: 7px 14px 7px 11px; background: var(--panel);
}
.lamp { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.onair[data-state="live"] .lamp { background: var(--lamp); box-shadow: 0 0 0 4px var(--lamp-soft), 0 0 12px var(--lamp); }
.onair .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.listen-btn { display: inline-block; text-decoration: none; font-weight: 700; background: var(--lamp); color: var(--ground); border-radius: 999px; padding: 9px 18px; }
.listen-btn:hover { color: var(--ground); filter: brightness(1.08); }

.notice { font-size: 0.92rem; color: var(--muted); border: 1px dashed var(--rule); border-radius: var(--radius); padding: 10px 14px; }

/* Player */
.deck {
	background: var(--panel); border: 1px solid var(--rule); border-radius: calc(var(--radius) + 6px);
	padding: clamp(18px, 3.5vw, 34px); display: grid; gap: 24px; min-width: 0;
}
.deck-top { display: grid; grid-template-columns: minmax(0, 260px) minmax(0, 1fr); gap: clamp(18px, 4vw, 40px); align-items: center; }
.art { width: 100%; max-width: 100%; aspect-ratio: 1 / 1; border-radius: 10px; overflow: hidden; background: var(--ground); border: 1px solid var(--rule); box-shadow: 0 18px 40px -20px rgba(0,0,0,.6); }
.art img, .art canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.np { min-width: 0; display: grid; gap: 10px; }
.show-chip { justify-self: start; display: inline-flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 0.92rem; color: var(--muted); }
.show-chip b { font-family: var(--font-hand); font-weight: 400; font-size: 1.5rem; line-height: 1; color: var(--lamp); }
.title {
	font-family: var(--font-display); font-variation-settings: "opsz" 72; font-weight: 700;
	font-size: clamp(1.9rem, 5vw, 3.3rem); line-height: 1.03; letter-spacing: -0.03em; text-wrap: balance; overflow-wrap: anywhere;
}
.artist { font-size: clamp(1.05rem, 2vw, 1.3rem); overflow-wrap: anywhere; }
.artist span { color: var(--muted); }
.progress { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 4px; font-family: var(--font-data); font-size: 0.78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.track { height: 4px; background: var(--rule); border-radius: 4px; overflow: hidden; }
.track i { display: block; height: 100%; width: 0; background: var(--ink); border-radius: 4px; transition: width 1s linear; }
.next { font-size: 0.92rem; color: var(--muted); overflow-wrap: anywhere; }
.next b { color: var(--ink); font-weight: 600; }

.controls { display: flex; align-items: center; gap: 18px 24px; flex-wrap: wrap; }
.play {
	width: 76px; height: 76px; border-radius: 50%; border: none; cursor: pointer; flex: none;
	background: var(--lamp); color: var(--ground); display: grid; place-items: center; box-shadow: 0 0 0 6px var(--lamp-soft);
	transition: transform .15s ease;
}
.play:hover { transform: scale(1.04); }
.play svg { width: 30px; height: 30px; fill: currentColor; }
.play-label { display: grid; gap: 2px; min-width: 0; }
.play-label strong { font-weight: 700; font-size: 1.12rem; }
.play-label span { font-size: 0.88rem; color: var(--muted); }
.eq { display: inline-flex; gap: 3px; align-items: flex-end; height: 16px; margin-left: 6px; }
.eq i { width: 3px; height: 4px; background: var(--lamp); border-radius: 1px; }
.playing .eq i { animation: sr-eq 0.9s ease-in-out infinite alternate; }
.playing .eq i:nth-child(2) { animation-delay: .25s; }
.playing .eq i:nth-child(3) { animation-delay: .5s; }
.playing .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes sr-eq { from { height: 3px; } to { height: 16px; } }

/* Volume as an amp gain scale, red zone 9 to 11 */
.gain { margin-left: auto; display: grid; gap: 6px; width: min(300px, 100%); }
.gain-head { display: flex; justify-content: space-between; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.gain-head b { font-family: var(--font-data); font-weight: 500; color: var(--ink); }
.scale-wrap { position: relative; height: 22px; }
.scale {
	position: absolute; inset: 0; border-right: 1px solid var(--muted);
	background:
		linear-gradient(90deg, transparent 0 81.82%, color-mix(in srgb, var(--hot) 30%, transparent) 81.82% 100%),
		repeating-linear-gradient(90deg, var(--muted) 0 1px, transparent 1px calc(100% / 11)),
		repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px calc(100% / 55));
	background-size: 100% 100%, 100% 100%, 100% 55%; background-repeat: no-repeat;
}
.needle { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1px; background: var(--lamp); left: 80%; border-radius: 2px; box-shadow: 0 0 10px var(--lamp); pointer-events: none; }
#volume { position: absolute; inset: -6px 0; width: 100%; height: 34px; margin: 0; opacity: 0; cursor: pointer; }
.scale-nums { display: flex; justify-content: space-between; font-family: var(--font-data); font-size: 0.68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.scale-nums span:nth-last-child(-n+2) { color: var(--hot); font-weight: 500; }
.deck-foot { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; border-top: 1px solid var(--rule); padding-top: 14px; }
.hero-note { color: var(--muted); font-size: 0.95rem; }
.spec { font-family: var(--font-data); font-size: 0.74rem; color: var(--muted); }
.status { font-size: 0.9rem; color: var(--lamp); }
.status:empty { display: none; }

/* Sections */
h1, h2 { font-family: var(--font-display); letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font-variation-settings: "opsz" 40; font-weight: 700; font-size: 1.45rem; }
.section-sub { color: var(--muted); font-size: 0.97rem; max-width: 60ch; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.block { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; min-width: 0; }

/* The setlist: today's shows on paper, taped down, played ones crossed off */
.setlist {
	position: relative; background: var(--paper); color: var(--paper-ink); margin-top: 10px;
	padding: 30px clamp(18px, 3vw, 30px) 24px; border-radius: 3px; transform: rotate(-0.8deg);
	box-shadow: 0 1px 0 rgba(0,0,0,.08), 0 14px 30px -12px rgba(0,0,0,.5);
}
.setlist::before, .setlist::after { content: ""; position: absolute; top: -12px; width: 92px; height: 26px; background: var(--tape); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.setlist::before { left: 22px; transform: rotate(-4deg); }
.setlist::after { right: 22px; transform: rotate(5deg); }
.setlist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.setlist-head .hand { font-family: var(--font-hand); font-size: 1.9rem; line-height: 1.1; }
.setlist-head .date { font-family: var(--font-data); font-size: 0.78rem; color: var(--paper-muted); }
.shows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.shows li { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 4px 14px; align-items: baseline; padding: 6px 8px; position: relative; }
.shows time { font-family: var(--font-data); font-size: 0.8rem; color: var(--paper-muted); font-variant-numeric: tabular-nums; }
.shows .name { font-family: var(--font-hand); font-size: 1.62rem; line-height: 1.1; }
.shows .blurb { grid-column: 2; font-size: 0.88rem; color: var(--paper-muted); line-height: 1.4; }
.shows li.done .name { text-decoration: line-through; text-decoration-color: var(--marker); text-decoration-thickness: 3px; color: var(--paper-muted); }
.shows li.done .blurb { opacity: .65; }
.shows li.now { border: 2.5px solid var(--marker); border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; margin: 2px -4px; padding: 8px 12px; }
.shows li.now .name { color: var(--marker); }
.shows li .on { position: absolute; right: 12px; top: 8px; font-family: var(--font-hand); color: var(--marker); font-size: 1.2rem; transform: rotate(4deg); }

/* Request House */
.requests { background: var(--panel); border: 1px solid var(--rule); border-radius: calc(var(--radius) + 4px); padding: clamp(18px, 3vw, 26px); display: grid; gap: 14px; min-width: 0; }
.req-state { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; flex-wrap: wrap; }
.pill { font-family: var(--font-data); font-size: 0.74rem; border-radius: 999px; padding: 3px 10px; border: 1px solid var(--rule); color: var(--muted); }
.pill.open { border-color: var(--lamp); color: var(--lamp); background: var(--lamp-soft); }
.search { display: grid; gap: 6px; }
.search label { font-size: 0.88rem; color: var(--muted); }
.search input { font: inherit; font-size: 1rem; color: var(--ink); background: var(--ground); border: 1px solid var(--rule); border-radius: 10px; padding: 11px 14px; width: 100%; }
.search input:disabled { opacity: .55; }
.results { list-style: none; margin: 0; padding: 0; display: grid; max-height: 380px; overflow-y: auto; }
.results li { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.results .t { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.results .a { font-size: 0.86rem; color: var(--muted); overflow-wrap: anywhere; }
.results .empty { display: block; color: var(--muted); font-size: 0.92rem; border: 0; padding: 10px 0; }
.req-btn { font: 600 0.85rem var(--font-body); border-radius: 999px; padding: 7px 14px; cursor: pointer; border: 1px solid var(--lamp); background: transparent; color: var(--lamp); white-space: nowrap; }
.req-btn:hover:not(:disabled) { background: var(--lamp); color: var(--ground); }
.req-btn:disabled { border-color: var(--rule); color: var(--muted); cursor: default; }
.req-msg { font-size: 0.92rem; }
.req-msg:empty { display: none; }
.req-msg.err { color: var(--lamp); }

/* History */
.history { list-style: none; margin: 0; padding: 0; display: grid; }
.history li { display: grid; grid-template-columns: 50px 44px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.history time { font-family: var(--font-data); font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.thumb { width: 44px; height: 44px; border-radius: 6px; background: var(--ground); border: 1px solid var(--rule); overflow: hidden; }
.results .thumb { width: 40px; height: 40px; }
.thumb img, .thumb canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.history .t { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.history .a { font-size: 0.88rem; color: var(--muted); overflow-wrap: anywhere; }

/* Listen anywhere */
.listen p { max-width: 62ch; }
.url { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.url code { flex: 1 1 220px; min-width: 0; font-family: var(--font-data); font-size: 0.82rem; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); overflow-x: auto; white-space: nowrap; user-select: all; }
.btn { font: 600 0.9rem var(--font-body); border-radius: 10px; padding: 10px 16px; cursor: pointer; border: 1px solid var(--ink); background: var(--ink); color: var(--panel); }
.btn:hover { opacity: .88; }
.ways { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ways li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 12px; font-size: 0.95rem; }
.ways b { font-weight: 600; color: var(--muted); }
.soon { color: var(--muted); }

/* About */
.about { display: grid; gap: 12px; max-width: 68ch; }
.about p { font-size: 1.08rem; }

/* Mini player, docked once the main player scrolls away */
.mini {
	position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(14px + env(safe-area-inset-bottom, 0px)); z-index: 50;
	width: min(560px, calc(100% - 24px)); display: grid; grid-template-columns: auto 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
	background: var(--panel); border: 1px solid var(--rule); border-radius: 999px; padding: 8px 18px 8px 8px;
	box-shadow: 0 16px 40px -12px rgba(0,0,0,.55);
}
.mini-play { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--lamp); color: var(--ground); display: grid; place-items: center; cursor: pointer; }
.mini-play svg { width: 20px; height: 20px; fill: currentColor; }
.mini-play .i-pause { display: none; }
.mini.playing .mini-play .i-play { display: none; }
.mini.playing .mini-play .i-pause { display: block; }
.mini-art { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--ground); }
.mini-art img, .mini-art canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.mini-text { min-width: 0; display: grid; line-height: 1.25; }
.mini-text b, .mini-text span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-text span { color: var(--muted); font-size: 0.86rem; }
.mini-up { font-size: 0.85rem; color: var(--muted); text-decoration: none; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); padding-top: 22px; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px 32px; flex-wrap: wrap; font-size: 0.9rem; color: var(--muted); }
.footer-name { font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; letter-spacing: -0.03em; color: var(--ink); }
.footer-name span { color: var(--lamp); }
.socials { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px 18px; flex-wrap: wrap; }
.socials a { font-weight: 600; color: var(--ink); text-decoration: none; }
.socials a:hover { color: var(--lamp); }
.footer-small { display: grid; gap: 4px; text-align: right; }

/* Plain pages */
.page-main { max-width: 68ch; }
.prose { display: grid; gap: 14px; }
.prose h1 { font-variation-settings: "opsz" 72; font-weight: 800; font-size: clamp(2rem, 5vw, 2.8rem); }
.prose h2 { margin-top: 12px; }
.prose p, .prose li { font-size: 1.05rem; }
.prose ul, .prose ol { margin: 0; padding-left: 1.2em; }
.lost .hand { font-family: var(--font-hand); color: var(--lamp); font-size: 1.8rem; }

@media (max-width: 780px) {
	.deck-top { grid-template-columns: minmax(0, 1fr); }
	.art { max-width: 260px; }
	.cols { grid-template-columns: minmax(0, 1fr); }
	.gain { margin-left: 0; }
	.setlist { transform: none; }
	.site-nav { width: 100%; justify-content: space-between; }
	.footer-small { text-align: left; }
	.mini-up { display: none; }
	.mini { grid-template-columns: auto 40px minmax(0, 1fr); padding-right: 14px; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.track i, .play { transition: none; }
	.playing .eq i { animation: none; height: 10px; }
}
