:root {
  --cream: #faf6f0;
  --cream2: #f3ece3;
  --gold: #b8905a;
  --gold-light: #d4aa7a;
  --dark: #221c17;
  --text: #3a2e24;
  --muted: #8a7060;
  --white: #fff;
  --shadow: 0 4px 32px rgba(60, 40, 20, 0.08);
}

/* ===== RESET / BASE ===== */

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

html {
  height: 100%;
  overflow-y: scroll;
  scrollbar-gutter: stable;
}

body {
  height: 100%;
  min-height: 100%;
  position: relative;
  font-family: 'Jost', sans-serif;
  background: var(--cream);
  color: var(--text);
}

/* ===== NAV ===== */

nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 40px;
  height: 110px;
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: transparent;
  transition:
    transform 0.28s ease,
    opacity 0.22s ease;
}

nav.nav-hidden {
  transform: translateY(-110%);
}

html.home-preload nav {
  opacity: 0;
  transform: translateY(-12px);
  background: transparent !important;
  box-shadow: none !important;
}

body.hero-page nav,
body.page-dettagli nav,
body.page-galleria nav,
body.page-location nav,
body.page-rsvp nav,
body.page-pernoi nav {
  background: transparent !important;
  box-shadow: none !important;
}

/* ===== LOGO / MENU ===== */

.logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--gold-light);
}

.logo a,
.logo a:link,
.logo a:visited,
.logo a:hover,
.logo a:active,
.logo a:focus {
  display: flex;
  align-items: center;
  height: 100%;
  color: inherit;
  text-decoration: none;
  outline: none;
  box-shadow: none;
}

.logo img {
  display: block;
  width: auto;
  height: 144px;
}

.tabs {
  display: flex;
  gap: 2px;
  list-style: none;
}

.tabs a {
  display: inline-block;
  padding: 7px 14px;
  border: none;
  border-radius: 50px;
  background: none;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
}

.tabs a:hover {
  color: #fff;
}

.tabs a.on {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

/* ===== BACKGROUND LAYERS ===== */

.bg-fixed {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
}

.bg-overlay {
  position: fixed;
  inset: 0;
  z-index: 1;
  width: 100vw;
  height: 100vh;
  height: 100lvh;
  pointer-events: none;
  background: rgba(6, 3, 1, 0.55);
}

#app {
  position: relative;
  z-index: 2;
}

/* ===== PAGE FRAMEWORK ===== */

.page {
  display: none !important;
  min-height: 100vh;
  padding: 140px 24px 56px;
  position: relative;
  z-index: 2;
  background: transparent !important;
}

.page.on {
  display: block !important;
  animation: fu 0.3s ease both;
}

#p-home,
#p-dettagli,
#p-galleria,
#p-location,
#p-rsvp,
#p-pernoi {
  position: relative;
  background: none !important;
}

#p-home {
  min-height: 100%;
}

#p-home.on {
  display: flex !important;
  flex-direction: column;
  height: 100dvh;
  padding: 0;
}

/* ===== PAGE SPACING ===== */

#p-dettagli {
  padding-top: 200px;
}

#p-location,
#p-rsvp,
#p-pernoi {
  padding-top: 190px;
}

#p-galleria {
  padding-top: 180px;
}

/* ===== PAGE OVERLAYS ===== */

body.hero-page .bg-overlay,
body.page-home .bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 3, 1, 0.72) 0%,
    rgba(6, 3, 1, 0.55) 30%,
    rgba(6, 3, 1, 0.68) 70%,
    rgba(6, 3, 1, 0.88) 100%
  );
}

body.page-dettagli .bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 3, 1, 0.88) 0%,
    rgba(6, 3, 1, 0.6) 35%,
    rgba(6, 3, 1, 0.7) 100%
  );
}

body.page-galleria .bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 3, 1, 0.78) 0%,
    rgba(6, 3, 1, 0.6) 40%,
    rgba(6, 3, 1, 0.86) 100%
  );
}

body.page-location .bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 3, 1, 0.82) 0%,
    rgba(6, 3, 1, 0.64) 40%,
    rgba(6, 3, 1, 0.88) 100%
  );
}

body.page-rsvp .bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 3, 1, 0.88) 0%,
    rgba(6, 3, 1, 0.74) 40%,
    rgba(6, 3, 1, 0.92) 100%
  );
}

body.page-pernoi .bg-overlay {
  background: linear-gradient(
    180deg,
    rgba(6, 3, 1, 0.84) 0%,
    rgba(6, 3, 1, 0.66) 38%,
    rgba(6, 3, 1, 0.9) 100%
  );
}

