/*
Theme Name: Giochiadi
Theme URI: https://www.giochiadi.it/
Author: CSEN Comitato di Parma
Description: Tema vetrina delle Giochiadi: foto a tutto schermo, pulsanti per scaricare dispositivo tecnico e modulo di iscrizione, calendario, video delle prove di gioco. Si integra con il plugin "Giochiadi Classifiche". Foto, documenti, testi e video si modificano da Aspetto › Personalizza.
Version: 1.1.0
Requires at least: 6.2
Tested up to: 6.8
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: giochiadi
Tags: one-column, custom-menu, accessibility-ready, custom-logo, featured-images
*/

/* =========================================================
   Giochiadi – foglio di stile
   Colori ripresi dal marchio: blu notte, giallo, verde, rosso
   ========================================================= */

:root {
  --navy: #12264a;
  --navy-2: #1c3766;
  --navy-deep: #0b1830;
  --yellow: #ffd84d;
  --yellow-2: #ffc61a;
  --green: #138a3a;      /* 5.1:1 su bianco */
  --green-soft: #e3f5e8;
  --red: #c8102e;        /* 5.9:1 su bianco */
  --red-soft: #fde8eb;
  --yellow-soft: #fff6d4;
  --ink: #14213d;
  --ink-2: #44506a;      /* 7.9:1 su bianco */
  --paper: #ffffff;
  --tint: #f4f6fb;
  --line: #dde3ee;

  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 10px 30px -12px rgba(18, 38, 74, .28);
  --shadow-lg: 0 24px 60px -20px rgba(11, 24, 48, .55);

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: ui-rounded, "SF Pro Rounded", "Segoe UI Variable Display", "Segoe UI", system-ui, "Arial Rounded MT Bold", Arial, sans-serif;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 8px);
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(1rem, .96rem + .2vw, 1.125rem);
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -.01em;
}
h2 { font-size: clamp(1.9rem, 1.4rem + 2.4vw, 3rem); font-weight: 900; }
h3 { font-size: 1.25rem; font-weight: 800; }
p  { margin: 0 0 1em; }

a { color: var(--navy-2); text-underline-offset: .18em; }
a:hover { color: var(--red); }

:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px var(--navy);
  border-radius: 6px;
}

.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;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  background: var(--yellow); color: var(--navy);
  padding: .75rem 1.25rem; border-radius: 999px;
  font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: 12px; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: 760px; }
.center { text-align: center; }

main:focus { outline: none; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--header-h);
  color: #fff;
  transition: background-color .3s, box-shadow .3s;
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(11, 24, 48, .94);
  box-shadow: 0 6px 24px -10px rgba(0, 0, 0, .5);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header.is-scrolled { background: rgba(11, 24, 48, .82); backdrop-filter: blur(12px); }
}
.header-inner {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  display: inline-flex; align-items: center; gap: .6rem;
  color: inherit; text-decoration: none; line-height: 1;
  border-radius: 14px;
}
/* Logo: scritta GIOCHIADI (font Scratch My Back, convertito in tracciati SVG) su "adesivo" bianco */
.brand-logo {
  display: inline-flex; padding: .4rem .85rem;
  background: #fff; border-radius: 12px;
  box-shadow: 0 4px 0 var(--yellow);
  transform: rotate(-2deg);
  transition: transform .2s ease;
}
.brand-logo img { display: block; width: auto; height: 30px; }
.brand:hover .brand-logo { transform: rotate(0deg) scale(1.04); }
@media (max-width: 380px) { .brand-logo img { height: 24px; } }

