/* =========================================================
   I Concorso Nazionale "M° Giuseppe Chielli" – Città di Noci
   Palette e stile ispirati al materiale ufficiale del bando
   ========================================================= */

:root {
  --green: #1f3d2b;        /* verde bosco profondo (bottone, footer, titoli) */
  --green-dark: #163020;
  --gold: #a9812f;         /* oro/bronzo */
  --gold-soft: #c9a24b;
  --cream: #f7f2e6;        /* sfondo pagina */
  --cream-2: #fbf8f0;      /* sezioni chiare */
  --ink: #2b2b28;          /* testo */
  --ink-soft: #55534c;
  --line: #e6ddca;
  --white: #ffffff;

  --maxw: 1200px;
  --radius: 999px;
  --shadow: 0 10px 30px rgba(31, 61, 43, 0.12);
  --font-serif: Georgia, "Times New Roman", "Iowan Old Style", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; }

/* Focus keyboard visibile e coerente su tutti i link/controlli */
a:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* ----------------------------- Navbar ----------------------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 240, 0.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 10px 24px;
}
.navbar__logo img { height: 58px; width: auto; }

/* ------------------------------ Hero ------------------------------ */
.hero {
  background: var(--cream-2);
}
.hero img {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

/* ---------------------------- Contenuto --------------------------- */
.intro {
  background: var(--cream-2);
  text-align: center;
  padding: 64px 0 72px;
  scroll-margin-top: 96px; /* compensa la navbar sticky quando si punta a #bando */
}
.intro h1 {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--green);
  font-size: clamp(2rem, 4.5vw, 3.4rem);
  line-height: 1.12;
  letter-spacing: 0.2px;
  margin: 0 auto 22px;
  max-width: 16ch;
}
.intro h1 em {
  font-style: italic;
  color: var(--gold);
}
.intro p.lead {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-soft);
  max-width: 62ch;
  margin: 0 auto 38px;
}

/* ---------------------- Bottone download (pill) ------------------- */
.btn-download {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  padding: 12px 12px 12px 34px;
  background: var(--green);
  color: var(--white);
  text-decoration: none;
  border-radius: var(--radius);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.2;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  border: none;
  cursor: pointer;
}
.btn-download:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(31, 61, 43, 0.22);
}
.btn-download:focus-visible {
  outline: 3px solid var(--gold-soft);
  outline-offset: 3px;
}
.btn-download__label { text-align: left; max-width: 16ch; }
.btn-download__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--white);
  color: var(--green);
  border-radius: 50%;
  flex: 0 0 auto;
  transition: transform 0.18s ease;
}
.btn-download:hover .btn-download__icon { transform: translate(2px, -2px); }
.btn-download__icon svg { width: 24px; height: 24px; }

.intro__hint {
  margin-top: 18px;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ------------------- Commissione giudicatrice -------------------- */
.commissione {
  max-width: 640px;
  margin: 0 auto 40px;
  padding: 30px 34px 34px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}
.commissione__title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--green);
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  margin: 0;
}
.commissione__title::after {
  content: "";
  display: block;
  width: 60px;
  height: 3px;
  margin: 14px auto 0;
  background: var(--gold-soft);
  border-radius: 2px;
}
.commissione__role { margin-top: 22px; }
.commissione__label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--gold);
  margin-bottom: 6px;
}
.commissione__names {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.55;
}
.commissione__names--list {
  list-style: none;
  padding: 0;
}
.commissione__names--list li { margin: 2px 0; }

/* ------------------- Premio alla Carriera ------------------------ */
.premio {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% -10%, rgba(169, 129, 47, 0.10), transparent 60%),
    var(--green);
  color: var(--cream-2);
  padding: 72px 0 84px;
  border-top: 1px solid rgba(201, 162, 75, 0.35);
  text-align: center;
  scroll-margin-top: 96px;
}
/* Pentagramma decorativo, molto leggero, dietro il contenuto */
.premio__stave {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6%;
  height: 120px;
  opacity: 0.10;
  pointer-events: none;
}
.premio__stave svg { width: 100%; height: 100%; }
.premio__stave line { stroke: var(--gold-soft); stroke-width: 1.4; }

.premio .container { position: relative; z-index: 1; }

.premio__eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 14px;
}
.premio__title {
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--white);
  font-size: clamp(1.7rem, 3.6vw, 2.7rem);
  line-height: 1.15;
  margin: 0 auto;
  max-width: 20ch;
}
.premio__title em { font-style: italic; color: var(--gold-soft); }
.premio__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin: 20px auto 0;
  background: linear-gradient(90deg, transparent, var(--gold-soft), transparent);
  border-radius: 2px;
}
.premio__lead {
  max-width: 68ch;
  margin: 22px auto 0;
  color: #e7e1d0;
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.7;
}

/* Griglia tre card affiancate */
.premio__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(18px, 2.5vw, 30px);
  margin-top: 48px;
}