/* ===== TYPOGRAPHY / COMMON BLOCKS ===== */

.w {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 5;
}

.ws {
  max-width: 580px;
  margin: 0 auto;
}

.section-intro {
  text-align: center;
}

.lbl {
  margin-bottom: 10px;
  font-size: 0.7rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
}

.ttl {
  margin-bottom: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.9rem, 4.5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.1;
  color: var(--text);
}

.sub {
  margin-bottom: 36px;
  font-size: 0.87rem;
  line-height: 1.8;
  font-weight: 300;
  color: var(--muted);
}

.sub a {
  color: #e7ded2;
  text-decoration: none;
  border-bottom: 1px solid rgba(184, 144, 90, 0.35);
}

.sub a:hover {
  color: #fff;
  border-bottom-color: var(--gold);
}

.card {
  padding: 32px;
  background: var(--white);
  border: 1px solid rgba(184, 144, 90, 0.12);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

/* ===== INTERNAL PAGES - COMMON STYLE ===== */

:is(#p-dettagli, #p-galleria, #p-location, #p-rsvp, #p-pernoi) .card,
:is(#p-dettagli, #p-galleria, #p-location, #p-rsvp, #p-pernoi) .d-card {
  background: rgba(25, 18, 14, 0.7);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(184, 144, 90, 0.25);
  color: #f3ede4;
}

:is(#p-dettagli, #p-galleria, #p-location, #p-rsvp, #p-pernoi) .ttl {
  color: #fff;
}

:is(#p-dettagli, #p-galleria, #p-location, #p-rsvp, #p-pernoi) .sub,
:is(#p-dettagli, #p-galleria, #p-location, #p-rsvp, #p-pernoi) .d-cv {
  color: #d7c8b6;
}

:is(#p-dettagli, #p-location, #p-rsvp, #p-pernoi) .lbl,
:is(#p-dettagli, #p-location, #p-rsvp, #p-pernoi) .ttl,
:is(#p-dettagli, #p-location, #p-rsvp, #p-pernoi) .sub {
  text-align: center;
}

/* ===== HOME ===== */

#p-home .home-body,
#p-home .h-cd,
#p-home .cd-title {
  position: relative;
  z-index: 10;
}

.home-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 88px 20px 28px;
  text-align: center;
}

.h-ey {
  margin-bottom: 18px;
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--gold-light);
  animation: fu 0.7s 0.2s both;
}

.h-t {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(3.2rem, 13vw, 7rem);
  font-weight: 300;
  line-height: 1;
  color: var(--white);
  animation: fu 0.7s 0.05s both;
}

.h-div {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 22px auto;
  animation: fu 0.7s 0.4s both;
}

.h-div::before,
.h-div::after {
  content: '';
  flex: 1;
  max-width: 90px;
  height: 1px;
}

.h-div::before {
  background: linear-gradient(90deg, transparent, rgba(184, 144, 90, 0.55));
}

.h-div::after {
  background: linear-gradient(90deg, rgba(184, 144, 90, 0.55), transparent);
}

.h-names {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.5rem, 4.5vw, 2.6rem);
  font-weight: 400;
  color: var(--white);
  animation: fu 0.7s 0.55s both;
}

.h-names em {
  font-style: italic;
  color: var(--gold-light);
}

.h-date {
  margin-top: 12px;
  font-size: 1.05rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--gold-light);
  animation: fu 0.7s 0.7s both;
}

.cd-title {
  position: relative;
  z-index: 10;
  margin: 20px 0 14px;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 300;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.6),
    0 0 10px rgba(0, 0, 0, 0.4);
}

.h-cd {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 20px 24px;
  background: rgba(0, 0, 0, 0.25);
  border-top: 1px solid rgba(184, 144, 90, 0.15);
}

.cd-it {
  text-align: center;
}

.cd-n {
  display: block;
  font-family: 'Cormorant Garamond', serif !important;
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
  color: var(--white);
}

.cd-l {
  display: block;
  margin-top: 5px;
  font-size: 0.52rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.cd-dot {
  align-self: center;
  padding-bottom: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.8rem;
  color: rgba(184, 144, 90, 0.35);
}

/* ===== DETTAGLI ===== */

.d-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 28px;
}

.d-card {
  padding: 26px 22px;
  background: var(--white);
  border: 1px solid rgba(184, 144, 90, 0.1);
  border-radius: 18px;
  box-shadow: var(--shadow);
  transition: transform 0.22s;
}