.site-nav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; gap: .25rem;
}
.site-nav a {
  display: block; padding: .6rem .9rem; border-radius: 999px;
  color: #fff; text-decoration: none; font-weight: 600;
}
.site-nav a:hover { background: rgba(255, 255, 255, .14); color: #fff; }

.nav-toggle {
  display: none;
  width: 48px; height: 48px; border-radius: 12px;
  border: 0; background: rgba(255, 255, 255, .14); color: #fff; cursor: pointer;
  place-items: center;
}
.nav-toggle-bars,
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  display: block; width: 22px; height: 2.5px; border-radius: 2px;
  background: currentColor; position: relative; transition: transform .25s, opacity .25s;
}
.nav-toggle-bars::before,
.nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: grid; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: rgba(11, 24, 48, .97);
    padding: .5rem var(--gutter) 1.25rem;
    display: none;
  }
  .site-header.is-open .site-nav { display: block; }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: .9rem 1rem; font-size: 1.1rem; border-radius: 12px; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  color: #fff;
  background: var(--navy-deep);
  overflow: hidden;
  isolation: isolate;
}
.hero-slides { position: absolute; inset: 0; z-index: -2; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1.4s ease;
}
.hero-slide.is-active { opacity: 1; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover;
  transform: scale(1.04);
}
.hero-slide.is-active img { animation: kenburns 9s ease-out forwards; }
@keyframes kenburns {
  from { transform: scale(1.12); }
  to   { transform: scale(1.02); }
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 24, 48, .55) 0%, rgba(11, 24, 48, .25) 30%, rgba(11, 24, 48, .55) 62%, rgba(11, 24, 48, .92) 100%),
    linear-gradient(90deg, rgba(11, 24, 48, .7) 0%, rgba(11, 24, 48, 0) 70%);
}

.hero-content {
  padding-top: calc(var(--header-h) + 3rem);
  padding-bottom: 7rem;
}
.hero-eyebrow {
  display: inline-block;
  background: var(--yellow); color: var(--navy);
  font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  font-size: .9rem;
  padding: .35rem .9rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: clamp(3.4rem, 1.5rem + 10vw, 9rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -.02em;
  line-height: .9;
  margin-bottom: .25em;
  text-shadow: 0 6px 30px rgba(0, 0, 0, .35);
}
.hero-lead {
  max-width: 38rem;
  font-size: clamp(1.1rem, 1rem + .6vw, 1.45rem);
  line-height: 1.45;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .45);
  margin-bottom: 2rem;
}

.hero-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  max-width: 780px;
}
@media (max-width: 640px) {
  .hero-actions { grid-template-columns: 1fr; }
}

.hero-controls {
  position: absolute; left: 0; right: 0; bottom: 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.hero-pause {
  width: 44px; height: 44px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .7);
  background: rgba(11, 24, 48, .5); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.hero-pause svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.hero-pause .icon-play { display: none; fill: currentColor; stroke-width: 1.5; }
.hero-pause[aria-pressed="true"] .icon-pause { display: none; }
.hero-pause[aria-pressed="true"] .icon-play { display: block; }
.hero-pause:hover { background: rgba(11, 24, 48, .8); }

.hero-dots { display: flex; gap: .25rem; }
.hero-dots button {
  width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer;
  display: grid; place-items: center;
}
.hero-dots button::before {
  content: ""; width: 12px; height: 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .55); border: 2px solid #fff;
  transition: width .3s, background-color .3s;
}
.hero-dots button[aria-current="true"]::before { width: 30px; background: var(--yellow); border-color: var(--yellow); }

/* ---------- Pulsanti ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .75rem;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-weight: 800; text-decoration: none; line-height: 1.2;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s, color .2s;
}
.btn-icon {
  flex: none; width: 1.4em; height: 1.4em;
  fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-xl {
  padding: 1.15rem 1.6rem 1.15rem 1.3rem;
  border-radius: 22px;
  min-height: 88px;
  box-shadow: var(--shadow-lg);
}
.btn-xl .btn-icon {
  width: 52px; height: 52px; padding: 12px;
  border-radius: 16px;
  stroke-width: 2.4;
}
.btn-text { display: flex; flex-direction: column; gap: .2rem; }
.btn-label { font-family: var(--font-display); font-size: clamp(1.15rem, 1rem + .6vw, 1.45rem); font-weight: 900; }
.btn-meta { font-size: .9rem; font-weight: 600; opacity: .9; }

.btn-primary { background: var(--yellow); color: var(--navy); }
.btn-primary .btn-icon { background: var(--navy); color: var(--yellow); }
.btn-primary:hover { background: var(--yellow-2); color: var(--navy); box-shadow: 0 18px 40px -14px rgba(255, 198, 26, .7); }

.btn-secondary { background: #fff; color: var(--navy); }
.btn-secondary .btn-icon { background: var(--green); color: #fff; }
.btn-secondary:hover { color: var(--navy); background: #f1f5ff; }

.btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .6); box-shadow: none; }
.btn-ghost .btn-icon { background: rgba(255, 255, 255, .14); }
.btn-ghost:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, .08); }

.btn-outline { background: #fff; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }

/* ---------- Sezioni ---------- */
.section { padding-block: clamp(4rem, 3rem + 5vw, 7.5rem); }
.section-tint { background: var(--tint); }
.section-dark {
  background:
    radial-gradient(1200px 500px at 90% -10%, rgba(255, 216, 77, .16), transparent 60%),
    radial-gradient(800px 400px at -10% 110%, rgba(19, 138, 58, .25), transparent 60%),
    var(--navy);
  color: #fff;
}
.section-dark a { color: var(--yellow); }
.section-dark a:hover { color: #fff; }

.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem;
  font-weight: 800; font-size: .9rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--red);
  margin-bottom: .75rem;
}
.eyebrow::before { content: ""; width: 24px; height: 4px; border-radius: 4px; background: currentColor; }
.eyebrow-light { color: var(--yellow); }

