/*
Theme Name: Vive el Delta Ràdio
Theme URI: https://viveeldelta.com
Author: Vive el Delta
Description: Plataforma de ràdio geolocalitzada de les Terres de l'Ebre. Mapa a pantalla gairebé completa, cercador flotant, targetes d'emissora i reproductor persistent que no es talla en navegar. Requereix el plugin "Ràdios Terres de l'Ebre".
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: vive-el-delta
*/

/* ===================================================================
   1. Tokens — paleta "Delta de nit" (fosc) i "Sorra i riu" (clar)
   =================================================================== */
:root {
	--f-display: "Archivo", "Arial Narrow", system-ui, sans-serif;
	--f-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--f-dial: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

	--player-h: 76px;
	--header-h: 60px;
	--r-pill: 999px;
	--r-card: 22px;
	--ease: cubic-bezier(.2, .8, .2, 1);

	/* Clar */
	--bg: #F4F1EA;            /* sorra */
	--surface: #FFFFFF;
	--surface-2: #ECE7DC;
	--glass: rgba(255, 255, 255, .64);
	--glass-line: rgba(255, 255, 255, .85);
	--ink: #14211F;           /* fang fosc */
	--muted: #5C6966;
	--line: rgba(20, 33, 31, .12);
	--onair: #D9362B;         /* vermell "en directe" (hereu de la marca) */
	--onair-ink: #FFFFFF;
	--river: #1D6E8A;         /* blau riu */
	--rice: #6F9A1E;          /* verd arrossar */
	--pin: #14211F;
	--pin-ring: rgba(20, 33, 31, .18);
	--shadow: 0 18px 40px -18px rgba(20, 33, 31, .35), 0 2px 6px rgba(20, 33, 31, .08);
	color-scheme: light;
}
:root[data-theme="dark"] {
	--bg: #0A1214;            /* delta de nit */
	--surface: #111C1E;
	--surface-2: #18272A;
	--glass: rgba(14, 24, 26, .58);
	--glass-line: rgba(255, 255, 255, .09);
	--ink: #EDF2EE;
	--muted: #8FA29D;
	--line: rgba(237, 242, 238, .10);
	--onair: #FF5A3C;
	--onair-ink: #1A0905;
	--river: #4FB3D9;
	--rice: #B5E04A;          /* llum d'arrossar: els punts brillen */
	--pin: #B5E04A;
	--pin-ring: rgba(181, 224, 74, .22);
	--shadow: 0 22px 50px -20px rgba(0, 0, 0, .8), 0 2px 8px rgba(0, 0, 0, .4);
	color-scheme: dark;
}

/* ===================================================================
   2. Base
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.55 var(--f-ui);
	padding-bottom: var(--player-h);
	overflow-x: clip;
	-webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
a:hover { color: var(--onair); }
img { max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--river); outline-offset: 2px; }
svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3 { font-family: var(--f-display); font-stretch: 112%; font-weight: 750; line-height: 1.05; letter-spacing: -.01em; text-wrap: balance; margin: 0 0 .4em; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.screen-reader-text:focus { position: fixed !important; top: 8px; left: 8px; width: auto; height: auto; clip: auto; z-index: 10001; background: var(--surface); padding: 10px 16px; border-radius: 12px; }
#ebre-player-bar { display: none !important; } /* reproductor antic del plugin */

/* ===================================================================
   3. Capçalera
   =================================================================== */
