/* =========================================================
   Il Dono di Francesco ETS — Design system
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;0,6..72,600;1,6..72,400;1,6..72,500&family=Public+Sans:wght@400;500;600;700&display=swap');

:root {
  --paper: #faf6f1;
  --paper-dim: #f3ece3;
  --ink: #241f1b;
  --ink-soft: #5c5349;
  --red: #b0261e;
  --red-dark: #8a1c16;
  --red-tint: #f4e2df;
  --ochre: #c79a46;
  --line: #e3dad1;
  --white: #ffffff;

  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Public Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --maxw: 1120px;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--ink);
}

h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); font-weight: 500; }
h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
h3 { font-size: 1.25rem; font-weight: 600; font-family: var(--font-body); }

p { margin: 0 0 1.1em; }

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

.measure {
  max-width: 66ch;
}

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Top bar ---------- */
.topbar {
  background: var(--ink);
  color: #e9e2d8;
  font-size: 0.85rem;
}
.topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  padding-bottom: 8px;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar a { color: #f2c9c5; }
.topbar strong { color: var(--white); letter-spacing: 0.02em; }

/* ---------- Header / Nav ---------- */
header.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 20px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--red);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.3rem;
  flex: none;
}
.brand-text {
  font-family: var(--font-display);
  line-height: 1.05;
}
.brand-text strong { display: block; font-size: 1.05rem; font-weight: 600; }
.brand-text span { display: block; font-size: 0.72rem; letter-spacing: 0.06em; color: var(--ink-soft); }

nav.main-nav ul {
  list-style: none;
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
nav.main-nav a {
  display: inline-block;
  padding: 8px 12px;
  color: var(--ink);
  font-size: 0.95rem;
  border-radius: var(--radius);
}
nav.main-nav a:hover { background: var(--red-tint); text-decoration: none; }
nav.main-nav a.active { color: var(--red); font-weight: 600; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 10px;
  font-size: 1rem;
  cursor: pointer;
}

@media (max-width: 780px) {
  .nav-toggle { display: inline-block; }
  nav.main-nav {
    display: none;
    width: 100%;
    order: 3;
  }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; gap: 0; border-top: 1px solid var(--line); padding-top: 8px; }
  .site-header .container { flex-wrap: wrap; }
}

/* ---------- Page header (interior pages) ---------- */
.page-head {
  padding: 48px 0 36px;
  border-bottom: 1px solid var(--line);
}
.page-head .eyebrow {
  color: var(--red);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 6px;
  display: block;
}
.page-head p { color: var(--ink-soft); }

/* ---------- Hero (home) ---------- */
.hero {
  padding: 64px 0 56px;
}
.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero h1 { margin-bottom: 0.4em; }
.hero .lede {
  font-size: 1.1rem;
  color: var(--ink-soft);
  max-width: 46ch;
}
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 22px; }

.hero-photos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.hero-photos img {
  border-radius: var(--radius);
  object-fit: cover;
  width: 100%;
  height: 100%;
}
.hero-photos .ph-tall { grid-row: span 2; aspect-ratio: 3/4; }
.hero-photos .ph-wide { aspect-ratio: 4/3; }

@media (max-width: 860px) {
  .hero .container { grid-template-columns: 1fr; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); }
.btn-outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-outline:hover { background: var(--ink); color: var(--white); }

/* ---------- Sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-tint { background: var(--paper-dim); }
.section-head { margin-bottom: 32px; max-width: 60ch; }
.section-head .eyebrow {
  color: var(--red);
  font-weight: 600;
  font-size: 0.85rem;
  display: block;
  margin-bottom: 6px;
}

/* Pillars */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.pillar { border-top: 3px solid var(--red); padding-top: 16px; }
.pillar h3 { margin-bottom: 6px; }
.pillar p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.96rem; }
@media (max-width: 780px) { .pillars { grid-template-columns: 1fr; } }