.section-intro { font-size: 1.15rem; color: var(--ink-2); max-width: 46rem; margin-bottom: 2.5rem; }
.center .section-intro { margin-inline: auto; }
.lead { font-size: 1.2rem; }

.note { color: var(--ink-2); font-size: .95rem; margin-top: 2rem; max-width: 52rem; }
.note-light { color: rgba(255, 255, 255, .85); }

/* Progetto */
.intro-grid {
  display: grid; gap: clamp(2rem, 5vw, 5rem);
  grid-template-columns: 1.3fr 1fr; align-items: center;
}
@media (max-width: 860px) { .intro-grid { grid-template-columns: 1fr; } }

.stats {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem;
}
.stats li {
  background: var(--tint); border-radius: var(--radius);
  padding: 1.4rem 1.2rem;
  display: flex; flex-direction: column;
}
.stats li:nth-child(1) { background: var(--yellow); }
.stats li:nth-child(4) { background: var(--navy); color: #fff; }
.stat-num { font-family: var(--font-display); font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem); font-weight: 900; line-height: 1; }
.stat-label { font-weight: 700; margin-top: .4rem; }

.values {
  list-style: none; margin: clamp(3rem, 6vw, 5rem) 0 0; padding: 0;
  display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px) { .values { grid-template-columns: 1fr; } }
.value {
  border-radius: var(--radius); padding: 1.75rem;
  border-top: 6px solid;
}
.value p { margin: 0; color: var(--ink-2); }
.value-green  { background: var(--green-soft);  border-color: var(--green); }
.value-yellow { background: var(--yellow-soft); border-color: var(--yellow-2); }
.value-red    { background: var(--red-soft);    border-color: var(--red); }

/* Calendario */
.dates {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: .9rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.dates li {
  display: flex; align-items: center; gap: 1rem;
  background: #fff; border-radius: var(--radius);
  padding: .9rem 1rem;
  border: 1px solid var(--line);
  box-shadow: 0 2px 0 rgba(18, 38, 74, .04);
}
.dates time {
  flex: none; width: 64px; height: 64px; border-radius: 16px;
  background: var(--navy); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  line-height: 1;
}
.dates li:nth-child(3n+2) time { background: var(--green); }
.dates li:nth-child(3n+3) time { background: var(--red); }
.dates .d { font-family: var(--font-display); font-size: 1.6rem; font-weight: 900; }
.dates .m { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; margin-top: .2rem; }
.dates div { display: flex; flex-direction: column; min-width: 0; }
.dates strong { font-size: 1.08rem; }
.dates div span { font-size: .92rem; color: var(--ink-2); }

.cal-bottom {
  display: grid; gap: 1.25rem; margin-top: 2rem;
  grid-template-columns: 1fr 1fr;
}
@media (max-width: 860px) { .cal-bottom { grid-template-columns: 1fr; } }

.final-card {
  position: relative; overflow: hidden;
  background: var(--navy); color: #fff;
  border-radius: var(--radius-lg); padding: 2rem;
}
.final-card::after {
  content: ""; position: absolute; right: -40px; bottom: -40px;
  width: 200px; height: 200px;
  background: url("assets/img/logo.svg") center / contain no-repeat;
  opacity: .18; transform: rotate(-12deg);
}
.final-card h3 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); font-weight: 900; color: var(--yellow); }
.final-card p:last-child { margin: 0; max-width: 28rem; }

