/* ============================================
   Invito Matrimonio - Stili Busta
   ============================================ */

@font-face {
  font-family: "Didot";
  src: url("../fonts/Didot.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: "Didot";
  src: url("../fonts/Didot Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: "Didot";
  src: url("../fonts/Didot Italic.otf") format("opentype");
  font-weight: 400;
  font-style: italic;
}

@font-face {
  font-family: "Didot";
  src: url("../fonts/Didot Title.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  font-family: "Didot", Georgia, serif;
  font-weight: bold;
  background: #f7f3e8;
}

/* Blocca scroll finché l’intro video è visibile o in dissolvenza */
body.scroll-locked {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
}

/* Intro video - fullscreen, parte al click */
.video-intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f7f3e8;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity 1s linear;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.video-intro.is-hidden {
  pointer-events: none;
  opacity: 0;
}

.video-intro__player {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-object-fit: cover;
  object-position: center;
  -webkit-object-position: center;
  pointer-events: none;
}

/* Contenuto principale */
.main-content {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: calc(1.5rem + env(safe-area-inset-top, 0)) calc(1.5rem + env(safe-area-inset-right, 0)) calc(1.5rem + env(safe-area-inset-bottom, 0)) calc(1.5rem + env(safe-area-inset-left, 0));
  padding-top: calc(2rem + env(safe-area-inset-top, 0));
  background: #f7f3e8;
  color: #83756d;
  z-index: 0;
}

/* Row con immagine - mobile first */
.main-content .row {
  width: 100%;
  padding: 0;
}

.main-content .row img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.main-content .row--tavola {
  padding-top: 3rem;
}

.main-content .row--tavola img {
  width: 92%;
  max-width: 92%;
  margin: 0 auto;
  display: block;
}

.main-content .row--ninni {
  margin-top: 0;
  margin-bottom: 0;
}

.main-content .row--ninni img {
  width: 35%;
  max-width: 35%;
  margin: 0 auto;
  display: block;
}

.main-content .row--names {
  text-align: center;
  padding: 2.5rem 1rem;
}

.names {
  margin: 0;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(2rem, 9vw, 2.75rem);
  font-weight: 400;
  color: #83756d;
}

.names__amp {
  color: #ff9494;
}

.main-content .row--star {
  text-align: center;
  padding: 3rem 0 1rem 0;
  margin-top: 1.5rem;
}

.star {
  display: block;
  width: 1.4rem;
  height: auto;
  max-width: 1.4rem;
  margin: 0 auto;
}

.main-content .row--location {
  text-align: center;
  padding: 0 1rem 1.5rem;
}

.main-content .row--rsvp {
  text-align: center;
  padding: 1.5rem 1rem;
}

.main-content .row--countdown {
  text-align: center;
  padding: 1.5rem 1rem;
}

.countdown-text {
  margin: 0 auto;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.2rem, 4.5vw, 1.5rem);
  font-weight: 400;
  color: #83756d;
  text-align: center;
}

/* Countdown */
.countdown {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  padding: 0 0 2rem;
  width: 100%;
  max-width: 340px;
  margin: 0 auto;
  box-sizing: border-box;
}

.countdown__item {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.countdown__value {
  width: 100%;
  padding: 0.65rem 0.5rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.75rem, 6vw, 2.25rem);
  font-weight: 400;
  color: #83756d;
  line-height: 1.2;
  text-align: center;
  background: #ebe7df;
  border: 1px solid rgba(131, 117, 109, 0.3);
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(131, 117, 109, 0.08);
}

.countdown__label {
  margin-top: 0.5rem;
  font-family: "Didot", Georgia, serif;
  font-size: 0.9rem;
  color: rgba(131, 117, 109, 0.85);
}

.rsvp-text {
  margin: 0 auto;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  font-weight: 400;
  color: #83756d;
  line-height: 1.5;
  text-align: center;
}

/* RSVP Form */
.rsvp-form-wrapper {
  width: 100%;
  max-width: 340px;
  margin: 0 auto 2rem;
  padding: 0;
}

.rsvp-form__field--hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.form-feedback {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-family: "Didot", Georgia, serif;
  font-size: 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-feedback.is-hidden {
  display: none;
}

.form-feedback__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 1.1rem;
  font-weight: bold;
  color: #2d8a2d;
  background: rgba(45, 138, 45, 0.15);
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-feedback__icon--visible {
  opacity: 1;
  transform: scale(1);
  animation: form-feedback-tick 0.5s ease-out;
}

@keyframes form-feedback-tick {
  0% { transform: scale(0.5); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.form-feedback--success {
  background: rgba(131, 117, 109, 0.15);
  color: #83756d;
  border: 1px solid rgba(131, 117, 109, 0.3);
}

.form-feedback--error {
  background: rgba(255, 100, 100, 0.1);
  color: #b33;
  border: 1px solid rgba(255, 100, 100, 0.3);
}

.form-feedback--error .form-feedback__icon {
  display: none;
}

.rsvp-form {
  background: #fff;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(131, 117, 109, 0.12);
}

.rsvp-form__field {
  margin-bottom: 1.25rem;
}

.rsvp-form__field:last-of-type {
  margin-bottom: 1rem;
}

.rsvp-form__field label,
.rsvp-form__field legend {
  display: block;
  margin-bottom: 0.35rem;
  font-family: "Didot", Georgia, serif;
  font-size: 1rem;
  color: #83756d;
}

.rsvp-form__fieldset {
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
}

.rsvp-form__fieldset legend {
  margin-bottom: 0.5rem;
}

.rsvp-form__fieldset--inline {
  display: flex;
  flex-wrap: wrap;
}

.rsvp-form__fieldset--inline legend {
  flex-basis: 100%;
}

.rsvp-form__fieldset--inline .rsvp-form__radio-label {
  margin-right: 1.5rem;
  margin-bottom: 0;
}

.rsvp-form__subtitle {
  margin: 0 0 0.6rem;
  font-family: "Didot", Georgia, serif;
  font-size: 0.9rem;
  color: rgba(131, 117, 109, 0.85);
  font-style: italic;
}

.rsvp-form__field input[type="text"],
.rsvp-form__field input[type="email"],
.rsvp-form__field input[type="number"],
.rsvp-form__field textarea {
  width: 100%;
  padding: 0.65rem 0.8rem;
  font-family: "Didot", Georgia, serif;
  font-size: 1.05rem;
  color: #83756d;
  background: #fdfbf8;
  border: 1px solid rgba(131, 117, 109, 0.2);
  border-radius: 4px;
  box-sizing: border-box;
}

.rsvp-form__field input::placeholder,
.rsvp-form__field textarea::placeholder {
  color: rgba(131, 117, 109, 0.5);
}

.rsvp-form__field textarea {
  resize: vertical;
  min-height: 80px;
}

.rsvp-form__radio-label,
.rsvp-form__checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.4rem;
  font-family: "Didot", Georgia, serif;
  font-size: 1rem;
  color: #83756d;
  cursor: pointer;
}

.rsvp-form__radio-label input,
.rsvp-form__checkbox-label input {
  width: 1rem;
  height: 1rem;
  accent-color: #83756d;
}

.rsvp-form__field--conditional.is-hidden {
  display: none;
}

.rsvp-form__submit {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-top: 0.5rem;
  font-family: "Didot", Georgia, serif;
  font-size: 1rem;
  letter-spacing: 0.15em;
  color: #fff;
  background: #ff9494;
  border: 1px solid #ff9494;
  cursor: pointer;
  text-transform: uppercase;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.rsvp-form__submit:hover {
  background: #f08080;
  color: #fff;
  border-color: #f08080;
}

.location-text {
  margin: 0;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.5rem, 6vw, 1.9rem);
  font-weight: 400;
  color: #83756d;
}

/* Location card - sezione a sfondo bianco, più stretta */
.location-card {
  width: 100%;
  max-width: 340px;
  margin: 0 auto 2rem;
  padding: 0;
  background: #fff;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(131, 117, 109, 0.12);
}

.location-card__photo {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
}

.location-card__pin {
  display: block;
  width: 1.4rem;
  height: auto;
  margin: 1rem auto 0.25rem;
}

.location-card__title {
  margin: 0 1rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  font-weight: 400;
  color: #83756d;
  text-align: center;
}

.location-card__place {
  margin: 0.1rem 1rem 0.75rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.25rem, 5vw, 1.5rem);
  color: #83756d;
  text-align: center;
}

.location-card__time {
  margin: 0 1rem 1rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  color: #83756d;
  opacity: 0.9;
  text-align: center;
}

.location-card__map {
  width: 92%;
  max-width: 92%;
  margin: 0 auto;
  height: 200px;
  overflow: hidden;
}

.location-card__map iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.location-card__actions {
  display: flex;
  gap: 0.75rem;
  padding: 1rem;
}

.location-card__btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  font-family: "Didot", Georgia, serif;
  font-size: 0.9rem;
  color: #83756d;
  background: transparent;
  border: 1px solid #ddc8ce;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.location-card__btn-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.location-card__btn-icon svg {
  display: block;
}

.location-card__btn:hover {
  background: rgba(131, 117, 109, 0.08);
  color: #83756d;
  border-color: rgba(131, 117, 109, 0.4);
}

/* Gift section - sfondo marrone come save the date */
.gift-section {
  width: 100vw;
  max-width: 100vw;
  margin-top: 4.5rem;
  margin-bottom: 4.5rem;
  margin-left: calc(-1.5rem - env(safe-area-inset-left, 0));
  margin-right: calc(-1.5rem - env(safe-area-inset-right, 0));
}

.gift-section__inner {
  width: 100%;
  box-sizing: border-box;
  background: #83756d;
  padding: 2rem calc(1.5rem + env(safe-area-inset-right, 0)) 2rem calc(1.5rem + env(safe-area-inset-left, 0));
  text-align: center;
}

.gift-section__intro {
  margin: 0 0 0.5rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.2rem, 4.5vw, 1.5rem);
  font-weight: 400;
  color: #f7f3e8;
}

.gift-section__sub {
  margin: 0 0 1.25rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.1rem, 4vw, 1.35rem);
  color: #ff9494;
}

