:root {
  --bg: #faf8f5;
  --bg-alt: #f1ece5;
  --text: #2b2724;
  --muted: #6e655d;
  --accent: #a8836a;
  --accent-dark: #8a6a54;
  --white: #ffffff;
  --radius: 4px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1a18;
    --bg-alt: #252220;
    --text: #f1ece5;
    --muted: #b3a89c;
    --accent: #c9a68c;
    --accent-dark: #dcb9a0;
  }
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 300;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
code { background: var(--bg-alt); padding: 0.1em 0.4em; border-radius: 3px; font-size: 0.9em; }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  background: transparent;
  color: #fff;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}
.site-header.scrolled {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(0,0,0,0.08);
}
.logo {
  font-family: var(--serif); font-size: 1.5rem; font-weight: 600;
  color: inherit; text-decoration: none; line-height: 1.1;
  display: flex; flex-direction: column;
}
.logo span {
  font-family: var(--sans); font-size: 0.65rem; letter-spacing: 0.25em;
  text-transform: uppercase; font-weight: 400; opacity: 0.8;
}
.site-nav { display: none; }
.menu-toggle {
  background: none; border: 0; cursor: pointer; width: 40px; height: 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 6px;
  color: inherit;
}
.menu-toggle span { display: block; height: 1.5px; width: 24px; background: currentColor; transition: transform 0.3s, opacity 0.3s; }
.menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

.site-nav.open {
  display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg); color: var(--text);
  padding: 1rem 1.25rem 1.5rem; gap: 1rem; box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}
.site-nav a { color: inherit; text-decoration: none; font-size: 0.95rem; letter-spacing: 0.05em; }
.site-nav .nav-cta { color: var(--accent-dark); font-weight: 600; }

