/* ============================================================
   Associazione Carlo Chiara APS — carlochiara.org
   Identità: navy #1B2A4A / oro #C8961E (dal logo)
   Display: Fraunces · Testo: Source Sans 3
   ============================================================ */

:root {
  --navy-deep: #101A30;
  --navy: #1B2A4A;
  --navy-soft: #26365C;
  --gold: #C8961E;
  --gold-light: #E8B85A;
  --amber: #F2A93B;
  --paper: #FAF7F1;
  --paper-dark: #F1EBDF;
  --ink: #23282F;
  --ink-soft: #5A6270;
  --line: #E2DACA;
  --radius: 10px;
  --wrap: 1120px;
  --shadow: 0 18px 45px rgba(16, 26, 48, .12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 1.06rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--amber); outline-offset: 2px;
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* ---------- Tipografia ---------- */
h1, h2, h3, .display {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560;
  line-height: 1.12;
  color: var(--navy);
  letter-spacing: -.01em;
}
h1 { font-size: clamp(2.3rem, 5.4vw, 4rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.28rem; line-height: 1.3; }
h1 em, h2 em { font-style: italic; color: var(--gold); }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: .9rem;
}

.lead { font-size: 1.22rem; color: var(--ink-soft); }

/* Divisore firma: filetto oro con rombo centrale */
.sig-rule {
  display: flex; align-items: center; gap: 10px;
  margin: 1.4rem 0;
}
.sig-rule::before, .sig-rule::after {
  content: ""; flex: 1; height: 1px; background: var(--gold);
  opacity: .55;
}
html.js .reveal .sig-rule::before { transform-origin: left; }
html.js .reveal .sig-rule::after { transform-origin: right; }
html.js .reveal .sig-rule::before, html.js .reveal .sig-rule::after {
  transform: scaleX(0); transition: transform .9s cubic-bezier(.2,.7,.2,1) .25s;
}
html.js .reveal .sig-rule span {
  opacity: 0; transition: opacity .5s ease .1s;
}
html.js .reveal.in .sig-rule::before, html.js .reveal.in .sig-rule::after { transform: scaleX(1); }
html.js .reveal.in .sig-rule span { opacity: 1; }
.sig-rule span {
  width: 8px; height: 8px; background: var(--gold);
  transform: rotate(45deg);
}
.sig-rule.left::before { flex: 0 0 42px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 247, 241, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0;
  transition: padding .25s ease;
}
.site-header.scrolled .nav-bar { padding: 7px 0; }
.site-header { transition: box-shadow .25s ease; }
.site-header.scrolled { box-shadow: 0 6px 24px rgba(16,26,48,.10); }
.brand img { transition: width .25s ease, height .25s ease; }
.site-header.scrolled .brand img { width: 38px; height: 38px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 46px; height: 46px; border-radius: 50%; object-fit: cover; }
.brand-name {
  font-family: "Fraunces", serif; font-weight: 620;
  color: var(--navy); font-size: 1.05rem; line-height: 1.15;
}
.brand-name small {
  display: block; font-family: "Source Sans 3", sans-serif;
  font-size: .68rem; font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; }
.nav-links a {
  color: var(--navy); font-weight: 600; font-size: .96rem;
  text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent;
}
.nav-links a:hover { border-bottom-color: var(--gold-light); }
.nav-links a.active { border-bottom-color: var(--gold); }
.nav-links .btn { padding: 10px 20px; border-bottom: none; }
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 42px; height: 42px;
}
.nav-toggle span {
  display: block; height: 2px; margin: 6px 8px; background: var(--navy);
  transition: transform .2s;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; inset: 75px 0 auto 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; gap: 0; padding: 8px 0 18px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; text-align: center; }
  .nav-links a { display: inline-block; padding: 12px 0; }
}