.gift-section__btn {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #83756d;
  background: #f7f3e8;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background 0.2s, color 0.2s;
}

.gift-section__btn:hover {
  background: #ff9494;
  color: #fff;
}

/* Popup regalo */
.gift-popup {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gift-popup.is-open {
  opacity: 1;
  visibility: visible;
}

.gift-popup.is-open .gift-popup__content {
  transform: scale(1);
  opacity: 1;
}

.gift-popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s ease;
}

.gift-popup__content {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 2rem;
  padding-top: 2.5rem;
  background: #f7f3e8;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.gift-popup__close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1.5rem;
  line-height: 1;
  color: #000;
  background: none;
  border: none;
  cursor: pointer;
}

.gift-popup__names {
  margin: 0 0 1rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #000;
  text-align: center;
}

.gift-popup__title {
  margin: 0 0 0.25rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-weight: 400;
  color: #000;
}

.gift-popup__iban {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 400;
  color: #000;
  letter-spacing: 0.05em;
  word-break: break-all;
}

/* Save the date - banner a tutta larghezza */
.save-the-date {
  width: 100vw;
  max-width: 100vw;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: calc(-1.5rem - env(safe-area-inset-left, 0));
  margin-right: calc(-1.5rem - env(safe-area-inset-right, 0));
}

