/*
 * Κρήτη FM «Κλίμακα»: header, menu drawer, the dial, page frame, footer.
 * Desktop menu from 1100 px; below that the menu is a drawer with «Ακούστε live» first.
 */

/* =========================================================
   Header
   ========================================================= */
/* No z-index here: it would trap the drawer under the backdrop. */
.kfm-header {
	background: var(--bg);
	border-bottom: 1px solid var(--line);
}
.kfm-header__bar {
	display: flex;
	align-items: center;
	gap: 28px;
	min-height: var(--header-h);
}

.kfm-logo { display: inline-flex; flex: none; border-radius: 4px; }
.kfm-logo__img { width: auto; height: 56px; }
.kfm-logo--footer .kfm-logo__img { height: 48px; }

.kfm-header__actions { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.kfm-header__live { padding: 10px 20px 10px 16px; }

.kfm-header__menu {
	display: none;
	align-items: center; gap: 8px;
	min-height: 44px; min-width: 44px;
	padding: 10px 14px;
	border: 1px solid var(--line); border-radius: 999px;
	background: transparent; color: var(--ink);
	font-weight: 500; font-size: 15px;
}
.kfm-header__menu:hover { border-color: var(--mute); }
.kfm-header__menu .kfm-icon { width: 20px; height: 20px; }

/* ---------- Menu (desktop) ---------- */
.kfm-nav { margin-left: auto; }
.kfm-nav__head, .kfm-nav__live { display: none; }
.kfm-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; }
.kfm-menu a {
	display: block;
	padding: 8px 0;
	color: var(--mute);
	font-size: 15px; font-weight: 500;
	text-decoration: none;
	box-shadow: inset 0 -2px 0 transparent;
}
.kfm-menu a:hover { color: var(--ink); }
.kfm-menu a[aria-current="page"],
.kfm-menu .current-menu-item > a { color: var(--ink); box-shadow: inset 0 -2px 0 var(--or); }
.kfm-nav + .kfm-header__actions { margin-left: 0; }

/* ---------- Below the desktop breakpoint ---------- */
@media (max-width: 1099px) {
	.kfm-header__bar { gap: 16px; }
	.kfm-header__menu { display: inline-flex; }
	.kfm-nav + .kfm-header__actions { margin-left: auto; }

	/* Without JS: the menu wraps under the bar as a plain row of links. */
	.no-js .kfm-header__bar { flex-wrap: wrap; }
	.no-js .kfm-header__menu { display: none; }
	.no-js .kfm-nav { order: 3; width: 100%; margin: 0 0 12px; }
	.no-js .kfm-menu { gap: 4px 20px; }

	/* With JS: a side drawer. No slide animation (motion is reserved for the needle and the meter). */
	.js .kfm-nav {
		position: fixed;
		inset: var(--wp-admin--admin-bar--height, 0px) 0 0 auto;
		z-index: 300;
		width: min(88vw, 380px);
		margin: 0;
		padding: 12px 20px 32px;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--deep);
		border-left: 1px solid var(--line);
		box-shadow: -24px 0 48px rgba(0, 0, 0, .45);
		visibility: hidden;
		transform: translateX(100%);
	}
	.js .kfm-nav.is-open { visibility: visible; transform: none; }

	.js .kfm-nav__head {
		display: flex; align-items: center; justify-content: space-between;
		min-height: 56px; margin-bottom: 12px;
	}
	.kfm-nav__title { font-family: var(--font-display); font-weight: 600; font-size: 22px; color: var(--mute); }
	.kfm-nav__close {
		display: grid; place-items: center;
		width: 44px; height: 44px;
		border: 1px solid var(--line); border-radius: 50%;
		background: transparent; color: var(--ink);
	}
	.kfm-nav__close:hover { border-color: var(--mute); }

	.js .kfm-nav__live { display: block; margin-bottom: 16px; }
	.js .kfm-nav__live .kfm-btn { min-height: 52px; font-size: 18px; }

	.js .kfm-menu { display: block; }
	.js .kfm-menu a {
		padding: 14px 4px 14px 14px;
		border-bottom: 1px solid var(--line);
		color: var(--ink);
		font-size: 19px;
		box-shadow: none;
	}
	.js .kfm-menu li:first-of-type:not(.kfm-nav__live) a,
	.js .kfm-nav__live + li a { border-top: 1px solid var(--line); }
	.js .kfm-menu a:hover { background: var(--panel); }
	.js .kfm-menu a[aria-current="page"],
	.js .kfm-menu .current-menu-item > a { box-shadow: inset 3px 0 0 var(--or); }

	.kfm-nav-backdrop {
		position: fixed; inset: 0; z-index: 250;
		background: rgba(8, 9, 10, .62);
	}
	.kfm-nav-open, .kfm-nav-open body { overflow: hidden; }
}

