/* =========================================================
   Giravico – foglio di stile
   Colori e misure principali sono "variabili" qui sotto:
   cambiandole si aggiorna tutto il sito.
   ========================================================= */
:root {
  --blu: #0E3A53;          /* blu profondo Adriatico */
  --blu-mare: #1F6F8B;
  --blu-chiaro: #DCEBEF;
  --bianco: #FBF7F0;       /* bianco caldo */
  --carta: #FFFDF9;
  --pietra: #EFE5D3;       /* pietra chiara */
  --pietra-scura: #CDBB98;
  --corallo: #B64A30;      /* accento corallo (contrasto AA con testo bianco) */
  --corallo-chiaro: #F6DCD2;
  --sabbia: #E9D3A8;
  --oliva: #55633A;
  --testo: #1E2A31;
  --testo-tenue: #4E5B62;
  --errore: #A3261B;
  --successo: #2F6B3A;

  --font-titoli: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --font-testo: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --raggio: 14px;
  --raggio-grande: 24px;
  --ombra: 0 1px 2px rgba(14, 58, 83, .06), 0 6px 20px rgba(14, 58, 83, .07);
  --max: 1160px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bianco);
  color: var(--testo);
  font-family: var(--font-testo);
  font-size: 1.0625rem;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--blu-mare); text-underline-offset: 3px; }
a:hover { color: var(--blu); }
h1, h2, h3 { font-family: var(--font-titoli); color: var(--blu); line-height: 1.15; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(2rem, 5vw, 3.25rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2.1rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

:focus-visible { outline: 3px solid var(--corallo); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }

.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: 12px; top: -60px; z-index: 100;
  background: var(--blu); color: #fff; padding: 10px 16px; border-radius: 8px;
}
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(40px, 7vw, 80px) 0; }
.section--stone { background: var(--pietra); }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.lead { font-size: 1.15rem; color: var(--testo-tenue); max-width: 62ch; }
.eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: .8rem; font-weight: 700; color: var(--corallo); margin-bottom: .75em; }

/* ---------- Banner demo ---------- */
.demo-banner {
  background: var(--blu); color: #F3EADB; font-size: .9rem; text-align: center;
  padding: 8px var(--gutter);
}

