@font-face {
  font-family: "Limoncello Recipe";
  src:
    url("../fonts/limoncello_recipe/limoncello_recipe.woff2") format("woff2"),
    url("../fonts/limoncello_recipe/limoncello_recipe.woff") format("woff"),
    url("../fonts/limoncello_recipe/limoncello_recipe.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Scratchy";
  src:
    url("../fonts/scratchy/scratchy_regular_400.woff2") format("woff2"),
    url("../fonts/scratchy/scratchy_regular_400.woff") format("woff"),
    url("../fonts/scratchy/scratchy_regular_400.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #2d4530;
  --accent: #8b3a2b;
  --shadow: rgba(0, 0, 0, 0.12);
  --paper: #e5e0da;

  --font-menu: "Poppins", Arial, sans-serif;
  --font-names: "Limoncello Recipe", Arial, sans-serif;
  --font-default: "Scratchy", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-default);
  color: var(--ink);
  background-image:
    linear-gradient(rgba(255,255,255,0.5), rgba(255,255,255,0.5)),
    url("../images/background.jpeg");
  background-repeat: repeat;
  background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }

/* Header and navigation */
.site-header {
  position: relative;
  background: transparent;
  padding: 22px 0;
}

.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 36px;
  max-width: 1200px;
  margin: 0 auto;

  font-family: var(--font-menu);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.site-nav a {
  text-decoration: none;
  padding: 4px 2px;
  transition: color 0.2s ease;
}

.site-nav a:hover { color: var(--accent); }
.site-nav a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ===========================
   SECTIONS / TITLES
   =========================== */
.section {
  padding: 18px 16px;
  max-width: 1080px;
  margin: 0 auto;
}

/* Titles: 2x current (30 -> 60) */
.section-title {
  font-family: var(--font-default);
  font-size: 60px;
  letter-spacing: 0.05em;
  text-align: center;
  margin: 22px 0 14px;
}

/* ===========================
   INTRO / HERO TYPOGRAPHY
   =========================== */
.intro-wrap {
  text-align: center;
  margin-top: 8px;
}

.names {
  font-family: var(--font-names);
  color: #620d0a;
  font-size: 40px;
  line-height: 1.1;
}

.date {
  margin-top: 18px;
  font-family: var(--font-default);
  color: #2d4530;
  font-size: 45px;
  text-align: center;
}

.place {
  margin-top: 10px;
  font-family: var(--font-default);
  color: #2d4530;
  font-size: 39px;
  text-align: center;
}

.phrase {
  margin-top: 12px;
  text-align: center;
  font-size: 24px;
}

/* Car illustration and caption */
.hero-illustration {
  display: grid;
  place-items: center;
  margin-top: 10px;
}

.hero-illustration img {
  width: min(760px, 92vw);
  height: auto;
}

.car-and-caption {
  display: grid;
  place-items: center;
  gap: 6px;
  margin-top: 18px;
}

.car-and-caption img {
  width: min(320px, 70vw);
  height: auto;
}

.car-and-caption .caption {
  font-family: var(--font-default);
  font-size: 14px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* Countdown: 1.5x */
.countdown {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin-top: 14px;
}

.time-unit {
  text-align: center;
  min-width: 64px;
}

/* Countdown numbers and labels */
.count-number {
  font-size: 33px; /* 22 * 1.5 */
  color: var(--accent);
}

.count-label {
  font-size: 18px; /* 12 * 1.5 */
  letter-spacing: 0.12em;
}

/* Photobooth strip */
.photo-strip {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  margin-top: 26px;
  flex-wrap: wrap;
  column-gap: 14px;
  row-gap: 0px;
  margin-bottom: -10px;
}

.photo {
  background: #fff;
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 8px 16px var(--shadow);
  width: 160px;
  margin-bottom: -10px;
}

.p1 { transform: rotate(-4deg); margin-top: 16px; }
.p2 { transform: rotate( 5deg); margin-top:  0px; }
.p3 { transform: rotate(-5deg); margin-top: 12px; }
.p4 { transform: rotate( 6deg); margin-top:  2px; }
.p5 { transform: rotate(-6deg); margin-top: 10px; }

/* ===========================
   FLIP CARDS
   - Desktop: hover
   - Touch: click (JS toggles .is-flipped)
   =========================== */
.cards-row {
  display: flex;
  justify-content: center;
  gap: 28px;
  flex-wrap: wrap;
}

/* Flip cards (touch-friendly) */
.flip-card {
  width: min(360px, 92vw);
  perspective: 1200px;
}

.flip-inner {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 600ms ease;
}

.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}

/* Hide the front face when the card is flipped (Firefox fix).
   Firefox sometimes shows the front face reversed even when rotated. By
   reducing the opacity and disabling pointer-events on the front we ensure
   the back face is visible and interactive across browsers. */
.flip-card.is-flipped .flip-front {
  opacity: 0;
  pointer-events: none;
}

/* And also hide the front on hover for devices that support hover */
@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .flip-front {
    opacity: 0;
    pointer-events: none;
  }
}

