﻿:root {
  --ruby: #18745a;
  --ruby-dark: #0d3f32;
  --rose: #cce8d7;
  --ivory: #fbfff8;
  --paper: #edf7e9;
  --teal: #b77832;
  --ink: #17352a;
  --muted: #667a6e;
  --line: rgba(24, 116, 90, 0.16);
  --shadow: 0 24px 64px rgba(13, 63, 50, 0.22);
}

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

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

body {
  min-height: 100dvh;
  font-family: "Nunito Sans", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 10%, rgba(204, 232, 215, 0.55), transparent 26rem),
    linear-gradient(135deg, #fbfff8, #e8f6e7 46%, #fff3df);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  touch-action: manipulation;
}

img {
  display: block;
  width: 100%;
}

.invite-frame {
  position: relative;
  width: min(100%, 560px);
  height: min(100dvh, 930px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(251, 255, 248, 0.96), rgba(237, 247, 233, 0.98)),
    url("../assets/flower.png") top right/360px auto no-repeat;
  box-shadow: var(--shadow);
}

.cover-screen {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  grid-template-rows: minmax(210px, 42%) minmax(0, 1fr);
  background: var(--ivory);
  transition: opacity 0.75s ease, visibility 0.75s ease, transform 0.75s ease;
}

.cover-screen.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(-18px);
  pointer-events: none;
}

.cover-photo {
  position: relative;
  background:
    linear-gradient(180deg, rgba(13, 63, 50, 0.04), rgba(13, 63, 50, 0.34)),
    url("../img/cover.JPG") center/cover;
}

.cover-photo::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -38px;
  width: 86px;
  height: 86px;
  border: 8px solid var(--ivory);
  border-radius: 999px;
  background: var(--ruby);
  transform: translateX(-50%);
}

.cover-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  overflow-y: auto;
  padding: 46px 22px 24px;
  text-align: center;
}

.microcopy {
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.cover-panel h1,
.hero-card h2,
.section-heading h3,
.person-card h3 {
  font-family: "Fraunces", serif;
  font-weight: 800;
  line-height: 1.06;
}

.cover-panel h1 {
  margin: 10px 0 12px;
  color: var(--ruby-dark);
  font-size: clamp(1.95rem, 9vw, 3.6rem);
  text-wrap: balance;
}

.line {
  display: block;
  width: 72px;
  height: 3px;
  margin-bottom: 16px;
  border-radius: 999px;
  background: var(--rose);
}

.recipient-label {
  color: var(--muted);
}

.guest-name {
  margin: 4px 0 18px;
  color: var(--ruby);
  font-weight: 800;
}

.open-button,
.rsvp-form button,
.rsvp-form a,
.event-card a {
  min-height: 44px;
  border: none;
  border-radius: 999px;
  color: var(--ivory);
  background: linear-gradient(135deg, var(--ruby), var(--teal));
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.open-button {
  position: relative;
  z-index: 2;
  width: min(100%, 240px);
  flex: 0 0 auto;
  padding: 12px 22px;
}

.open-button:hover,
.rsvp-form button:hover,
.rsvp-form a:hover,
.event-card a:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(24, 116, 90, 0.22);
}

.content {
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 14px 14px 34px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px);
  transition: opacity 0.75s ease, visibility 0.75s ease, transform 0.75s ease;
  -webkit-overflow-scrolling: touch;
}

.content.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.hero-section,
.countdown-section,
.couple-section,
.story-section,
.event-section,
.gallery-section,
.wish-section,
.rsvp-section {
  margin-bottom: 16px;
}

.hero-section {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: var(--ruby-dark);
}

.hero-image {
  height: 430px;
}

.hero-image img {
  height: 100%;
  object-fit: cover;
}

.hero-card {
  position: relative;
  margin: -88px 14px 14px;
  padding: 22px 18px;
  border-radius: 22px;
  background: rgba(251, 255, 248, 0.94);
  text-align: center;
  box-shadow: 0 18px 40px rgba(13, 63, 50, 0.2);
}

