/* ═══════════════════════════════════════════════
   OFFICINA DEI SOGNI — Design System
   Swiss Style · WCAG AAA · COGA Compliant
   ═══════════════════════════════════════════════ */

/* ── TOKENS ── */
:root {
  --verde:      #0A4D4A;  /* Titoli, link — contrasto 9.8:1 AAA */
  --verde-h:    #083d3b;
  --merlot:     #6B131D;  /* CTA primarie — contrasto 6.5:1 AA */
  --merlot-h:   #561018;
  --pergamena:  #FAF6F0;  /* Sfondo principale */
  --pergamena2: #F2EBE0;  /* Sfondo alternato sezioni */
  --corteccia:  #261A11;  /* Testo body — contrasto 11.2:1 AAA */
  --grigio-m:   #6B5B4E;  /* Testo secondario */
  --info:       #EBF5FB;  /* Box informativi */
  --bordo:      #D9C9B5;
  --bianco:     #FFFFFF;
  --rosso-ch:   #D62B2B;  /* Elemento svizzero */

  --font-titolo: 'Playfair Display', Georgia, serif;
  --font-corpo:  'Inter', 'Helvetica Neue', Arial, sans-serif;

  --radius:  4px;
  --ombra:   0 1px 3px rgba(38,26,17,.10), 0 4px 12px rgba(38,26,17,.06);
  --trans:   0.18s ease;

  --nav-h: 68px;
  --max-w: 1120px;
  --pad-x: clamp(1.25rem, 4vw, 2.5rem);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-corpo);
  background: var(--pergamena);
  color: var(--corteccia);
  line-height: 1.65;
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--verde); text-decoration: underline; }
a:hover { color: var(--verde-h); }
*:focus-visible {
  outline: 3px solid var(--verde);
  outline-offset: 3px;
  border-radius: var(--radius);
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--merlot);
  color: #fff;
  padding: .5rem 1rem;
  border-radius: 0 0 var(--radius) var(--radius);
  font-size: .875rem;
  font-weight: 600;
  z-index: 999;
  text-decoration: none;
}
.skip-link:focus { top: 0; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: var(--font-titolo);
  color: var(--verde);
  line-height: 1.2;
}
h1 { font-size: clamp(2rem,   5vw, 3.25rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; margin-bottom: .875rem; }
h3 { font-size: 1.2rem;   font-weight: 600; margin-bottom: .5rem; }
h4 { font-size: 1rem;     font-weight: 600; margin-bottom: .375rem; }
p  { font-size: 1.0625rem; margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.section-label {
  display: block;
  font-size: .8125rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--merlot);
  margin-bottom: .75rem;
}

/* ── LAYOUT ── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--pad-x); }
.section-pad { padding: 5rem 0; }
.section-alt { background: var(--pergamena2); }

/* ── GRIGLIA SVIZZERA ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px,1fr)); gap: 1.5rem; }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ── DIVIDER SVIZZERO ── */
.divider-ch {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 2rem 0;
}
.divider-ch::before,
.divider-ch::after { content: ''; flex: 1; height: 1px; background: var(--bordo); }
.divider-ch-cross {
  width: 20px; height: 20px;
  position: relative;
  flex-shrink: 0;
}
.divider-ch-cross::before,
.divider-ch-cross::after {
  content: '';
  position: absolute;
  background: var(--rosso-ch);
  border-radius: 1px;
}
.divider-ch-cross::before { width: 4px; height: 20px; left: 8px; top: 0; }
.divider-ch-cross::after  { width: 20px; height: 4px; top: 8px; left: 0; }

/* ── BOTTONI ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-corpo);
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .75rem 1.75rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  text-decoration: none;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
  white-space: nowrap;
  cursor: pointer;
}
.btn-primary  { background: var(--merlot); color: #fff; border-color: var(--merlot); }
.btn-primary:hover  { background: var(--merlot-h); border-color: var(--merlot-h); color: #fff; }
.btn-outline  { background: transparent; color: var(--verde); border-color: var(--verde); }
.btn-outline:hover  { background: var(--verde); color: #fff; }
.btn-ghost-w  { background: transparent; color: #fff; border-color: rgba(255,255,255,.55); }
.btn-ghost-w:hover  { background: rgba(255,255,255,.12); border-color: #fff; color: #fff; }
.btn-sm { font-size: .875rem; padding: .5rem 1.25rem; }

/* ── NAVBAR ── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  background: rgba(250,246,240,.97);
  border-bottom: 1px solid var(--bordo);
  backdrop-filter: blur(8px);
  height: var(--nav-h);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.nav-logo {
  font-family: var(--font-titolo);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--verde);
  text-decoration: none;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: .625rem;
}
.nav-logo-cross { /* piccola croce svizzera accanto al logo */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: var(--rosso-ch);
  border-radius: 2px;
  flex-shrink: 0;
}
.nav-logo-cross svg { color: #fff; }
.nav-links {
  display: flex; align-items: center; gap: .125rem; flex: 1; justify-content: center;
}
.nav-links a {
  font-size: .875rem; font-weight: 500; color: var(--corteccia);
  text-decoration: none; padding: .375rem .625rem; border-radius: var(--radius);
  transition: background var(--trans), color var(--trans);
  white-space: nowrap;
}
.nav-links a:hover, .nav-links a.active { background: var(--pergamena2); color: var(--verde); }

.nav-right { display: flex; align-items: center; gap: .75rem; flex-shrink: 0; }

/* Selettore lingua */
.lang-select {
  font-family: var(--font-corpo);
  font-size: .8125rem;
  font-weight: 600;
  color: var(--grigio-m);
  background: transparent;
  border: 1px solid var(--bordo);
  border-radius: var(--radius);
  padding: .3rem .5rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}
.lang-select:hover { border-color: var(--verde); color: var(--verde); }

/* Hamburger */
#menu-toggle {
  display: none; background: none; border: none; padding: .5rem;
  flex-direction: column; gap: 5px; cursor: pointer;
}
#menu-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--corteccia); border-radius: 1px;
  transition: transform var(--trans), opacity var(--trans);
}
#menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
#menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