/* The link area on the back of itinerary cards should only be clickable
   when the card is flipped (or hovered on non-touch devices).  It
   overlays the lower portion of the back face where the SVG text
   "Ir a la ubicación" appears. */
.back-link {
  position: absolute;
  inset: auto 0% 18% 0%;
  width: min(600px, 33.333%);
  height: 20px;
  margin: 0 auto;

  z-index: 20;
  display: block;
  background: transparent;

  pointer-events: none;
}
.flip-card.is-flipped .back-link {
  pointer-events: auto;
}
@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .back-link {
    pointer-events: auto;
  }
}

.flip-face {
  position: relative;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 10px 20px var(--shadow);
}

.flip-face img {
  display: block;
  width: 100%;
  height: auto;
}

.flip-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
  /* Ensure stacking context for overlay */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Front overlay inside the back of flip cards */
.front-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* Re-stack content of flip-back over the overlay */
.flip-back >  img:not(.front-overlay):not(.front-watermark) {
  position: relative;
  z-index: 1;
}

.card-link {
  position: absolute;
  inset: 0;
}

/* Hover flip on devices that actually hover */
@media (hover: hover) and (pointer: fine) {
  .flip-card:hover .flip-inner { transform: rotateY(180deg); }
}

/* Touch devices: don’t let the front full-card link steal the tap */
@media (hover: none), (pointer: coarse) {
  .card-link { pointer-events: none; }
}

/* Itinerary day title */

.day-title {
  text-align: center;
  margin: 26px 0 14px;
  font-family: var(--font-default);
  font-size: 24px; /* 16 * 1.5 */
  letter-spacing: 0.20em;
}

/* Dress code */
.section-dresscode .section-title { margin-bottom: 18px; }

.dress-grid {
  width: min(980px, 96vw);
  margin: 0 auto;

  display: grid;
  grid-template-columns: 1fr 0.5fr 0.5fr;
  grid-template-rows: auto auto;
  gap: 20px;

  align-items: stretch;
  justify-items: center;
}

.dress-cell {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 140px;
}

/* Cup spans both rows (merged square area) */
.dress-cup--merged {
  grid-column: 1 / 2;
  grid-row: 1 / 3;
}

.dress-cup--merged img {
  width: min(260px, 80%);
  height: auto;
}

/* Text spans top-right area */
.dress-text {
  grid-column: 2 / 4;
  grid-row: 1 / 2;
  text-align: center;

  font-family: var(--font-menu);
  color: var(--ink);
}

.dress-main {
  margin-top: 10px;
  font-size: 18px;
  letter-spacing: 0.10em;
}

.dress-strong { font-weight: 700; }

.dress-sides {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: start;
}

.dress-gender {
  font-weight: 600;
  letter-spacing: 0.10em;
}

.dress-link {
  display: inline-block;
  margin-top: 6px;
  text-decoration: none;
  font-size: 12px;
  letter-spacing: 0.12em;
}

.dress-link:hover { text-decoration: underline; }

/* Dance spans bottom-right */
.dress-dance {
  grid-column: 2 / 4;
  grid-row: 2 / 3;
}

.dress-dance img {
  width: min(440px, 90%);
  height: auto;
}

