/* Wedding invitation — horizontal swipe slides + bottom nav */

:root {
  --bg: #faf8f5;
  --ink: #2a2622;
  --muted: #5c5650;
  --accent: #7d6b5a;
  --line: #e5dfd6;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Outfit", system-ui, sans-serif;
  --nav-h: 3.65rem;
  --page-max: 32rem;
  --pad-x: max(1.25rem, env(safe-area-inset-left, 0px));
  --pad-x-end: max(1.25rem, env(safe-area-inset-right, 0px));
  --pad-section-top: clamp(1rem, 4vw, 1.75rem);
  --pad-section-bottom: clamp(1.5rem, 5vw, 2.25rem);
  --gap-block: clamp(1rem, 3vw, 1.5rem);
  --page-footer-art-h: 118px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.6;
  overflow: hidden;
}

/* ----- Horizontal swiper (swipe left/right) ----- */
.swiper-viewport {
  position: fixed;
  top: env(safe-area-inset-top);
  left: 0;
  right: 0;
  /* Flush to nav: bar already includes safe-area in its padding; don't add safe-area twice (that caused a gap / wrong layer under the slides). */
  bottom: calc(var(--nav-h) + 1px);
  display: flex;
  flex-flow: row nowrap;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  outline: none;
  z-index: 0;
}

.swiper-viewport::-webkit-scrollbar {
  display: none;
}

.swiper-slide {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  min-height: 100%;
  height: 100%;
  align-self: stretch;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Shared art — all slides except fullscreen hero (beranda) */
.swiper-slide:not(.swiper-slide--hero) {
  background-image: url("pages/Background.jpg");
  background-size: cover;
  /* Push art a bit lower so the empty olive strip is hidden by footer/nav */
  background-position: center calc(100% + 40px);
  background-repeat: no-repeat;
}

.slide-cat-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
  height: calc(var(--page-footer-art-h) + 48px);
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}

.slide-cat {
  position: absolute;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0.96;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.08));
}

.slide-cat--puyou {
  transform-origin: center bottom;
  animation-name: catWiggle;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.slide-cat--leona {
  animation-name: catWalk;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
  animation-direction: normal;
  --walk-x: 28px;
}

/* Visual lanes for Leona (debuggable + stable across reloads) */
.slide-cat--leona.slide-cat--lane-lower { z-index: 1; }
.slide-cat--leona.slide-cat--lane-middle { z-index: 2; }
.slide-cat--leona.slide-cat--lane-upper { z-index: 3; }

@keyframes catWiggle {
  0% {
    transform: rotate(-2.3deg) translateY(0);
  }
  50% {
    transform: rotate(0.8deg) translateY(-1px);
  }
  100% {
    transform: rotate(2.3deg) translateY(0);
  }
}

@keyframes catWalk {
  0% {
    transform: translateX(0) scaleX(1);
  }
  100% {
    transform: translateX(calc(-1 * var(--walk-x))) scaleX(1);
  }
}

.swiper-slide-inner {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--page-max);
  margin-inline: auto;
  padding: var(--pad-section-top) var(--pad-x-end) var(--pad-section-bottom)
    var(--pad-x);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: var(--gap-block);
  position: relative;
  z-index: 2;
}

/* Non-hero slides: reserve space for decorative footer art and center content vertically */
.swiper-slide:not(.swiper-slide--hero) .swiper-slide-inner {
  min-height: calc(100% - var(--page-footer-art-h));
  justify-content: center;
  padding-bottom: max(var(--pad-section-bottom), var(--page-footer-art-h));
}

/* Slides pendek — konten di tengah secara vertikal */
.swiper-slide--quote .swiper-slide-inner,
.swiper-slide--event .swiper-slide-inner,
.swiper-slide--footer .swiper-slide-inner {
  justify-content: center;
  min-height: 100%;
}

/* Slide beranda — gambar full area, tanpa inset max-width */
.swiper-slide--hero .swiper-slide-inner {
  justify-content: stretch;
  align-items: stretch;
  padding: 0;
  max-width: none;
  width: 100%;
  gap: 0;
  min-height: 100%;
}