.save-the-date__inner {
  width: 100%;
  box-sizing: border-box;
  background: #83756d;
  padding: 1.2rem calc(1.5rem + env(safe-area-inset-right, 0)) 1.2rem calc(1.5rem + env(safe-area-inset-left, 0));
  text-align: center;
}

.save-the-date__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 0 0 0.6rem;
  width: calc(100% + 3rem + env(safe-area-inset-left, 0) + env(safe-area-inset-right, 0));
  margin-left: calc(-1.5rem - env(safe-area-inset-left, 0));
  padding-left: calc(1.5rem + env(safe-area-inset-left, 0));
  padding-right: calc(1.5rem + env(safe-area-inset-right, 0));
  box-sizing: border-box;
}

.save-the-date__line {
  flex: 1;
  min-width: 0;
  height: 1px;
  background: #ff9494;
}

.save-the-date__text {
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.1rem, 4.5vw, 1.35rem);
  letter-spacing: 0.2em;
  color: #e6e3df;
  text-transform: uppercase;
  white-space: nowrap;
}

.save-the-date__date {
  margin: 0;
  font-family: "Didot", Georgia, serif;
  font-size: clamp(1.75rem, 7vw, 2.25rem);
  font-weight: 400;
  color: #ff9494;
}

/* Footer - full width e arriva fino al bordo inferiore (mobile) */
.site-footer {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: calc(100% + 3rem + env(safe-area-inset-left, 0) + env(safe-area-inset-right, 0));
  margin-left: calc(-1.5rem - env(safe-area-inset-left, 0));
  margin-right: calc(-1.5rem - env(safe-area-inset-right, 0));
  margin-bottom: calc(-1.5rem - env(safe-area-inset-bottom, 0));
  padding: 1.5rem calc(1.5rem + env(safe-area-inset-right, 0)) calc(1.5rem + env(safe-area-inset-bottom, 0)) calc(1.5rem + env(safe-area-inset-left, 0));
  background: #83756d;
}

