/*
 * AUD-ST-004: Store Radio on WooCommerce — the station page shell and the
 * "Listen" launcher ([gobolt_radio_launcher] and the widget).
 *
 * The plugin's own tokens (Meridian defaults, as in the Store Radio POC). A
 * theme or the merchant's custom CSS changes the look by overriding the
 * --wpsc-radio-* properties; the station inside the shell reads them through
 * its --accent and --r contract. Text keeps the theme's font, as the station does.
 */
.wpsc-radio-page,
.wpsc-radio-launcher {
	--wpsc-radio-ink: #1e1d1a;
	--wpsc-radio-ink-hover: #57544d;
	--wpsc-radio-on-ink: #ffffff;
	--wpsc-radio-accent: #1c6b52;
	--wpsc-radio-well: rgba(30, 29, 26, 0.05);
	--wpsc-radio-surface: #ffffff;
	--wpsc-radio-sunken: #efede8;
	--wpsc-radio-hairline: #eceae4;
	--wpsc-radio-shadow: 0 1px 2px rgba(30, 29, 26, 0.06), 0 8px 24px rgba(30, 29, 26, 0.08);
	--wpsc-radio-radius: 16px;
}

/* ---------- Station page shell ---------- */
.wpsc-radio-page {
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
}

/* Same box the station takes once mounted, so nothing shifts. */
.wpsc-radio-page .gobolt-radio {
	display: block;
	box-sizing: border-box;
	max-width: 1040px;
	margin: 0 auto;
	padding: 26px 16px 24px;
}

/* The station's theming contract (src/radio/CONTRACT.md): it reads --accent
   and --r from any ancestor. Set here so a theme's own --accent never
   repaints the station; AUD-ST-009's appearance settings land on the root,
   closer, and win. */
.wpsc-radio-page {
	--accent: var(--wpsc-radio-accent);
	--r: var(--wpsc-radio-radius);
}

/* ---------- Loading skeleton: the POC Gallery layout in outline ---------- */
.wpsc-radio-page .gobolt-radio__boot {
	display: grid;
	gap: 22px;
}

.wpsc-radio-page .gobolt-radio__boot[hidden] {
	display: none;
}

.wpsc-radio-page .gobolt-radio__boot-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 12px 20px;
}

.wpsc-radio-page .gobolt-radio__boot-titles {
	display: grid;
	flex: 1 1 240px;
	gap: 10px;
}

/* The now-playing card: the station's surface, hairline and shadow. */
.wpsc-radio-page .gobolt-radio__boot-now {
	display: grid;
	grid-template-columns: minmax(220px, 340px) 1fr;
	gap: 22px;
	padding: 22px;
	border: 1px solid var(--wpsc-radio-hairline);
	border-radius: var(--wpsc-radio-radius);
	background: var(--wpsc-radio-surface);
	box-shadow: var(--wpsc-radio-shadow);
}

.wpsc-radio-page .gobolt-radio__boot-info {
	display: grid;
	align-content: start;
	gap: 12px;
}

.wpsc-radio-page .gobolt-radio__boot-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 6px;
}

.wpsc-radio-page .gobolt-radio__bone {
	display: block;
	height: 12px;
	border-radius: 6px;
	background: var(--wpsc-radio-sunken);
	animation: wpsc-radio-breathe 1.2s ease-in-out infinite alternate;
}

/* The header sits on the theme's own background: tint from its text colour. */
.wpsc-radio-page .gobolt-radio__boot-head .gobolt-radio__bone {
	background: var(--wpsc-radio-well);
	background: color-mix(in srgb, currentColor 9%, transparent);
}

