/* ============================================================
   Parrocchia Digitale · Offerte — foglio di stile condiviso
   Direzione: cancelleria parrocchiale, sobria ed editoriale.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;0,9..144,600;1,9..144,400&family=Libre+Franklin:wght@400;500;600&display=swap');

:root {
  color-scheme: light;

  --paper:      #f6f1e7;
  --paper-2:    #efe7d6;
  --paper-3:    #e7ddc7;
  --screen:     #fbf8f1;

  --ink:        #23201c;
  --ink-soft:   #5c5347;
  --ink-faint:  #8a7f6c;

  --accent:      #6f2b32;
  --accent-deep: #4d1c22;
  --gold:        #b08b4c;
  --olive:       #566b3f;

  --line:       #d9cdb2;
  --line-soft:  #e6dcc6;

  --measure: 42rem;
  --shadow-soft: 0 1px 0 rgba(35, 32, 28, 0.04);

  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans:  'Libre Franklin', 'Segoe UI', system-ui, sans-serif;
}

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

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(120, 100, 60, 0.05) 1px, transparent 1px);
  background-size: 4px 4px;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout di base ---------- */

.wrap {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 1.5rem;
}

main.wrap { padding-top: 3.5rem; padding-bottom: 4rem; }

section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--line-soft);
}
section:first-of-type { border-top: 0; }

/* ---------- Testata ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 241, 231, 0.88);
  backdrop-filter: saturate(1.4) blur(8px);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}
.brand span { color: var(--accent); }

.nav {
  display: flex;
  gap: 1.15rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.nav a:hover { color: var(--ink); }
.nav a[aria-current='page'] {
  color: var(--accent);
  border-bottom-color: var(--gold);
}

/* ---------- Menu mobile ---------- */

.nav-cb {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.nav-toggle { display: none; }

@media (max-width: 48rem) {
  .site-header__inner { flex-wrap: nowrap; align-items: center; }

  .nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-right: -10px;
    flex: none;
    cursor: pointer;
  }
  .nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--ink);
    transition: transform 0.2s ease, opacity 0.2s ease;
  }
  .nav-cb:focus-visible ~ .nav-toggle { outline: 2px solid var(--accent); outline-offset: 3px; }
  .nav-cb:checked ~ .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-cb:checked ~ .nav-toggle span:nth-child(2) { opacity: 0; }
  .nav-cb:checked ~ .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 14px 26px -14px rgba(35, 28, 20, 0.28);
    max-height: 75vh;
    overflow-y: auto;
    text-transform: none;
    letter-spacing: 0.05em;
    font-size: 0.82rem;
  }
  .nav-cb:checked ~ .nav { display: flex; }
  .nav a {
    padding: 0.95rem 1.5rem;
    border-top: 1px solid var(--line-soft);
    border-bottom: none;
  }
  .nav a[aria-current='page'] {
    border-bottom: none;
    box-shadow: inset 3px 0 0 var(--gold);
  }
}

/* ---------- Tipografia ---------- */

.kicker {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 0.75rem;
}

h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 5vw, 2.9rem);
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin-bottom: 0.6rem;
}

h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.5rem;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.4rem;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

.lead {
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

a { color: var(--accent); text-underline-offset: 0.15em; }
a:hover { color: var(--accent-deep); }

strong { font-weight: 600; }

ul, ol { margin: 0 0 1rem 1.25rem; }
li { margin: 0.4rem 0; }

.muted { color: var(--ink-faint); font-size: 0.9rem; }

/* ---------- Hero ---------- */

.hero { padding: 1rem 0 2.5rem; border-top: 0; }
.hero .placeholder-note { margin-top: 1.5rem; }

/* segnaposto nome parrocchia */
.ph {
  font-style: italic;
  color: var(--accent);
  background: linear-gradient(transparent 65%, rgba(176, 139, 76, 0.28) 65%);
  padding: 0 0.1em;
  white-space: nowrap;
}
.placeholder-note {
  font-size: 0.82rem;
  color: var(--ink-faint);
  border-left: 2px solid var(--gold);
  padding-left: 0.75rem;
}

/* ---------- Passi numerati ---------- */

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}
.step {
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.1rem;
}
.step__n {
  font-family: var(--serif);
  font-size: 1.4rem;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 0.4rem;
}
.step p { font-size: 0.95rem; color: var(--ink-soft); }

/* ---------- Callout ---------- */

.note {
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.15rem;
  margin: 1.25rem 0;
  font-size: 0.97rem;
}
.note--gold  { border-left-color: var(--gold); }
.note--olive { border-left-color: var(--olive); }
.note h3 { color: var(--accent); }
.note p { color: var(--ink-soft); }
.note p:first-child { margin-top: 0; }

