/* Festa delle Associazioni 2027 – Rosangela Gentili */

@font-face {
  font-family: "Caveat Brush";
  src: url("../fonts/CaveatBrush-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("../fonts/Nunito.woff2") format("woff2");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --teal: #0b6f86;
  --teal-dark: #08485a;
  --teal-light: #3aa8b5;
  --coral: #e5413a;
  --sun: #f5a524;
  --sand: #fdeed6;
  --sand-2: #fff7ea;
  --ink: #17323a;
  --muted: #4f6a71;
  --white: #fff;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(8, 72, 90, .12);
  --script: "Caveat Brush", "Segoe Print", cursive;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--sand-2);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--teal); }
a:hover { color: var(--coral); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-family: var(--script); font-weight: 400; font-size: clamp(2.3rem, 5vw, 3.4rem); color: var(--teal); }
h3 { font-size: 1.2rem; font-weight: 800; }
p { margin: 0 0 1em; }
.small { font-size: .9rem; color: var(--muted); }

.wrap { width: min(1140px, 100% - 32px); margin-inline: auto; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: 8px 14px; z-index: 100; }
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 6px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 247, 234, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(11, 111, 134, .1);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--teal); font-weight: 800; }
.brand span { font-family: var(--script); font-weight: 400; font-size: 1.6rem; line-height: 1; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 700; font-size: .95rem;
  padding: 8px 12px; border-radius: 999px;
}
.nav a:hover { background: rgba(11, 111, 134, .08); color: var(--teal); }
.nav .nav-ig { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: #fff; background: linear-gradient(45deg, #f9a03f, #e1306c 55%, #833ab4); margin-left: 6px; }
.nav .nav-ig:hover { color: #fff; filter: brightness(1.08); }
.nav .nav-ig svg { width: 20px; height: 20px; }

.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; height: 3px; background: var(--teal); border-radius: 3px; margin: 5px 0; transition: .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--sand-2); border-bottom: 1px solid rgba(11, 111, 134, .15);
    padding: 8px 16px 16px; box-shadow: var(--shadow);
    display: none;
  }
  .nav.open { display: flex; }
  .nav a { padding: 12px; border-radius: 10px; }
  .nav .nav-ig { width: auto; height: auto; margin: 8px 0 0; padding: 12px; }
  .nav .nav-ig::after { content: "Instagram"; margin-left: 8px; }
  .nav .nav-ig { display: flex; justify-content: center; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 999px;
  font-weight: 800; font-size: 1rem; text-decoration: none;
  border: 2px solid transparent; transition: transform .15s, box-shadow .15s, background .15s;
}
.btn svg { width: 20px; height: 20px; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 6px 16px rgba(11, 111, 134, .3); }
.btn-primary:hover { background: var(--teal-dark); color: #fff; }
.btn-ig { background: linear-gradient(45deg, #f9a03f, #e1306c 55%, #833ab4); color: #fff; box-shadow: 0 6px 16px rgba(225, 48, 108, .3); }
.btn-ig:hover { color: #fff; }
.btn-ghost { border-color: var(--teal); color: var(--teal); background: rgba(255, 255, 255, .6); }
.btn-ghost:hover { background: #fff; color: var(--teal-dark); }
.btn-lg { padding: 15px 28px; font-size: 1.08rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, #fff9ee 0%, transparent 60%),
    linear-gradient(180deg, #fff4e0 0%, var(--sand) 70%);
  padding: clamp(40px, 7vw, 80px) 0 0;
}
.hero-sun {
  position: absolute; width: 520px; height: 520px; border-radius: 50%;
  left: 50%; top: -120px; transform: translateX(-50%);
  background: radial-gradient(circle, rgba(245, 165, 36, .35), rgba(245, 165, 36, 0) 65%);
  pointer-events: none;
}
.hero-inner { position: relative; }
.edition {
  display: inline-block; margin: 0 0 12px; padding: 4px 16px; border-radius: 999px;
  background: var(--coral); color: #fff; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem;
}
.hero h1 { font-family: var(--script); font-weight: 400; color: var(--teal); margin: 0; }
.h1-a, .h1-b { display: block; font-size: clamp(3.2rem, 11vw, 7.5rem); line-height: .92; }
.h1-c { display: block; color: var(--coral); font-size: clamp(2rem, 6vw, 3.6rem); margin-top: .1em; transform: rotate(-2deg); }
.dates {
  display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 4px 12px;
  font-weight: 900; color: var(--teal-dark); margin: 22px 0 6px;
  font-size: clamp(2.2rem, 6vw, 3.4rem); line-height: 1;
}
.dates i { color: var(--sun); font-style: normal; }
.dates small { flex-basis: 100%; font-size: clamp(1.3rem, 3vw, 1.8rem); letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
.place { font-weight: 700; color: var(--muted); letter-spacing: .04em; margin-bottom: 26px; }

.countdown { display: flex; justify-content: center; gap: 10px; margin: 0 0 28px; flex-wrap: wrap; }
.countdown div {
  min-width: 78px; padding: 10px 8px; border-radius: 14px;
  background: rgba(255, 255, 255, .75); box-shadow: var(--shadow);
}
.countdown b { display: block; font-size: 1.9rem; line-height: 1.1; color: var(--teal); font-variant-numeric: tabular-nums; }
.countdown span { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.countdown.done { font-family: var(--script); font-size: 2.2rem; color: var(--coral); }

.hero-cta { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 30px; }

.motto-wave { position: relative; height: clamp(110px, 16vw, 200px); margin-top: -10px; }
.motto-wave svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.motto-wave .w3 { fill: var(--teal-light); opacity: .55; }
.motto-wave .w2 { fill: var(--teal); opacity: .85; }
.motto-wave .w1 { fill: var(--teal-dark); }
.motto {
  margin: 0; padding: 0 16px 34px; background: var(--teal-dark); color: #fff;
  font-family: var(--script); font-size: clamp(1.8rem, 5vw, 3rem); line-height: 1.1;
}

/* ---------- Sections ---------- */
.section { padding: clamp(56px, 8vw, 96px) 0; }
.section-sea { background: linear-gradient(180deg, #e8f5f5, #f4fbfa); }
.section-sand { background: var(--sand); }
.section-dark { background: var(--teal-dark); color: #e6f3f4; }
.section-dark h2 { color: #fff; }
.section-dark .kicker { color: var(--sun); }
.kicker { text-transform: uppercase; letter-spacing: .14em; font-weight: 800; font-size: .82rem; color: var(--coral); margin-bottom: .2em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 720px; }
.sub { margin-top: 48px; color: var(--teal-dark); }

.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: start; }
.two-col-wide { grid-template-columns: 1fr 1.15fr; align-items: center; }
@media (max-width: 820px) { .two-col, .two-col-wide { grid-template-columns: 1fr; } }

.card { background: #fff; border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.dedication { position: relative; border-top: 6px solid var(--coral); }
.dedication .drop { width: 40px; height: 50px; color: var(--teal-light); margin-bottom: 8px; }
.dedication blockquote {
  margin: 8px 0 16px; font-family: var(--script); font-size: 2rem; line-height: 1.15; color: var(--coral);
}

/* ---------- Programma ---------- */
.food-banner {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; text-align: center;
  background: var(--sun); color: #fff; font-weight: 700; font-size: 1.15rem;
  border-radius: 999px; padding: 14px 24px; margin: 28px 0 32px;
  box-shadow: 0 8px 20px rgba(245, 165, 36, .35);
}
.food-banner svg { width: 26px; height: 26px; }
.days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .days { grid-template-columns: 1fr; } }
.day { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.day header {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px;
  align-items: end; padding: 20px 24px; background: var(--teal); color: #fff;
}
.day-sat header { background: var(--coral); }
.day-sun header { background: #d98a10; }
.day-num { grid-row: 1 / 3; grid-column: 1; font-size: 3.4rem; font-weight: 900; line-height: .9; }
.day-name { grid-column: 2; font-family: var(--script); font-size: 1.9rem; line-height: 1; }
.day-month { grid-column: 2; font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; opacity: .9; }
.tbd {
  margin: 20px 24px 0; padding: 10px 14px; border: 2px dashed rgba(11, 111, 134, .35); border-radius: 12px;
  text-align: center; font-weight: 800; color: var(--teal);
}
.day h3 { margin: 20px 24px 6px; font-size: .8rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.events { list-style: none; margin: 0; padding: 0 24px 24px; }
.events li { padding: 10px 0; border-bottom: 1px solid #eef2f2; line-height: 1.4; }
.events li:last-child { border-bottom: 0; }
.events .t { display: block; font-size: .85rem; font-weight: 800; color: var(--coral); }

/* ---------- Menu ---------- */
.menu {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px 56px; margin-top: 28px;
  background: #fff; border-radius: var(--radius); padding: clamp(24px, 4vw, 44px); box-shadow: var(--shadow);
}
@media (max-width: 760px) { .menu { grid-template-columns: 1fr; } }
.menu h3 { font-family: var(--script); font-weight: 400; font-size: 1.9rem; color: var(--teal); margin: 10px 0 6px; }
.menu ul { list-style: none; margin: 0 0 14px; padding: 0; }
.menu li { display: flex; align-items: baseline; gap: 8px; padding: 6px 0; }
.menu li span { flex: 0 1 auto; }
.menu li::after { content: ""; order: 1; flex: 1 1 20px; border-bottom: 2px dotted #cfdcdc; transform: translateY(-4px); }
.menu li b { order: 2; white-space: nowrap; color: var(--teal-dark); }
.allergeni { border-left: 4px solid var(--coral); padding-left: 12px; }

/* ---------- Dove ---------- */
.facts { list-style: none; padding: 0; margin: 18px 0 26px; }
.facts li { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-weight: 700; }
.facts svg { width: 24px; height: 24px; color: var(--coral); flex: none; }
.facts-light svg { color: var(--sun); }
.facts-light a { color: #fff; }
.facts-light a:hover { color: var(--sun); }
.map { margin: 0; }
.map img { border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; }
.map figcaption { font-size: .9rem; color: var(--muted); margin-top: 10px; }

/* ---------- Partecipa ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 28px; }
@media (max-width: 1000px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }
.cards .card { display: flex; flex-direction: column; transition: transform .2s; }
.cards .card:hover { transform: translateY(-4px); }
.cards .card p { flex: 1; font-size: .98rem; }
.card-ico { width: 44px; height: 44px; color: var(--coral); margin-bottom: 12px; }
.link { font-weight: 800; text-decoration: none; }

/* ---------- Loghi ---------- */
.logos {
  list-style: none; padding: 0; margin: 28px 0 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px;
}
.logos li {
  background: #fff; border-radius: 14px; box-shadow: 0 4px 14px rgba(8, 72, 90, .08);
  padding: 16px 12px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.logos img { width: 100%; height: 96px; object-fit: contain; }
.logos span { font-size: .82rem; font-weight: 700; color: var(--muted); line-height: 1.3; }
.logos-sponsor { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.logos-sponsor img { height: 120px; }

/* ---------- Instagram ---------- */
.section-ig { background: linear-gradient(135deg, #fff1e3 0%, #fde3ea 50%, #efe4f7 100%); }
.ig-inner { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 820px) { .ig-inner { grid-template-columns: 1fr; } }
.ig-card {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border-radius: 22px; box-shadow: 0 18px 40px rgba(131, 58, 180, .18);
  overflow: hidden; max-width: 400px; justify-self: center; width: 100%;
  transform: rotate(2deg); transition: transform .25s;
}
.ig-card:hover { transform: rotate(0) scale(1.02); color: var(--ink); }
.ig-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.ig-head img { border-radius: 50%; padding: 2px; background: linear-gradient(45deg, #f9a03f, #e1306c, #833ab4); }
.ig-head b { display: block; font-size: .98rem; }
.ig-head span { font-size: .8rem; color: var(--muted); }
.ig-post { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.ig-follow { display: block; text-align: center; padding: 14px; font-weight: 800; color: #c13584; }

/* Feed Instagram (da /api/instagram.php) */
.ig-more { margin-top: 18px; }
.ig-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 32px; }
.ig-grid[hidden] { display: none; }
.ig-grid-home { grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 0; }
@media (max-width: 900px) { .ig-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .ig-grid, .ig-grid-home { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.ig-item {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden;
  border-radius: 14px; background: #fff; box-shadow: 0 6px 18px rgba(131, 58, 180, .14);
}
.ig-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.ig-item:hover img, .ig-item:focus-visible img { transform: scale(1.06); }
.ig-info {
  position: absolute; inset: auto 0 0 0; padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgba(5, 47, 59, .88));
  color: #fff; font-size: .82rem; line-height: 1.35;
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.ig-info b { display: block; font-size: .75rem; letter-spacing: .04em; text-transform: uppercase; color: var(--sun); }
.ig-info span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ig-item:hover .ig-info, .ig-item:focus-visible .ig-info { opacity: 1; transform: none; }
@media (hover: none) { .ig-info { display: none; } }
.ig-badge {
  position: absolute; top: 8px; right: 8px; width: 24px; height: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .5));
  background: no-repeat center / contain;
}
.ig-badge-video { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M7 4.5v15l13-7.5z'/%3E%3C/svg%3E"); }
.ig-badge-album { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M8 3h12a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H8a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm-4 4h1v13h13v1H4a1 1 0 0 1-1-1V7z'/%3E%3C/svg%3E"); }
.foto-page { min-height: calc(100vh - 140px); }
.page-title { font-family: var(--script); font-weight: 400; color: var(--teal); font-size: clamp(2.6rem, 6vw, 3.8rem); }
.ig-empty { margin-top: 32px; max-width: 640px; }
.nav a[aria-current="page"] { color: var(--teal); background: rgba(11, 111, 134, .08); }

/* ---------- Contatti / footer ---------- */
.org { display: flex; gap: 20px; align-items: center; background: rgba(255, 255, 255, .06); border-radius: var(--radius); padding: 24px; }
.org img { width: 96px; height: 96px; flex: none; }
.org p { margin: 0; font-size: .95rem; }
.org a { color: #cdeef2; word-break: break-all; }
@media (max-width: 480px) { .org { flex-direction: column; text-align: center; } }

.site-footer { background: #052f3b; color: #a9c8cd; font-size: .9rem; padding: 24px 0; }
.footer-inner { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.footer-inner p { margin: 0; }
.site-footer a { color: #fff; }

/* ---------- Privacy page ---------- */
.page { max-width: 760px; padding: 48px 0 72px; min-height: calc(100vh - 140px); }
.page h1 { font-family: var(--script); font-weight: 400; color: var(--teal); font-size: clamp(2.4rem, 6vw, 3.4rem); }
.page h2 { font-family: var(--sans); font-weight: 800; font-size: 1.25rem; color: var(--teal-dark); margin-top: 1.6em; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .ig-card, .cards .card { transition: none; }
}
