:root {
	--hifm-accent: var(--wp--preset--color--accent-1, #ff3d6e);
	--hifm-surface: var(--wp--preset--color--accent-5, #1b1530);
	--hifm-text: var(--wp--preset--color--contrast, #fff);
	--hifm-muted: var(--wp--preset--color--accent-4, #a79fc2);
	--hifm-radius: 14px;
}

/* Badges & buttons */
.hifm-badge {
	display: inline-block;
	padding: 0.15em 0.65em;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: color-mix(in srgb, var(--hifm-text) 12%, transparent);
	vertical-align: middle;
}

.hifm-badge--live {
	background: var(--hifm-accent);
	color: #fff;
}

.hifm-badge--live::before {
	content: "";
	display: inline-block;
	width: 0.5em;
	height: 0.5em;
	margin-right: 0.4em;
	border-radius: 50%;
	background: currentColor;
	animation: hifm-pulse 1.4s ease-in-out infinite;
}

.hifm-listen-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.8em 1.6em;
	border: 0;
	border-radius: 999px;
	background: var(--hifm-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform 0.15s ease, filter 0.15s ease;
}

.hifm-listen-btn::before {
	content: "▶";
}

.hifm-listen-btn.is-playing::before {
	content: "❚❚";
}

.hifm-listen-btn:hover,
.hifm-listen-btn:focus-visible {
	transform: translateY(-1px);
	filter: brightness(1.1);
}

/* On air card */
.hifm-on-air {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: 2fr 1fr;
	align-items: stretch;
}

.hifm-on-air > div {
	padding: 1.75rem;
	border: 1px solid var(--hifm-border, transparent);
	border-radius: var(--hifm-radius);
	background: var(--hifm-surface);
}

.hifm-on-air__title {
	margin: 0.6rem 0 0.25rem;
	font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.hifm-on-air__title a,
.hifm-on-air__next a {
	color: inherit;
	text-decoration: none;
}

.hifm-on-air__meta {
	color: var(--hifm-muted);
	margin: 0 0 0.75rem;
}

.hifm-on-air__image img {
	display: block;
	width: 100%;
	max-height: 260px;
	margin-top: 1rem;
	object-fit: cover;
	border-radius: calc(var(--hifm-radius) - 4px);
}

.hifm-on-air__next h4 {
	margin: 0.6rem 0 0.25rem;
	font-size: 1.3rem;
}

@media (max-width: 781px) {
	.hifm-on-air {
		grid-template-columns: 1fr;
	}
}

/* Schedule */
.hifm-schedule {
	display: grid;
	gap: 1.25rem;
}

.hifm-schedule__day {
	padding: 1.25rem 1.5rem;
	border: 1px solid var(--hifm-border, transparent);
	border-radius: var(--hifm-radius);
	background: var(--hifm-surface);
}

.hifm-schedule__day.is-today {
	outline: 2px solid var(--hifm-accent);
}

.hifm-schedule__day h3 {
	margin: 0 0 0.75rem;
}

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

.hifm-schedule__slot {
	display: grid;
	grid-template-columns: 13rem 1fr;
	gap: 1rem;
	padding: 0.65rem 0;
	border-top: 1px solid color-mix(in srgb, var(--hifm-text) 10%, transparent);
}

.hifm-schedule__slot:first-child {
	border-top: 0;
}

.hifm-schedule__slot.is-live {
	color: var(--hifm-accent);
}

.hifm-schedule__time {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
	color: var(--hifm-muted);
}

.hifm-schedule__show a {
	font-weight: 700;
	color: inherit;
	text-decoration: none;
}

.hifm-schedule__show small {
	display: block;
	color: var(--hifm-muted);
}

.hifm-schedule__empty {
	margin: 0;
	color: var(--hifm-muted);
}

@media (max-width: 600px) {
	.hifm-schedule__slot {
		grid-template-columns: 1fr;
		gap: 0.2rem;
	}
}

/* Hosts */
.hifm-hosts {
	display: grid;
	gap: 1.5rem;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.hifm-host {
	padding: 1.25rem;
	border: 1px solid var(--hifm-border, transparent);
	border-radius: var(--hifm-radius);
	background: var(--hifm-surface);
	text-align: center;
}

.hifm-host h3 {
	margin: 0.9rem 0 0.25rem;
	font-size: 1.2rem;
}

.hifm-host h3 a {
	color: inherit;
	text-decoration: none;
}

.hifm-host p {
	margin: 0;
	color: var(--hifm-muted);
	font-size: 0.95rem;
}

.hifm-host__image img,
.hifm-host__initials {
	display: grid;
	place-items: center;
	width: 140px;
	height: 140px;
	margin: 0 auto;
	border-radius: 50%;
	object-fit: cover;
}

.hifm-host__initials {
	background: linear-gradient(135deg, var(--hifm-accent), var(--hifm-accent-2, #7b5cff));
	color: #fff;
	font-size: 2.6rem;
	font-weight: 800;
	text-decoration: none;
}

.hifm-host-shows ul,
.hifm-request-line {
	padding-left: 1.1em;
}

.hifm-host-shows small {
	color: var(--hifm-muted);
}

/* Sticky player */
body.has-hifm-player {
	padding-bottom: 76px;
}

.hifm-player {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	gap: 1rem;
	height: 76px;
	padding: 0 clamp(1rem, 4vw, 2.5rem);
	background: var(--hifm-player-bg, rgba(15, 11, 28, 0.92));
	backdrop-filter: blur(12px);
	border-top: 1px solid var(--hifm-player-border, rgba(255, 255, 255, 0.08));
	box-shadow: 0 -4px 24px rgb(0 0 0 / 0.06);
	color: var(--hifm-player-text, #fff);
	font-size: 0.95rem;
}

.hifm-player__toggle {
	flex: none;
	display: grid;
	place-items: center;
	width: 50px;
	height: 50px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--hifm-accent);
	color: #fff;
	cursor: pointer;
}

.hifm-player__toggle svg {
	width: 26px;
	height: 26px;
	fill: currentColor;
}

.hifm-player .hifm-icon-pause,
.hifm-player.is-playing .hifm-icon-play {
	display: none;
}

.hifm-player.is-playing .hifm-icon-pause {
	display: block;
}

.hifm-player__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1;
	line-height: 1.3;
}

.hifm-player__station {
	font-weight: 800;
}

.hifm-player__freq {
	font-weight: 400;
	opacity: 0.7;
}

.hifm-player__now {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	opacity: 0.85;
}

.hifm-player__live-dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #777;
}

.hifm-player.is-playing .hifm-player__live-dot {
	background: var(--hifm-accent);
	animation: hifm-pulse 1.4s ease-in-out infinite;
}

.hifm-player__status {
	font-size: 0.8rem;
	opacity: 0.7;
}

.hifm-player__status:empty {
	display: none;
}

.hifm-player__volume input {
	width: 120px;
	accent-color: var(--hifm-accent);
}

@media (max-width: 600px) {
	.hifm-player__volume {
		display: none;
	}
}

@keyframes hifm-pulse {
	50% {
		opacity: 0.35;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hifm-badge--live::before,
	.hifm-player.is-playing .hifm-player__live-dot {
		animation: none;
	}
}

/* Live video streams */
.hifm-stream-frame {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--hifm-radius);
	background: #000;
}

.hifm-stream-frame iframe,
.hifm-stream-frame video,
.hifm-stream-frame > div,
.hifm-stream-frame .wp-embedded-content {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	border: 0;
}

.hifm-stream-frame--empty {
	display: grid;
	place-items: center;
	color: #fff;
	text-align: center;
	padding: 1rem;
}

.hifm-stream-facade {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 100%;
	padding: 0;
	border: 0;
	background: linear-gradient(135deg, var(--hifm-accent), var(--hifm-accent-2, #7b5cff));
	cursor: pointer;
}

.hifm-stream-facade img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease, filter 0.4s ease;
}

.hifm-stream-facade:hover img {
	transform: scale(1.03);
	filter: brightness(0.85);
}

.hifm-stream-facade__play {
	position: relative;
	display: grid;
	place-items: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: var(--hifm-accent);
	box-shadow: 0 10px 30px rgb(0 0 0 / 0.35);
	transition: transform 0.2s ease;
}

.hifm-stream-facade:hover .hifm-stream-facade__play {
	transform: scale(1.08);
}

.hifm-stream-facade__play svg {
	width: 34px;
	height: 34px;
	margin-left: 4px;
	fill: #fff;
}

.hifm-stream-embed {
	margin: 1.5em 0;
}

.hifm-streams {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: repeat(var(--hifm-columns, 3), minmax(0, 1fr));
}

@media (max-width: 781px) {
	.hifm-streams {
		grid-template-columns: 1fr;
	}
}

.hifm-stream-card h3 {
	margin: 0.6rem 0 0.1rem;
	font-size: 1.05rem;
	line-height: 1.3;
}

.hifm-stream-card h3 a {
	color: inherit;
	text-decoration: none;
}

.hifm-stream-card p {
	margin: 0;
	color: var(--hifm-muted);
	font-size: 0.85rem;
}

.hifm-stream-card__thumb {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	border-radius: var(--hifm-radius);
	background: linear-gradient(135deg, var(--hifm-accent), var(--hifm-accent-2, #7b5cff));
}

.hifm-stream-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hifm-stream-status {
	position: absolute;
	top: 0.6rem;
	left: 0.6rem;
	padding: 0.2em 0.6em;
	border-radius: 4px;
	background: rgb(0 0 0 / 0.7);
	color: #fff;
	font-size: 0.7rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.hifm-stream-status--live {
	background: var(--hifm-accent);
}

/* Mini player that keeps a stream going while the visitor browses */
.hifm-video-dock {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 9998;
	width: min(380px, calc(100vw - 2rem));
	overflow: hidden;
	border-radius: var(--hifm-radius, 8px);
	background: #000;
	box-shadow: 0 12px 40px rgb(0 0 0 / 0.35);
	animation: hifm-dock-in 0.25s ease-out;
}

.hifm-video-dock[hidden] {
	display: none;
}

body.has-hifm-player .hifm-video-dock {
	bottom: calc(76px + 1rem);
}

@media (max-width: 640px) {
	.hifm-video-dock {
		right: 0.75rem;
		width: min(260px, 65vw);
	}

	body.has-hifm-player .hifm-video-dock {
		bottom: calc(76px + 0.75rem);
	}
}

.hifm-video-dock__bar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.5rem 0.45rem 0.75rem;
	background: var(--hifm-accent);
	color: #fff;
	font-size: 0.8rem;
	line-height: 1.2;
}

.hifm-video-dock__label {
	flex-shrink: 0;
	font-weight: 800;
	font-size: 0.65rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.85;
}

.hifm-video-dock__title {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	color: inherit;
	font-weight: 700;
	text-decoration: none;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hifm-video-dock__title:hover {
	text-decoration: underline;
}

.hifm-video-dock__close {
	display: grid;
	flex-shrink: 0;
	place-items: center;
	width: 28px;
	height: 28px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

.hifm-video-dock__close:hover {
	background: rgb(255 255 255 / 0.2);
}

.hifm-video-dock__close svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.5;
	stroke-linecap: round;
}

.hifm-video-dock .hifm-stream-frame {
	border-radius: 0;
}

@keyframes hifm-dock-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
}

/* Loading bar for pages swapped in place */
.hifm-navigating body::before {
	content: "";
	position: fixed;
	inset: 0 0 auto 0;
	z-index: 100000;
	height: 3px;
	background: var(--hifm-accent);
	transform-origin: left;
	animation: hifm-loading 1.2s ease-out forwards;
}

@keyframes hifm-loading {
	from {
		transform: scaleX(0);
	}
	to {
		transform: scaleX(0.85);
	}
}

@media (prefers-reduced-motion: reduce) {
	.hifm-video-dock,
	.hifm-navigating body::before {
		animation: none;
	}
}