.premio-card {
  position: relative;
  background: var(--cream-2);
  color: var(--ink);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 40px 26px 32px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
/* Filetto colorato in alto, distingue il rango (oro / argento / bronzo) */
.premio-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--rank);
}
.premio-card--gold   { --rank: linear-gradient(90deg, #c9a24b, #a9812f); }
.premio-card--silver { --rank: linear-gradient(90deg, #cfd2d6, #9aa0a6); }
.premio-card--bronze { --rank: linear-gradient(90deg, #d3a06b, #a56a37); }

.premio-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.30);
  border-color: var(--gold-soft);
}

.premio-card__medal {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 18px;
  transition: transform 0.25s ease;
}
.premio-card:hover .premio-card__medal { transform: scale(1.12) rotate(-4deg); }

.premio-card__rank {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  color: var(--green);
  font-size: 1.18rem;
  margin-bottom: 12px;
}
.premio-card__name {
  margin: 0 0 10px;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--gold);
}
.premio-card__desc {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
  line-height: 1.55;
}

/* Comparsa graduale allo scroll */
.reveal.reveal--armed {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
/* Ingresso scaglionato delle tre card */
.premio__grid.reveal--armed .premio-card {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.premio__grid.is-visible .premio-card { opacity: 1; transform: none; }
.premio__grid.is-visible .premio-card:nth-child(1) { transition-delay: 0.05s; }
.premio__grid.is-visible .premio-card:nth-child(2) { transition-delay: 0.18s; }
.premio__grid.is-visible .premio-card:nth-child(3) { transition-delay: 0.31s; }

/* --------------------------- Patrocini ---------------------------- */
.patrocini {
  background: var(--cream);
  padding: 40px 0 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* I loghi restano sempre su un'unica riga orizzontale, su ogni dispositivo.
   flex-grow proporzionale al rapporto d'aspetto → immagini alla stessa altezza. */
.patrocini__row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: clamp(14px, 3vw, 48px);
  max-width: 1180px;
}
.patrocini__strip { flex: 5.54 1 0; min-width: 0; }
.patrocini__extra { flex: 1.99 1 0; min-width: 0; }
.patrocini__row img { width: 100%; }

/* ----------------------------- Footer ----------------------------- */
.footer {
  background: var(--green);
  color: #eae4d4;
  padding: 56px 0 28px;
}
.footer a { color: #eae4d4; text-decoration: none; }
.footer a:hover { color: var(--white); text-decoration: underline; }

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.footer__brand img {
  height: 74px;
  width: auto;
  background: var(--cream-2);
  padding: 12px 16px;
  border-radius: 10px;
}
.footer__brand p {
  margin: 18px 0 0;
  color: #cfc9b8;
  font-size: 0.95rem;
  max-width: 34ch;
}
.footer h3 {
  font-family: var(--font-serif);
  color: var(--gold-soft);
  font-size: 1.05rem;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  margin: 0 0 16px;
}
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: 10px; font-size: 0.96rem; color: #d7d1c1; }
.footer li strong { color: var(--white); font-weight: 600; }

.footer__bottom {
  margin-top: 44px;
  padding-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #b7b1a2;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.footer__legal a { color: #cfc9b8; }

/* --------------------------- Pagine legali ------------------------ */
.legal {
  background: var(--cream-2);
  min-height: 70vh;
  padding: 56px 0 72px;
}
.legal .container { max-width: 820px; }
.legal h1 {
  font-family: var(--font-serif);
  color: var(--green);
  font-size: clamp(1.8rem, 3.5vw, 2.6rem);
  margin: 0 0 6px;
}
.legal .updated { color: var(--ink-soft); font-size: 0.9rem; margin: 0 0 32px; }
.legal h2 {
  font-family: var(--font-serif);
  color: var(--green);
  font-size: 1.35rem;
  margin: 34px 0 10px;
}
.legal p, .legal li { color: var(--ink-soft); }
.legal a { color: var(--gold); }
.back-link {
  display: inline-block;
  margin-bottom: 28px;
  color: var(--green);
  font-weight: 600;
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* --------------------------- Responsive --------------------------- */
@media (max-width: 860px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .footer__brand { grid-column: 1 / -1; }
}
/* Su tablet/mobile le tre card del premio si dispongono verticalmente */
@media (max-width: 720px) {
  .premio { padding: 56px 0 64px; }
  .premio__grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-left: auto;
    margin-right: auto;
  }
}
@media (max-width: 560px) {
  .intro { padding: 44px 0 52px; }
  .footer__grid { grid-template-columns: 1fr; }
  .btn-download { padding-left: 26px; gap: 16px; font-size: 1.02rem; }
  .btn-download__icon { width: 48px; height: 48px; }
  .navbar__logo img { height: 48px; }
}

/* --------------------- Preferenze di movimento -------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