/* ---------- Bottoni ---------- */
.btn {
  display: inline-block;
  padding: 13px 28px;
  border-radius: 999px;
  font-weight: 700; font-size: .98rem;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: var(--navy-deep);
  box-shadow: 0 8px 22px rgba(200, 150, 30, .35);
}
.btn-outline { border-color: var(--gold); color: var(--gold); background: transparent; }
.btn-outline.on-dark { border-color: var(--gold-light); color: var(--gold-light); }
.btn-navy { background: var(--navy); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  position: relative; color: #fff;
  background: var(--navy-deep) url("../img/hero-luce.jpg") center/cover no-repeat;
  padding: clamp(90px, 14vh, 170px) 0 clamp(80px, 12vh, 150px);
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 90px;
  background: linear-gradient(to bottom, transparent, rgba(16,26,48,.35));
}
.hero .wrap { position: relative; z-index: 2; max-width: 880px; text-align: center; }
html.js .hero .eyebrow,
html.js .hero h1,
html.js .hero .lead,
html.js .hero .hero-actions {
  opacity: 0; transform: translateY(24px);
  animation: heroIn .8s cubic-bezier(.2,.7,.2,1) forwards;
}
html.js .hero h1 { animation-delay: .15s; }
html.js .hero .lead { animation-delay: .3s; }
html.js .hero .hero-actions { animation-delay: .45s; }
@keyframes heroIn { to { opacity: 1; transform: none; } }
/* Canvas braci nell'hero */
.embers {
  position: absolute; inset: 0; z-index: 1;
  pointer-events: none;
}
.hero h1 { color: #fff; margin-bottom: 1.2rem; }
.hero h1 em { color: var(--gold-light); }
.hero .lead { color: rgba(255,255,255,.85); margin-bottom: 2.2rem; }
.hero .eyebrow { color: var(--gold-light); }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Hero interno (pagine) */
.page-hero {
  background: var(--navy) url("../img/hero-luce.jpg") center/cover no-repeat;
  color: #fff; padding: 84px 0 64px; text-align: center;
}
.page-hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.1rem); }
.page-hero .lead { color: rgba(255,255,255,.82); max-width: 640px; margin: .8rem auto 0; }
.page-hero .eyebrow { color: var(--gold-light); }

/* ---------- Sezioni ---------- */
.section { padding: clamp(64px, 9vh, 108px) 0; }
.section.tint { background: var(--paper-dark); }
.section.dark { background: var(--navy-deep); color: rgba(255,255,255,.88); }
.section.dark h2, .section.dark h3 { color: #fff; }
.section.dark .lead { color: rgba(255,255,255,.75); }

.section-head { max-width: 720px; margin-bottom: 3rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 900px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { gap: 36px; }
}

.figure {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
}
.figure img { width: 100%; height: 100%; object-fit: cover; }
.figure figcaption {
  font-size: .82rem; color: var(--ink-soft); padding: 10px 14px;
  background: #fff;
}

/* ---------- Card ---------- */
.card {
  background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 28px;
  box-shadow: 0 6px 18px rgba(16,26,48,.05);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(200,150,30,.18);
  border-color: var(--gold-light);
}
.card .icon { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.card:hover .icon { transform: rotate(-8deg) scale(1.08); }
.card h3 { margin-bottom: .6rem; }
.card .icon {
  width: 46px; height: 46px; margin-bottom: 1.1rem;
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--gold-light), var(--gold));
  color: var(--navy-deep);
}
.card .icon svg { width: 22px; height: 22px; }
.section.dark .card { background: var(--navy); border-color: var(--navy-soft); }
.section.dark .card p { color: rgba(255,255,255,.78); }

/* ---------- Citazione ---------- */
.quote {
  border-left: 3px solid var(--gold);
  padding: 6px 0 6px 24px;
  font-family: "Fraunces", serif;
  font-style: italic; font-size: 1.25rem; color: var(--navy);
}
.section.dark .quote { color: var(--gold-light); }

/* ---------- Timeline (Il Premio) ---------- */
.timeline { list-style: none; position: relative; padding-left: 34px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 1px; background: var(--gold); opacity: .5;
}
html.js .reveal .timeline::before {
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.2s cubic-bezier(.2,.7,.2,1) .2s;
}
html.js .reveal.in .timeline::before { transform: scaleY(1); }
html.js .reveal .timeline li::before {
  opacity: 0; transition: opacity .4s ease;
}
html.js .reveal.in .timeline li::before { opacity: 1; }
html.js .reveal.in .timeline li:nth-child(1)::before { transition-delay: .45s; }
html.js .reveal.in .timeline li:nth-child(2)::before { transition-delay: .95s; }
.timeline li { position: relative; padding-bottom: 2rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -30px; top: 8px;
  width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg);
}
.timeline .year {
  font-family: "Fraunces", serif; font-weight: 620; font-size: 1.3rem;
  color: var(--gold); display: block;
}

/* ---------- Persone ---------- */
.person { text-align: center; }
.person .avatar {
  width: 108px; height: 108px; margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--navy-soft), var(--navy-deep));
  color: var(--gold-light);
  font-family: "Fraunces", serif; font-size: 1.7rem; font-weight: 600;
  border: 2px solid var(--gold);
}
.person .role { color: var(--gold); font-weight: 700; font-size: .88rem;
  letter-spacing: .06em; text-transform: uppercase; }
.person p { font-size: .95rem; color: var(--ink-soft); }

/* ---------- Elenchi criteri ---------- */
.criteria { list-style: none; }
.criteria li {
  position: relative; padding-left: 30px; margin-bottom: 1rem;
}
.criteria li::before {
  content: ""; position: absolute; left: 4px; top: .55em;
  width: 9px; height: 9px; background: var(--gold); transform: rotate(45deg);
}
.criteria strong { color: var(--navy); }
.section.dark .criteria strong { color: var(--gold-light); }

