/* Insieme per Crescere – colori e font dalla brand guideline */

@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-latin.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Libre Franklin";
  src: url("../fonts/libre-franklin-latin-italic.woff2") format("woff2");
  font-weight: 400 800;
  font-style: italic;
  font-display: swap;
}

:root {
  /* Brand */
  --marrone: #6e420f;
  --arancione: #f7a70a;
  --verde: #76b82a;
  --giallo: #ffed00;

  /* Derivati per testo leggibile (contrasto AA su chiaro) */
  --testo: #3a2409;
  --testo-soft: #6b5640;
  --verde-scuro: #3f6e12;
  --sfondo: #fffdf8;
  --sfondo-tinta: #fdf5e4;
  --bordo: #eadcc4;
  --bianco: #ffffff;

  --radius: 18px;
  --wrap: 1120px;
  --font: "Libre Franklin", system-ui, -apple-system, "Segoe UI", sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 96px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 450;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--testo);
  background: var(--sfondo);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--verde-scuro); text-underline-offset: 3px; }
a:hover { color: var(--marrone); }
:focus-visible { outline: 3px solid var(--arancione); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 { line-height: 1.12; margin: 0 0 .5em; color: var(--marrone); letter-spacing: -0.015em; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 800; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 700; }
h1 em, h2 em { font-style: italic; color: var(--verde-scuro); }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 32px; } }

.skip { position: absolute; left: -999px; top: 8px; background: var(--marrone); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

.eyebrow {
  font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--marrone); margin-bottom: .75rem;
  display: inline-flex; align-items: center; gap: .6em;
}
.eyebrow::before { content: ""; width: 28px; height: 4px; border-radius: 4px; background: var(--arancione); }
.muted { color: var(--testo-soft); }
.lead { font-size: clamp(1.1rem, 2vw, 1.3rem); color: var(--testo-soft); max-width: 34em; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 248, .94);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--bordo);
}
.header__inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.header__logo img { width: 128px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--testo); font-weight: 600; font-size: .98rem;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: var(--sfondo-tinta); color: var(--marrone); }
@media (max-width: 560px) {
  .header__inner { justify-content: center; }
  .header__logo img { width: 112px; }
  .nav a { padding: 6px 10px; font-size: .92rem; }
  html { scroll-padding-top: 140px; }
}

/* Hero */
.hero { position: relative; padding: clamp(48px, 8vw, 96px) 0 0; overflow: hidden; }
.hero__inner { display: grid; gap: 32px; align-items: center; padding-bottom: clamp(48px, 7vw, 88px); }
@media (min-width: 860px) { .hero__inner { grid-template-columns: 1.25fr .75fr; } }
.hero__photo { position: relative; margin: 0; justify-self: center; width: min(420px, 100%); }
.hero__photo > img:first-child {
  width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: top;
  border-radius: 28px; border: 6px solid var(--bianco);
  box-shadow: 0 24px 48px -24px rgba(110, 66, 15, .45);
  transform: rotate(1.5deg);
}
.hero__badge {
  position: absolute; left: -22px; bottom: -22px; width: 118px; padding: 14px;
  background: var(--bianco); border-radius: 24px; box-shadow: 0 12px 28px -14px rgba(110, 66, 15, .5);
}
@media (max-width: 859px) {
  .hero__photo { order: -1; width: 100%; }
  .hero__photo > img:first-child { aspect-ratio: 4 / 3; transform: none; border-width: 4px; border-radius: 22px; }
  .hero__badge { width: 84px; padding: 10px; left: 12px; bottom: -18px; border-radius: 18px; }
}
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }

.stripes { display: grid; grid-template-columns: 3fr 2fr 2fr 1fr; height: 10px; }
.stripes span:nth-child(1) { background: var(--marrone); }
.stripes span:nth-child(2) { background: var(--arancione); }
.stripes span:nth-child(3) { background: var(--giallo); }
.stripes span:nth-child(4) { background: var(--verde); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  font: inherit; font-weight: 700; text-decoration: none;
  padding: 13px 22px; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s ease, background-color .15s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--marrone); color: #fff; }
