/* =========================================================
   IZ2BKT — main.css
   Design system moderno (light/dark), zero dipendenze.
   ========================================================= */

/* ---------- Variabili ---------- */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --accent: #c8102e;            /* rosso QSL */
  --accent-strong: #a30d25;
  --accent-soft: rgba(200, 16, 46, .10);
  --blue: #1d4ed8;

  --bg: #ffffff;
  --bg-subtle: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --border: #e4e7ec;
  --text: #1a1f28;
  --text-muted: #5a6472;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  --shadow-md: 0 6px 16px rgba(16, 24, 40, .08), 0 2px 6px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
  --container: 1120px;
  --header-h: 68px;
}

html[data-theme="dark"] {
  --bg: #0e1117;
  --bg-subtle: #0b0e14;
  --surface: #161b23;
  --surface-2: #1d232d;
  --border: #2a313c;
  --text: #e8ecf1;
  --text-muted: #9aa5b1;
  --accent: #ff4d67;
  --accent-strong: #ff7387;
  --accent-soft: rgba(255, 77, 103, .14);
  --blue: #7aa2ff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
  --shadow-lg: 0 28px 60px -14px rgba(0, 0, 0, .65);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --bg: #0e1117;
    --bg-subtle: #0b0e14;
    --surface: #161b23;
    --surface-2: #1d232d;
    --border: #2a313c;
    --text: #e8ecf1;
    --text-muted: #9aa5b1;
    --accent: #ff4d67;
    --accent-strong: #ff7387;
    --accent-soft: rgba(255, 77, 103, .14);
    --blue: #7aa2ff;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, .45);
    --shadow-lg: 0 28px 60px -14px rgba(0, 0, 0, .65);
  }
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, iframe, svg { max-width: 100%; display: block; }
img { height: auto; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: clamp(2.1rem, 1.3rem + 3.4vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 1.15rem + 1.6vw, 2.2rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-strong); }
ul { padding-left: 1.15em; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.container { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.section { padding-block: clamp(3rem, 1.5rem + 5vw, 5.5rem); }
.section--alt { background: var(--bg-subtle); }
.section__head { max-width: 62ch; margin-bottom: 2.25rem; }
.section__head p { color: var(--text-muted); margin-bottom: 0; }
.eyebrow {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--accent); margin-bottom: .5rem;
}
.muted { color: var(--text-muted); }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: #fff; padding: .65rem 1rem; border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus { left: 0; color: #fff; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1.25rem;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: inherit; }
.brand img { height: 32px; width: auto; }
.brand__sub { font-size: .78rem; color: var(--text-muted); line-height: 1.2; max-width: 14ch; }
@media (max-width: 480px) { .brand__sub { display: none; } }

.nav { margin-inline-start: auto; display: flex; align-items: center; gap: .25rem; }
.nav a {
  padding: .5rem .8rem; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-weight: 500; font-size: .95rem;
  transition: background .18s ease, color .18s ease;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  cursor: pointer; transition: background .18s ease, transform .18s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 20px; height: 20px; }
html[data-theme="dark"] .icon-btn .icon-sun { display: block; }
html[data-theme="dark"] .icon-btn .icon-moon { display: none; }
.icon-btn .icon-sun { display: none; }

.nav-toggle { display: none; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; margin-inline-start: auto; }
  .nav {
    position: absolute; inset-inline: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: .25rem;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: .75rem 1.25rem 1rem; box-shadow: var(--shadow-md);
    display: none;
  }
  .nav.is-open { display: flex; }
  .nav a { padding: .7rem .8rem; font-size: 1rem; }
  .nav .icon-btn { align-self: flex-start; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  color: #fff; padding-block: clamp(3.5rem, 2rem + 8vw, 7rem);
  background: #10141c;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: url("../../images/hero-dish.jpg") center / cover no-repeat;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(105deg, rgba(8, 10, 16, .94) 0%, rgba(8, 10, 16, .82) 45%, rgba(8, 10, 16, .45) 100%);
}
.hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: clamp(2rem, 1rem + 4vw, 4rem); align-items: center; }
.hero h1 { color: #fff; margin-bottom: .5rem; }
.hero__kicker { font-family: var(--font-mono); letter-spacing: .22em; text-transform: uppercase; font-size: .82rem; color: #ffd7dd; margin-bottom: .75rem; }
.hero p { color: rgba(255, 255, 255, .84); font-size: 1.08rem; max-width: 52ch; }
.hero__badges { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0 1.75rem; }
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem; border-radius: 999px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .22);
  font-size: .82rem; font-weight: 600; letter-spacing: .02em;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.qsl-card {
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  transform: rotate(1.2deg);
  transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.qsl-card:hover { transform: rotate(0deg) scale(1.015); }

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__media { order: -1; max-width: 420px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.35rem; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 600; font-size: .97rem; cursor: pointer;
  text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px rgba(200, 16, 46, .8); }
.btn--primary:hover { background: var(--accent-strong); color: #fff; }
.btn--ghost { background: rgba(255, 255, 255, .08); color: #fff; border-color: rgba(255, 255, 255, .3); }
.btn--ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.btn--soft { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn--soft:hover { background: var(--surface); color: var(--text); }

/* ---------- Griglie e card ---------- */
.grid { display: grid; gap: 1.25rem; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .grid--2, .grid--3 { grid-template-columns: 1fr; } }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.35rem 1.4rem; box-shadow: var(--shadow-sm);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
.card h3 { margin-bottom: .35rem; }
.card p { margin: 0; color: var(--text-muted); font-size: .96rem; }
.card ul { margin: .8rem 0; padding-left: 1.05rem; color: var(--text-muted); font-size: .92rem; }
.card ul li + li { margin-top: .28rem; }
.card__tag {
  display: inline-block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .06em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-soft);
  padding: .18rem .5rem; border-radius: 6px; margin-bottom: .6rem;
}

/* ---------- Chi sono / dati ---------- */
.about { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(1.5rem, 1rem + 3vw, 3.25rem); align-items: start; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.about__photo { border-radius: var(--radius-lg); box-shadow: var(--shadow-md); width: 100%; }
.figure { margin: 0; }
.figure figcaption { font-size: .85rem; color: var(--text-muted); margin-top: .6rem; }

.data-list { display: grid; grid-template-columns: auto 1fr; gap: .55rem 1.25rem; margin: 0; }
.data-list dt { font-weight: 700; color: var(--text); }
.data-list dd { margin: 0; color: var(--text-muted); }
@media (max-width: 520px) { .data-list { grid-template-columns: 1fr; gap: .1rem; } .data-list dd { margin-bottom: .7rem; } }

.chip-row { display: flex; flex-wrap: wrap; gap: .45rem; margin-top: 1.25rem; }
.chip {
  font-size: .82rem; font-weight: 600; padding: .3rem .65rem; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
}

/* ---------- Tab live logs ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.1rem; }
.tab {
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  padding: .55rem 1.05rem; border-radius: 999px; font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.tab[aria-selected="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tab:hover:not([aria-selected="true"]) { background: var(--surface-2); color: var(--text); }

.embed {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm);
}
.embed iframe { width: 100%; height: clamp(420px, 55vh, 620px); border: 0; }
.embed--short iframe { height: 400px; }

/* ---------- Video / media ---------- */
.video-wrap { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); background: #000; }
.video-wrap video { width: 100%; aspect-ratio: 16 / 9; }

.promo {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 0;
  border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); box-shadow: var(--shadow-sm);
}
.promo__body { padding: clamp(1.5rem, 1rem + 2vw, 2.5rem); }
.promo__media { min-height: 220px; background: center / cover no-repeat; }
.promo__media a { display: block; height: 100%; }
.promo img { height: 100%; width: 100%; object-fit: cover; }
@media (max-width: 760px) { .promo { grid-template-columns: 1fr; } .promo__media { order: -1; } }

/* ---------- Pagina interna ---------- */
.page-head { padding-block: clamp(2.5rem, 1.5rem + 4vw, 4rem) 0; }
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2.2rem; font-size: 1.35rem; }
.prose h2:first-child { margin-top: 0; }
.prose ul { color: var(--text-muted); }

/* ---------- Dialog ---------- */
dialog.modal {
  width: min(100% - 2rem, 1100px); padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); overflow: hidden;
}
dialog.modal::backdrop { background: rgba(8, 10, 16, .7); backdrop-filter: blur(3px); }
.modal__bar { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--border); }
.modal__bar h2 { font-size: 1.05rem; margin: 0; }
.modal__bar .icon-btn { margin-inline-start: auto; }
.modal__body { position: relative; background: var(--surface-2); }
.modal__body iframe { width: 100%; height: min(75vh, 760px); border: 0; background: var(--surface-2); }
.modal__status { padding: 3rem 1.5rem; text-align: center; color: var(--text-muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-subtle); margin-top: 3rem; }
.site-footer__inner {
  display: flex; flex-wrap: wrap; gap: 1.5rem; justify-content: space-between; align-items: center;
  padding-block: 2.25rem;
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 1rem; }
.site-footer a { color: var(--text-muted); text-decoration: none; font-size: .93rem; }
.site-footer a:hover { color: var(--accent); }
.site-footer small { color: var(--text-muted); }

/* ---------- Cookie banner ---------- */
.cookie-banner {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 60;
  background: var(--surface); border-top: 1px solid var(--border); box-shadow: var(--shadow-lg);
  padding: 1rem 0;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.cookie-banner p { margin: 0; font-size: .93rem; color: var(--text-muted); flex: 1 1 320px; }
.cookie-banner .btn { padding: .55rem 1.1rem; font-size: .9rem; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }

/* ---------- Utilità ---------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.stack > * + * { margin-top: 1rem; }
.inline-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.text-center { text-align: center; }
del { color: var(--text-muted); }

/* Stampa */
@media print {
  .site-header, .site-footer, .cookie-banner, .hero__actions, .tabs { display: none !important; }
  .hero { color: #000; background: #fff; padding-block: 1rem; }
  .hero::before, .hero::after { display: none; }
  .hero p, .hero__kicker { color: #000; }
  body { font-size: 11pt; }
}