.ved-header {
	position: sticky; top: 0; z-index: 1100;
	height: var(--header-h);
	display: flex; align-items: center; gap: 16px;
	padding: 0 max(16px, env(safe-area-inset-left)) 0 max(16px, env(safe-area-inset-right));
	background: color-mix(in srgb, var(--bg) 82%, transparent);
	backdrop-filter: blur(14px) saturate(150%); -webkit-backdrop-filter: blur(14px) saturate(150%);
	border-bottom: 1px solid var(--line);
}
.admin-bar .ved-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .ved-header { top: 0; position: relative; } }
.ved-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.ved-brand__mark { width: 30px; height: 30px; }
.ved-brand__logo { display: block; height: 42px; width: auto; max-width: min(240px, 52vw); object-fit: contain; border-radius: 8px; }
@media (max-width: 700px) { .ved-brand__logo { height: 36px; } }
.ved-brand__mark .m-dot { fill: var(--onair); stroke: none; }
.ved-brand__mark .m-wave { stroke: var(--ink); stroke-width: 2.4; }
.ved-brand__mark .m-wave--2 { opacity: .45; }
.ved-brand__name { font: 800 20px/1 var(--f-display); font-stretch: 118%; letter-spacing: -.02em; }
.ved-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ved-nav a { display: block; padding: 8px 12px; border-radius: var(--r-pill); text-decoration: none; font-weight: 500; font-size: 15px; color: var(--muted); }
.ved-nav a:hover, .ved-nav .current-menu-item a { color: var(--ink); background: var(--surface-2); }
@media (max-width: 700px) { .ved-nav { display: none; } }
.ved-menu { display: none; position: relative; }
.ved-menu summary { list-style: none; }
.ved-menu summary::-webkit-details-marker { display: none; }
.ved-menu__panel { position: absolute; right: 0; top: 50px; min-width: 230px; padding: 8px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); z-index: 1300; }
.ved-menu__panel ul { list-style: none; margin: 0; padding: 0; }
.ved-menu__panel a { display: block; padding: 12px 14px; border-radius: 12px; text-decoration: none; font-weight: 600; }
.ved-menu__panel a:hover, .ved-menu__panel .current-menu-item a { background: var(--surface-2); color: var(--ink); }
@media (max-width: 700px) { .ved-menu { display: block; } }

.ved-icon-btn {
	width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
	background: var(--surface); display: grid; place-items: center; cursor: pointer;
}
.ved-icon-btn svg { width: 19px; height: 19px; }
:root[data-theme="dark"] .ved-icon-btn .i-moon, :root:not([data-theme="dark"]) .ved-icon-btn .i-sun { display: none; }

/* ===================================================================
   4. Escenari del mapa (88% d'alçada)
   =================================================================== */
.ved-stage {
	position: relative;
	/* Ocupa tot l'espai visible entre la capçalera i el reproductor fix */
	height: calc(100vh - var(--header-h) - var(--player-h));
	height: calc(100svh - var(--header-h) - var(--player-h));
	min-height: 480px;
	isolation: isolate;
	overflow: hidden;
}
.ved-map { position: absolute; inset: 0; background: var(--surface-2); z-index: 0; }
.ved-map .leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 75%, transparent); color: var(--muted); font-size: 10px; border-radius: 8px 0 0 0; }
.ved-map .leaflet-control-attribution a { color: inherit; }
.ved-map .leaflet-bar { border: 0; box-shadow: var(--shadow); border-radius: 14px; overflow: hidden; }
.ved-map .leaflet-bar a { background: var(--surface); color: var(--ink); border-color: var(--line); width: 38px; height: 38px; line-height: 38px; }
.leaflet-container { font-family: var(--f-ui); }
.ved-map .leaflet-tile-pane, .ved-minimap .leaflet-tile-pane {
	filter: sepia(var(--ved-sep, 0%)) hue-rotate(var(--ved-h, 0deg)) saturate(var(--ved-s, 100%)) brightness(var(--ved-b, 100%));
}