.d-card:hover {
  transform: translateY(-3px);
}

.d-ct {
  margin-bottom: 5px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  letter-spacing: 0.05em;
  color: var(--text);
}

.d-cv {
  font-size: 1rem;
  line-height: 1.7;
  text-align: center;
  font-weight: 300;
  color: var(--muted);
}

#p-dettagli .d-ct {
  text-align: center;
  color: var(--gold);
}

/* ===== RSVP ===== */

.rsvp-card {
  padding: 38px 34px;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.f-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.f-row label {
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

.f-row label span {
  font-size: 0.9em;
  letter-spacing: 0;
  text-transform: none;
  color: #cbb8a2;
}

.f-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.rsvp-form input,
.rsvp-form textarea {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid rgba(184, 144, 90, 0.28);
  border-radius: 16px;
  outline: none;
  resize: none;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 0.98rem;
  font-weight: 300;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
}

.rsvp-form input::placeholder,
.rsvp-form textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

.rsvp-form input:focus,
.rsvp-form textarea:focus {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(212, 170, 122, 0.6);
  box-shadow: 0 0 0 3px rgba(184, 144, 90, 0.1);
}

.att-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.att-btn {
  padding: 14px 18px;
  border: 1px solid rgba(184, 144, 90, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f3ede4;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.92rem;
  font-weight: 300;
  transition: all 0.22s ease;
}

.att-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(212, 170, 122, 0.55);
}

.att-btn.on {
  background: rgba(184, 144, 90, 0.18);
  border-color: rgba(212, 170, 122, 0.65);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.rsvp-actions,
.gift-actions,
.loc-actions {
  display: flex;
  justify-content: center;
}

.rsvp-actions {
  margin-top: 8px;
}

.btn-gold {
  padding: 14px 30px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(180deg, #cda06c 0%, #b8905a 100%);
  color: #fff;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    filter 0.2s ease;
}

.btn-gold:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.rsvp-ok {
  text-align: center;
}

.rsvp-ok .ttl {
  margin-bottom: 10px;
}

#attending-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ===== GALLERIA ===== */

.gallery-shell {
  display: grid;
  gap: 24px;
}

.gallery-intro {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border-radius: 22px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}

.gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(8, 4, 2, 0.08) 0%, rgba(8, 4, 2, 0.7) 100%);
}

.gallery-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
}

.gallery-caption {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 1;
  padding: 20px 18px 18px;
}

.gallery-caption .lbl {
  margin-bottom: 8px;
}

.gallery-caption p {
  font-size: 0.92rem;
  line-height: 1.7;
  color: #f1e8db;
}

.gallery-note {
  text-align: center;
}

.gallery-note .sub:last-child,
.gallery-intro .sub:last-child {
  margin-bottom: 0;
}

/* ===== LOCATION ===== */

.loc-hero {
  margin-bottom: 24px;
  padding: 40px 34px;
  text-align: center;
}

.loc-kicker {
  margin-bottom: 10px;
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
}

.loc-name {
  margin-bottom: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem;
  color: #fff;
}

.loc-address {
  font-size: 0.95rem;
  line-height: 1.9;
  color: #e3d6c6;
}

.loc-actions {
  margin-top: 22px;
}

.loc-photo {
  margin: 22px 0 26px;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.loc-photo img {
  display: block;
  width: 100%;
  height: 380px;
  object-fit: cover;
}

.loc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 22px;
}

.loc-card {
  min-height: 220px;
}

.loc-ct {
  margin-bottom: 10px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  color: #fff;
}

.loc-tx {
  font-size: 0.92rem;
  line-height: 1.9;
  color: #d7c8b6;
}

.loc-note {
  text-align: center;
}

#p-location .loc-grid .loc-card {
  grid-column: 1 / -1;
}

/* ===== PER NOI ===== */

.gift-card {
  margin-top: 28px;
  padding: 22px 34px 22px;
  text-align: center;
}

.gift-text {
  margin-bottom: 28px;
  font-size: 0.98rem;
  line-height: 1.95;
  font-weight: 300;
  color: #e3d6c6;
}

.gift-box {
  margin-bottom: 16px;
  padding: 18px 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(184, 144, 90, 0.2);
  border-radius: 18px;
}

.gift-label {
  margin-bottom: 8px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}

.gift-value {
  font-size: 1rem;
  line-height: 1.7;
  color: #fff;
}

.gift-iban {
  margin-bottom: 18px;
  font-size: 1.08rem;
  line-height: 1.8;
  letter-spacing: 0.08em;
  word-break: break-word;
  color: #fff;
}

