/* =========================================================
   WONDERDEEDS — BANDIERE DEL MONDO
   styles_v_003.css ("Il grafico")
   Novità v_003:
   - Sfondo predisposto per motivo atlante (img-grafica/sfondo-atlante.webp)
     con velo crema morbido regolabile
   - Titolo Stato sempre in MAIUSCOLO (Caps Lock)
   - Icone PNG più grandi (28px dati / 30px titoli sezione)
   - Etichette colori rettangolari (senza rotondità a pillola)
     con testo centrato nel rettangolo visibile
   - Player audio a pillola con onde sonore interattive, tasto
     rosso circolare e titolo centrato
   ========================================================= */

:root {
  /* Palette base Wonderdeeds */
  --bg-page: #FFFDF9;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #475569;
  --text-soft: #64748B;
  --border-soft: #E2E8F0;

  /* Accenti marchio */
  --brand-primary: #E11D48;
  --brand-primary-dark: #9F1239;
  --brand-primary-hover: #BE123C;
  --brand-amber: #F59E0B;
  --brand-amber-dark: #D97706;
  --brand-amber-bg: #FEF3C7;
  --brand-amber-text: #78350F;
  --brand-green: #15803D;
  --brand-green-bg: #DCFCE7;

  /* Tocchi pastello + bordi 3D */
  --pastel-capital-bg: #F0F9FF;
  --pastel-capital-border: #BAE6FD;
  --pastel-capital-3d: #7DD3FC;

  --pastel-currency-bg: #F0FDF4;
  --pastel-currency-border: #BBF7D0;
  --pastel-currency-3d: #86EFAC;

  --pastel-area-bg: #FFF7ED;
  --pastel-area-border: #FED7AA;
  --pastel-area-3d: #FDBA74;

  /* Misure rapide modificabili */
  --max-width: 460px;
  --radius-card: 24px;
  --radius-box: 16px;
  --icon-size-label: 28px;
  --icon-size-heading: 30px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  /* Motivo atlante giocoso da img-grafica/sfondo-atlante.webp
     (abbassa 0.72 a 0.45 per renderlo più visibile, alzalo a 0.85 per schiarirlo) */
  background-image:
    linear-gradient(rgba(255, 253, 249, 0.72), rgba(255, 253, 249, 0.72)),
    url("img-grafica/sfondo-atlante.webp");
  background-repeat: repeat;
  background-size: 320px auto;
  background-position: top center;
  color: var(--text-main);
  line-height: 1.45;
  min-height: 100vh;
  padding: 14px 14px 30px;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------
   1. HEADER COMPATTO SU UNA RIGA
   --------------------------------------------------------- */
.site-header {
  max-width: var(--max-width);
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 4px;
}

.logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  min-height: 42px;
}

.logo-img {
  display: block;
  max-height: 42px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 1px 1.5px rgba(15, 23, 42, 0.16));
}

.logo-fallback {
  display: none;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: var(--text-main);
}

.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background-color: var(--bg-card);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 8px 30px 8px 13px;
  border: 2px solid var(--border-soft);
  border-bottom: 4px solid #CBD5E1;
  border-radius: 999px;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7.5L10 12.5L15 7.5' stroke='%230F172A' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  transition: transform 0.12s ease, border-color 0.2s ease;
}

.lang-select:focus {
  outline: none;
  border-color: var(--brand-primary);
}

/* ---------------------------------------------------------
   CONTENITORE E SCHEDA UNICA CON EFFETTO TATTILE 3D
   --------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
}

.card {
  background-color: var(--bg-card);
  border: 2px solid #E2E8F0;
  border-bottom: 6px solid #CBD5E1;
  border-radius: var(--radius-card);
  padding: 22px 18px 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

/* ---------------------------------------------------------
   2. TESTATA PAESE (Continente centrato + Stato in MAIUSCOLO)
   --------------------------------------------------------- */
.country-header {
  text-align: center;
  margin-bottom: 16px;
}

.badge-continente {
  display: inline-block;
  background-color: var(--brand-green-bg);
  color: var(--brand-green);
  border: 1.5px solid #86EFAC;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.country-title {
  font-size: clamp(1.55rem, 6.2vw, 2.05rem);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-main);
  line-height: 1.12;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------
   3. RIQUADRO BANDIERA (Cornice da album creativo)
   --------------------------------------------------------- */