.wpsc-radio-page .gobolt-radio__bone--kicker { width: 96px; height: 10px; }
.wpsc-radio-page .gobolt-radio__bone--title { width: min(320px, 80%); height: 30px; border-radius: 8px; }
.wpsc-radio-page .gobolt-radio__bone--meta { width: 200px; max-width: 70%; height: 13px; }
.wpsc-radio-page .gobolt-radio__bone--button { width: 116px; height: 44px; border-radius: 10px; }
.wpsc-radio-page .gobolt-radio__bone--button-alt { width: 132px; height: 44px; border-radius: 10px; }
.wpsc-radio-page .gobolt-radio__bone--art { width: 100%; height: auto; aspect-ratio: 1; border-radius: 12px; }
.wpsc-radio-page .gobolt-radio__bone--name { width: 75%; height: 24px; border-radius: 8px; }
.wpsc-radio-page .gobolt-radio__bone--price { width: 90px; height: 18px; }
.wpsc-radio-page .gobolt-radio__bone--line { width: 100%; }
.wpsc-radio-page .gobolt-radio__bone--line-short { width: 60%; }

@keyframes wpsc-radio-breathe {
	from { opacity: 1; }
	to { opacity: 0.55; }
}

/* Same breakpoint as the station: the card stacks, the art stays modest. */
@media (max-width: 760px) {
	.wpsc-radio-page .gobolt-radio__boot-now {
		grid-template-columns: 1fr;
		gap: 16px;
		padding: 16px;
	}

	.wpsc-radio-page .gobolt-radio__bone--art {
		max-width: 280px;
	}
}

/* Without scripts only the fallback shows. */
@media (scripting: none) {
	.wpsc-radio-page .gobolt-radio__boot {
		display: none;
	}
}

/* ---------- Could not load: a calm card, like the POC's empty state ---------- */
.wpsc-radio-page .gobolt-radio__fallback {
	max-width: 640px;
	margin: 24px auto 0;
	padding: 22px 26px;
	border: 1px solid var(--wpsc-radio-hairline);
	border-radius: var(--wpsc-radio-radius);
	background: var(--wpsc-radio-surface);
	box-shadow: var(--wpsc-radio-shadow);
	color: var(--wpsc-radio-ink);
	line-height: 1.55;
}

.wpsc-radio-page .gobolt-radio__fallback a,
.wpsc-radio-page .gobolt-radio__fallback a:hover {
	background: none;
	box-shadow: none;
	color: var(--wpsc-radio-accent);
	font-weight: 600;
	letter-spacing: normal;
	text-decoration: underline;
	text-transform: none;
	text-underline-offset: 2px;
}

.wpsc-radio-page .gobolt-radio__fallback[hidden] {
	display: none;
}

/* ---------- "Listen" launcher (the POC's listen pill) ---------- */
/* Doubled class: outranks a theme's `.entry-content a` and `a:hover`. */
a.wpsc-radio-launcher.wpsc-radio-launcher {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	box-sizing: border-box;
	min-height: 44px;
	padding: 7px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--wpsc-radio-ink);
	color: var(--wpsc-radio-on-ink);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	text-shadow: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

a.wpsc-radio-launcher.wpsc-radio-launcher:hover,
a.wpsc-radio-launcher.wpsc-radio-launcher:active {
	background: var(--wpsc-radio-ink-hover);
	color: var(--wpsc-radio-on-ink);
	text-decoration: none;
}

a.wpsc-radio-launcher.wpsc-radio-launcher:focus-visible {
	outline: 2px solid var(--wpsc-radio-accent);
	outline-offset: 2px;
	color: var(--wpsc-radio-on-ink);
}

.wpsc-radio-launcher__eq {
	display: inline-flex;
	align-items: flex-end;
	gap: 2px;
	height: 12px;
}

.wpsc-radio-launcher__eq i {
	display: block;
	width: 2px;
	height: 40%;
	border-radius: 1px;
	background: currentColor;
}

.wpsc-radio-launcher__eq i:nth-child(2) {
	height: 100%;
}

.wpsc-radio-launcher__eq i:nth-child(3) {
	height: 65%;
}

@media (prefers-reduced-motion: reduce) {
	a.wpsc-radio-launcher.wpsc-radio-launcher {
		transition: none;
	}

	.wpsc-radio-page .gobolt-radio__bone {
		animation: none;
	}
}