/* ---------- Header ---------- */
.site-header { background: var(--carta); border-bottom: 1px solid var(--pietra); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--blu); font-family: var(--font-titoli); font-size: 1.35rem; font-weight: 700; margin-right: auto; }
.brand img { width: 34px; height: 34px; }
.nav-list { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav-list a {
  display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; color: var(--testo); font-weight: 500;
}
.nav-list a:hover { background: var(--pietra); color: var(--blu); }
.nav-list a[aria-current="page"] { color: var(--blu); background: var(--blu-chiaro); }
.lang-switch {
  border: 1px solid var(--pietra-scura); background: transparent; color: var(--blu); font: inherit; font-weight: 600;
  padding: 8px 12px; border-radius: 999px; cursor: pointer; min-height: 44px; text-decoration: none; display: inline-flex; align-items: center;
}
.lang-switch:hover { background: var(--pietra); }
.menu-toggle { display: none; }

@media (max-width: 880px) {
  .menu-toggle {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px;
    border: 1px solid var(--pietra-scura); border-radius: 999px; background: var(--carta); color: var(--blu); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
  }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--carta); border-bottom: 1px solid var(--pietra); box-shadow: var(--ombra); }
  .site-nav.is-open { display: block; }
  .nav-list { flex-direction: column; padding: 8px var(--gutter) 16px; }
  .nav-list a { padding: 14px 12px; font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .header-inner { gap: 8px; }
  .brand { font-size: 1.1rem; white-space: nowrap; gap: 8px; }
  .brand img { width: 28px; height: 28px; }
  .menu-toggle, .lang-switch { padding: 8px 12px; font-size: .95rem; }
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 22px; border-radius: 999px; border: 2px solid transparent;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; line-height: 1.2; text-align: center;
}
.btn--primary { background: var(--corallo); color: #fff; }
.btn--primary:hover { background: #973A24; color: #fff; }
.btn--secondary { background: transparent; color: var(--blu); border-color: var(--blu); }
.btn--secondary:hover { background: var(--blu); color: #fff; }
.btn--ghost { background: transparent; color: var(--blu-mare); padding: 8px 12px; min-height: 44px; }
.btn--ghost:hover { background: var(--pietra); color: var(--blu); }
.btn--small { min-height: 40px; padding: 8px 14px; font-size: .95rem; }
.btn[disabled] { opacity: .6; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Hero ---------- */
.hero { padding: clamp(28px, 5vw, 64px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(24px, 5vw, 64px); align-items: center; }
.hero-art { border-radius: 260px 260px var(--raggio-grande) var(--raggio-grande); overflow: hidden; aspect-ratio: 4 / 4.6; background: var(--pietra); box-shadow: var(--ombra); }
.hero-art img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { order: -1; aspect-ratio: 16 / 10; border-radius: 160px 160px var(--raggio) var(--raggio); max-height: 320px; }
}

/* ---------- Planner (scelte iniziali) ---------- */
.planner { background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio-grande); padding: clamp(18px, 3vw, 28px); box-shadow: var(--ombra); margin-top: 24px; }
.planner h2 { font-size: 1.35rem; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 10px; padding: 0; }
.hint { color: var(--testo-tenue); font-size: .95rem; margin: -4px 0 10px; }
.choice-group { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice span {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px;
  border: 1.5px solid var(--pietra-scura); border-radius: 999px; background: var(--carta); cursor: pointer; font-weight: 500; user-select: none;
}
.choice span:hover { border-color: var(--blu-mare); }
.choice input:checked + span { background: var(--blu); border-color: var(--blu); color: #fff; }
.choice input:checked + span::before { content: "✓"; font-weight: 700; }
.choice input:focus-visible + span { outline: 3px solid var(--corallo); outline-offset: 2px; }

/* ---------- Card esperienze ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio-grande); overflow: hidden;
  display: flex; flex-direction: column; box-shadow: var(--ombra); position: relative;
}
.card-media { aspect-ratio: 16 / 10; background: var(--pietra); position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-media .badge { position: absolute; top: 12px; left: 12px; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-body h3 { margin: 0; font-size: 1.2rem; }
.card-body h3 a { color: var(--blu); text-decoration: none; }
.card-body h3 a::after { content: ""; position: absolute; inset: 0; } /* tutta la card è cliccabile */
.card-body h3 a:hover { text-decoration: underline; }
.card-body p { margin: 0; color: var(--testo-tenue); }
.meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .92rem; color: var(--testo-tenue); margin-top: auto; padding-top: 6px; }
.meta span { display: inline-flex; align-items: center; gap: 5px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: .8rem; font-weight: 600; color: var(--blu); background: var(--blu-chiaro); padding: 3px 10px; border-radius: 999px; }

/* ---------- Badge di stato ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; line-height: 1.5; }
.badge--esempio { background: #FFF3C9; color: #5C4600; border: 1px solid #E3C766; }
.badge--da-verificare { background: var(--corallo-chiaro); color: #7A2C1A; }
.badge--verificato { background: #DCEFDF; color: var(--successo); }
.badge--consiglio { background: var(--blu-chiaro); color: var(--blu); }

/* ---------- Filtri ---------- */
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 12px; align-items: end; background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio); padding: 16px; margin-bottom: 16px; }
@media (max-width: 760px) { .filters { grid-template-columns: 1fr 1fr; } .filters .btn { grid-column: 1 / -1; } }
@media (max-width: 420px) { .filters { grid-template-columns: 1fr; } }
label, .label { font-weight: 600; display: block; margin-bottom: 6px; }
select, input[type="text"], input[type="email"], textarea {
  width: 100%; font: inherit; color: var(--testo); background: #fff; min-height: 48px;
  border: 1.5px solid var(--pietra-scura); border-radius: 10px; padding: 10px 12px;
}
select:focus-visible, input:focus-visible, textarea:focus-visible { border-color: var(--blu-mare); }
textarea { min-height: 130px; resize: vertical; }
.results-count { color: var(--testo-tenue); margin: 0 0 16px; }

/* ---------- Stato vuoto / avvisi ---------- */
.empty { text-align: center; padding: 40px 20px; background: var(--carta); border: 1.5px dashed var(--pietra-scura); border-radius: var(--raggio-grande); }
.empty h2, .empty h3 { margin-bottom: .3em; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--raggio); background: var(--blu-chiaro); color: var(--blu); margin: 0 0 16px; }
.notice--warn { background: #FFF3C9; color: #4D3B00; }
.notice--error { background: #F9DEDA; color: var(--errore); }
.notice--success { background: #DCEFDF; color: var(--successo); }
.notice p { margin: 0; }
.notice::before { content: "i"; flex: none; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; font-weight: 700; font-size: .8rem; font-family: Georgia, serif; margin-top: 2px; }
.notice--success::before { content: "✓"; }
.notice--error::before, .notice--warn::before { content: "!"; }

/* ---------- Dettaglio esperienza ---------- */
.back-link { display: inline-flex; gap: 6px; align-items: center; margin-bottom: 16px; font-weight: 600; }
.detail-grid { display: grid; grid-template-columns: 1.3fr .9fr; gap: clamp(20px, 4vw, 48px); align-items: start; }
@media (max-width: 860px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-media { border-radius: var(--raggio-grande); overflow: hidden; aspect-ratio: 16 / 10; background: var(--pietra); margin-bottom: 20px; }
.detail-media img { width: 100%; height: 100%; object-fit: cover; }
.facts { background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio-grande); padding: 20px; box-shadow: var(--ombra); position: sticky; top: 84px; }
.facts dl { margin: 0 0 16px; display: grid; gap: 12px; }
.facts dt { font-size: .85rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--testo-tenue); }
.facts dd { margin: 2px 0 0; }
.facts .btn { width: 100%; margin-top: 8px; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--raggio-grande); padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; box-shadow: 0 20px 60px rgba(0,0,0,.25); color: var(--testo); background: var(--carta); }
dialog::backdrop { background: rgba(14, 58, 83, .45); }
.dialog-body { padding: 24px; }
.dialog-body h2 { font-size: 1.4rem; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.option-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; max-height: 50vh; overflow: auto; }
.option-list button { width: 100%; text-align: left; background: #fff; border: 1.5px solid var(--pietra); border-radius: 12px; padding: 12px 14px; font: inherit; cursor: pointer; min-height: 48px; }
.option-list button:hover { border-color: var(--blu-mare); }
.option-list small { display: block; color: var(--testo-tenue); }

/* ---------- Itinerario ---------- */
.wizard { max-width: 760px; }
.days { display: grid; gap: 20px; }
.day { background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio-grande); padding: 18px; box-shadow: var(--ombra); }
.day-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.day-head h2 { font-size: 1.4rem; margin: 0; }
.slots { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 820px) { .slots { grid-template-columns: 1fr; } }
.slot { border-radius: var(--raggio); background: var(--bianco); border: 1px solid var(--pietra); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.slot-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--corallo); }
.slot h3 { font-size: 1.08rem; margin: 0; }
.slot p { margin: 0; color: var(--testo-tenue); font-size: .95rem; }
.slot--free { background: transparent; border-style: dashed; }
.slot--alt { border-color: var(--sabbia); background: #FBF2E2; }
.slot-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.itinerary-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 20px; }

/* ---------- Info utili ---------- */
.jump-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 0; list-style: none; }
.jump-nav a { display: inline-flex; min-height: 44px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--carta); border: 1px solid var(--pietra-scura); text-decoration: none; color: var(--blu); font-weight: 600; }
.jump-nav a:hover { background: var(--pietra); }
.info-section { scroll-margin-top: 90px; margin-bottom: 36px; }
.info-section h2 { display: flex; gap: 10px; align-items: center; scroll-margin-top: 90px; }
.info-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.info-item { background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio); padding: 16px; }
.info-item h3 { font-size: 1.08rem; margin: 8px 0 6px; }
.info-item p { margin: 0 0 8px; }
.info-item .source { font-size: .88rem; color: var(--testo-tenue); margin: 0; }
.info-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.info-tile { display: flex; flex-direction: column; gap: 6px; padding: 18px; background: var(--carta); border-radius: var(--raggio); border: 1px solid var(--pietra-scura); text-decoration: none; color: var(--blu); font-weight: 700; min-height: 96px; }
.info-tile:hover { background: #fff; border-color: var(--blu-mare); }
.info-tile .icon { font-size: 1.5rem; line-height: 1; }

/* ---------- Operatori ---------- */
.benefits { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 32px; padding: 0; list-style: none; }
.benefits li { background: var(--carta); border-radius: var(--raggio); padding: 18px; border-top: 4px solid var(--corallo); }
.benefits h3 { font-size: 1.1rem; }
.benefits p { margin: 0; color: var(--testo-tenue); }
.form { max-width: 640px; background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio-grande); padding: clamp(18px, 3vw, 28px); box-shadow: var(--ombra); }
.field { margin-bottom: 18px; }
.field .req { color: var(--testo-tenue); font-weight: 400; font-size: .9rem; }
.field-error { color: var(--errore); font-size: .93rem; margin-top: 6px; font-weight: 600; }
.field-error:empty { display: none; }
[aria-invalid="true"] { border-color: var(--errore) !important; background: #FFF8F7; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { width: 22px; height: 22px; margin-top: 2px; flex: none; accent-color: var(--blu); }

/* ---------- Gestione ---------- */
.admin-table { width: 100%; border-collapse: collapse; background: var(--carta); font-size: .95rem; }
.admin-table th, .admin-table td { text-align: left; padding: 10px; border-bottom: 1px solid var(--pietra); vertical-align: top; }
.table-wrap { overflow-x: auto; border: 1px solid var(--pietra); border-radius: var(--raggio); margin-bottom: 24px; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--carta); border: 1px solid var(--pietra); border-radius: var(--raggio); padding: 14px; }
.stat strong { display: block; font-size: 1.8rem; color: var(--blu); font-family: var(--font-titoli); }

