/* ============================================
   Delizie & Eventi — Design tokens
   Palette:
     --crema      #F7F2E9  fondo
     --carta      #FFFDF8  card/bianco caldo
     --oliva      #2E3A26  verde oliva scuro (heading/nav)
     --oliva-2    #3E4E33  verde oliva secondario
     --terracotta #B8632E  accento caldo (CTA)
     --oro        #B08D4F  linee/dettagli
     --inchiostro #2B2620  testo
   Type:
     display: 'Fraunces' (serif con carattere)
     body/utility: 'Work Sans'
   ============================================ */

:root {
  --crema: #F7F2E9;
  --carta: #FFFDF8;
  --oliva: #2E3A26;
  --oliva-2: #3E4E33;
  --terracotta: #B8632E;
  --terracotta-dark: #9A4F23;
  --oro: #B08D4F;
  --inchiostro: #2B2620;
  --inchiostro-soft: #55503f;
  --line: rgba(46, 58, 38, 0.14);

  --font-display: 'Fraunces', serif;
  --font-body: 'Work Sans', sans-serif;

  --container: 1180px;
  --radius: 2px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--crema);
  color: var(--inchiostro);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

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

h1 { font-size: clamp(2.4rem, 5.2vw, 4.4rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.05rem; margin-bottom: 0.35em; }

em { font-style: italic; color: var(--terracotta); }

p { margin: 0 0 1em 0; }
.lead { font-size: 1.12rem; color: var(--inchiostro-soft); max-width: 46ch; }

a { color: inherit; }

.eyebrow {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--terracotta);
  margin: 0 0 0.9em 0;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 1px;
  background: var(--terracotta);
  margin-right: 10px;
  vertical-align: middle;
}
.eyebrow-light { color: var(--oro); }
.eyebrow-light::before { background: var(--oro); }

/* subtle grain overlay for warmth */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

/* ============ WHATSAPP FAB ============ */
.whatsapp-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 998;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px -6px rgba(20, 90, 50, 0.55);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: fabPulse 2.6s ease-in-out infinite;
}
.whatsapp-fab:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 14px 28px -6px rgba(20, 90, 50, 0.6);
}
@keyframes fabPulse {
  0%, 100% { box-shadow: 0 10px 24px -6px rgba(20, 90, 50, 0.55), 0 0 0 0 rgba(37, 211, 102, 0.45); }
  50% { box-shadow: 0 10px 24px -6px rgba(20, 90, 50, 0.55), 0 0 0 10px rgba(37, 211, 102, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .whatsapp-fab { animation: none; }
}
@media (max-width: 640px) {
  .whatsapp-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
}

/* ============ NAV ============ */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(247, 242, 233, 0.0);
  backdrop-filter: none;
  transition: background 0.35s ease, box-shadow 0.35s ease, backdrop-filter 0.35s ease;
  padding: 22px 0;
}
.nav.scrolled {
  background: rgba(247, 242, 233, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 var(--line);
  padding: 14px 0;
}
.nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--oliva);
}
.nav:not(.scrolled) .brand { color: var(--carta); }
.brand-mark {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 42px; height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.brand-amp { color: var(--terracotta); }
.brand-text {
  font-family: var(--font-display);
  font-size: 1.15rem;
  letter-spacing: 0.01em;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  font-size: 0.92rem;
}
.nav:not(.scrolled) .nav-links a:not(.nav-cta) { color: var(--carta); }
.nav-links a {
  text-decoration: none;
  color: var(--inchiostro);
  position: relative;
  padding: 4px 0;
}
.nav-links a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 0.25s ease;
}
.nav-links a:not(.nav-cta):hover::after { width: 100%; }
.nav-cta {
  background: var(--terracotta);
  color: var(--carta) !important;
  padding: 10px 20px !important;
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.25s ease;
}
.nav-cta:hover { background: var(--terracotta-dark); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--carta);
  transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease;
}
.nav.scrolled .nav-toggle span { background: var(--oliva); }

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-media img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 40%;
  transform: scale(1.06);
  animation: heroZoom 18s ease-out forwards;
}
@keyframes heroZoom {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20,22,14,0.35) 0%, rgba(20,22,14,0.25) 35%, rgba(20,20,12,0.78) 100%);
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px 90px 28px;
  color: var(--carta);
  width: 100%;
}
.hero-content h1 { color: var(--carta); max-width: 16ch; }
.hero-content h1 em { color: #E7B579; font-style: italic; }
.hero-sub {
  color: rgba(255,253,248,0.86);
  max-width: 52ch;
  font-size: 1.08rem;
}
.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 30px;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
  border: 1px solid transparent;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--terracotta);
  color: var(--carta);
}
.btn-primary:hover { background: var(--terracotta-dark); }
.btn-ghost {
  border-color: rgba(255,253,248,0.5);
  color: var(--carta);
}
.btn-ghost:hover { border-color: var(--carta); background: rgba(255,253,248,0.08); }
.btn-full { width: 100%; }

/* ============ SECTIONS ============ */
.section { padding: 120px 0; }
.section-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}
.section-tinted { background: #F0E9DA; }
.section-dark {
  background: var(--oliva);
  color: var(--carta);
}
.section-dark .lead.light-sub { color: rgba(255,253,248,0.75); }
h2.light { color: var(--carta); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px;
  align-items: center;
}
.grid-2.reverse { direction: rtl; }
.grid-2.reverse > * { direction: ltr; }

.img-frame img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -20px rgba(43, 38, 32, 0.35);
}
.img-caption {
  font-size: 0.88rem;
  color: var(--inchiostro-soft);
  margin-top: 14px;
  font-style: italic;
  max-width: 42ch;
}

