﻿:root {
  --ruby: #244c8f;
  --ruby-dark: #101f44;
  --rose: #c8d8f4;
  --ivory: #f8fbff;
  --paper: #e8eefb;
  --teal: #c1933f;
  --ink: #141d33;
  --muted: #667087;
  --line: rgba(36, 76, 143, 0.16);
  --shadow: 0 24px 64px rgba(16, 31, 68, 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(200, 216, 244, 0.55), transparent 26rem),
    linear-gradient(135deg, #f8fbff, #e9efff 46%, #fff6df);
}

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(248, 251, 255, 0.96), rgba(232, 238, 251, 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(16, 31, 68, 0.04), rgba(16, 31, 68, 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(36, 76, 143, 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(248, 251, 255, 0.94);
  text-align: center;
  box-shadow: 0 18px 40px rgba(16, 31, 68, 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(200, 216, 244, 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(248, 251, 255, 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(16, 31, 68, 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(36, 76, 143, 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(16, 31, 68, 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(20, 29, 51, 0.86);
  backdrop-filter: blur(8px);
}

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

.lightbox-panel img {
  max-height: 82dvh;
  border: 1px solid rgba(248, 251, 255, 0.55);
  border-radius: 22px;
  object-fit: contain;
  background: var(--ink);
  box-shadow: 0 24px 64px rgba(20, 29, 51, 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));
  }
}


/* Midnight Blue layout identity */
.theme-midnight-blue { background: radial-gradient(circle at top, rgba(193,147,63,.22), transparent 22rem), #080d1f; }
.theme-midnight-blue .invite-frame { background: linear-gradient(180deg, #0b1430, #111a35); color: var(--ivory); }
.theme-midnight-blue .cover-screen { display: block; background: #080d1f; }
.theme-midnight-blue .cover-photo { position: absolute; inset: 0; height: 100%; opacity: .74; }
.theme-midnight-blue .cover-photo::after { display: none; }
.theme-midnight-blue .cover-panel { position: absolute; inset: 0; justify-content: flex-end; align-items: flex-start; padding: 32px; text-align: left; background: linear-gradient(180deg, transparent, rgba(8,13,31,.92)); }
.theme-midnight-blue .cover-panel h1, .theme-midnight-blue .hero-card h2, .theme-midnight-blue .section-heading h3, .theme-midnight-blue .person-card h3 { color: var(--ivory); }
.theme-midnight-blue .line { margin-left: 0; background: var(--teal); }
.theme-midnight-blue .hero-section { border-radius: 0 0 36px 36px; background: #080d1f; }
.theme-midnight-blue .hero-image { height: 500px; }
.theme-midnight-blue .hero-card { margin: -190px 18px 22px; background: rgba(16,31,68,.72); color: var(--ivory); backdrop-filter: blur(14px); }
.theme-midnight-blue .countdown-section, .theme-midnight-blue .story-section, .theme-midnight-blue .event-section, .theme-midnight-blue .gallery-section, .theme-midnight-blue .wish-section, .theme-midnight-blue .rsvp-section, .theme-midnight-blue .person-card { background: rgba(255,255,255,.06); border-color: rgba(200,216,244,.22); }
.theme-midnight-blue .timer-grid div, .theme-midnight-blue .timeline article, .theme-midnight-blue .event-card, .theme-midnight-blue .wish-list li { background: rgba(255,255,255,.07); }
.theme-midnight-blue .gallery-thumb { border-radius: 999px 999px 18px 18px; }
