/* ==========================================================================
   MRG.fm - PLAYER DELLE STAZIONI / STATION PLAYER  (file unico per tutte le stazioni / one file for all stations)
   [NOTA] Ogni pagina ha <html data-station="nome">: sceglie la riga dei colori qui sotto.
   [NOTE] Every page has <html data-station="name">: it picks its colour line below.
   COME CAMBIARE / HOW TO CHANGE:
   - Colori di una stazione / a station's colours ......... blocco THEMES (--bg sfondo/background, --fg testo/text)
   - Arancione MRG e fascia scura / MRG orange + dark strip .. :root qui sotto (--orange, --strip)
   - Larghezza della pagina / page width .................... main { max-width }
   - Dimensione logo / cover / play ......................... .logo / .cover / #pp
   - Riga 2 (Our Mission...) / row 2 ......................... .mrg
   ========================================================================== */

/* ---------- COLORI MRG / MRG COLOURS ---------- */
:root {
  --bg: #0f1f30;       /* sfondo predefinito / default background */
  --fg: #fff;          /* testo predefinito / default text */
  --orange: #fb580b;   /* arancione MRG.fm (riga 2) / MRG.fm orange (row 2) */
  --strip: #111;       /* fascia scura dietro la riga 2: serve a leggere l'arancione su ogni colore / dark strip behind row 2: keeps the orange readable on every colour */
}

