/**
 * RESCUED Radio Spots — front-end styles.
 * Everything is scoped under .rs-spots so nothing here can leak into the theme.
 */

.rs-spots {
	--rs-ink: #14202B;
	--rs-brass: #B7862F;
	--rs-brass-lt: #DCB96F;
	--rs-brick: #9E3626;
	--rs-stone: #8B8271;
	--rs-body: #43403A;
	--rs-card: #FFFFFF;
	--rs-rule: rgba(20, 32, 43, .15);

	--rs-display: "Archivo", "Helvetica Neue", Arial, sans-serif;
	--rs-text: "Nunito Sans", "Segoe UI", system-ui, sans-serif;
	--rs-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;

	font-family: var(--rs-text);
	color: var(--rs-body);
	font-size: 16.5px;
	line-height: 1.6;

	/* The rows respond to the width of THIS container, not the viewport. A theme
	   may hand the shortcode a 660px column inside a 1440px window, and a plain
	   media query would never fire. */
	container-type: inline-size;
	container-name: rsspots;
}

.rs-spots *,
.rs-spots *::before,
.rs-spots *::after {
	box-sizing: border-box;
}

/* ---------- week ---------- */

.rs-week {
	margin-top: 56px;
}

.rs-week:first-child {
	margin-top: 0;
}

.rs-weekhead {
	display: flex;
	align-items: baseline;
	gap: 16px;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--rs-ink);
	padding-bottom: 11px;
	margin-bottom: 20px;
}

.rs-weekhead .rs-wk {
	font-family: var(--rs-mono);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--rs-brass-lt);
	background: var(--rs-ink);
	padding: 5px 10px;
	border-radius: 2px;
}

.rs-spots .rs-weekhead h2 {
	font-family: var(--rs-display);
	font-size: clamp(25px, 4vw, 36px);
	font-weight: 900;
	font-stretch: 76%;
	letter-spacing: .01em;
	text-transform: uppercase;
	color: var(--rs-ink);
	margin: 0;
	padding: 0;
	line-height: 1.1;
}

.rs-weekhead .rs-dates {
	font-family: var(--rs-mono);
	font-size: 13px;
	color: var(--rs-stone);
	margin-left: auto;
	font-variant-numeric: tabular-nums;
	letter-spacing: .02em;
}

/* ---------- row ---------- */

.rs-spot {
	display: grid;
	grid-template-columns: 104px minmax(0, 1fr) 232px;
	gap: 0 26px;
	align-items: center;
	padding: 20px 24px 20px 20px;
	margin-bottom: 10px;
	border-radius: 4px;
	scroll-margin-top: 90px;
	transition: transform .16s ease, box-shadow .16s ease;
}

.rs-spot .rs-num {
	font-family: var(--rs-display);
	font-weight: 900;
	font-stretch: 70%;
	font-size: 42px;
	line-height: .9;
	letter-spacing: .01em;
	font-variant-numeric: tabular-nums;
}

.rs-spot .rs-air {
	font-family: var(--rs-mono);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .1em;
	text-transform: uppercase;
	margin-top: 5px;
}

.rs-spots .rs-spot h3 {
	font-family: var(--rs-display);
	font-size: 21px;
	font-weight: 800;
	font-stretch: 88%;
	letter-spacing: .005em;
	color: var(--rs-ink);
	margin: 0 0 4px;
	padding: 0;
	line-height: 1.25;
	text-wrap: balance;
}

.rs-spots .rs-spot p {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.5;
	max-width: 52ch;
}

.rs-spot .rs-act {
	justify-self: end;
	text-align: right;
	width: 100%;
}

/* -- live / on air -- */

.rs-spot[data-state="live"],
.rs-spot[data-state="onair"] {
	background: var(--rs-card);
	border: 1px solid var(--rs-rule);
	border-left: 5px solid var(--rs-brass);
	box-shadow: 0 1px 2px rgba(20, 32, 43, .06);
}

.rs-spot[data-state="live"]:hover,
.rs-spot[data-state="onair"]:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px -10px rgba(20, 32, 43, .38);
}

.rs-spot[data-state="live"] .rs-num,
.rs-spot[data-state="onair"] .rs-num {
	color: var(--rs-ink);
}

.rs-spot[data-state="live"] .rs-air,
.rs-spot[data-state="onair"] .rs-air {
	color: var(--rs-brass);
}

.rs-spot[data-state="onair"] {
	border-left-color: var(--rs-brick);
	background: #FFFCF7;
}

.rs-spot[data-state="onair"] .rs-air {
	color: var(--rs-brick);
}

.rs-onair {
	display: none;
	align-items: center;
	gap: 7px;
	font-family: var(--rs-mono);
	font-size: 10.5px;
	font-weight: 600;
	letter-spacing: .15em;
	text-transform: uppercase;
	color: var(--rs-brick);
	margin-bottom: 7px;
}

.rs-spot[data-state="onair"] .rs-onair {
	display: inline-flex;
}

.rs-onair i {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--rs-brick);
	animation: rs-blip 1.9s ease-in-out infinite;
}

@keyframes rs-blip {
	0%, 100% { opacity: 1; transform: scale(1); }
	50% { opacity: .28; transform: scale(.72); }
}

/* -- locked -- */

.rs-spot[data-state="locked"] {
	background: transparent;
	border: 1px dashed rgba(20, 32, 43, .2);
	border-left: 5px solid rgba(20, 32, 43, .14);
}