@media (max-width: 900px) {
  #menu-toggle { display: flex; }
  .nav-links {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: var(--nav-h); left: 0; right: 0;
    background: var(--pergamena); border-bottom: 1px solid var(--bordo);
    padding: 1rem var(--pad-x) 1.5rem;
    gap: .125rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: .625rem .75rem; }
  .nav-right .btn { display: none; }
}

/* ── HERO ── */
.hero {
  min-height: 100vh; display: flex; align-items: center;
  background: linear-gradient(155deg, #062f2c 0%, var(--verde) 55%, #3d1a07 100%);
  padding-top: var(--nav-h); overflow: hidden; position: relative;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 15% 85%, rgba(107,19,29,.3) 0%, transparent 50%),
    radial-gradient(circle at 85% 15%, rgba(107,19,29,.2) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; max-width: 740px; }
.hero-badge {
  display: inline-block;
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.25);
  color: #e8d9b0; font-size: .8125rem; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding: .375rem 1rem; border-radius: 20px;
  margin-bottom: 1.5rem;
}
.hero h1 { color: #FAF6F0; margin-bottom: 1.25rem; }
.hero-sub {
  font-size: 1.125rem; color: rgba(250,246,240,.82);
  margin-bottom: 2.5rem; max-width: 600px; line-height: 1.8;
}
.hero-ctas { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-meta {
  display: flex; gap: 2rem; margin-top: 3rem; padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,.15); flex-wrap: wrap;
}
.hero-meta-item strong {
  display: block; color: #e8d9b0; font-size: .8125rem;
  letter-spacing: .05em; text-transform: uppercase; font-weight: 600; margin-bottom: .25rem;
}
.hero-meta-item span { color: #FAF6F0; font-size: 1rem; font-weight: 500; }

/* ── CARD EVENTO ── */
.event-card {
  background: var(--bianco); border: 1px solid var(--bordo);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--ombra);
  transition: transform var(--trans), box-shadow var(--trans);
  display: flex; flex-direction: column;
}
.event-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(38,26,17,.12); }
.event-card-img { aspect-ratio: 16/9; background: var(--pergamena2); overflow: hidden; }
.event-card-img img { width: 100%; height: 100%; object-fit: cover; }
.event-card-body { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; gap: .5rem; }
.event-card-date {
  font-size: .8125rem; font-weight: 700; color: var(--merlot);
  letter-spacing: .04em; text-transform: uppercase;
}
.event-card-title { font-size: 1.125rem; color: var(--verde); font-family: var(--font-titolo); font-weight: 600; }
.event-card-place { font-size: .875rem; color: var(--grigio-m); }
.event-card-desc { font-size: .9375rem; color: var(--corteccia); flex: 1; margin-top: .25rem; }
.event-card-foot { padding: 1rem 1.5rem; border-top: 1px solid var(--bordo); }

/* Badge "In Primo Piano" */
.badge-fp {
  display: inline-block;
  background: var(--merlot); color: #fff;
  font-size: .75rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: .25rem .75rem; border-radius: 20px;
}