/* Hero */
.hero {
  position: relative; min-height: 100svh;
  display: flex; align-items: center; justify-content: center; text-align: center;
  color: #fff; padding: 6rem 1.5rem 4rem;
  background: #2f2722 url("immagini/copertina.jpg") center / cover no-repeat;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(rgba(20,16,14,0.5), rgba(20,16,14,0.4)); }
.hero-content { position: relative; max-width: 760px; }
.eyebrow {
  font-size: 0.72rem; letter-spacing: 0.3em; text-transform: uppercase;
  color: var(--accent); font-weight: 600; margin-bottom: 1rem;
}
.hero .eyebrow { color: #e8d6c6; }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2.4rem, 7vw, 4.5rem); line-height: 1.1; margin-bottom: 1.25rem;
}
.hero h1 em { color: #f0dccb; }
.hero-sub { font-size: 1.05rem; opacity: 0.9; margin-bottom: 2rem; }

.btn {
  display: inline-block; background: var(--accent); color: #fff;
  padding: 0.9rem 2rem; border: 0; border-radius: var(--radius);
  font: inherit; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  font-size: 0.8rem; text-decoration: none; cursor: pointer; transition: background 0.2s;
}
.btn:hover, .btn:focus-visible { background: var(--accent-dark); }

/* Sections */
.section { padding: 5rem 1.25rem; max-width: 1100px; margin: 0 auto; }
.section.alt { max-width: none; background: var(--bg-alt); }
.section.alt > * { max-width: 1100px; margin-left: auto; margin-right: auto; }
.section-head { text-align: center; margin-bottom: 3rem; }
.section-head h2, .about-text h2 {
  font-family: var(--serif); font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem); line-height: 1.2;
  margin-bottom: 0.75rem;
}
.section-head p:not(.eyebrow) { color: var(--muted); max-width: 560px; margin: 0 auto; }

/* Gallery */
.gallery {
  display: grid; grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 180px; gap: 10px;
}
.gallery-item {
  position: relative; border: 0; padding: 0; background: none; cursor: zoom-in;
  overflow: hidden; border-radius: var(--radius); font: inherit; color: inherit;
}
.gallery-item.tall { grid-row: span 2; }
.gallery-item.wide { grid-column: span 2; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.gallery-item:hover img, .gallery-item:focus-visible img { transform: scale(1.05); }
.about-photo img { width: 100%; height: 100%; max-height: 560px; object-fit: cover; }
.gallery-item span {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.75rem;
  background: linear-gradient(transparent, rgba(0,0,0,0.55)); color: #fff;
  font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; text-align: left;
  opacity: 0; transition: opacity 0.3s;
}
.gallery-item:hover span, .gallery-item:focus-visible span { opacity: 1; }

/* Placeholder "photos" (gradients) until real images are added */
.ph { background: linear-gradient(135deg, #c8b3a1, #7d6557); }
.ph-2 { background: linear-gradient(135deg, #e6d9cc, #9c8577); }
.ph-3 { background: linear-gradient(135deg, #b9a48f, #4f4039); }
.ph-4 { background: linear-gradient(135deg, #d8c3b0, #6e5a4d); }
.ph-5 { background: linear-gradient(135deg, #a88f7c, #3c322c); }
.ph-6 { background: linear-gradient(135deg, #eadfd3, #8d7a6b); }
.ph-about { background: linear-gradient(160deg, #d6c4b3, #5d4c42); height: 100%; min-height: 420px; }

/* Cards */
.cards { display: grid; gap: 1.5rem; grid-template-columns: 1fr; }
.card {
  background: var(--bg); padding: 2.25rem 1.75rem; border-radius: var(--radius);
  border: 1px solid rgba(0,0,0,0.06); text-align: center;
}
.card h3 { font-family: var(--serif); font-size: 1.7rem; font-weight: 600; margin-bottom: 0.75rem; }
.card p { color: var(--muted); margin-bottom: 0.75rem; }
.card .price { color: var(--accent-dark); font-weight: 600; font-size: 1.05rem; margin-top: 1rem; }
.card.featured { border-color: var(--accent); box-shadow: 0 10px 30px rgba(168,131,106,0.15); }
.note { text-align: center; color: var(--muted); font-size: 0.85rem; margin-top: 2rem; }

/* About */
.about { display: grid; gap: 2.5rem; align-items: center; }
.about-photo { border-radius: var(--radius); overflow: hidden; }
.about-text p:not(.eyebrow) { color: var(--muted); margin-bottom: 1rem; }

/* Contact */
.contact { display: grid; gap: 2.5rem; }
.contact-form { display: grid; gap: 1rem; background: var(--bg); padding: 2rem 1.5rem; border-radius: var(--radius); }
.contact-form label { display: grid; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); }
.contact-form input, .contact-form select, .contact-form textarea {
  font: inherit; font-size: 1rem; padding: 0.75rem; border: 1px solid #d8cfc5; border-radius: var(--radius);
  background: var(--bg-alt); color: var(--text); width: 100%;
}
.contact-form input:focus, .contact-form select:focus, .contact-form textarea:focus {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.contact-form .btn { justify-self: start; cursor: pointer; }
.contact-info p { margin-bottom: 1.5rem; color: var(--muted); }
.contact-info a, .note a { color: var(--accent-dark); }
.contact-info strong { color: var(--text); font-weight: 600; }

.footer { text-align: center; padding: 2.5rem 1rem; color: var(--muted); font-size: 0.85rem; border-top: 1px solid rgba(0,0,0,0.06); }

/* Lightbox */
.lightbox {
  position: fixed; inset: 0; z-index: 100; background: rgba(15,12,10,0.94);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 3rem 1rem 1.5rem;
}
.lightbox[hidden] { display: none; }
.lightbox-stage { display: flex; align-items: center; justify-content: center; max-width: 100%; }
.lightbox-stage img { max-width: 100%; max-height: 80vh; width: auto; height: auto; border-radius: var(--radius); }
.lightbox-caption { color: #ddd; margin-top: 1rem; font-size: 0.9rem; letter-spacing: 0.1em; text-transform: uppercase; }
.lightbox-close {
  position: absolute; top: 0.5rem; right: 0.75rem; background: none; border: 0; color: #fff;
  font-size: 2.5rem; cursor: pointer; line-height: 1; padding: 0.5rem;
}

.lightbox-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.35); border: 0; color: #fff; cursor: pointer;
  font-size: 2.5rem; line-height: 1; width: 48px; height: 64px; border-radius: var(--radius);
}
.lightbox-nav.prev { left: 0.5rem; }
.lightbox-nav.next { right: 0.5rem; }
.lightbox-nav:hover, .lightbox-nav:focus-visible { background: rgba(0,0,0,0.65); }

/* Pagine interne (portfolio, storie) */
.inner .site-header { background: var(--bg); color: var(--text); box-shadow: 0 1px 0 rgba(0,0,0,0.08); }
.inner main { padding-top: 4.5rem; }
.site-nav a[aria-current="page"] { color: var(--accent-dark); }
.page-head h1, .story-end h2, .story-text h2 {
  font-family: var(--serif); font-weight: 400; line-height: 1.2; margin-bottom: 0.75rem;
}
.page-head h1 { font-size: clamp(2.1rem, 5.5vw, 3.2rem); }
.cta-row { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin-top: 3rem; }
.btn-ghost { background: transparent; color: var(--accent-dark); box-shadow: inset 0 0 0 1px var(--accent); }
.btn-ghost:hover, .btn-ghost:focus-visible { background: var(--accent); color: #fff; }

/* Galleria a colonne: le foto mantengono la loro proporzione */
/* Righe da sinistra a destra: l'ordine di lettura è quello della giornata.
   Ogni foto occupa una larghezza proporzionale al suo formato (--ar, impostato in script.js). */
/* Su telefono: una foto per riga, intera. Su desktop lo script la dispone a mosaico (vedi script.js). */
.masonry { display: grid; grid-template-columns: 1fr; gap: 10px; }
.shot {
  display: block; width: 100%; padding: 0; border: 0; background: var(--bg-alt);
  cursor: zoom-in; border-radius: var(--radius); overflow: hidden;
}
.shot img { width: 100%; height: auto; display: block; transition: opacity 0.3s; }
.shot:hover img, .shot:focus-visible img { opacity: 0.88; }

/* Elenco storie */
.stories { display: grid; gap: 2rem; grid-template-columns: 1fr; }
.story-card {
  display: block; color: inherit; text-decoration: none; background: var(--bg-alt);
  border-radius: var(--radius); overflow: hidden;
}
.story-card img { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; transition: transform 0.6s ease; }
.story-card:hover img, .story-card:focus-visible img { transform: scale(1.04); }
.story-card-text { padding: 1.5rem; }
.story-card-text .eyebrow { margin-bottom: 0.5rem; }
.story-card-text h2 { font-family: var(--serif); font-weight: 600; font-size: 1.7rem; line-height: 1.2; margin-bottom: 0.5rem; }
.story-card-text p:last-child { color: var(--muted); }

/* Pagina del singolo matrimonio */
.hero-story { min-height: 70svh; background-color: #2f2722; background-size: cover; background-position: center; }
.story-meta { display: grid; gap: 1rem; margin-bottom: 2.5rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(128,128,128,0.25); }
.story-meta dt { font-size: 0.72rem; letter-spacing: 0.25em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.story-meta dd { color: var(--text); }
.story-text { max-width: 680px; margin: 0 auto 3rem; }
.story-text p { color: var(--muted); margin-bottom: 1rem; font-size: 1.05rem; }
.story-text h2 { font-size: 1.8rem; margin-top: 2rem; }
.story-end { text-align: center; margin-top: 4rem; }
.story-end h2 { font-size: clamp(1.8rem, 4.5vw, 2.4rem); }
.story-end p { color: var(--muted); }
.story-end .cta-row { margin-top: 1.5rem; }

/* Tablet and up */
@media (min-width: 720px) {
  .masonry { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; gap: 14px; }
  .shot { height: 100%; }
  .shot img { height: 100%; object-fit: cover; }
  .stories { grid-template-columns: repeat(2, 1fr); }
  .story-meta { grid-template-columns: repeat(3, 1fr); }
  .menu-toggle { display: none; }
  .site-nav { display: flex; gap: 2rem; }
  .site-nav.open { display: flex; }
  .site-nav a { position: relative; }
  .site-nav a:not(.nav-cta):hover { color: var(--accent); }
  .gallery { grid-template-columns: repeat(3, 1fr); grid-auto-rows: 240px; }
  .gallery-item:last-child { grid-column: span 2; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .about { grid-template-columns: 1fr 1fr; }
  .contact { grid-template-columns: 1fr 1fr; }
  .contact-form { padding: 2.5rem; }
}

/* Testimonianze */
.testimonials { border-top: 1px solid rgba(128,128,128,0.2); }
.rating-summary { color: var(--muted); }
.stars { color: var(--accent); letter-spacing: 0.15em; }
.reviews { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
.review { background: var(--bg-alt); padding: 1.75rem; border-radius: var(--radius); }
.review h3 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; line-height: 1.25; margin: 0.5rem 0 0.75rem; }
.review blockquote { margin: 0.75rem 0 0; }
.review blockquote p { color: var(--muted); margin-bottom: 0.75rem; }
.review footer { font-size: 0.85rem; color: var(--muted); margin-top: 1rem; }
.review footer strong { color: var(--text); font-weight: 600; }
@media (min-width: 720px) { .reviews { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .reviews { grid-template-columns: repeat(3, 1fr); } }

/* Anteprima Instagram: griglia di foto che rimanda al profilo */
.insta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.insta-grid a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: var(--radius); background: var(--bg-alt); }
.insta-grid img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.6s ease; }
.insta-grid a:hover img, .insta-grid a:focus-visible img { transform: scale(1.05); }
.section-head a { color: var(--accent-dark); }
@media (min-width: 720px) { .insta-grid { grid-template-columns: repeat(6, 1fr); gap: 12px; } }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