/* ---------- Elenco piattaforme / opzioni ---------- */

.option {
  padding: 1rem 0;
  border-top: 1px solid var(--line-soft);
}
.option:first-child { border-top: 0; }
.option__name { font-weight: 600; color: var(--ink); }
.option__name .tag {
  display: inline-block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--screen);
  background: var(--accent);
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  margin-left: 0.5rem;
  vertical-align: 0.1em;
}
.option p { font-size: 0.93rem; color: var(--ink-soft); margin-top: 0.35rem; }

/* ---------- Timeline ---------- */

.timeline { margin-top: 1rem; }
.timeline li {
  list-style: none;
  border-left: 2px solid var(--line);
  padding: 0.2rem 0 0.9rem 1rem;
  margin-left: 0.25rem;
  position: relative;
}
.timeline li::before {
  content: '';
  position: absolute;
  left: -5px; top: 0.55rem;
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
}
.timeline strong { color: var(--accent); }

/* ---------- FAQ ---------- */

.faq { margin-top: 0.5rem; }
.faq details {
  border-top: 1px solid var(--line-soft);
  padding: 0.9rem 0;
}
.faq details:last-child { border-bottom: 1px solid var(--line-soft); }
.faq summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-family: var(--serif);
  color: var(--gold);
  font-size: 1.3rem;
  line-height: 1;
}
.faq details[open] summary::after { content: '\2212'; }
.faq details p { margin-top: 0.7rem; color: var(--ink-soft); font-size: 0.97rem; }

/* ---------- Pulsanti ---------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.75rem 1.4rem;
  border: 0;
  border-radius: 4px;
  background: var(--accent);
  color: var(--screen);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent-deep); color: var(--screen); }
.btn:active { transform: translateY(1px); }
.btn--ghost {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1.5px var(--accent);
}
.btn--ghost:hover { background: var(--accent); color: var(--screen); }

.cta-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--paper-2);
}
.site-footer .wrap {
  padding-top: 2rem;
  padding-bottom: 2.5rem;
  font-size: 0.85rem;
  color: var(--ink-faint);
}
.site-footer a { color: var(--ink-soft); }
.site-footer p { margin-bottom: 0.6rem; }

/* ============================================================
   Simulazione — cornice telefono
   ============================================================ */

.sim-intro { text-align: center; margin-bottom: 2rem; }

.device {
  max-width: 22rem;
  margin: 0 auto 1.5rem;
  background: #17140f;
  border-radius: 2.75rem;
  padding: 0.7rem;
  box-shadow: 0 24px 60px -20px rgba(35, 28, 20, 0.55);
}
.device__screen {
  background: var(--screen);
  border-radius: 2.15rem;
  overflow: hidden;
  min-height: 40rem;
  display: flex;
  flex-direction: column;
}
.statusbar {
  display: flex;
  justify-content: space-between;
  padding: 0.6rem 1.4rem 0.3rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.screen {
  flex: 1;
  padding: 1.4rem 1.4rem 1.8rem;
  display: none;
  flex-direction: column;
}
.screen.is-active { display: flex; }

.screen__head {
  background: var(--accent-deep);
  color: var(--screen);
  margin: -1.4rem -1.4rem 1.4rem;
  padding: 1.3rem 1.4rem;
  text-align: center;
}
.screen__head h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.15rem;
  color: var(--screen);
  margin-bottom: 0.2rem;
}
.screen__parish { font-weight: 600; font-size: 1rem; }
.screen__sub { font-size: 0.78rem; opacity: 0.82; margin-top: 0.3rem; }

.progress {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.4rem;
  font-size: 0.72rem;
  color: var(--ink-faint);
}
.progress span {
  display: flex; align-items: center; gap: 0.35rem;
}
.progress span::before {
  content: '';
  width: 0.5rem; height: 0.5rem; border-radius: 50%;
  background: var(--line);
}
.progress span.is-on::before { background: var(--accent); }
.progress span.is-on { color: var(--ink); }

.amount-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.amount-grid button {
  padding: 0.85rem 0;
  border: 1.5px solid var(--line);
  background: var(--screen);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.amount-grid button:hover { border-color: var(--accent); }
.amount-grid button.is-sel {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--screen);
}