/* Slides panjang — mulai atas, ada ruang bawah untuk scroll nyaman */
.swiper-slide--scroll .swiper-slide-inner {
  justify-content: center;
  padding-top: max(var(--pad-section-top), env(safe-area-inset-top, 0px));
}

/* ----- Bottom sticky menu ----- */
.section-nav-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  justify-content: flex-start;
  align-items: center;
  min-height: var(--nav-h);
  padding: 0.35rem calc(0.5rem + env(safe-area-inset-right)) calc(0.5rem + env(safe-area-inset-bottom)) calc(0.5rem + env(safe-area-inset-left));
  background: rgba(250, 248, 245, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.section-nav-bottom::-webkit-scrollbar {
  display: none;
}

.bgm-toggle {
  position: fixed;
  right: max(0.8rem, env(safe-area-inset-right));
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 0.65rem);
  z-index: 260;
  border: 1px solid rgba(47, 63, 91, 0.28);
  background: rgba(250, 248, 245, 0.92);
  color: #1f2f4a;
  border-radius: 999px;
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1;
  text-transform: none;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.bgm-toggle.is-off {
  color: #5b6472;
  background: rgba(240, 238, 235, 0.88);
}

.nav-item {
  flex: 0 0 auto;
  appearance: none;
  border: none;
  background: transparent;
  font-family: var(--sans);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0.45rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.nav-item.is-active {
  color: var(--ink);
  background: rgba(125, 107, 90, 0.15);
}

.nav-item:hover {
  color: var(--accent);
}

/* ----- Hero (first slide) — fullscreen foto + overlay teks ----- */
.invite-hero--fullscreen {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  text-align: center;
}

.hero-media {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 100%;
  overflow: hidden;
}

.hero-media .hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-overlay {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-overlay--guest {
  bottom: 0;
  padding-top: 4rem;
  padding-right: max(1.25rem, env(safe-area-inset-right, 0px));
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: max(1.25rem, env(safe-area-inset-left, 0px));
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.5) 0%,
    transparent 100%
  );
}

.hero-guest {
  font-size: 0.82rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.95);
  text-align: center;
  line-height: 1.45;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.hero-guest span {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.25rem;
  color: rgba(255, 255, 255, 0.88);
}

.hero-guest strong {
  font-family: var(--serif);
  font-size: clamp(1rem, 3.8vw, 1.22rem);
  font-weight: 600;
  color: #fff;
}

/* Quote — hanya judul (QS) tebal & rata tengah */
.quote-ref {
  font-family: var(--sans);
  text-align: center;
  font-size: clamp(0.94rem, 2.8vw, 1.12rem);
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #4a5a73;
  margin: 0 0 1.35rem;
  flex-shrink: 0;
}

.quote-text {
  font-family: "Lora", Georgia, serif;
  font-size: clamp(1rem, 2.9vw, 1.13rem);
  font-weight: 500;
  font-style: normal;
  line-height: 1.72;
  text-align: center;
  margin: 0;
  padding: 0 0.6rem;
  max-width: 27rem;
  margin-inline: auto;
  color: #1f2f4a;
  flex-shrink: 0;
}

/* Section titles */
.section-title {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 600;
  text-align: center;
  margin: 0;
  line-height: 1.25;
}

.swiper-slide--scroll > .swiper-slide-inner > .section-title {
  padding-top: 0.15rem;
  margin-bottom: 0;
}

#slide-couple .section-title {
  font-family: var(--sans);
  font-size: clamp(1.22rem, 3.7vw, 1.45rem);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: none;
  color: #223049;
  margin-bottom: 0.6rem;
}

/* Couple — swipe container (nested carousel) */
.couple-swiper-wrap {
  width: 100%;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  min-height: 0;
}

.couple-swiper {
  display: flex;
  flex-flow: row nowrap;
  gap: 0;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-behavior: smooth;
  outline: none;
}

.couple-swiper::-webkit-scrollbar {
  display: none;
}

.couple-pane {
  flex: 0 0 100%;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  box-sizing: border-box;
  padding-inline: 0;
}

.couple-card {
  text-align: center;
  width: min(100%, clamp(14rem, 82vw, 19.5rem));
  margin-inline: auto;
}