.schedule {
  background: #fff; border-radius: var(--radius-lg); padding: 2rem;
  border: 1px solid var(--line);
}
.schedule ol { list-style: none; margin: 0; padding: 0; }
.schedule li {
  display: flex; gap: 1rem; align-items: baseline;
  padding: .6rem 0; border-bottom: 1px dashed var(--line);
  font-weight: 600;
}
.schedule li:last-child { border-bottom: 0; }
.schedule .time { flex: none; min-width: 7.5rem; font-variant-numeric: tabular-nums; color: var(--green); font-weight: 800; }

/* Giochi */
.games {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.game {
  position: relative;
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column;
  transition: box-shadow .2s, transform .2s;
}
.game:hover { box-shadow: var(--shadow); transform: translateY(-3px); }
.game h3, .game p { padding-inline: 1.2rem; }
.game h3 { margin-top: 1rem; }
.game p { color: var(--ink-2); font-size: .97rem; margin-bottom: 1.2rem; }
.game-num {
  position: absolute; top: .75rem; left: .75rem; z-index: 2;
  background: var(--yellow); color: var(--navy);
  font-family: var(--font-display); font-weight: 900; font-size: .95rem;
  padding: .2rem .6rem; border-radius: 999px;
}
.game-media {
  position: relative; display: block; aspect-ratio: 16 / 9;
  background: var(--navy);
  color: #fff; text-decoration: none;
  order: -1;
}
.game-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s, opacity .3s; opacity: .85; }
.game-media:hover img { transform: scale(1.05); opacity: 1; }
.game-play {
  position: absolute; left: .75rem; bottom: .75rem;
  display: inline-flex; align-items: center; gap: .45rem;
  background: rgba(11, 24, 48, .85); color: #fff;
  padding: .45rem .85rem .45rem .6rem; border-radius: 999px;
  font-weight: 700; font-size: .9rem;
}
.game-play svg { width: 18px; height: 18px; fill: var(--yellow); }
.game-media:hover .game-play { background: var(--red); color: #fff; }
.game-media:hover, .game-media:focus-visible { color: #fff; }

.games-cta { margin: 2.5rem 0 0; text-align: center; }

/* Iscrizione */
.steps {
  list-style: none; margin: 1rem 0 3rem; padding: 0;
  display: grid; gap: 1.25rem; grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }
.steps li {
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: var(--radius); padding: 1.75rem;
}
.steps p { margin: 0; color: rgba(255, 255, 255, .88); }
.step-num {
  display: grid; place-items: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--yellow); color: var(--navy);
  font-family: var(--font-display); font-weight: 900; font-size: 1.5rem;
  margin-bottom: 1rem;
}
.iscrizione-actions {
  display: flex; flex-wrap: wrap; gap: 1rem;
}
.iscrizione-actions .btn { flex: 1 1 280px; max-width: 380px; }
.section-dark .btn-primary { color: var(--navy); }
.section-dark .btn-primary .btn-icon { color: var(--yellow); }

/* Classifiche */
.badge {
  display: inline-block; margin: 0;
  background: var(--green-soft); color: #0d5e28;
  border: 2px solid var(--green);
  padding: .6rem 1.2rem; border-radius: 999px;
  font-weight: 800;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: rgba(255, 255, 255, .88);
  padding-top: 4rem;
  font-size: .98rem;
}
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.footer-grid {
  display: grid; gap: 2.5rem;
  grid-template-columns: 1.4fr 1fr 1fr;
}
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.brand-footer { margin-bottom: 1rem; color: #fff; }
.footer-title { font-size: 1rem; text-transform: uppercase; letter-spacing: .1em; color: var(--yellow); }
.site-footer address { font-style: normal; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .5rem; }
.footer-legal {
  margin-top: 3rem; padding-block: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, .14);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  font-size: .88rem; color: rgba(255, 255, 255, .72);
}
.footer-legal p { margin: 0; }

/* ---------- Banner cookie ---------- */
.cookie-banner {
  position: fixed; z-index: 90;
  left: 16px; right: 16px; bottom: 16px;
  max-width: 640px; margin-inline: auto;
  background: var(--navy-deep); color: #fff;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, .14);
}
.cookie-banner[hidden] { display: none; }
.cookie-banner-inner { padding: 1.25rem 1.4rem; }
.cookie-banner-title { font-size: 1.15rem; margin: 0 0 .4rem; color: var(--yellow); }
.cookie-banner p { margin: 0 0 1rem; font-size: .95rem; line-height: 1.5; color: rgba(255, 255, 255, .9); }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }
.cookie-banner-actions .btn { flex: 1 1 140px; justify-content: center; max-width: 220px; }
@media (max-width: 480px) { .cookie-banner-actions .btn { max-width: none; } }
.link-button {
  padding: 0; border: 0; background: none; font: inherit; color: inherit;
  text-decoration: underline; cursor: pointer;
}
.link-button:hover { color: #fff; }

/* ---------- Finestra video ---------- */
.video-dialog {
  width: min(960px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  padding: 0; border: 0; border-radius: var(--radius-lg);
  background: var(--navy-deep); color: #fff;
  box-shadow: var(--shadow-lg);
}
.video-dialog::backdrop { background: rgba(5, 12, 26, .82); }
.video-dialog-inner { padding: 1rem 1rem 1.25rem; }
.video-dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .75rem; }
.video-dialog h2 { font-size: clamp(1.2rem, 1rem + 1vw, 1.6rem); margin: 0 0 0 .25rem; }
.video-close {
  flex: none; width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .14); color: #fff;
  display: grid; place-items: center; cursor: pointer;
}
.video-close:hover { background: var(--red); }
.video-close svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; }
.video-dialog video { width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 12px; }
.video-desc { margin: .9rem .25rem 0; color: rgba(255, 255, 255, .85); }