.field { margin-bottom: 1rem; }
.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}
.field input {
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1.5px solid var(--line);
  border-radius: 6px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  background: var(--screen);
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.check {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  padding: 0.8rem 0.9rem;
  margin: 1rem 0;
  font-size: 0.9rem;
}
.check input { width: 1.1rem; height: 1.1rem; margin-top: 0.15rem; accent-color: var(--accent); cursor: pointer; }
.check label { cursor: pointer; }

.freq { display: none; margin: 0.5rem 0 1rem; }
.freq.is-open { display: block; }
.freq > span {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}
.freq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.freq-grid button {
  padding: 0.55rem 0;
  border: 1.5px solid var(--line);
  background: var(--screen);
  border-radius: 5px;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
}
.freq-grid button.is-sel { background: var(--accent); border-color: var(--accent); color: var(--screen); }

.hint {
  font-size: 0.8rem;
  color: var(--ink-faint);
  text-align: center;
  margin: 0.4rem 0 0;
}

.btn-block { width: 100%; margin-top: 1rem; text-align: center; }
.btn-link {
  background: none; border: 0; color: var(--accent);
  font-family: var(--sans); font-weight: 600; font-size: 0.9rem;
  cursor: pointer; padding: 0; margin-bottom: 1rem;
}

.recap {
  background: var(--paper-2);
  padding: 1rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.recap__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.35rem 0;
  font-size: 0.92rem;
}
.recap__row strong { color: var(--accent); }
.recap__row.total {
  border-top: 1px solid var(--line);
  margin-top: 0.35rem;
  padding-top: 0.7rem;
  font-family: var(--serif);
  font-size: 1.1rem;
}

.processing { text-align: center; padding: 3rem 0; }
.spinner {
  width: 2.4rem; height: 2.4rem;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1.2rem;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.done-mark {
  width: 3.2rem; height: 3.2rem;
  margin: 1.5rem auto 1rem;
  border-radius: 50%;
  background: var(--olive);
  color: var(--screen);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem;
}
.done-title {
  text-align: center;
  font-family: var(--serif);
  font-size: 1.3rem;
  margin-bottom: 1.2rem;
}
.ref {
  text-align: center;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--paper-2);
  padding: 0.8rem;
  border-radius: 6px;
  margin: 1rem 0;
}
.ref strong { display: block; color: var(--ink); margin-bottom: 0.2rem; }
.recurring-box {
  display: none;
  background: var(--paper-2);
  border-left: 3px solid var(--gold);
  padding: 0.85rem 0.95rem;
  font-size: 0.86rem;
  color: var(--ink-soft);
  margin-top: 1rem;
}
.recurring-box.is-shown { display: block; }

/* ============================================================
   Animazione di ingresso
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  main.wrap > section,
  .hero {
    animation: rise 0.5s ease both;
  }
  .hero { animation-delay: 0.02s; }
  main.wrap > section:nth-of-type(1) { animation-delay: 0.06s; }
  main.wrap > section:nth-of-type(2) { animation-delay: 0.10s; }
  main.wrap > section:nth-of-type(3) { animation-delay: 0.14s; }
  main.wrap > section:nth-of-type(4) { animation-delay: 0.18s; }
  main.wrap > section:nth-of-type(n+5) { animation-delay: 0.22s; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(0.6rem); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   Citazioni — pagina di catechesi
   ============================================================ */

.catechesis section { padding: 2.75rem 0; }

.quote {
  margin: 1.5rem 0;
  padding-left: 1.35rem;
  border-left: 2px solid var(--gold);
}
.quote p {
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.5;
  color: var(--ink);
  margin-bottom: 0;
}
.quote cite {
  display: block;
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.quote cite a { color: var(--ink-faint); }

/* riquadro di apertura (controcanto) */
.aside {
  margin: 1.75rem 0 0.5rem;
  padding: 1.25rem 1.4rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
}
.aside__latin {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent);
  margin-bottom: 0.4rem;
}
.aside p:last-child { margin-bottom: 0; color: var(--ink-soft); font-size: 0.97rem; }

/* opere d'arte */
figure.artwork { margin: 1.5rem 0 1.75rem; }
figure.artwork img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
figure.artwork figcaption {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-faint);
}
figure.artwork figcaption b { color: var(--ink-soft); font-weight: 600; }

ul.credits { list-style: none; margin-left: 0; }
ul.credits li {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--ink-faint);
  padding-left: 0.9rem;
  border-left: 2px solid var(--line);
  margin: 0.6rem 0;
}

/* riga di senso nella schermata di conferma della simulazione */
.offering-line {
  font-size: 0.9rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--line-soft);
  padding-top: 1rem;
  margin-top: 0.5rem;
}
.offering-line strong { color: var(--ink); }
.offering-line a {
  display: inline-block;
  margin-top: 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
}

/* ---------- Piccoli schermi ---------- */

@media (max-width: 34rem) {
  main.wrap { padding-top: 2.5rem; }
  .quote p { font-size: 1.12rem; }
}