/* ---------- THEMES: colori storici di ogni stazione / each station's own colours since 2013 ---------- */
:root[data-station="60sradio"] { --bg: #a39317; --fg: #000; }   /* 60sRadio */
:root[data-station="70sradio"] { --bg: #bc5a2c; --fg: #000; }   /* 70sRadio */
:root[data-station="80sradio"] { --bg: #8f6b8a; --fg: #000; }   /* 80sRadio */
:root[data-station="90sradio"] { --bg: #68a050; --fg: #000; }   /* 90sRadio */
:root[data-station="ambientradio"] { --bg: #0f1f30; --fg: #fff; }   /* AmbientRadio */
:root[data-station="bluesradio"] { --bg: #202c58; --fg: #fff; }   /* BluesRadio */
:root[data-station="classicalradio"] { --bg: #861619; --fg: #fff; }   /* ClassicalRadio */
:root[data-station="droneradio"] { --bg: #8aaebf; --fg: #000; }   /* DroneRadio */
:root[data-station="italiaradio"] { --bg: #26800c; --fg: #000; }   /* ItaliaRadio */
:root[data-station="jazzradio"] { --bg: #3f1a09; --fg: #fff; }   /* JazzRadio */
:root[data-station="loungeradio"] { --bg: #3d3d3d; --fg: #fff; }   /* LoungeRadio */
:root[data-station="mondelloradio"] { --bg: #f7f7f7; --fg: #000; }   /* Mondello Radio */
:root[data-station="operaradio"] { --bg: #7c2224; --fg: #fff; }   /* OperaRadio */
:root[data-station="planethiphop"] { --bg: #000; --fg: #fff; }   /* Planet Hip Hop */
:root[data-station="rockradio"] { --bg: #a80000; --fg: #fff; }   /* RockRadio */
:root[data-station="zerobeatzone"] { --bg: #262626; --fg: #fff; }   /* Zero Beat Zone */

/* ---------- COLORI DERIVATI (non toccare) / DERIVED COLOURS (leave alone) ---------- */
:root {
  --line: color-mix(in srgb, var(--fg) 35%, transparent);  /* bordi sottili / thin borders */
  --tint: color-mix(in srgb, var(--fg) 8%, transparent);   /* sfondo leggero / light fill */
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--fg);
  font: 16px/1.3 system-ui, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;  /* font e dimensione base / base font and size */
  display: flex; justify-content: center;
  padding: 16px;                                                               /* margine della pagina / page margin */
}
main { width: 100%; max-width: 420px; text-align: center; }                    /* larghezza massima della colonna / maximum column width */

/* ---------- INTESTAZIONE / HEADER ---------- */
.logo { width: 96px; height: 96px; object-fit: contain; display: block; margin: 4px auto 6px; }  /* logo: dimensione e spazi / size and spacing */
h1 { font-size: 18px; margin: 0 0 52px; letter-spacing: .5px; }                /* nome stazione; margin-bottom = spazio sotto / name; margin-bottom = gap below */
/* SLOGAN che si alternano (testi in slogans.js) / ROTATING SLOGANS (texts in slogans.js).
   width = larghezza della riga dello slogan (fino a 760px sul computer, cosi' non va a capo; sul telefono si adatta allo schermo e va a capo da solo) / width of the slogan line (up to 760px on a computer so it does not wrap; on a phone it fits the screen and wraps by itself). min-height = spazio riservato cosi' la pagina non salta quando lo slogan cambia / reserved space so the page does not jump when the slogan changes.
   transition = durata della dissolvenza / fade duration (il cambio ogni 30 s si regola in ogni pagina: SLOGAN_EVERY). */
.tag { margin: -44px 0 14px; padding: 0 6px; width: min(94vw, 760px); position: relative; left: 50%; transform: translateX(-50%); min-height: 1.4em; display: flex; align-items: center; justify-content: center; font-size: 13.5px; font-weight: 600; letter-spacing: .3px; line-height: 1.3; opacity: .9; transition: opacity .8s ease; }
@media (max-width: 560px) { .tag { min-height: 2.7em; } }   /* su telefono riserva 2 righe / on phones reserve 2 lines */
.tag.is-hidden { opacity: 0; }

/* ---------- COPERTINA E BRANO / COVER AND TRACK ---------- */
.cover { width: min(110px, 38%); margin: 0 auto; aspect-ratio: 1; background: rgba(0,0,0,.25); border-radius: 6px; overflow: hidden; }  /* dimensione copertina / cover size */
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.artist { margin: 14px 0 2px; font-size: 14px; opacity: .75; min-height: 1.3em; }                          /* artista / artist */
.title { margin: 0; font-size: 22px; font-weight: 600; min-height: 1.3em; overflow-wrap: anywhere; }       /* titolo brano / track title */

/* ---------- COMANDI / CONTROLS ---------- */
.ctl { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 16px 0; }           /* gap = distanza tra i comandi / spacing between controls */
#pp { width: 64px; height: 64px; border-radius: 50%; border: 0; background: var(--fg); color: var(--bg); cursor: pointer; display: flex; align-items: center; justify-content: center; }  /* tasto Play / Play button */
#pp svg { width: 28px; height: 28px; fill: currentColor; }
#pp:disabled { opacity: .35; cursor: not-allowed; }                                                         /* tasto spento (stazione offline) / disabled button (offline station) */
#vol { width: 120px; accent-color: var(--fg); }                                                             /* volume */
#sh { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--fg); cursor: pointer; display: flex; align-items: center; justify-content: center; }  /* tasto condividi / share button */
#sh svg { width: 18px; height: 18px; fill: currentColor; }
#sh:hover { background: var(--tint); }
.msg { font-size: 12px; min-height: 1.2em; opacity: .8; }                                                   /* messaggi di stato / status messages */

/* ---------- RIGA 1: SOCIAL DELLA STAZIONE / ROW 1: STATION SOCIAL LINKS ---------- */
.soc { margin-top: 14px; font-size: 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 14px; }  /* gap = distanza tra i link / spacing between links */
.soc a { color: var(--fg); }

/* ---------- RIGA 2: TERRITORIO MRG.fm / ROW 2: MRG.fm TERRITORY ----------
   [NOTA] 4 link su una sola riga, anche su telefoni stretti: il font si adatta allo schermo.
   [NOTE] 4 links on one line, even on narrow phones: the font scales with the screen.
   font-size: clamp(MIN, ADATTAMENTO/SCALING, MAX) - ingrandisci MAX per schermi larghi, abbassa MIN per telefoni piccolissimi.
   padding = spazio interno della fascia (il primo/ultimo link si avvicinano ai bordi riducendo il 12px laterale). */
.mrg {
  margin-top: 12px; padding: 9px 12px; border-radius: 10px;
  background: var(--strip); border: 1px solid rgba(251,88,11,.45);
  display: flex; justify-content: space-between; align-items: center; gap: 6px; flex-wrap: nowrap;
  font-size: clamp(11px, 3.5vw, 14px); font-weight: 700; white-space: nowrap;
}
.mrg a { color: var(--orange); text-decoration: none; }
.mrg a:hover { text-decoration: underline; }

/* ---------- RIQUADRO "SUPPORT US" (opzionale, dopo 10 minuti) / OPTIONAL "SUPPORT US" BOX (after 10 minutes) ---------- */
.nudge { margin: 14px auto 0; max-width: 340px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--tint); font-size: 14px; }
.nudge[hidden] { display: none; }
.nudge p { margin: 0 0 10px; }
.nbtn { display: inline-block; padding: 5px 12px; border-radius: 16px; font-size: 12.5px; font-weight: 700; text-decoration: none; background: var(--fg); color: var(--bg); }
#nx { margin-left: 10px; background: none; border: 0; color: var(--fg); opacity: .75; font-size: 12.5px; text-decoration: underline; cursor: pointer; }

/* ---------- SEZIONI A SCOMPARSA / COLLAPSIBLE SECTIONS ---------- */
.info { margin: 18px auto 0; text-align: left; font-size: 13px; line-height: 1.5; }
.info details { border-top: 1px solid var(--line); padding: 8px 2px; }
.info details:last-child { border-bottom: 1px solid var(--line); }
.info summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; opacity: .9; }
.info summary::-webkit-details-marker { display: none; }
.info summary::after { content: "+"; font-size: 16px; }
.info details[open] summary::after { content: "\2013"; }
.info p { margin: 8px 0 0; opacity: .9; }
.info a { color: var(--fg); }
.more { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 14px; }                                    /* elenco altre stazioni / list of other stations */

/* ---------- ACCESSIBILITA' / ACCESSIBILITY ---------- */
#pp:focus-visible, #vol:focus-visible, #sh:focus-visible, #nx:focus-visible,
a:focus-visible, summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.mrg a:focus-visible { outline-color: var(--orange); }

/* ---------- TELEFONI PICCOLI / SMALL PHONES ---------- */
@media (max-width: 360px) { body { padding: 10px; } .mrg { padding: 9px 8px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