/* News preview list on home */
.news-preview { display: grid; gap: 0; }
.news-row {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.news-row img { border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; }
.news-row time { color: var(--ink-soft); font-size: 0.85rem; }
@media (max-width: 620px) {
  .news-row { grid-template-columns: 72px 1fr; }
  .news-row .news-arrow { display: none; }
}

/* Quote block (home teaser) */
.quote-block {
  background: var(--ink);
  color: var(--paper);
  padding: 56px 0;
}
.quote-block blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.2rem, 2.2vw, 1.6rem);
  max-width: 62ch;
  margin: 0 0 18px;
  line-height: 1.45;
}
.quote-block cite { font-style: normal; color: #cbb; font-size: 0.9rem; }

/* ---------- Chi siamo ---------- */
.founder-block {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}
.founder-block img { border-radius: var(--radius); }
@media (max-width: 780px) { .founder-block { grid-template-columns: 1fr; } }

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 2px solid var(--line);
}
.timeline li {
  position: relative;
  padding: 0 0 26px 26px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--red);
}
.timeline time {
  display: block;
  font-weight: 600;
  color: var(--red);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.board-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.board-list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.board-list .role { color: var(--ink-soft); font-size: 0.9rem; }

/* ---------- Associati ---------- */
.support-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}
@media (max-width: 780px) { .support-cols { grid-template-columns: 1fr; } }
.support-cols h3 { color: var(--red); }
.iban-box {
  margin-top: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: var(--font-body);
}
.iban-box .label { font-size: 0.8rem; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.iban-box .value { font-weight: 700; letter-spacing: 0.02em; font-size: 1.05rem; }

/* ---------- Gallery ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.gallery-item img { border-radius: var(--radius); aspect-ratio: 4/3; object-fit: cover; }
.gallery-item figcaption {
  margin-top: 10px;
  font-weight: 600;
  font-size: 0.95rem;
}
@media (max-width: 860px) { .gallery-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .gallery-grid { grid-template-columns: 1fr; } }

/* ---------- Testimonianze ---------- */
.testimony {
  max-width: 68ch;
  margin: 0 auto;
}
.testimony .mark {
  font-family: var(--font-display);
  font-size: 3.5rem;
  color: var(--red);
  line-height: 1;
  margin-bottom: 8px;
}
.testimony p { font-size: 1.05rem; }
.testimony-nav {
  display: flex;
  justify-content: center;
  gap: 18px;
  margin-top: 32px;
}
.testimony-nav button {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 1.1rem;
}
.testimony-nav button:hover { border-color: var(--red); color: var(--red); }

/* ---------- Eventi & News ---------- */
.empty-state {
  background: var(--paper-dim);
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--ink-soft);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
}

.news-list { list-style: none; margin: 0; padding: 0; }
.news-list li {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 18px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.news-list img { border-radius: var(--radius); aspect-ratio: 1/1; object-fit: cover; }
.news-list h3 { margin-bottom: 4px; font-size: 1.05rem; }
.news-list time { color: var(--ink-soft); font-size: 0.85rem; }
.news-list .source { color: var(--ink-soft); font-size: 0.85rem; }

.legal-note {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
  color: var(--ink-soft);
}

/* ---------- Contatti ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
}
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.form-field { margin-bottom: 18px; }
.form-field label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 6px;
}
.form-field input,
.form-field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.98rem;
  background: var(--white);
}
.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--red);
}
.form-note { font-size: 0.85rem; color: var(--ink-soft); margin-top: -6px; }

.info-card {
  background: var(--paper-dim);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}
.info-card h3 { margin-bottom: 10px; }
.info-card p { margin-bottom: 6px; font-size: 0.95rem; }

.alert {
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.95rem;
}
.alert-success { background: #e5f1e6; color: #2a5c2e; border: 1px solid #bcdcbf; }
.alert-error { background: #fbe6e4; color: var(--red-dark); border: 1px solid #f0c0bb; }

/* ---------- Footer ---------- */
footer.site-footer {
  background: var(--ink);
  color: #d8cfc3;
  padding: 56px 0 22px;
  margin-top: 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 36px;
  padding-bottom: 32px;
}
.footer-grid h4 {
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  margin-bottom: 14px;
}
.footer-grid p, .footer-grid a { color: #cfc4b6; font-size: 0.92rem; }
.footer-grid a:hover { color: var(--white); }
.social-icons { display: flex; gap: 10px; margin-top: 10px; }
.social-icons a {
  width: 36px; height: 36px;
  border: 1px solid #4a443c;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper);
}
.social-icons a:hover { background: var(--red); border-color: var(--red); text-decoration: none; }
.donate-thumb { border-radius: var(--radius); margin-top: 10px; max-width: 140px; }

.footer-bottom {
  border-top: 1px solid #40392f;
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.82rem;
  color: #a89e8f;
}
.footer-bottom a { color: #a89e8f; }

@media (max-width: 860px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
}