/* ---------- CTA banda ---------- */
.cta-band {
  position: relative; overflow: hidden;
  background: var(--navy-deep);
  color: #fff; text-align: center;
  padding: clamp(70px, 10vh, 110px) 0;
}
.cta-band::before {
  content: ""; position: absolute; inset: -6%;
  background: url("../img/comunita.jpg") center/cover no-repeat;
  animation: kenburns 26s ease-in-out infinite alternate;
  z-index: 0;
}
.cta-band .wrap { position: relative; z-index: 1; }
@keyframes kenburns {
  from { transform: scale(1) translateY(0); }
  to   { transform: scale(1.08) translateY(-1.6%); }
}
.cta-band h2 { color: #fff; margin-bottom: 1rem; }
.cta-band p { color: rgba(255,255,255,.85); max-width: 560px; margin: 0 auto 2rem; }

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
label { font-weight: 700; font-size: .92rem; color: var(--navy); display: block; margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 8px;
  font: inherit; background: #fff; color: var(--ink);
}
textarea { min-height: 150px; resize: vertical; }
.form-note { font-size: .86rem; color: var(--ink-soft); }
.hp-field { position: absolute; left: -9999px; }
.alert { padding: 14px 18px; border-radius: 8px; margin-bottom: 1.4rem; font-weight: 600; }
.alert.ok { background: #E8F3E4; color: #2C5E2A; border: 1px solid #BFDDB8; }
.alert.err { background: #FBE9E7; color: #8C2F24; border: 1px solid #F0C4BE; }

/* ---------- News ---------- */
.news-item {
  display: grid; grid-template-columns: 130px 1fr; gap: 26px;
  padding: 26px 0; border-bottom: 1px solid var(--line);
}
.news-item:last-child { border-bottom: none; }
.news-date {
  font-family: "Fraunces", serif; color: var(--gold); font-weight: 620;
  line-height: 1.25;
}
@media (max-width: 700px) { .news-item { grid-template-columns: 1fr; gap: 8px; } }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-deep); color: rgba(255,255,255,.75);
  padding: 64px 0 30px; font-size: .95rem;
}
.footer-grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1.4fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid var(--navy-soft);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: var(--gold-light); font-size: .8rem; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase; margin-bottom: 1rem;
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer a:hover { color: var(--gold-light); }
.footer-brand img { width: 58px; border-radius: 50%; margin-bottom: 1rem; }
.footer-bottom {
  padding-top: 26px; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; font-size: .84rem; color: rgba(255,255,255,.5);
}

/* Stagger: le card di una stessa griglia entrano in sequenza */
html.js .grid-3 .reveal:nth-child(2), html.js .grid-2 > .reveal:nth-child(2) { transition-delay: .12s; }
html.js .grid-3 .reveal:nth-child(3) { transition-delay: .24s; }
html.js .grid-3 .reveal:nth-child(4) { transition-delay: .12s; }
html.js #persone .reveal:nth-child(2) { transition-delay: .1s; }
html.js #persone .reveal:nth-child(3) { transition-delay: .2s; }
html.js #persone .reveal:nth-child(4) { transition-delay: .3s; }

/* Avatar: alone dorato al passaggio */
.person .avatar { transition: box-shadow .3s ease, transform .3s ease; }
.person:hover .avatar { box-shadow: 0 0 0 6px rgba(200,150,30,.25); transform: scale(1.04); }

/* Bottoni: bagliore al passaggio */
.btn-gold:hover { box-shadow: 0 10px 30px rgba(242,169,59,.55); }

/* ---------- Reveal on scroll (progressive: attivo solo con JS) ---------- */
.reveal { opacity: 1; transform: none; }
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .6s ease, transform .6s ease; }
html.js .reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1; transform: none; }
  .cta-band::before { animation: none; }
  html.js .hero .eyebrow, html.js .hero h1, html.js .hero .lead, html.js .hero .hero-actions {
    opacity: 1; transform: none; animation: none;
  }
  html.js .reveal .sig-rule::before, html.js .reveal .sig-rule::after { transform: scaleX(1); transition: none; }
  html.js .reveal .sig-rule span { opacity: 1; }
  html.js .reveal .timeline::before { transform: scaleY(1); transition: none; }
  html.js .reveal .timeline li::before { opacity: 1; transition: none; }
  .embers { display: none; }
}

/* ---------- Pagine legali ---------- */
.prose { max-width: 780px; }
.prose h2 { margin: 2.2rem 0 .8rem; font-size: 1.5rem; }
.prose p, .prose li { margin-bottom: .9rem; }
.prose ul { padding-left: 1.3rem; }