/* Recommendations */
.section-recomendaciones { margin-bottom: 70px; }

.flip-back--solid {
  background: var(--paper);
  padding: 0;
}

.flip-card--recommendation {
  width: min(570px, 92vw);
}

.rec-grid {
  width: 100%;
  height: 100%;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
}

.flip-card--recommendation .flip-back {
  display: block;
  padding: 0;
}

.front-watermark{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}

.flip-back > img:not(.front-overlay):not(.front-watermark){
  position: relative;
  z-index: 1;
}

/* Ensure the recommendation content panel is above the watermark */
.flip-card--recommendation .rec-grid{
  position: absolute;
  inset: 0;
  z-index: 2;
}

.rec-row {
  display: grid;
  gap: 14px;
  align-items: center;
}
.rec-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rec-row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.rec-item {
  text-align: center;
  font-family: var(--font-menu);
  font-size: 13px;
  line-height: 1.2;
}

.rec-name {
  display: block;
  margin-bottom: 8px;
}

.rec-link {
  font-family: var(--font-menu);
  display: inline;
  padding: 0;
  margin-top: 0;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-decoration: underline;
}

@media (min-width: 1200px) {
  .cards-row--triple {
    flex-wrap: nowrap;
    align-items: stretch;
  }
}

@media (max-width: 1199px) {
  .cards-row--triple { flex-wrap: wrap; }
}

/* Gift table */
.gift-wrap {
  position: relative;
  display: grid;
  place-items: center;
}

.gift-wrap img {
  width: min(576px, 78vw);
  height: auto;
}

.gift-link { position: absolute; }
.gift-link--amazon { left: 30%; top: 40%; width: 40%; height: 14%; }
.gift-link--zepika { left: 30%; top: 58%; width: 40%; height: 14%; }

/* Closing illustration */
.section-illustration {
  display: grid;
  place-items: center;
  margin-top: 40px;
}

.section-illustration .closing-svg {
  width: min(760px, 92vw);
  height: auto;
}

/* RSVP */
.form-frame-wrapper {
  position: relative;
  width: min(560px, 94vw);
  margin: 0 auto;
  display: grid;
  place-items: center;
}

/* frame 1.2x */
.form-frame-img {
  width: 100%;
  height: auto;
  transform: scale(1.2);
  transform-origin: center;
}

.rsvp-form {
  position: absolute;
  top: 24%;
  left: 14%;
  right: 14%;
  bottom: 18%;

  display: grid;
  gap: 12px;
  justify-items: center;
}

/* Inputs/button*/
.rsvp-input {
  width: min(340px, 70vw);
  height: 36px;
  padding: 0 8px;
  line-height: 36px;
  border: 1px solid rgba(45, 69, 48, 0.25);
  background: rgba(255,255,255,0.3);
  text-align: center;
  font-family: var(--font-menu);
  font-size: 14px;
}

.rsvp-button {
  height: 27px;
  padding: 0px 12px;
  line-height: 27px;
  border: 0;
  cursor: pointer;
  background: rgba(45, 69, 48, 0.90);
  color: #fff;
  text-align: center;
  font-family: var(--font-menu);
  font-size: 14px;
  letter-spacing: 0.10em;
}

.form-response {
  margin-top: 12px;
  text-align: center;
  font-size: 20px;
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .site-nav { gap: 22px; }
}

@media (max-width: 640px) {
  .names { font-size: 36px; }
  .date  { font-size: 36px; }
  .place { font-size: 30px; }
  .phrase { font-size: 20px; }

  .count-number { font-size: 28px; }
  .count-label { font-size: 14px; }

  .photo { width: 150px; }

  .dress-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }

  .dress-cup--merged { grid-column: auto; grid-row: auto; }
  .dress-text { grid-column: auto; grid-row: auto; }
  .dress-dance { grid-column: auto; grid-row: auto; }

  .rec-row { gap: 10px; }

  .rec-item {
    font-size: 11px;
    line-height: 1.15;
  }

  .rec-name { margin-bottom: 6px; }

  .rec-link {
    font-size: 10px;
    letter-spacing: 0.10em;
  }
}