.rs-spot[data-state="locked"] .rs-num {
	color: rgba(20, 32, 43, .2);
}

.rs-spot[data-state="locked"] .rs-air {
	color: rgba(139, 130, 113, .85);
}

.rs-spots .rs-spot[data-state="locked"] h3 {
	color: rgba(20, 32, 43, .42);
}

.rs-spots .rs-spot[data-state="locked"] p {
	color: rgba(67, 64, 58, .5);
}

/* ---------- actions ---------- */

.rs-spots .rs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	width: 100%;
	font-family: var(--rs-display);
	font-weight: 800;
	font-stretch: 86%;
	font-size: 13.5px;
	letter-spacing: .07em;
	text-transform: uppercase;
	padding: 12px 16px;
	border-radius: 3px;
	text-decoration: none;
	background: var(--rs-ink);
	color: #FBF6EC;
	border: 1px solid var(--rs-ink);
	box-shadow: none;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.rs-spots .rs-btn:hover,
.rs-spots .rs-btn:focus {
	background: var(--rs-brass);
	border-color: var(--rs-brass);
	color: var(--rs-ink);
}

.rs-spots .rs-btn.rs-ghost {
	background: transparent;
	color: var(--rs-ink);
}

.rs-spots .rs-btn.rs-ghost:hover,
.rs-spots .rs-btn.rs-ghost:focus {
	background: var(--rs-ink);
	color: #FBF6EC;
}

.rs-spots .rs-btn svg {
	width: 14px;
	height: 14px;
	flex: none;
}

.rs-meta {
	display: block;
	font-family: var(--rs-text);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.35;
	color: var(--rs-stone);
	margin-top: 8px;
}

.rs-meta em {
	font-style: normal;
	font-family: var(--rs-mono);
	font-weight: 400;
	font-size: 11.5px;
	color: rgba(139, 130, 113, .85);
}

.rs-pending {
	font-family: var(--rs-mono);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: .06em;
	color: var(--rs-stone);
	border: 1px dashed rgba(20, 32, 43, .22);
	border-radius: 3px;
	padding: 12px 14px;
	text-align: center;
	text-transform: uppercase;
}

.rs-spots a:focus-visible,
.rs-spots button:focus-visible {
	outline: 3px solid var(--rs-brass);
	outline-offset: 2px;
}

/* ---------- responds to the container, not the window ---------- */

/* Mid width: same three columns, tightened so the headline keeps its room. */
@container rsspots (max-width: 1000px) {

	.rs-spot {
		grid-template-columns: 84px minmax(0, 1fr) 190px;
		gap: 0 18px;
		padding: 18px 18px 18px 16px;
	}

	.rs-spot .rs-num {
		font-size: 34px;
	}

	.rs-spots .rs-spot h3 {
		font-size: 19px;
	}
}

/* Narrow: stack. Below roughly 760px the three-column row stops being readable. */
@container rsspots (max-width: 760px) {

	/* The theme's container can run flush to the screen edge on a phone, so the
	   week block carries its own gutter here. One value, both sides. */
	.rs-week {
		padding-left: 16px;
		padding-right: 16px;
	}

	/* Stack the week header: chip, then theme name, then dates. Side by side
	   they squeeze the theme name onto two lines on a narrow screen. */
	.rs-weekhead {
		flex-direction: column;
		align-items: flex-start;
		gap: 9px;
	}

	.rs-weekhead .rs-dates {
		margin-left: 0;
		width: auto;
	}

	.rs-spot {
		grid-template-columns: 1fr;
		gap: 14px;
		padding: 20px;
	}

	.rs-spot .rs-lead {
		display: flex;
		align-items: baseline;
		gap: 14px;
	}

	.rs-spot .rs-num {
		font-size: 32px;
	}

	.rs-spot .rs-air {
		margin-top: 0;
	}

	.rs-spot .rs-act {
		justify-self: stretch;
		text-align: left;
	}

}

/* Fallback for browsers without container queries: same rules, viewport-based.
   Duplicated deliberately — the two cannot be merged into one selector list. */
@supports not (container-type: inline-size) {

	@media (max-width: 820px) {

		/* The theme's container can run flush to the screen edge on a phone, so the
		   week block carries its own gutter here. One value, both sides. */
		.rs-week {
			padding-left: 16px;
			padding-right: 16px;
		}

		/* Stack the week header: chip, then theme name, then dates. Side by side
		   they squeeze the theme name onto two lines on a narrow screen. */
		.rs-weekhead {
			flex-direction: column;
			align-items: flex-start;
			gap: 9px;
		}

		.rs-weekhead .rs-dates {
			margin-left: 0;
			width: auto;
		}

		.rs-spot {
			grid-template-columns: 1fr;
			gap: 14px;
			padding: 20px;
		}

		.rs-spot .rs-lead {
			display: flex;
			align-items: baseline;
			gap: 14px;
		}

		.rs-spot .rs-num {
			font-size: 32px;
		}

		.rs-spot .rs-air {
			margin-top: 0;
		}

		.rs-spot .rs-act {
			justify-self: stretch;
			text-align: left;
		}

	}
}

@media (prefers-reduced-motion: reduce) {

	.rs-spots *,
	.rs-spots *::before,
	.rs-spots *::after {
		animation: none !important;
		transition: none !important;
	}
}