.hero-card h2 {
  margin: 8px 0 10px;
  color: var(--ruby-dark);
  font-size: clamp(2rem, 11vw, 4.1rem);
  text-wrap: balance;
}

.date {
  margin-bottom: 10px;
  color: var(--ruby);
  font-weight: 800;
}

.quote,
.person-card p,
.timeline p,
.event-card p,
.wish-list,
.rsvp-form p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

.guest-chip {
  display: inline-flex;
  gap: 4px;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--ruby-dark);
  background: rgba(204, 232, 215, 0.5);
  font-size: 0.9rem;
}

.countdown-section,
.story-section,
.event-section,
.gallery-section,
.wish-section,
.rsvp-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(251, 255, 248, 0.78);
}

.timer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.timer-grid div {
  min-width: 0;
  padding: 12px 6px;
  border-radius: 16px;
  background: var(--paper);
  text-align: center;
}

.timer-grid strong {
  display: block;
  color: var(--ruby);
  font-size: 1.28rem;
}

.timer-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.couple-section {
  display: grid;
  gap: 10px;
}

.person-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 24px;
  background: var(--ivory);
  box-shadow: 0 12px 30px rgba(13, 63, 50, 0.09);
}

.person-card-right {
  grid-template-columns: 1fr 112px;
  text-align: right;
}

.person-card-right img {
  grid-column: 2;
  grid-row: 1;
}

.person-card-right div {
  grid-column: 1;
  grid-row: 1;
}

.person-card img {
  height: 138px;
  border-radius: 18px;
  object-fit: cover;
}

.person-card h3 {
  margin: 5px 0 7px;
  color: var(--ruby-dark);
  font-size: 1.62rem;
}

.couple-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin: -3px auto;
  border-radius: 999px;
  color: var(--ivory);
  background: var(--ruby);
  font-family: "Fraunces", serif;
  font-size: 1.6rem;
}

.section-heading {
  margin-bottom: 16px;
  text-align: center;
}

.section-heading h3 {
  margin-top: 5px;
  color: var(--ruby-dark);
  font-size: 1.74rem;
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline article {
  position: relative;
  padding: 14px 14px 14px 56px;
  border-radius: 18px;
  background: var(--paper);
}

.timeline span {
  position: absolute;
  left: 14px;
  top: 14px;
  color: var(--teal);
  font-family: "Fraunces", serif;
  font-weight: 800;
}

.timeline h4 {
  margin-bottom: 4px;
}

.event-grid {
  display: grid;
  gap: 12px;
}

.event-card {
  padding: 16px;
  border-radius: 18px;
  background: var(--paper);
}

.event-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.event-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ruby-dark);
  line-height: 1.45;
}

.event-card a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  padding: 10px 15px;
  font-size: 0.9rem;
}

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

.gallery-thumb {
  overflow: hidden;
  aspect-ratio: 1 / 1.18;
  border: none;
  border-radius: 18px;
  background: var(--paper);
  cursor: zoom-in;
}

.gallery-thumb img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-thumb:hover img {
  transform: scale(1.06);
}

.wish-list {
  display: grid;
  gap: 10px;
  list-style: none;
}

.wish-list li {
  padding: 14px;
  border-radius: 18px;
  background: var(--paper);
}

.wish-list strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ruby-dark);
}

.rsvp-form {
  display: grid;
  gap: 10px;
}

.rsvp-form input,
.rsvp-form select,
.rsvp-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--ivory);
}

.rsvp-form input:focus,
.rsvp-form select:focus,
.rsvp-form textarea:focus {
  outline: none;
  border-color: var(--ruby);
  box-shadow: 0 0 0 3px rgba(24, 116, 90, 0.12);
}

.rsvp-form button,
.rsvp-form a {
  display: grid;
  place-items: center;
  padding: 12px 18px;
}