.site-footer__center {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.site-footer__names {
  display: block;
  max-width: 175px;
  height: auto;
}

.site-footer__date {
  margin: 0.5rem 0 0;
  font-family: "Didot", Georgia, serif;
  font-size: 1.25rem;
  color: #ff9494;
}

.site-footer__palla {
  position: absolute;
  top: 0;
  right: calc(0.75rem + env(safe-area-inset-right, 0));
  display: block;
  max-width: 65px;
  height: auto;
}

/* Stelle decorative nel footer */
.site-footer__star {
  position: absolute;
  display: block;
  height: auto;
  pointer-events: none;
}

.site-footer__star--1 {
  left: calc(1.75rem + env(safe-area-inset-left, 0));
  bottom: 1.5rem;
  width: 70px;
}

.site-footer__star--2 {
  left: calc(1.5rem + env(safe-area-inset-left, 0));
  top: 1.5rem;
  width: 18px;
}

.site-footer__star--3 {
  right: calc(4rem + env(safe-area-inset-right, 0));
  bottom: 2rem;
  width: 20px;
}

.site-footer__star--4 {
  right: calc(0.5rem + env(safe-area-inset-right, 0));
  top: 1.75rem;
  width: 20px;
}

/* ============================================
   Desktop - Effetto cartolina
   Solo per viewport desktop, mobile invariato
   ============================================ */
@media (min-width: 768px) {
  body {
    background: #fff;
  }

  .main-content {
    max-width: 720px;
    margin: 2rem auto;
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  }

  /* Save the date e gift section: restano al bordo della cartolina, non sbordano */
  .save-the-date,
  .gift-section {
    width: calc(100% + 3rem + env(safe-area-inset-left, 0) + env(safe-area-inset-right, 0));
    max-width: none;
    margin-left: calc(-1.5rem - env(safe-area-inset-left, 0));
    margin-right: calc(-1.5rem - env(safe-area-inset-right, 0));
  }

  /* Footer: full width e arriva fino al bordo inferiore della cartolina */
  .site-footer {
    width: calc(100% + 3rem + env(safe-area-inset-left, 0) + env(safe-area-inset-right, 0));
    margin-left: calc(-1.5rem - env(safe-area-inset-left, 0));
    margin-right: calc(-1.5rem - env(safe-area-inset-right, 0));
    margin-bottom: -2.5rem;
  }

  /* Location card e form: più grandi per occupare più spazio nella cartolina */
  .location-card {
    max-width: 600px;
  }

  .location-card__map {
    height: 320px;
  }

  .rsvp-form-wrapper {
    max-width: 600px;
  }

  .rsvp-form {
    padding: 2rem;
  }
}