/* ---------- Footer ---------- */
.site-footer { background: var(--blu); color: #E9E1D2; padding: 40px 0 28px; margin-top: 40px; }
.site-footer a { color: #fff; }
.footer-grid { display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; }
.footer-grid p { margin: 0 0 6px; }
.footer-brand { font-family: var(--font-titoli); font-size: 1.3rem; color: #fff; font-weight: 700; margin-bottom: 6px; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

/* ---------- Varie ---------- */
.loading { padding: 80px var(--gutter); text-align: center; color: var(--testo-tenue); }
.noscript { padding: 20px; text-align: center; }
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(150%);
  background: var(--blu); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: var(--ombra);
  max-width: calc(100vw - 32px); transition: transform .25s ease; z-index: 200;
}
.toast.is-visible { transform: translateX(-50%) translateY(0); }
.prose { max-width: 68ch; }
.cta-band { background: var(--blu); color: #F3EADB; border-radius: var(--raggio-grande); padding: clamp(24px, 4vw, 40px); display: flex; flex-wrap: wrap; gap: 16px 32px; align-items: center; justify-content: space-between; }
.cta-band h2 { color: #fff; margin-bottom: .2em; }
.cta-band p { margin: 0; }
.cta-band .btn--primary { background: #E07B5F; color: #1E2A31; }
.cta-band .btn--primary:hover { background: #F0957B; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

@media print {
  .site-header, .site-footer, .demo-banner, .itinerary-toolbar, .slot-actions, .day-head button, .skip-link, .toast { display: none !important; }
  body { background: #fff; }
  .day { box-shadow: none; break-inside: avoid; }
}