.flag-wrapper {
  background-color: #FAF6EE;
  border: 2px dashed #D6CFC2;
  border-radius: 18px;
  padding: 15px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.flag-img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 185px;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

/* ---------------------------------------------------------
   4. DATI GEOGRAFICI — SCHEMA 2+1 PASTELLO TATTILE
   --------------------------------------------------------- */
.geo-grid {
  display: grid;
  grid-template-columns: 1.45fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.geo-box {
  border-radius: var(--radius-box);
  padding: 11px 13px;
  text-align: left;
  min-width: 0;
  border-width: 1.5px;
  border-style: solid;
  border-bottom-width: 4px;
}

.geo-box--full {
  grid-column: 1 / -1;
  background-color: var(--pastel-capital-bg);
  border-color: var(--pastel-capital-border);
  border-bottom-color: var(--pastel-capital-3d);
}

.geo-box--currency {
  background-color: var(--pastel-currency-bg);
  border-color: var(--pastel-currency-border);
  border-bottom-color: var(--pastel-currency-3d);
}

.geo-box--area {
  background-color: var(--pastel-area-bg);
  border-color: var(--pastel-area-border);
  border-bottom-color: var(--pastel-area-3d);
}

.geo-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.geo-label-row .section-icon {
  width: var(--icon-size-label);
  height: var(--icon-size-label);
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.12));
}

.geo-label {
  font-size: clamp(0.7rem, 2.8vw, 0.78rem);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-soft);
  line-height: 1.15;
}

.geo-value {
  font-size: clamp(0.95rem, 3.8vw, 1.06rem);
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------
   TITOLI DI SEZIONE (Icone stile sticker 30px)
   --------------------------------------------------------- */
.section-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.section-heading .section-icon {
  width: var(--icon-size-heading);
  height: var(--icon-size-heading);
  object-fit: contain;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.14));
}

/* ---------------------------------------------------------
   5. COLORI DA USARE — PASTELLI + RETTANGOLI (NO PILLOLA)
   --------------------------------------------------------- */
.colors-section {
  margin-bottom: 22px;
}

.colors-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 12px;
}

/* Caso 3 colori: 2 sopra + 1 centrato sotto della stessa larghezza */
.colors-list[data-count="3"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.colors-list[data-count="3"] .color-item:nth-child(1) {
  grid-column: 1 / 3;
}

.colors-list[data-count="3"] .color-item:nth-child(2) {
  grid-column: 3 / 5;
}

.colors-list[data-count="3"] .color-item:nth-child(3) {
  grid-column: 2 / 4;
}

.color-item {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  padding-left: 10px;
}

.color-crayon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 0 2px #FFFFFF) drop-shadow(0 0 1.5px #FFFFFF) drop-shadow(0 2px 4px rgba(15, 23, 42, 0.22));
}

.crayon-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.color-strip {
  width: 100%;
  min-height: 38px;
  /* Rettangolare pulito (metti 0px se vuoi angoli vivi a 90°) */
  border-radius: 4px;
  /* Spazio calibrato per centrare otticamente il testo nel rettangolo visibile */
  padding: 7px 10px 7px 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: 0 3px 0 rgba(15, 23, 42, 0.14);
}

/* Bordino leggero automatico sui colori chiarissimi (es. Bianco) */
.color-item--light .color-strip {
  border: 1.5px solid #CBD5E1;
  box-shadow: 0 3px 0 #E2E8F0;
}

.color-name {
  display: block;
  width: 100%;
  text-align: center;
  font-size: clamp(0.8rem, 3.2vw, 0.9rem);
  font-weight: 800;
  line-height: 1.15;
  overflow-wrap: break-word;
}

/* ---------------------------------------------------------
   6. INNO NAZIONALE — PLAYER A PILLOLA CON ONDE SONORE
   --------------------------------------------------------- */
.anthem-section {
  background-color: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  border-bottom: 4px solid #CBD5E1;
  border-radius: 34px;
  padding: 12px 16px 12px 12px;
  margin-bottom: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07);
}