/* Colors dels marcadors segons el fons del mapa triat */
.ved-map--light .ved-pin { --pin: var(--ved-pin-light, #1D6E8A); --pin-ring: color-mix(in srgb, var(--pin) 22%, transparent); --ink: #14211F; --bg: #F4F1EA; }
.ved-map--dark .ved-pin { --pin: var(--ved-pin-dark, #B5E04A); --pin-ring: color-mix(in srgb, var(--pin) 22%, transparent); --ink: #EDF2EE; --bg: #0A1214; }
#ved-map.ved-map--dark .ved-pin__dot { box-shadow: 0 0 0 5px var(--pin-ring), 0 0 18px 2px color-mix(in srgb, var(--pin) 55%, transparent); }
#ved-map.ved-map--light .ved-pin__dot { box-shadow: 0 0 0 5px var(--pin-ring), 0 3px 10px rgba(0, 0, 0, .35); }
#ved-map .ved-pin.is-live .ved-pin__dot { box-shadow: 0 0 0 5px color-mix(in srgb, var(--onair) 25%, transparent), 0 0 20px 4px color-mix(in srgb, var(--onair) 55%, transparent); }

/* Crèdit del mapa: petit i discret */
.ved-credit { margin: 0 0 6px 8px !important; font: 500 10px/1.2 var(--f-ui); color: var(--muted); opacity: .75; text-shadow: 0 0 3px var(--bg); }
.ved-credit a { color: inherit; text-decoration: none; }
.ved-credit a:hover { text-decoration: underline; color: var(--ink); }
@media (max-width: 760px) { .ved-stage .ved-credit { margin-bottom: 70px !important; } }

/* Notícies RSS */
.ved-st__news { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.ved-st__newshead { margin: 0 0 6px; font: 700 12px/1.2 var(--f-ui); color: var(--muted); }
.ved-st__news ul, .ved-news__list { list-style: none; margin: 0; padding: 0; }
.ved-st__news li, .ved-news__list li { padding: 7px 0; border-bottom: 1px solid var(--line); }
.ved-st__news li:last-child, .ved-news__list li:last-child { border-bottom: 0; }
.ved-st__news a, .ved-news__list a { display: block; font: 600 14px/1.35 var(--f-ui); text-decoration: none; color: var(--ink); }
.ved-st__news a:hover, .ved-news__list a:hover { color: var(--onair); }
.ved-st__news time, .ved-news__list time { display: block; margin-top: 2px; font-size: 12px; color: var(--muted); }
.ved-news { margin: 28px 0; }
.ved-news__list a { font-size: 16px; }
.ved-news { margin: 40px 0 32px; }
.ved-news > h2 { margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ved-news__list li { padding: 12px 0; }
.ved-st__news { margin-top: 16px; padding-top: 14px; }
.ved-st__newshead { margin: 0 0 10px !important; }
.ved-station__side .ved-h3 { margin: 0 0 14px; }

/* Avís de gestos cooperatius */
.ved-hint { position: absolute; inset: 0; z-index: 998; display: grid; place-items: center; padding: 24px; pointer-events: none;
	background: rgba(10, 18, 20, .45); color: #fff; font: 700 clamp(16px, 2vw, 22px)/1.3 var(--f-ui); text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.4);
	opacity: 0; transition: opacity .25s; }
.ved-hint.is-on { opacity: 1; }

/* Selector d'estil del mapa */
.ved-layers { position: relative; }
.ved-layers__btn { width: 44px; height: 44px; border-radius: 14px; border: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.ved-layers__btn svg { width: 20px; height: 20px; }
.ved-layers__menu { position: absolute; right: 0; bottom: 52px; width: 230px; padding: 8px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-family: var(--f-ui); }
.ved-layers__menu[hidden] { display: none; }
.ved-layers__menu p { margin: 4px 8px 6px; font: 700 12px/1.2 var(--f-ui); color: var(--muted); }
.ved-layers__menu button { width: 100%; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 6px 8px; border: 0; border-radius: 12px; background: none; color: var(--ink); font: 600 14px/1.2 var(--f-ui); cursor: pointer; text-align: left; }
.ved-layers__menu button small { margin-left: auto; font-weight: 500; color: var(--muted); }
.ved-layers__menu button:hover { background: var(--surface-2); }
.ved-layers__menu button[aria-checked="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 2px var(--ink); }
.ved-sw { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line); flex: none; }
.ved-sw--auto { background: linear-gradient(135deg, #f2f3f0 50%, #1b1b1d 50%); }
@media (max-width: 760px) { .ved-map .leaflet-bottom.leaflet-right { margin-bottom: 72px; } }
/* Sense clau CARTO: OSM enfosquit per al mode nit */
:root.ved-no-carto[data-theme="dark"] .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }

/* -- Marcadors -- */
.ved-pin-wrap { background: none; border: 0; }
.ved-pin { position: relative; width: 48px; height: 48px; display: grid; place-items: center; cursor: pointer; transition: opacity .3s var(--ease); }
.ved-pin__dot {
	position: relative; z-index: 2;
	width: 16px; height: 16px; border-radius: 50%;
	background: var(--pin);
	box-shadow: 0 0 0 5px var(--pin-ring), 0 3px 10px rgba(0, 0, 0, .35);
	transition: transform .25s var(--ease), background .25s;
}
:root[data-theme="dark"] .ved-pin__dot { box-shadow: 0 0 0 5px var(--pin-ring), 0 0 18px 2px rgba(181, 224, 74, .55); }
.ved-pin__n {
	position: absolute; z-index: 3; top: 4px; right: 4px;
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--surface); color: var(--ink); border: 1px solid var(--line);
	font: 700 11px/16px var(--f-dial); text-align: center;
}
.ved-pin__label {
	position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
	white-space: nowrap; font: 600 12px/1 var(--f-ui); color: var(--ink);
	text-shadow: 0 0 3px var(--bg), 0 0 3px var(--bg), 0 0 6px var(--bg);
	pointer-events: none;
}
/* El mapa base ja retola els pobles: l'etiqueta pròpia només en hover, seleccionat o sonant */
.ved-pin__label { opacity: 0; transition: opacity .2s; }
.ved-pin:hover .ved-pin__label, .ved-pin.is-selected .ved-pin__label, .ved-pin.is-live .ved-pin__label { opacity: 1; }
.ved-pin:hover, .ved-pin.is-selected { z-index: 5; }
.ved-pin__wave { position: absolute; z-index: 1; inset: 16px; border-radius: 50%; border: 2px solid var(--onair); opacity: 0; }
.ved-pin:hover .ved-pin__dot, .ved-pin.is-selected .ved-pin__dot { transform: scale(1.3); }
.ved-pin.is-live .ved-pin__dot { background: var(--onair); box-shadow: 0 0 0 5px color-mix(in srgb, var(--onair) 25%, transparent), 0 0 20px 4px color-mix(in srgb, var(--onair) 55%, transparent); }
.ved-pin.is-live .ved-pin__wave { animation: ved-wave 2.4s cubic-bezier(.1, .6, .3, 1) infinite; }
.ved-pin.is-live .ved-pin__wave:nth-of-type(2) { animation-delay: .8s; }
.ved-pin.is-live .ved-pin__wave:nth-of-type(3) { animation-delay: 1.6s; }
.ved-pin.is-dim { opacity: .22; pointer-events: none; }
.ved-pin.is-dim .ved-pin__label { display: none; }
@keyframes ved-wave { 0% { transform: scale(.7); opacity: .85; } 100% { transform: scale(3.2); opacity: 0; } }

/* -- Cercador flotant (càpsula glass) -- */
.ved-top {
	position: absolute; z-index: 1000;
	top: 18px; left: 50%; transform: translateX(-50%);
	width: min(660px, calc(100% - 28px));
}
.ved-search {
	display: flex; align-items: center; gap: 10px;
	height: 58px; padding: 0 10px 0 20px; margin: 0;
	border-radius: var(--r-pill);
	background: var(--glass);
	backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%);
	border: 1px solid var(--glass-line);
	box-shadow: var(--shadow);
	transition: box-shadow .2s, background .2s;
}
.ved-search:focus-within { background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow), 0 0 0 3px color-mix(in srgb, var(--river) 35%, transparent); }
.ved-search__icon { width: 20px; height: 20px; color: var(--muted); flex: none; }
.ved-search input {
	flex: 1; min-width: 0; height: 100%;
	border: 0; outline: 0; background: transparent; color: var(--ink);
	font: 500 16px/1 var(--f-ui);
	-webkit-appearance: none; appearance: none;
}
.ved-search input::placeholder { color: var(--muted); }
.ved-search input::-webkit-search-cancel-button { display: none; }
.ved-search__clear { width: 34px; height: 34px; border: 0; background: var(--surface-2); border-radius: 50%; display: grid; place-items: center; cursor: pointer; flex: none; }
.ved-search__clear svg { width: 16px; height: 16px; }
.ved-search__clear[hidden] { display: none; }
.ved-search__count {
	flex: none; min-width: 40px; height: 38px; padding: 0 12px; border-radius: var(--r-pill);
	display: grid; place-items: center;
	background: var(--ink); color: var(--bg);
	font: 700 14px/1 var(--f-dial);
}

.ved-chips {
	display: flex; gap: 8px; margin-top: 10px;
	overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px;
	justify-content: center;
	mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
}
.ved-chips::-webkit-scrollbar { display: none; }
.ved-chip {
	flex: none; height: 34px; padding: 0 14px; border-radius: var(--r-pill);
	border: 1px solid var(--glass-line);
	background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
	font: 600 13px/1 var(--f-ui); color: var(--ink); cursor: pointer;
	display: inline-flex; align-items: center; gap: 6px;
	box-shadow: 0 4px 14px -8px rgba(0, 0, 0, .4);
	transition: background .15s, color .15s;
}
.ved-chip small { font: 700 11px/1 var(--f-dial); opacity: .6; }
.ved-chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ved-chip-sep { flex: none; width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); }
@media (max-width: 760px) { .ved-chips { justify-content: flex-start; } }

/* Resultats desplegables */
.ved-results {
	margin-top: 6px; max-height: min(46vh, 380px); overflow: auto;
	border-radius: var(--r-card); padding: 6px;
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
	border: 1px solid var(--glass-line); box-shadow: var(--shadow);
}
.ved-stage[data-view="list"] .ved-results { display: none; }

/* -- Files d'emissora (resultats, llistat, a prop) -- */
.ved-row {
	display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; align-items: center; gap: 12px;
	padding: 8px; border-radius: 16px; cursor: pointer;
}
.ved-row:hover, .ved-row:focus-within { background: var(--surface-2); }
.ved-row__name { font-weight: 600; line-height: 1.25; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ved-row__meta { font-size: 13px; color: var(--muted); margin: 2px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ved-fm { font-family: var(--f-dial); font-weight: 700; color: var(--ink); }
.ved-results__empty { padding: 14px 12px; color: var(--muted); margin: 0; }

/* Logo / monograma */
.ved-logo, .ved-mono {
	width: 48px; height: 48px; border-radius: 14px; flex: none; overflow: hidden;
	display: grid; place-items: center; background: #fff;
	border: 1px solid var(--line);
}
.ved-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.ved-mono { font: 800 16px/1 var(--f-display); font-stretch: 120%; color: #fff; background: var(--mono, var(--river)); border: 0; letter-spacing: .02em; }

/* Botó play rodó petit */
.ved-play-mini {
	width: 44px; height: 44px; border-radius: 50%; border: 0; cursor: pointer; flex: none;
	background: var(--ink); color: var(--bg); display: grid; place-items: center;
	transition: transform .15s var(--ease), background .2s;
}
.ved-play-mini:hover { transform: scale(1.06); }
.ved-play-mini svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.i-pause, .is-playing .i-play { display: none; }
.is-playing .i-pause { display: inline; }
.ved-play-mini.is-playing { background: var(--onair); color: var(--onair-ink); }

/* -- Targeta flotant del municipi -- */
.ved-card {
	position: absolute; z-index: 1001;
	left: 20px; bottom: 24px;
	width: 360px; max-height: calc(100% - 150px); overflow: auto;
	padding: 18px; border-radius: 26px;
	background: color-mix(in srgb, var(--surface) 90%, transparent);
	backdrop-filter: blur(22px) saturate(160%); -webkit-backdrop-filter: blur(22px) saturate(160%);
	border: 1px solid var(--glass-line);
	box-shadow: var(--shadow);
	animation: ved-rise .32s var(--ease);
}
.ved-card[hidden] { display: none; }
@keyframes ved-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.ved-card__head { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ved-card__title { font-size: 26px; margin: 0; }
.ved-card__head { align-items: center; margin-bottom: 4px; }
.ved-card__place { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font: 600 14px/1.2 var(--f-ui); color: var(--ink); }
.ved-card__place svg { width: 16px; height: 16px; color: var(--onair); flex: none; }
.ved-card__comarca, .ved-card__n { font-weight: 500; color: var(--muted); }
.ved-card__comarca::before, .ved-card__n::before { content: "·"; margin-right: 6px; }
.ved-card__head + .ved-st { border-top: 0; padding-top: 8px; }
.ved-st__top { grid-template-columns: 64px minmax(0, 1fr) !important; gap: 14px !important; }
.ved-st .ved-logo, .ved-st .ved-mono { width: 64px !important; height: 64px !important; border-radius: 18px !important; }
.ved-st h2.ved-st__name { font: 750 24px/1.08 var(--f-display); font-stretch: 112%; letter-spacing: -.01em; margin: 0; }
@media (max-width: 760px) { .ved-st h2.ved-st__name { font-size: 21px; } }
.ved-card__sub { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.ved-card__close { margin-left: auto; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--surface-2); cursor: pointer; display: grid; place-items: center; flex: none; }
.ved-card__close svg { width: 16px; height: 16px; }
.ved-st { padding: 12px 0; border-top: 1px solid var(--line); }
.ved-st__top { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: center; }
.ved-st .ved-logo, .ved-st .ved-mono { width: 56px; height: 56px; border-radius: 16px; }
.ved-st__name { margin: 0; font: 700 17px/1.2 var(--f-ui); }
.ved-st__name a { text-decoration: none; }
.ved-st__meta { margin: 3px 0 0; font-size: 13px; color: var(--muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ved-tag { font: 600 11px/1 var(--f-ui); padding: 4px 8px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); }
.ved-dialchip { font: 700 13px/1 var(--f-dial); color: var(--ink); }
.ved-dialchip b { color: var(--onair); }
.ved-weblink { font: 600 12px/1 var(--f-ui); color: var(--river); text-decoration: none; padding: 4px 8px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--river) 35%, transparent); }
.ved-weblink:hover { color: var(--bg); background: var(--river); }

/* Botó principal "Escolta en directe" */
.ved-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	min-height: 48px; padding: 0 22px; border-radius: var(--r-pill);
	border: 0; cursor: pointer; text-decoration: none;
	background: var(--ink); color: var(--bg);
	font: 700 15px/1 var(--f-ui);
	transition: transform .15s var(--ease), background .2s;
}
.ved-btn:hover { color: var(--bg); transform: translateY(-1px); }
.ved-btn svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.ved-btn--live { background: var(--onair); color: var(--onair-ink); }
.ved-btn--live:hover { color: var(--onair-ink); }
.ved-btn--block { width: 100%; margin-top: 12px; }
.ved-btn.is-playing { background: var(--ink); color: var(--bg); }
.ved-btn .ved-eq { display: none; }
.ved-btn.is-playing .ved-eq { display: flex; }

/* -- Llistat (vista mòbil) -- */
.ved-list {
	position: absolute; inset: 0; z-index: 999;
	overflow: auto; overscroll-behavior: contain;
	background: var(--bg);
	padding: 150px 14px 96px;
	display: none;
}
.ved-stage[data-view="list"] .ved-list { display: block; }
.ved-list h3 { font-size: 13px; font-family: var(--f-ui); font-weight: 700; color: var(--muted); letter-spacing: .02em; margin: 18px 8px 6px; font-stretch: 100%; }
.ved-list ul, .ved-results ul, .ved-near { list-style: none; margin: 0; padding: 0; }

/* -- Selector Mapa / Llistat (mòbil) -- */
.ved-switch {
	position: absolute; z-index: 1002; left: 50%; bottom: 18px; transform: translateX(-50%);
	display: none; padding: 5px; gap: 4px; border-radius: var(--r-pill);
	background: var(--glass); backdrop-filter: blur(20px) saturate(170%); -webkit-backdrop-filter: blur(20px) saturate(170%);
	border: 1px solid var(--glass-line); box-shadow: var(--shadow);
}
.ved-switch button {
	height: 44px; padding: 0 18px; border-radius: var(--r-pill); border: 0; background: transparent; cursor: pointer;
	display: inline-flex; align-items: center; gap: 8px; font: 600 14px/1 var(--f-ui); color: var(--muted);
}
.ved-switch svg { width: 18px; height: 18px; }
.ved-switch [aria-selected="true"] { background: var(--ink); color: var(--bg); }

@media (max-width: 760px) {
	.ved-stage { height: calc(100svh - var(--header-h) - var(--player-h)); min-height: 460px; }
	.ved-top { top: 12px; }
	.ved-search { height: 52px; padding-left: 16px; }
	.ved-switch { display: flex; }
	.ved-card { left: 10px; right: 10px; width: auto; bottom: 78px; max-height: calc(100% - 210px); border-radius: 24px; padding: 14px; }
	.ved-map .leaflet-control-zoom { display: none; }
	.ved-results { max-height: 40vh; }
}


.admin-bar .ved-stage { height: calc(100svh - var(--header-h) - var(--player-h) - 32px); }
@media (max-width: 782px) { .admin-bar .ved-stage { height: calc(100svh - var(--header-h) - var(--player-h) - 46px); } }
/* ===================================================================
   5. Secció de graella
   =================================================================== */
.ved-section { padding: clamp(36px, 5vw, 72px) max(16px, 4vw); max-width: 1320px; margin: 0 auto; }
.ved-section__head h1, .ved-section__head h2 { font-size: clamp(30px, 4vw, 48px); }
.ved-section__head p { color: var(--muted); margin: 0 0 24px; }
.ved-section__body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; }
.ved-section__body:has(.ved-banners--side) { grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 900px) { .ved-section__body:has(.ved-banners--side) { grid-template-columns: minmax(0, 1fr); } }
.ved-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.ved-tile {
	display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center;
	padding: 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
	transition: border-color .2s, transform .2s var(--ease);
}
.ved-tile:hover { border-color: color-mix(in srgb, var(--ink) 30%, transparent); transform: translateY(-2px); }
.ved-tile.is-live { border-color: var(--onair); }
.ved-tile__logo { width: 64px; height: 64px; border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; }
.ved-tile__logo img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.ved-tile__logo .ved-mono { width: 100%; height: 100%; border-radius: 0; font-size: 20px; }
.ved-tile__name { font: 700 17px/1.2 var(--f-ui); margin: 0; font-stretch: 100%; letter-spacing: 0; }
.ved-tile__name a { text-decoration: none; }
.ved-tile__meta { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.ved-empty { color: var(--muted); }

/* ===================================================================
   6. Fitxa d'emissora
   =================================================================== */
.ved-station { max-width: 1240px; margin: 0 auto; padding: clamp(28px, 5vw, 64px) max(16px, 4vw); }
.ved-station__hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(18px, 3vw, 40px); align-items: center; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.ved-station__logo { width: clamp(110px, 16vw, 180px); aspect-ratio: 1; border-radius: 32px; overflow: hidden; background: #fff; border: 1px solid var(--line); display: grid; place-items: center; box-shadow: var(--shadow); }
.ved-station__logo img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.ved-station__logo .ved-mono { width: 100%; height: 100%; border-radius: 0; font-size: 44px; }
.ved-station__where { margin: 0 0 6px; color: var(--muted); font-weight: 600; }
.ved-station h1 { font-size: clamp(36px, 6vw, 68px); margin-bottom: 12px; }
.ved-dial { font: 700 15px/1 var(--f-dial); color: var(--muted); margin: 0 0 18px; }
.ved-dial span { font-size: 32px; color: var(--ink); }
.ved-station__grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; padding-top: 32px; }
@media (max-width: 860px) { .ved-station__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) { .ved-station__hero { grid-template-columns: minmax(0, 1fr); } }
.ved-prose { max-width: 68ch; font-size: 17px; }
.ved-facts { display: grid; gap: 0; margin: 24px 0; }
.ved-facts div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ved-facts dt { color: var(--muted); font-size: 14px; }
.ved-facts dd { margin: 0; overflow-wrap: anywhere; }
.ved-back { font-weight: 600; text-decoration: none; }
.ved-minimap { height: 240px; border-radius: var(--r-card); overflow: hidden; margin-bottom: 24px; border: 1px solid var(--line); }
.ved-h3 { font-size: 20px; }
.ved-article { margin: 0 auto; }
.ved-article h1 { font-size: clamp(32px, 5vw, 56px); }
.ved-404 { text-align: center; padding: 8vh 0; margin: 0 auto; }

/* ===================================================================
   7. Banners i peu
   =================================================================== */
.ved-banners { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; padding: 12px; }
.ved-banners--side { flex-direction: column; justify-content: flex-start; padding: 0; }
.ved-banners img { border-radius: 14px; display: block; }
.ved-footer { background: var(--surface); border-top: 1px solid var(--line); padding: 48px max(16px, 4vw) 36px; }
.ved-footer__inner { max-width: 1240px; margin: 0 auto; color: var(--muted); }
.ved-footer__brand { font: 800 26px/1 var(--f-display); font-stretch: 118%; color: var(--ink); margin: 0 0 8px; }
.ved-footer__nav ul { list-style: none; padding: 0; display: flex; gap: 18px; flex-wrap: wrap; }
.ved-footer__small { font-size: 13px; }

/* ===================================================================
   8. Reproductor fix inferior (persistent)
   =================================================================== */
.ved-player {
	position: fixed; z-index: 1200; left: 0; right: 0; bottom: 0;
	height: calc(var(--player-h) + env(safe-area-inset-bottom));
	padding: 0 max(14px, env(safe-area-inset-right)) env(safe-area-inset-bottom) max(14px, env(safe-area-inset-left));
	display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto auto; align-items: center; gap: 14px;
	background: color-mix(in srgb, var(--surface) 92%, transparent);
	backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%);
	border-top: 1px solid var(--line);
	box-shadow: 0 -10px 30px -18px rgba(0, 0, 0, .5);
}
.ved-player__art .ved-logo, .ved-player__art .ved-mono { width: 52px; height: 52px; border-radius: 14px; }
.ved-player__info { min-width: 0; }
.ved-player__info p { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ved-player__status { font: 700 11px/1.2 var(--f-ui); letter-spacing: .03em; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ved-player__title { font: 750 17px/1.25 var(--f-display); font-stretch: 110%; }
.ved-player__sub { font-size: 13px; color: var(--muted); }
.ved-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); flex: none; }
.ved-player[data-state="live"] .ved-live-dot, .ved-player[data-state="demo"] .ved-live-dot { background: var(--onair); animation: ved-blink 1.6s ease-in-out infinite; }
.ved-player[data-state="live"] .ved-player__status { color: var(--onair); }
.ved-player[data-state="error"] .ved-player__status { color: var(--onair); }
@keyframes ved-blink { 50% { opacity: .25; } }
.ved-player__btn {
	width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer;
	background: var(--onair); color: var(--onair-ink); display: grid; place-items: center;
	box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--onair) 80%, transparent);
}
.ved-player__btn:disabled { background: var(--surface-2); color: var(--muted); box-shadow: none; cursor: default; }
.ved-player__btn svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.ved-player__btn .i-load { display: none; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-dasharray: 30 60; transform-origin: center; animation: ved-spin 1s linear infinite; }
.ved-player[data-state="buffering"] .ved-player__btn .i-load { display: inline; }
.ved-player[data-state="buffering"] .ved-player__btn .i-play, .ved-player[data-state="buffering"] .ved-player__btn .i-pause { display: none; }
@keyframes ved-spin { to { transform: rotate(360deg); } }
.ved-vol input { width: 110px; accent-color: var(--onair); }
@media (max-width: 760px) { .ved-vol { display: none; } .ved-player { grid-template-columns: 52px minmax(0, 1fr) auto auto; gap: 12px; } }

/* Equalitzador animat */
.ved-eq { display: flex; align-items: flex-end; gap: 3px; height: 18px; opacity: 0; transition: opacity .3s; }
.ved-eq i { width: 3px; height: 100%; border-radius: 2px; background: currentColor; transform-origin: bottom; transform: scaleY(.3); }
.ved-player .ved-eq { color: var(--onair); }
.ved-player[data-state="live"] .ved-eq, .ved-player[data-state="demo"] .ved-eq, .ved-btn.is-playing .ved-eq { opacity: 1; }
.ved-player[data-state="live"] .ved-eq i, .ved-player[data-state="demo"] .ved-eq i, .ved-btn.is-playing .ved-eq i { animation: ved-eq .9s ease-in-out infinite alternate; }
.ved-eq i:nth-child(2) { animation-delay: -.3s !important; }
.ved-eq i:nth-child(3) { animation-delay: -.6s !important; }
.ved-eq i:nth-child(4) { animation-delay: -.15s !important; }
@keyframes ved-eq { to { transform: scaleY(1); } }

/* Transició suau entre pàgines (navegació sense recàrrega) */
.ved-main { transition: opacity .18s ease; }
.ved-main.is-leaving { opacity: .35; }

/* ===================================================================
   9. Pàgines de text, formulari i avisos
   =================================================================== */
.ved-article { max-width: 760px; }
.ved-article h2 { font-size: 24px; margin-top: 1.6em; }
.ved-article h3 { font-size: 18px; font-family: var(--f-ui); font-stretch: 100%; margin-top: 1.4em; }
.ved-article table { width: 100%; border-collapse: collapse; font-size: 15px; margin: 1em 0; }
.ved-article th, .ved-article td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.ved-article th { color: var(--muted); font-weight: 600; }
.ved-scroll { overflow-x: auto; }
.ved-form { display: grid; gap: 4px; margin-top: 18px; }
.ved-form p { margin: 0 0 12px; }
.ved-form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 16px; }
.ved-form label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.ved-form input:not([type="checkbox"]), .ved-form select, .ved-form textarea {
	width: 100%; min-height: 48px; padding: 12px 16px; border-radius: 14px;
	border: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 16px/1.4 var(--f-ui);
}
.ved-form textarea { resize: vertical; }
.ved-form input:focus, .ved-form select:focus, .ved-form textarea:focus { outline: 2px solid var(--river); outline-offset: 1px; }
.ved-check { display: flex; gap: 10px; align-items: flex-start; }
.ved-check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--onair); flex: none; }
.ved-check label { font-weight: 400; margin: 0; }
.ved-form__legal { font-size: 13px; color: var(--muted); }
.ved-hp { position: absolute !important; left: -9999px; }
.ved-notice { padding: 14px 18px; border-radius: 14px; font-weight: 600; }
.ved-notice--ok { background: color-mix(in srgb, var(--rice) 18%, var(--surface)); }
.ved-notice--err { background: color-mix(in srgb, var(--onair) 14%, var(--surface)); }
.ved-footer__legal ul { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; }
.ved-footer__legal a { color: var(--ink); text-decoration: none; }
.ved-footer__legal a:hover { color: var(--onair); }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
	.ved-pin.is-live .ved-pin__wave { opacity: .5; transform: scale(2); animation: none !important; }
}