.couple-photo {
  width: min(100%, clamp(10rem, 54vw, 13.5rem));
  height: auto;
  max-height: min(39vh, 18rem);
  object-fit: contain;
  object-position: center center;
  border-radius: 8px;
  display: block;
  margin-inline: auto;
  margin-bottom: 0.75rem;
}

@media (max-height: 740px) {
  .couple-photo {
    max-height: min(35vh, 15.5rem);
  }
}

.couple-name {
  font-family: var(--serif);
  font-size: clamp(0.98rem, 3.45vw, 1.28rem);
  font-weight: 600;
  letter-spacing: 0.005em;
  line-height: 1.22;
  margin: 0 0 0.4rem;
  color: #1f2f4a;
  white-space: nowrap;
}

.couple-desc {
  font-family: var(--sans);
  font-size: clamp(0.9rem, 2.8vw, 1rem);
  font-weight: 400;
  font-style: normal;
  color: #334763;
  margin: 0;
  line-height: 1.5;
  max-width: 17rem;
  margin-inline: auto;
}

.couple-swiper-dots {
  display: flex;
  gap: 0.45rem;
  align-items: center;
  justify-content: center;
}

.couple-dot {
  width: 0.42rem;
  height: 0.42rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(34, 48, 73, 0.28);
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

.couple-dot.is-active {
  background: #6e5333;
  transform: scale(1.12);
}


/* Event & countdown */
#slide-event .swiper-slide-inner {
  gap: clamp(0.85rem, 3vw, 1.35rem);
}

.event-when {
  white-space: pre-line;
  margin: 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.93rem;
  line-height: 1.5;
  padding-inline: 0.25rem;
}

.countdown {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.countdown-unit {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  min-width: 4rem;
  text-align: center;
}

.countdown-unit span {
  display: block;
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.countdown-unit small {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Maps */
.venue-name {
  font-weight: 500;
  text-align: center;
  margin: 0 0 0.5rem;
}

.venue-address {
  text-align: center;
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 1rem;
}

.btn-maps {
  display: inline-block;
  align-self: center;
  margin-block: 0;
  padding: 0.7rem 1.65rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

#slide-maps .swiper-slide-inner {
  text-align: center;
}

#slide-maps .map-embed-wrap {
  align-self: stretch;
}

.map-embed-wrap {
  margin-top: 0.35rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Story */
.story-heading {
  font-family: var(--serif);
  font-size: 1.08rem;
  margin: 0 0 0.45rem;
}

.story-block p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

/* Gift */
.gift-intro {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto 1rem;
  font-size: 0.95rem;
}

.bank-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.7;
  text-align: center;
}

.bank-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--line);
}

code {
  font-size: 0.85em;
  background: #eee9e0;
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

/* Footer slide */
.invite-footer {
  text-align: center;
  padding: 0;
  margin: 0;
  color: #2f3f5b;
  font-family: var(--serif);
  font-size: clamp(1rem, 2.8vw, 1.1rem);
  line-height: 1.6;
}

.invite-footer p {
  margin: 0;
}

.thanks-message {
  max-width: 27rem;
  margin-inline: auto;
}

.thanks-prayer {
  margin-top: 0.85rem;
  color: #6e5333;
  font-size: clamp(1.05rem, 3vw, 1.2rem);
  font-weight: 700;
}

.thanks-family {
  margin-top: 0.95rem;
  color: #2b3954;
  font-size: clamp(0.97rem, 2.6vw, 1.05rem);
}

.thanks-family strong {
  display: inline-block;
  margin-top: 0.2rem;
  font-size: clamp(1.08rem, 3.1vw, 1.2rem);
  letter-spacing: 0.02em;
}

.footer-meta {
  font-size: 0.75rem;
  opacity: 0.75;
}

/* Desktop/webview preview: force centered mobile layout */
@media (min-width: 820px) {
  body {
    background: #e9e4dc;
  }

  .swiper-viewport {
    width: min(100vw, 430px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    box-shadow: 0 18px 52px rgba(0, 0, 0, 0.16);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  .section-nav-bottom {
    width: min(100vw, 430px);
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  .bgm-toggle {
    left: 50%;
    right: auto;
    margin-left: calc(215px - 2.95rem);
    transform: none;
  }
}