.gift-actions {
  margin-top: 22px;
}

.gift-card .gift-text {
  margin-bottom: 0;
}

/* ===== ANIMATIONS ===== */

@keyframes fu {
  from {
    opacity: 0;
    transform: translateY(18px);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

/* ===== RESPONSIVE ===== */

@media (max-width: 900px) and (orientation: landscape) {
  #p-home.on {
    height: auto;
    min-height: 100dvh;
    padding: 72px 0 28px;
    justify-content: center;
  }

  .home-body {
    padding-top: 10px;
  }

  .h-ey {
    margin-bottom: 8px;
  }

  .h-t {
    margin-bottom: 8px;
    line-height: 1;
  }

  .h-div {
    margin: 6px 0;
  }

  .h-names {
    margin: 8px 0 4px;
  }

  .h-date {
    margin-bottom: 10px;
  }

  .cd-title {
    margin: 10px 0 8px;
  }

  .h-cd {
    padding-bottom: 8px;
  }
}

@media (max-width: 768px) {
  .tabs {
    gap: 0;
    flex-wrap: nowrap;
  }

  .tabs a {
    padding: 6px 8px;
    letter-spacing: 0.06em;
  }

  #p-dettagli .sub {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
  }

  .gallery-grid {
    grid-template-columns: 1fr 1fr;
  }

  #p-galleria {
    padding-top: 150px;
  }

  .gallery-shell {
    gap: 18px;
  }

  .gallery-item {
    min-height: 280px;
  }

  .gallery-caption {
    padding: 18px 16px 16px;
  }

  .gallery-caption p {
    font-size: 0.87rem;
    line-height: 1.6;
  }
}

@media (max-width: 580px) {
  nav {
    height: 80px;
    padding: 0 12px;
    align-items: center;
  }

  .logo {
    height: 100%;
    align-items: center;
    white-space: nowrap;
    font-size: 0.85rem;
  }

  .logo img {
    width: auto;
    height: 96px;
  }

  .tabs a {
    padding: 5px 8px;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
  }

  .page {
    padding: 80px 14px 48px;
  }

  #p-dettagli,
  #p-galleria,
  #p-location,
  #p-rsvp,
  #p-pernoi {
    padding-top: 120px;
  }

  .d-grid,
  .gallery-grid,
  .loc-grid,
  .f-split,
  .att-row {
    grid-template-columns: 1fr;
  }

  .home-body {
    padding: 70px 16px 16px;
  }

  .h-ey {
    margin-bottom: 10px;
    font-size: 0.68rem;
    letter-spacing: 0.15em;
    white-space: nowrap;
  }

  .h-t {
    font-size: clamp(2.8rem, 16vw, 4.5rem);
  }

  .h-div {
    margin: 10px auto;
  }

  .h-names {
    font-size: clamp(1.2rem, 5.5vw, 1.8rem);
  }

  .h-date {
    margin-top: 8px;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
  }

  .h-cd {
    gap: 8px;
    padding: 16px 12px 20px;
  }

  .cd-n {
    font-size: 1.4rem;
  }

  .cd-l {
    margin-top: 3px;
    font-size: 0.44rem;
  }

  .cd-dot {
    display: none;
  }

  .rsvp-card {
    padding: 26px 18px;
  }

  .f-row label {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
  }

  .rsvp-form input,
  .rsvp-form textarea,
  .att-btn {
    font-size: 0.95rem;
  }

  .btn-gold {
    width: 100%;
    padding: 14px 20px;
    letter-spacing: 0.14em;
  }

  .loc-photo img {
    height: 260px;
  }

  .gallery-item {
    min-height: 0;
    aspect-ratio: 4 / 5;
    border-radius: 18px;
  }

  .gallery-shell {
    gap: 14px;
  }

  .gallery-intro {
    padding: 0 6px;
  }

  .gallery-caption {
    padding: 16px 14px 14px;
  }

  .gallery-caption .lbl {
    margin-bottom: 6px;
    font-size: 0.62rem;
    letter-spacing: 0.18em;
  }

  .gallery-caption p {
    font-size: 0.82rem;
    line-height: 1.55;
  }

  .gallery-note {
    padding: 22px 16px;
  }

  .gift-card {
    margin-top: 28px;
    padding: 28px 18px;
  }

  .gift-text {
    font-size: 0.93rem;
    line-height: 1.85;
  }

  .gift-iban {
    margin-bottom: 18px;
    font-size: 0.93rem;
    letter-spacing: 0.02em;
  }
}