/* ---------- Animazioni d'ingresso ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .7s ease, transform .7s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Preferenze utente ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media (forced-colors: active) {
  .btn, .hero-pause, .video-close { border: 2px solid ButtonText; }
  .hero-dots button::before { background: ButtonText; }
}

@media print {
  .site-header, .hero-controls, .hero-slides, .video-dialog, .game-media, .cookie-banner { display: none !important; }
  .hero { min-height: 0; color: var(--ink); background: none; }
  .hero::before { display: none; }
  .section-dark { background: none; color: var(--ink); }
}

.js .game.reveal.is-visible:hover { transform: translateY(-3px); }

/* Sfumatura dietro al menu quando è sopra la foto */
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -40px; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 24, 48, .7), rgba(11, 24, 48, 0));
  transition: opacity .3s;
}
.site-header.is-scrolled::before,
.site-header.is-open::before { opacity: 0; }

/* ---------- Pagina classifiche ---------- */
.page-inner .site-header { position: sticky; }
.rank-page { padding-top: clamp(2.5rem, 2rem + 3vw, 4.5rem); min-height: 70vh; }
.rank-title { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.2rem); font-weight: 900; }
.rank-empty { font-size: 1.15rem; background: var(--tint); border-radius: var(--radius); padding: 1.5rem; }
.rank-filter { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin-bottom: 1.75rem; }
.rank-filter > div { display: grid; gap: .3rem; min-width: 0; flex: 0 1 auto; }
.rank-filter > div:last-of-type { flex: 1 1 280px; max-width: 520px; }
.rank-filter label { font-weight: 800; }
.rank-filter select { font: inherit; min-height: 48px; padding: .5rem .8rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%; }
.rank-filter select:hover { border-color: var(--navy); }
.rank-filter .btn { min-height: 48px; }
.rank-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(.75rem, 2vw, 1.5rem); box-shadow: var(--shadow); }
.rank-back { margin-top: 2rem; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; }
.table caption { text-align: left; font-weight: 700; color: var(--ink-2); padding: 0 .5rem .75rem; }
.table th, .table td { padding: .7rem .6rem; border-bottom: 1px solid var(--line); text-align: left; }
.table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-2); border-bottom: 2px solid var(--line); white-space: nowrap; }
.table tbody th { font-weight: 700; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table abbr { text-decoration: none; }
.ranking .total-col { background: var(--yellow-soft); font-size: 1.05rem; }
.ranking .game-col { color: var(--ink-2); font-size: .92rem; }
.ranking .podium-1 { background: #fffaf0; }
.pos { display: inline-grid; place-items: center; min-width: 2.4em; padding: .15rem .45rem; border-radius: 999px; font-weight: 800; background: var(--tint); }
.pos-1 { background: var(--yellow); color: var(--navy); }
.pos-2 { background: #dfe4ec; color: var(--navy); }
.pos-3 { background: #f2c9a1; color: #5a2d06; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; margin: 1rem .5rem 0; padding-left: 1.2rem; color: var(--ink-2); font-size: .92rem; }
@media (max-width: 640px) { .ranking .game-col, .rank-card .legend { display: none; } }
.page-inner .site-header,
.page-inner .site-header.is-scrolled { background: var(--navy-deep); backdrop-filter: none; }

/* =========================================================
   Pagine interne di WordPress (articoli, pagine, archivi)
   ========================================================= */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus {
  position: static !important; width: auto; height: auto; margin: 0; clip: auto; white-space: normal;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.admin-bar.page-inner .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar.page-inner .site-header { top: 0; } }

.content-area { padding-block: clamp(2.5rem, 2rem + 3vw, 4.5rem) clamp(4rem, 3rem + 4vw, 6rem); min-height: 60vh; }
.content-narrow { max-width: 820px; }
.entry-header { margin-bottom: 2rem; }
.entry-title { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.2rem); font-weight: 900; }
.entry-title a { color: inherit; text-decoration: none; }
.entry-title a:hover { color: var(--red); }
.entry-meta { color: var(--ink-2); font-size: .95rem; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem); margin-top: 1.8em; }
.entry-content h3 { margin-top: 1.5em; }
.entry-content img { border-radius: var(--radius); }
.entry-content ul, .entry-content ol { padding-left: 1.4em; }
.entry-content blockquote { margin-left: 0; padding: .5rem 0 .5rem 1.25rem; border-left: 5px solid var(--yellow); font-size: 1.15rem; }
.entry-content table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: .6rem; border-bottom: 1px solid var(--line); text-align: left; }
.entry-content .wp-block-button__link { border-radius: 999px; background: var(--yellow); color: var(--navy); font-weight: 800; }
.alignwide { max-width: 1100px; }
.alignfull { width: 100vw; max-width: 100vw; margin-left: calc(50% - 50vw); }
.wp-caption-text, figcaption { color: var(--ink-2); font-size: .9rem; margin-top: .5rem; }
.post-thumbnail img { border-radius: var(--radius-lg); margin-bottom: 2rem; width: 100%; }

.post-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.post-card h2 { font-size: 1.35rem; }
.pagination, .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 2.5rem; }
.nav-links a, .nav-links span { padding: .5rem .9rem; border-radius: 999px; border: 2px solid var(--line); text-decoration: none; font-weight: 700; }
.nav-links .current { background: var(--navy); color: #fff; border-color: var(--navy); }

.search-form { display: flex; gap: .5rem; flex-wrap: wrap; }
.search-form input[type="search"] { font: inherit; min-height: 48px; padding: .5rem .9rem; border: 2px solid var(--line); border-radius: 12px; flex: 1 1 220px; }
.search-form button { font: inherit; }

.site-nav .current-menu-item > a, .site-nav a[aria-current="page"] { background: rgba(255, 255, 255, .16); }
.custom-logo { width: 40px; height: 40px; object-fit: contain; }
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--line); }
.comment-list { padding-left: 1.2rem; }
.comment-form input, .comment-form textarea { font: inherit; width: 100%; padding: .6rem .8rem; border: 2px solid var(--line); border-radius: 12px; }
.comment-form .submit { font: inherit; font-weight: 800; padding: .7rem 1.4rem; border: 0; border-radius: 999px; background: var(--yellow); color: var(--navy); cursor: pointer; width: auto; }