.music-button {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  color: var(--ivory);
  background: var(--ruby);
  box-shadow: 0 12px 28px rgba(13, 63, 50, 0.24);
  cursor: pointer;
  font-weight: 800;
}

.music-button.is-muted {
  background: #8d7e81;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23, 53, 42, 0.86);
  backdrop-filter: blur(8px);
}

.lightbox-panel {
  position: relative;
  width: min(92vw, 760px);
}

.lightbox-panel img {
  max-height: 82dvh;
  border: 1px solid rgba(251, 255, 248, 0.55);
  border-radius: 22px;
  object-fit: contain;
  background: var(--ink);
  box-shadow: 0 24px 64px rgba(23, 53, 42, 0.42);
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  color: var(--ivory);
  background: var(--ruby);
  cursor: pointer;
}

.lightbox-close {
  top: 12px;
  right: 12px;
}

.lightbox-prev,
.lightbox-next {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev {
  left: 12px;
}

.lightbox-next {
  right: 12px;
}

@media (max-width: 390px) {
  .timer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .person-card,
  .person-card-right {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .person-card-right img,
  .person-card-right div {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-height: 720px) {
  .cover-screen {
    grid-template-rows: minmax(170px, 36%) minmax(0, 1fr);
  }

  .cover-photo::after {
    width: 68px;
    height: 68px;
    bottom: -30px;
    border-width: 6px;
  }

  .cover-panel {
    padding-top: 36px;
    padding-bottom: 18px;
  }

  .cover-panel h1 {
    font-size: clamp(1.65rem, 8vw, 2.6rem);
    margin-bottom: 8px;
  }

  .line {
    margin-bottom: 10px;
  }

  .guest-name {
    margin-bottom: 12px;
  }
}

@media (min-width: 720px) {
  .invite-frame {
    min-height: 92dvh;
    margin: 28px auto;
    border: 1px solid var(--line);
    border-radius: 34px;
  }

  .content {
    padding: 18px;
  }

  .hero-section {
    display: grid;
    grid-template-columns: 0.95fr 1fr;
  }

  .hero-image {
    height: auto;
    min-height: 520px;
  }

  .hero-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 18px 18px 18px -34px;
  }

  .event-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gallery-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}


/* Emerald Forest layout identity */
.theme-emerald-forest .invite-frame { background: linear-gradient(90deg, rgba(13,63,50,.12) 0 24px, transparent 24px), var(--ivory); }
.theme-emerald-forest .content { padding-left: 28px; }
.theme-emerald-forest .cover-screen { grid-template-columns: 36% 64%; grid-template-rows: 1fr; }
.theme-emerald-forest .cover-photo { height: 100%; border-radius: 0 0 80px 0; }
.theme-emerald-forest .cover-photo::after { left: auto; right: -30px; bottom: 50%; transform: translateY(50%); }
.theme-emerald-forest .cover-panel { justify-content: center; padding: 28px; text-align: left; align-items: flex-start; }
.theme-emerald-forest .line { margin-left: 0; }
.theme-emerald-forest .hero-section { border-radius: 18px; border-left: 10px solid var(--ruby); background: var(--paper); }
.theme-emerald-forest .hero-image { height: 300px; clip-path: polygon(0 0,100% 0,100% 86%,0 100%); }
.theme-emerald-forest .hero-card { margin: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: left; }
.theme-emerald-forest .couple-section { position: relative; padding-left: 18px; border-left: 2px solid var(--line); }
.theme-emerald-forest .person-card { border-radius: 18px; box-shadow: none; border: 1px solid var(--line); }
.theme-emerald-forest .timeline { position: relative; padding-left: 18px; }
.theme-emerald-forest .timeline::before { content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 999px; background: var(--ruby); }
.theme-emerald-forest .event-card { border-left: 8px solid var(--ruby); border-radius: 12px 22px 22px 12px; }
.theme-emerald-forest .gallery-thumb { border-radius: 8px 28px 8px 28px; }