.check-list {
  list-style: none;
  padding: 0;
  margin: 28px 0 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 24px;
}
.check-list li {
  padding-left: 26px;
  position: relative;
  font-size: 0.95rem;
  color: var(--inchiostro-soft);
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  color: var(--terracotta);
  font-weight: 600;
}

/* ============ EVENTI GRID ============ */
.event-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  background: var(--line);
  border: 1px solid var(--line);
}
.event-card {
  background: var(--carta);
  padding: 40px 32px;
  transition: background 0.3s ease, transform 0.3s ease;
}
.event-card:hover { background: #FBF7EE; }
.event-icon {
  display: inline-block;
  font-size: 1.4rem;
  color: var(--terracotta);
  margin-bottom: 18px;
}
.event-card p { color: var(--inchiostro-soft); font-size: 0.95rem; margin: 0; }
.event-card h3 { margin-bottom: 10px; }

/* ============ OFFER LIST ============ */
.offer-list {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.offer-item {
  display: flex;
  gap: 22px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.offer-item:last-child { border-bottom: none; padding-bottom: 0; }
.offer-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--oro);
  min-width: 40px;
}
.offer-item p { color: var(--inchiostro-soft); font-size: 0.95rem; margin: 0; }

/* ============ TIMELINE (signature element) ============ */
.timeline {
  position: relative;
  margin-top: 64px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.timeline-line {
  position: absolute;
  top: 17px;
  left: 0; right: 0;
  height: 1px;
  background: rgba(176, 141, 79, 0.4);
}
.timeline-item { position: relative; }
.timeline-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--oliva);
  border: 1px solid var(--oro);
  color: var(--oro);
  font-family: var(--font-display);
  font-size: 0.85rem;
  position: relative;
  z-index: 2;
  margin-bottom: 22px;
}
.timeline-card {
  background: rgba(255,253,248,0.05);
  border: 1px solid rgba(255,253,248,0.14);
  border-radius: var(--radius);
  padding: 26px 22px;
  height: 100%;
}
.timeline-card h3 { color: var(--carta); font-size: 1.15rem; }
.timeline-card p:not(.timeline-tag) { color: rgba(255,253,248,0.78); font-size: 0.92rem; margin: 0; }
.timeline-tag {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--oro);
  font-weight: 600;
  margin-bottom: 10px;
}
.timeline-card-highlight {
  background: rgba(184, 99, 46, 0.16);
  border-color: rgba(184, 99, 46, 0.55);
}

/* ============ GALLERY ============ */
.gallery {
  margin-top: 44px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 220px;
  gap: 14px;
}
.gallery-item { overflow: hidden; border-radius: var(--radius); }
.gallery-item.span-2 { grid-column: span 2; }
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.gallery-item:hover img { transform: scale(1.06); }

/* ============ CONTATTI ============ */
.contact-list {
  list-style: none;
  padding: 0;
  margin: 36px 0 0 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-list li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.contact-label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.72rem;
  color: var(--oro);
  font-weight: 600;
}
.contact-value {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--oliva);
  text-decoration: none;
}

.contact-form {
  background: var(--carta);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
}
.form-row { margin-bottom: 20px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--oliva);
  margin-bottom: 8px;
}
.form-row input, .form-row select, .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--crema);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--inchiostro);
  resize: vertical;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  outline: 2px solid var(--terracotta);
  outline-offset: 1px;
}
.form-row-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-note {
  margin-top: 14px;
  font-size: 0.88rem;
  color: var(--oliva-2);
  min-height: 1.2em;
}

/* ============ FOOTER ============ */
.footer {
  background: var(--oliva);
  color: rgba(255,253,248,0.8);
  padding: 56px 0 32px;
  text-align: center;
}
.footer-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--carta);
  margin-bottom: 18px;
}
.footer-brand .brand-mark {
  font-family: var(--font-display);
  font-size: 1.1rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.footer-fine { font-style: italic; font-family: var(--font-display); color: var(--oro); margin: 4px 0 20px; }
.footer-copy { font-size: 0.82rem; color: rgba(255,253,248,0.5); }

/* ============ REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .grid-2, .grid-2.reverse { grid-template-columns: 1fr; direction: ltr; gap: 40px; }
  .event-grid { grid-template-columns: repeat(2, 1fr); }
  .timeline { grid-template-columns: 1fr 1fr; }
  .timeline-line { display: none; }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 180px; }
  .gallery-item.span-2 { grid-column: span 2; }
  .section { padding: 84px 0; }
}

@media (max-width: 640px) {
  .nav-links {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--oliva);
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 26px;
    padding: 40px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
  }
  .nav-links.open { transform: translateX(0); }
  .nav:not(.scrolled) .nav-links a:not(.nav-cta),
  .nav-links a:not(.nav-cta) { color: var(--carta); }
  .nav-toggle { display: flex; }
  .nav.scrolled .nav-toggle span,
  .nav-toggle span { background: var(--carta); }
  .nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-toggle.open span:nth-child(2) { opacity: 0; }
  .nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .event-grid { grid-template-columns: 1fr; }
  .timeline { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .check-list { grid-template-columns: 1fr; }
  .form-row-split { grid-template-columns: 1fr; }
  .hero-content { padding-bottom: 64px; }
  .contact-form { padding: 24px; }
}