@media (max-width: 599px) {
	.kfm-header__bar { gap: 10px; }
	.kfm-header__actions { gap: 8px; }
	.kfm-header__live { padding: 10px 16px 10px 12px; }
	.kfm-header__menu { padding: 10px; }
	.kfm-header__menu span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 359px) {
	.kfm-logo--header .kfm-logo__img { height: 44px; }
}

/* =========================================================
   The dial: graphite glass, ticks every 0.1 MHz, the orange needle at 87.5
   ========================================================= */
.kfm-dial {
	position: relative;
	overflow: hidden;
	background:
		linear-gradient(180deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, 0) 38%),
		linear-gradient(180deg, #25282c 0%, #1c1e21 100%);
	border-bottom: 1px solid var(--line);
	color: var(--mute);
}
.kfm-dial::after {
	/* a faint inner shadow along the top, like the scale sits behind glass */
	content: "";
	position: absolute; inset: 0 0 auto;
	height: 10px;
	background: linear-gradient(180deg, rgba(0, 0, 0, .28), transparent);
	pointer-events: none;
}
.kfm-dial__frame {
	position: relative;
	width: 100%;
	max-width: calc(var(--wrap) + 2 * var(--gutter));
	height: 100%;
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.kfm-dial__svg { display: block; width: 100%; height: 100%; overflow: visible; }

.kfm-dial__tick--minor { fill: var(--mute); opacity: .42; }
.kfm-dial__tick--medium { fill: var(--mute); opacity: .8; }
.kfm-dial__tick--major { fill: var(--ink); opacity: .78; }
.kfm-dial__rail { stroke: #4a4f55; stroke-width: 1; }

.kfm-dial__num {
	fill: var(--mute);
	font-family: var(--font-display);
	font-weight: 400;
	font-size: 18px;
	font-variant-numeric: tabular-nums;
	letter-spacing: .01em;
}
.kfm-dial__freq { fill: var(--or); font-family: var(--font-display); font-weight: 800; font-size: 40px; }
.kfm-dial__tagline { fill: var(--ink); font-family: var(--font-text); font-weight: 400; font-size: 15px; }

.kfm-dial__pin { stroke: var(--or); stroke-width: 3; stroke-linecap: round; }
.kfm-dial__glow { stroke: var(--or); stroke-width: 9; opacity: .75; }

/* Sizes */
.kfm-dial--full { height: 150px; }
.kfm-dial--slim { height: 36px; }
.kfm-dial--slim .kfm-dial__pin { stroke-width: 2.5; stroke-linecap: butt; }
.kfm-dial--slim .kfm-dial__glow { stroke-width: 7; opacity: .7; }
.kfm-dial--slim .kfm-dial__tick--major { opacity: .6; }

.kfm-dial--mini { height: 22px; background: none; border: 0; overflow: visible; }
.kfm-dial--mini::after { display: none; }
.kfm-dial--mini .kfm-dial__frame { max-width: none; padding: 0; }
.kfm-dial--mini .kfm-dial__pin { stroke-width: 2; stroke-linecap: butt; }
.kfm-dial--mini .kfm-dial__glow { stroke-width: 5; opacity: .7; }
.kfm-dial--mini .kfm-dial__tick--major { opacity: .55; }
.kfm-dial--mini .kfm-dial__tick--medium { opacity: .45; }

/* The one-time tuning sweep on the home page: the station name waits for the needle. */
.kfm-dial__station { transition: opacity .3s ease-out; }
.kfm-dial.is-tuning .kfm-dial__station { opacity: 0; transition: none; }

@media (max-width: 599px) {
	.kfm-dial--full { height: 104px; }
	.kfm-dial__row--minor { display: none; }
	.kfm-dial__num { font-size: 15px; }
	.kfm-dial__num--alt { display: none; }
	.kfm-dial__freq { font-size: 28px; }
	.kfm-dial__tagline { font-size: 13px; }
	.kfm-dial__glow { stroke-width: 7; }
}

/* =========================================================
   Page frame
   ========================================================= */
.kfm-page { padding-block: 56px 24px; }
.kfm-page__head { margin-bottom: 36px; }
.kfm-page__title { max-width: 18em; }
.kfm-page__head .kfm-lead { margin-top: 14px; }
.kfm-page__image { margin-bottom: 32px; max-width: 960px; }
.kfm-page__image img { border-radius: var(--radius); }

@media (max-width: 599px) {
	.kfm-page { padding-block: 36px 16px; }
	.kfm-page__head { margin-bottom: 24px; }
}

/* Plain post list (index.php fallback) */
.kfm-list { max-width: 820px; border-bottom: 1px solid var(--line); }
.kfm-list__item { padding-block: 24px; border-top: 1px solid var(--line); }
.kfm-list__title { font-size: 28px; font-weight: 600; }
.kfm-list__title a { text-decoration: none; }
.kfm-list__title a:hover { text-decoration: underline; text-decoration-color: var(--mute); }
.kfm-list .kfm-meta { margin-top: 6px; }
.kfm-list__excerpt { margin-top: 10px; color: var(--mute); max-width: 44em; }

/* Pagination */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
	display: inline-grid; place-items: center;
	min-width: 44px; min-height: 44px; padding: 0 14px;
	border: 1px solid var(--line); border-radius: var(--radius);
	color: var(--ink); text-decoration: none;
	font-variant-numeric: tabular-nums;
}
.pagination a.page-numbers:hover { border-color: var(--mute); }
.pagination .page-numbers.current { background: var(--panel); border-color: var(--ink); font-weight: 600; }
.pagination .page-numbers.dots { border-color: transparent; }

.kfm-page-links { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }

/* 404 */
.kfm-404__code {
	font-family: var(--font-display);
	font-weight: 800;
	font-size: clamp(96px, 16vw, 180px);
	line-height: .85;
	color: var(--panel);
	-webkit-text-stroke: 1px var(--line);
	margin-bottom: 12px;
	font-variant-numeric: tabular-nums;
}
.kfm-404__links { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 32px; }
.kfm-404__links a {
	display: inline-flex; align-items: center;
	min-height: 44px; padding: 10px 20px;
	border: 1px solid var(--line); border-radius: 999px;
	background: var(--panel);
	font-weight: 500; text-decoration: none;
}
.kfm-404__links a:hover { border-color: var(--mute); }

/* =========================================================
   Footer
   ========================================================= */
.kfm-footer {
	margin-top: 96px;
	padding-block: 56px 28px;
	background: var(--deep);
	border-top: 1px solid var(--line);
	color: var(--mute);
	font-size: 15px;
}
.kfm-footer__grid {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
	gap: 40px;
}
.kfm-footer__tagline { margin-top: 18px; color: var(--ink); font-size: 17px; }
.kfm-footer__freq { margin-top: 4px; display: flex; align-items: baseline; gap: 8px; }
.kfm-footer__mhz { font-family: var(--font-display); font-weight: 800; font-size: 30px; line-height: 1; color: var(--ink); }

.kfm-footer__heading {
	margin-bottom: 14px;
	font-family: var(--font-text);
	font-weight: 500; font-size: 15px; line-height: 1.4;
	letter-spacing: 0;
	color: var(--mute);
}
.kfm-footer__list li + li { margin-top: 2px; }
.kfm-footer__list a {
	display: inline-flex; align-items: center; gap: 10px;
	min-height: 40px;
	color: var(--ink);
	text-decoration: none;
	font-variant-numeric: tabular-nums;
}
.kfm-footer__list a .kfm-icon { width: 20px; height: 20px; color: var(--mute); }
.kfm-footer__list a:hover span { text-decoration: underline; text-decoration-color: var(--mute); text-underline-offset: .18em; }
.kfm-footer__list a:hover .kfm-icon { color: var(--ink); }

.kfm-footer__base {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px;
	margin-top: 48px; padding-top: 20px;
	border-top: 1px solid var(--line);
	font-size: 14px;
}
.kfm-footer__base a { color: var(--mute); text-decoration-color: var(--line); }
.kfm-footer__base a:hover { color: var(--ink); text-decoration-color: var(--mute); }

@media (max-width: 899px) {
	.kfm-footer__grid { grid-template-columns: 1fr 1fr; }
	.kfm-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 599px) {
	.kfm-footer { margin-top: 64px; padding-top: 40px; }
	.kfm-footer__grid { grid-template-columns: 1fr; gap: 28px; }
	.kfm-footer__base { margin-top: 32px; }
}

/* =========================================================
   Level meter (decorative): still until the stream plays, then the bars move.
   Task 12 puts the class kfm-playing on <body> while audio plays.
   ========================================================= */
.kfm-meter { display: inline-flex; align-items: flex-end; gap: 2px; height: 16px; color: var(--or); flex: none; }
.kfm-meter i { display: block; width: 3px; border-radius: 1px; background: currentColor; height: 40%; }
.kfm-meter i:nth-child(2) { height: 75%; }
.kfm-meter i:nth-child(3) { height: 55%; }
.kfm-meter i:nth-child(4) { height: 90%; }
.kfm-meter i:nth-child(5) { height: 45%; }
@keyframes kfm-level { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
.kfm-playing .kfm-meter i { transform-origin: bottom; animation: kfm-level .9s ease-in-out infinite; }
.kfm-playing .kfm-meter i:nth-child(2) { animation-duration: .7s; animation-delay: -.2s; }
.kfm-playing .kfm-meter i:nth-child(3) { animation-duration: 1.1s; animation-delay: -.5s; }
.kfm-playing .kfm-meter i:nth-child(4) { animation-duration: .8s; animation-delay: -.1s; }
.kfm-playing .kfm-meter i:nth-child(5) { animation-duration: 1s; animation-delay: -.7s; }

.kfm-btn--lg { min-height: 56px; padding: 14px 30px; font-size: 18px; }
.kfm-btn--lg .kfm-icon { width: 22px; height: 22px; }