.btn--primary:hover { background: #573309; color: #fff; }
.btn--ghost { border-color: var(--marrone); color: var(--marrone); background: transparent; }
.btn--ghost:hover { background: var(--marrone); color: #fff; }
.btn--accent { background: var(--arancione); color: var(--testo); }
.btn--accent:hover { background: #e59a05; color: var(--testo); }
.btn svg { width: 1.1em; height: 1.1em; flex: none; }

/* Sections */
.section { padding: clamp(56px, 9vw, 104px) 0; }
.section--tinted { background: var(--sfondo-tinta); }
.section--dark { background: var(--marrone); color: #fbeedb; }
.section--dark h2, .section--dark .eyebrow { color: #fff; }
.section--dark h2 em { color: var(--giallo); }
.section--dark a { color: var(--giallo); }

/* Chi siamo */
.about { display: grid; gap: 40px; margin-top: 16px; }
@media (min-width: 860px) { .about { grid-template-columns: 1.2fr 1fr; align-items: start; } }
.about__text p { max-width: 36em; }
.values { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.values__item {
  display: flex; flex-direction: column; padding: 20px 22px;
  border-radius: var(--radius); background: var(--bianco); border: 1px solid var(--bordo);
  border-left: 8px solid var(--c);
}
.values__item strong { font-size: 1.35rem; font-weight: 800; color: var(--marrone); }
.values__item span { color: var(--testo-soft); }
.values__item--marrone { --c: var(--marrone); }
.values__item--arancione { --c: var(--arancione); }
.values__item--verde { --c: var(--verde); }

/* Cards (bandi) */
.cards { display: grid; gap: 22px; margin-top: 24px; }
@media (min-width: 860px) { .cards { grid-template-columns: repeat(2, 1fr); } }
.card {
  background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--radius);
  padding: 28px; display: flex; flex-direction: column; gap: 6px;
  box-shadow: 0 1px 0 rgba(110, 66, 15, .04), 0 12px 32px -18px rgba(110, 66, 15, .25);
}
.card--aperto { border-top: 6px solid var(--verde); }
.card--terminato { border-top: 6px solid var(--bordo); }
.card__top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.card__year { font-weight: 800; color: var(--testo-soft); font-size: .95rem; }
.card h3 { margin-bottom: .2em; }
.card__subtitle { font-weight: 600; color: var(--testo); margin-bottom: .6em; }
.card__desc { color: var(--testo-soft); }
.card__details { margin: 4px 0 12px; display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: .96rem; }
.card__details dt { font-weight: 700; color: var(--marrone); }
.card__details dd { margin: 0; }
.card__actions { margin-top: auto; padding-top: 12px; display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.card__note { font-size: .95rem; color: var(--testo-soft); font-style: italic; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: .78rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.badge--aperto { background: #e8f4d8; color: var(--verde-scuro); }
.badge--terminato { background: #f1ebe2; color: var(--testo-soft); }

/* Eventi */
.events-group + .events-group { margin-top: 48px; }
.events-group h3 { color: var(--testo-soft); font-size: 1rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 16px; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.event {
  display: grid; grid-template-columns: 84px 1fr; gap: 20px; align-items: start;
  background: var(--bianco); border: 1px solid var(--bordo); border-radius: var(--radius); padding: 20px;
}
.event__date {
  background: var(--arancione); color: var(--testo); border-radius: 14px;
  text-align: center; padding: 10px 6px; line-height: 1.1;
}
.event__date strong { display: block; font-size: 1.9rem; font-weight: 800; }
.event__date span { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.event--passato .event__date { background: #f1ebe2; color: var(--testo-soft); }
.event h4 { margin: 0 0 4px; font-size: 1.15rem; color: var(--marrone); }
.event__meta { font-size: .95rem; color: var(--testo-soft); margin-bottom: 6px; }
.event p:last-child { margin-bottom: 0; }
.event__img { width: 100%; max-width: 520px; max-height: 320px; object-fit: cover; border-radius: 12px; margin: 4px 0 12px; }
.event__links { display: flex; gap: 16px; flex-wrap: wrap; font-weight: 600; font-size: .96rem; }
@media (max-width: 480px) { .event { grid-template-columns: 1fr; } .event__date { justify-self: start; padding: 8px 14px; } }

.empty {
  border: 2px dashed var(--bordo); border-radius: var(--radius); padding: 32px;
  text-align: center; color: var(--testo-soft); margin-top: 24px; background: var(--bianco);
}
.empty strong { display: block; color: var(--marrone); font-size: 1.15rem; margin-bottom: 4px; }

/* Contatti */
.contacts { display: grid; gap: 32px; }
@media (min-width: 860px) { .contacts { grid-template-columns: 1fr 1.2fr; align-items: start; } }
.contacts__list { margin: 0; display: grid; gap: 24px; }
@media (min-width: 560px) { .contacts__list { grid-template-columns: 1fr 1fr; } }
.contacts__list dt { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--arancione); margin-bottom: 6px; }
.contacts__list dd { margin: 0; font-size: 1.1rem; }

/* Footer */
.footer { background: #2b1a06; color: #d9c7ad; font-size: .9rem; }
.footer__inner { display: flex; gap: 12px 24px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding-top: 22px; padding-bottom: 22px; }
.footer p { margin: 0; }
.footer a { color: #fff; }
.footer__links { display: flex; gap: 20px; align-items: center; }
.footer__social {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .35); color: #fff; transition: background-color .15s ease;
}
.footer__social:hover { background: var(--arancione); border-color: var(--arancione); color: var(--testo); }
.footer__social svg { width: 20px; height: 20px; }

.social-link { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-weight: 600; }
.social-link:hover { text-decoration: underline; }
.social-link__icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: var(--giallo); color: var(--marrone);
}
.social-link__icon svg { width: 24px; height: 24px; }

/* Pagine testuali (privacy, 404) */
.page { padding: clamp(48px, 8vw, 88px) 0; }
.page .wrap { max-width: 780px; }
.page h2 { font-size: 1.35rem; margin-top: 1.6em; }