.audio-player {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 0;
  background-color: var(--brand-primary);
  color: #FFFFFF;
  border: none;
  border-bottom: 4px solid var(--brand-primary-dark);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: 0 5px 14px rgba(225, 29, 72, 0.30);
  transition: transform 0.1s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.audio-play-btn:hover {
  background-color: var(--brand-primary-hover);
}

.audio-play-btn:active {
  transform: translateY(2px);
  border-bottom-width: 2px;
}

.audio-play-btn.is-playing {
  background-color: var(--text-main);
  border-bottom-color: #020617;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.25);
}

.play-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.audio-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.audio-wave-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.waveform-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 30px;
  display: flex;
  align-items: center;
}

.waveform-bars {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 3px;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wave-bar {
  flex: 1;
  max-width: 4px;
  min-width: 2px;
  border-radius: 999px;
  background-color: #CBD5E1;
  transition: background-color 0.12s ease;
}

.wave-bar.is-played {
  background-color: var(--brand-primary);
}

/* Barra range trasparente sopra le onde per toccare/trascinare il punto di ascolto */
.audio-progress {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  z-index: 2;
}

.audio-time {
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-soft);
  min-width: 34px;
  text-align: right;
  flex-shrink: 0;
}

.anthem-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.anthem-title-row .section-icon {
  width: var(--icon-size-heading);
  height: var(--icon-size-heading);
  object-fit: contain;
  flex-shrink: 0;
}

.anthem-title {
  font-size: clamp(0.8rem, 3.2vw, 0.88rem);
  font-weight: 800;
  color: var(--text-muted);
  line-height: 1.2;
  text-align: center;
}

/* ---------------------------------------------------------
   7. BOX CURIOSITÀ ("Lo sapevi che?")
   --------------------------------------------------------- */
.fact-section {
  background-color: var(--brand-amber-bg);
  border: 1.5px solid #FDE68A;
  border-left: 5px solid var(--brand-amber);
  border-bottom: 4px solid #FCD34D;
  border-radius: 16px;
  padding: 14px 14px 14px 15px;
  margin-bottom: 20px;
  text-align: left;
}

.fact-section .section-heading {
  color: var(--brand-amber-text);
  margin-bottom: 6px;
}

.fact-text {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.5;
}

/* ---------------------------------------------------------
   8. PULSANTI CALL TO ACTION CON EFFETTO TATTILE 3D
   --------------------------------------------------------- */
.cta-group {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-decoration: none;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  padding: 14px 16px;
  border-radius: 16px;
  line-height: 1.25;
  transition: transform 0.1s ease, background-color 0.2s ease;
}

.cta-btn:active {
  transform: translateY(2px);
}

.cta-btn--primary {
  background-color: var(--brand-primary);
  color: #FFFFFF;
  border: none;
  border-bottom: 4px solid var(--brand-primary-dark);
  box-shadow: 0 6px 14px rgba(225, 29, 72, 0.20);
}

.cta-btn--primary:hover {
  background-color: var(--brand-primary-hover);
}

.cta-btn--secondary {
  background-color: var(--brand-amber-bg);
  color: var(--brand-amber-text);
  border: 1.5px solid var(--brand-amber);
  border-bottom: 4px solid var(--brand-amber-dark);
}

.cta-btn--secondary:hover {
  background-color: #FDE68A;
}

/* ---------------------------------------------------------
   FOOTER (2 righe ufficiali)
   --------------------------------------------------------- */
.site-footer {
  max-width: var(--max-width);
  margin: 18px auto 0;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-soft);
  line-height: 1.5;
  padding: 0 8px;
}

.site-footer p + p {
  margin-top: 2px;
}

/* ---------------------------------------------------------
   OTTIMIZZAZIONE SCHERMI MOLTO STRETTI (<= 350px)
   --------------------------------------------------------- */
@media (max-width: 350px) {
  .card {
    padding: 18px 14px 18px;
  }

  .geo-grid {
    grid-template-columns: 1fr;
  }

  .color-strip {
    padding: 7px 8px 7px 32px;
  }

  .anthem-section {
    border-radius: 26px;
    padding: 10px 12px;
  }
}