/* ── EVENTO IN EVIDENZA ── */
.featured-event {
  background: var(--info); border: 1px solid #c2ddf0;
  border-radius: var(--radius); padding: 2.5rem;
}
.featured-event-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.featured-meta { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.featured-meta-item { display: flex; align-items: center; gap: .5rem; font-size: .9375rem; }
.featured-meta-item svg { color: var(--verde); flex-shrink: 0; }
.cal-strip { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid #c2ddf0; }

/* ── VALUE CARDS ── */
.value-card {
  background: var(--bianco); border: 1px solid var(--bordo);
  border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--ombra);
}
.value-card-icon {
  width: 44px; height: 44px;
  background: var(--verde); border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center; margin-bottom: 1rem;
  color: #fff;
}
.value-card h3 { color: var(--verde); margin-bottom: .375rem; }
.value-card p  { font-size: .9375rem; color: var(--grigio-m); margin: 0; }

/* ── FAQ ACCORDION ── */
.faq-item { border-bottom: 1px solid var(--bordo); }
.faq-item:first-child { border-top: 1px solid var(--bordo); }
.faq-btn {
  width: 100%; background: none; border: none; padding: 1.25rem 0;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  text-align: left; font-family: var(--font-corpo); font-size: 1.0625rem;
  font-weight: 500; color: var(--corteccia); cursor: pointer; line-height: 1.4;
}
.faq-btn:hover { color: var(--verde); }
.faq-icon {
  flex-shrink: 0; width: 20px; height: 20px; position: relative;
}
.faq-icon::before, .faq-icon::after {
  content: ''; position: absolute;
  background: var(--verde); border-radius: 1px;
  transition: transform var(--trans);
}
.faq-icon::before { width: 12px; height: 2px; top: 9px; left: 4px; }
.faq-icon::after  { width: 2px; height: 12px; top: 4px; left: 9px; }
.faq-btn[aria-expanded="true"] .faq-icon::after { transform: scaleY(0); }
.faq-panel { display: none; padding: 0 0 1.25rem; max-width: 680px; }
.faq-panel.open { display: block; }
.faq-panel p { font-size: .9375rem; color: var(--grigio-m); }

/* ── PARTNER CARD ── */
.partner-card {
  background: var(--bianco); border: 1px solid var(--bordo);
  border-radius: var(--radius); padding: 1.5rem;
  display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center;
}
.partner-card img { max-height: 60px; width: auto; object-fit: contain; }
.partner-card h4 { color: var(--verde); font-size: 1rem; }
.partner-card p  { font-size: .875rem; color: var(--grigio-m); margin: 0; }
.partner-card a  { font-size: .875rem; font-weight: 600; }

/* ── PROGRESS BAR FUNDRAISING ── */
.progress-wrap { background: var(--pergamena2); border-radius: 99px; height: 10px; overflow: hidden; margin: .75rem 0; }
.progress-bar  { height: 100%; background: var(--verde); border-radius: 99px; transition: width .6s ease; }
.progress-labels { display: flex; justify-content: space-between; font-size: .8125rem; color: var(--grigio-m); }

/* ── MAPPA ── */
.map-frame { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--bordo); }
.map-frame iframe { width: 100%; height: 320px; border: none; display: block; }

/* ── FOOTER ── */
#footer {
  background: var(--corteccia); color: rgba(250,246,240,.75);
  padding: 4rem 0 0;
}
#footer h3 {
  font-family: var(--font-corpo); font-size: .8125rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--bordo); margin-bottom: .875rem;
}
#footer p, #footer li { font-size: .9375rem; margin-bottom: .375rem; }
#footer a { color: #e8d9b0; }
#footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; }
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-brand { font-family: var(--font-titolo); font-size: 1.25rem; color: #FAF6F0; margin-bottom: .5rem; }
.footer-bottom {
  background: rgba(0,0,0,.3); margin-top: 3rem; padding: 1.25rem 0;
}
.footer-bottom .container {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: .75rem;
}
.footer-legal { font-size: .8125rem; color: rgba(250,246,240,.4); }
.footer-legal a { color: rgba(250,246,240,.55); font-size: .8125rem; }
.footer-social { display: flex; gap: .75rem; }
.footer-social a {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,.2); color: rgba(255,255,255,.7);
  text-decoration: none; transition: border-color var(--trans), color var(--trans);
}
.footer-social a:hover { border-color: #fff; color: #fff; }

/* ── BACK TO TOP ── */
#back-to-top {
  position: fixed; bottom: 2rem; right: 2rem; z-index: 100;
  width: 44px; height: 44px;
  background: var(--verde); color: #fff; border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
  opacity: 0; pointer-events: none;
  transition: opacity var(--trans), transform var(--trans);
  cursor: pointer;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--verde-h); transform: translateY(-2px); }

/* ── UTILITIES ── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }  .mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; }
.mb-2 { margin-bottom: 1rem; }
.muted { color: var(--grigio-m); font-size: .9375rem; }

/* ── RESPONSIVE FINE-TUNING ── */
section { scroll-margin-top: var(--nav-h); }
@media (max-width: 480px) {
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; justify-content: center; }
  .cal-strip { flex-direction: column; }
}
