/* --- RESET & BASIC SETUP --- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Images never overflow their container */
img {
  max-width: 100%;
  height: auto;
}

/* --- FONTS --- */
/* EB Garamond — elegant Garamond serif with full Greek + Latin support,
   so Greek letters AND numbers render consistently in one font. */
html {
  /* Paper texture on the page root fills the iOS safe-area strips (e.g. behind
     the bottom URL bar) with the same texture as the doors, not flat colour.
     The top status-bar strip is the exception — iOS only allows a solid colour
     there (set via the theme-color meta tag). */
  background-color: #e8e4dc;
  background-image: url('images/background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

body {
  font-family: 'EB Garamond', Georgia, serif;
  color: #333;
  overflow-x: hidden;
}

/* While the envelope intro is on screen, fully lock the page so nothing can
   scroll or peek out below the doors (the #1 cause of the mobile gap issue). */
body.intro-lock {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  background-image: url('images/background.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* --- THE ENVELOPE OVERLAY & WAX SEAL --- */
#envelope-intro {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh; /* matches the visible area; scroll is locked so it stays stable */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e8e4dc;
  overflow: hidden;
  transition: opacity 1s ease-in-out;
}

/* Diagonal fold lines (X crease) simulating an envelope back */
#envelope-intro::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to bottom right,
      transparent calc(50% - 0.5px),
      rgba(0, 0, 0, 0.07) 50%,
      transparent calc(50% + 0.5px)
    ),
    linear-gradient(
      to bottom left,
      transparent calc(50% - 0.5px),
      rgba(0, 0, 0, 0.07) 50%,
      transparent calc(50% + 0.5px)
    );
  z-index: 1;
  pointer-events: none;
}

/* Doors carry the same background texture */
.envelope-door {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background-image: url('images/background.webp');
  /* Each door carries a full-screen-sized copy of the texture, positioned so
     the two halves line up into ONE continuous sheet (no seam, no tiling). */
  background-size: 100vw 100%;
  background-repeat: no-repeat;
  transition: transform 1.5s cubic-bezier(0.77, 0, 0.175, 1);
}

.left-door {
  left: 0;
  background-position: left center;
  box-shadow: 3px 0 18px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.right-door {
  right: 0;
  background-position: right center;
  z-index: 1;
}

/* Seal sits centered, above fold lines */
#seal-wrapper {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Seal + monogram stacked */
#seal-container {
  position: relative;
  width: 220px;
  height: 220px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

#seal-container:hover {
  transform: scale(1.05);
}

#wax-seal {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.5s ease;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.35));
}

/* "Tap to Open" — bottom-center, softly blinking */
#seal-hint {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: rgba(60, 45, 30, 0.75);
  margin: 0;
  white-space: nowrap;
  pointer-events: none;
  animation: softBlink 2.8s ease-in-out infinite;
}

@keyframes softBlink {
  0%, 100% { opacity: 0.85; }
  50%       { opacity: 0.2;  }
}

/* --- SCROLL REVEAL --- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Respect users who prefer no motion */
@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Open state — doors slide out */
.is-open .left-door  { transform: translateX(-100%); }
.is-open .right-door { transform: translateX(100%);  }

/* Seal + hint disappear immediately */
.is-open #seal-container { opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }
.is-open #seal-hint      { opacity: 0; transition: opacity 0.3s ease; }

/* Hide the X fold lines once the doors open */
#envelope-intro.is-open::before { opacity: 0; transition: opacity 0.4s ease 0.4s; }

/* The overlay fades out (revealing the site) once the doors have opened */
.fade-out {
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.1s ease;
}

.fade-out.gone {
  display: none !important;
}

/* Added display none to completely remove after fade */


/* --- MAIN LAYOUT & BACKGROUND --- */
#main-website {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 20px;
  gap: 40px;
  /* Space between sections */
}

/* --- LANGUAGE TOGGLE --- */
#lang-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.9);
  padding: 4px;
  border-radius: 30px;
  border: 2px solid #ddd;
  display: flex;
  align-items: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* --- MUSIC TOGGLE --- */
#music-toggle {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1000;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: rgba(255, 255, 255, 0.9);
  color: #5a0c11;
  font-size: 1.15rem;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  display: none;            /* shown once the envelope opens */
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease, transform 0.2s ease;
}

#music-toggle.visible {
  display: flex;
}

#music-toggle:hover {
  transform: scale(1.05);
}

/* Muted/paused state: dim + diagonal strike through the note */
#music-toggle.paused {
  opacity: 0.6;
}

#music-toggle .music-icon {
  position: relative;
  line-height: 1;
}

#music-toggle.paused .music-icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 2px;
  background: #5a0c11;
  transform: translate(-50%, -50%) rotate(-45deg);
}

.lang-btn {
  cursor: pointer;
  padding: 8px 16px;
  color: #333;
  font-weight: bold;
  font-size: 1rem;
  border-radius: 20px;
  transition: all 0.3s ease;
  user-select: none;
}

.lang-btn.active {
  background-color: #5a0c11;
  color: #fff;
}

/* --- SECTION STYLING (Glassmorphism replacing solid white box) --- */
.glass-panel {
  background-color: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Safari support */
  border: 1px solid rgba(255, 255, 255, 0.5);
  width: 100%;
  max-width: 700px;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  text-align: center;
}

h1,
h2 {
  color: #5a0c11;
  font-weight: normal;
  margin-bottom: 20px;
}

h1 {
  font-size: 3.5rem;
  line-height: 1.1;
}

h2 {
  font-size: 2.5rem;
}

p {
  font-size: 1.4rem;
  color: #444;
  margin-bottom: 15px;
}

/* Buttons */
.btn {
  display: inline-block;
  margin-top: 15px;
  padding: 12px 24px;
  background-color: #5a0c11;
  color: #fff;
  text-decoration: none;
  font-family: inherit;
  font-size: 1.2rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn:hover {
  background-color: #7a151b;
}

/* Gold "Add to Calendar" button + button row */
.loc-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-gold {
  background: linear-gradient(135deg, #caa54a, #b8860b);
  color: #fff;
}

.btn-gold:hover {
  background: linear-gradient(135deg, #bd9a3f, #a2760a);
}

/* --- SECTION ICONS --- */
.section-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 12px;
}

.section-icon svg {
  width: 40px;
  height: 40px;
  stroke: #5a0c11;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* --- COUNTDOWN --- */
.cd-wrap {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.cd-box {
  min-width: 88px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(184, 134, 11, 0.45);
  border-radius: 10px;
  padding: 16px 10px;
}

.cd-num {
  font-size: 2.4rem;
  color: #5a0c11;
  line-height: 1;
}

.cd-lbl {
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a7a6a;
  margin-top: 8px;
}

/* --- COMPONENT STYLES --- */

/* Hero Section — fills the screen on open; next section sits below the fold */
#hero {
  margin-top: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --- HERO FLORAL DECORATIONS (top & bottom, like a canvas border) --- */
.hero-deco {
  display: block;
  width: 230px;
  max-width: 70%;
  height: auto;
  margin: 0 auto;
}

.hero-deco-top {
  margin-bottom: 18px;
}

.hero-deco-bottom {
  margin-top: 22px;
  transform: rotate(180deg);   /* mirror the top piece */
}

/* --- HERO ENTRANCE ANIMATION (plays once the doors open) ---
   Each hero element starts hidden and slides/fades up, staggered.
   Guarded by body.js-hero so it never stays hidden without JS. */
body.js-hero #hero > * {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s ease, transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

/* keep the bottom flower's 180° flip while it animates */
body.js-hero #hero > .hero-deco-bottom {
  transform: translateY(26px) rotate(180deg);
}

body.js-hero #hero.hero-in > * {
  opacity: 1;
  transform: translateY(0);
}

body.js-hero #hero.hero-in > .hero-deco-bottom {
  transform: translateY(0) rotate(180deg);
}

body.js-hero #hero.hero-in > *:nth-child(1) { transition-delay: 0.10s; }
body.js-hero #hero.hero-in > *:nth-child(2) { transition-delay: 0.25s; }
body.js-hero #hero.hero-in > *:nth-child(3) { transition-delay: 0.40s; }
body.js-hero #hero.hero-in > *:nth-child(4) { transition-delay: 0.52s; }
body.js-hero #hero.hero-in > *:nth-child(5) { transition-delay: 0.64s; }
body.js-hero #hero.hero-in > *:nth-child(6) { transition-delay: 0.76s; }
body.js-hero #hero.hero-in > *:nth-child(7) { transition-delay: 0.90s; }

@media (prefers-reduced-motion: reduce) {
  body.js-hero #hero > * { opacity: 1; transform: none; transition: none; }
  body.js-hero #hero > .hero-deco-bottom { transform: rotate(180deg); }
}

/* --- HERO IMAGE --- */
#hero-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto 20px;
  border-radius: 12px;
  object-fit: contain;
}

/* Decorative gold divider under the names */
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 6px 0 14px;
}

.hd-line {
  height: 1px;
  width: 64px;
  background: linear-gradient(to right, rgba(184, 134, 11, 0), #b8860b);
}

.hd-line:last-child {
  background: linear-gradient(to left, rgba(184, 134, 11, 0), #b8860b);
}

.hd-heart {
  color: #b8860b;
  font-size: 1.1rem;
  line-height: 1;
}

.hero-tagline {
  font-style: italic;
  font-size: 1.15rem;
  color: rgba(90, 12, 17, 0.7);
  margin-top: 6px;
  letter-spacing: 0.02em;
}

/* --- SCROLL CUE (appears after the sketch finishes) --- */
#scroll-cue {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  /* Solid pill so it stands out from the text behind it */
  padding: 12px 22px 10px;
  background: #5a0c11;
  border-radius: 30px;
  box-shadow: 0 6px 20px rgba(90, 12, 17, 0.35);
}

#scroll-cue.show {
  opacity: 1;
  pointer-events: auto;
  animation: cueBob 1.8s ease-in-out infinite;
}

/* Once the user scrolls, hide it permanently */
#scroll-cue.hidden-cue {
  opacity: 0 !important;
  pointer-events: none !important;
  animation: none !important;
}

.scroll-label {
  font-family: 'EB Garamond', Georgia, serif;
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #fff;
}

.scroll-arrow {
  width: 12px;
  height: 12px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
}

@keyframes cueBob {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50%       { transform: translateX(-50%) translateY(7px); }
}

/* Legacy placeholder (kept for fallback) */
.hero-image-placeholder {
  width: 100%;
  height: 250px;
  background-color: #eccfcb;
  border-radius: 10px;
  margin-bottom: 20px;
  background-image: url('images/hero.jpg');
  /* Expected path for their image */
  background-size: cover;
  background-position: center;
}

/* Scratch Date Section */
.scratch-circles-wrapper {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.scratch-circle-container {
  position: relative;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  background: #fdfaf6;
  overflow: hidden;
  flex-shrink: 0;
}

.hidden-date-part {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #5a0c11;
  font-weight: bold;
}

.scratch-pad-circle {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  cursor: crosshair;
}

/*  Map Section */
.map-container {
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 15px;
}

/* Timeline/Schedule Section */
.timeline {
  position: relative;
  margin-top: 24px;
  text-align: left;
}

/* One continuous vertical line down the left */
.timeline::before {
  content: "";
  position: absolute;
  left: 6px;          /* line occupies 6–8px → centre at 7px */
  top: 7px;
  bottom: 7px;
  width: 2px;
  background: #5a0c11;
}

.timeline-item {
  position: relative;
  padding-left: 30px;
  margin-bottom: 26px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

/* Dot centred exactly on the line (both at x = 7px) */
.timeline-item::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  width: 14px;
  height: 14px;
  transform: translateX(-50%);
  background-color: #fff;
  border: 2px solid #5a0c11;
  border-radius: 50%;
}

.timeline-item .event {
  font-size: 1.7rem;
  color: #5a0c11;
  line-height: 1.1;
}

.timeline-item .event-sub {
  font-size: 1.15rem;
  color: #666;
  margin-top: 2px;
}

/* --- POEM / WELCOME --- */
.poem-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.poem-line {
  font-size: 1.5rem;
  font-style: italic;
  color: #5a0c11;
  line-height: 1.4;
}

/* Show the right block per language (Greek poem vs English welcome).
   Default (before JS runs) shows Greek, hides English. */
.poem-en { display: none; }
body.lang-en .poem-el { display: none; }
body.lang-en .poem-en { display: flex; }

.poem-en {
  gap: 16px;
}

.poem-para {
  font-size: 1.4rem;
  font-style: italic;
  color: #5a0c11;
  line-height: 1.55;
  margin: 0;
}

.poem-accent {
  font-style: normal;
  font-weight: 600;
  white-space: nowrap; /* keep "I do" / "I splash!" together on one line */
}

/* --- LOCATION VENUE TEXT --- */
.venue-name {
  font-size: 1.6rem;
  color: #5a0c11;
  margin-bottom: 4px;
}

.venue-detail {
  font-size: 1.05rem;
  color: #666;
  margin-bottom: 22px;
}

/* --- FAMILIES & SPONSORS --- */
.families-grid,
.sponsors-grid {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.sponsors-grid {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid rgba(90, 12, 17, 0.15);
}

.family-col,
.sponsor-col {
  flex: 1;
  min-width: 200px;
}

.family-col p,
.sponsor-col p {
  font-size: 1.35rem;
  color: #444;
  margin: 4px 0;
}

.sponsor-col h3 {
  color: #5a0c11;
  font-weight: normal;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

/* IBAN Section */
.iban-box {
  background: rgba(255, 255, 255, 0.9);
  padding: 15px;
  border-radius: 8px;
  border: 1px dashed #5a0c11;
  font-size: 1.1rem;
  margin-top: 15px;
  word-break: break-all;
}

/* RSVP Form */
#rsvp form {
  text-align: left;
  margin-top: 20px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group.row {
  display: flex;
  gap: 15px;
}

.sub-group {
  flex: 1;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 5px;
  color: #555;
  font-weight: bold;
}

input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.9);
}

textarea {
  resize: vertical;
}

.submit-btn {
  width: 100%;
}

.hidden {
  display: none;
}

#form-message {
  margin-top: 15px;
  text-align: center;
  font-size: 1rem;
  font-weight: bold;
}

.success {
  color: green;
}

.error {
  color: red;
}

/* --- FOOTER / CREDIT --- */
#site-footer {
  width: 100%;
  max-width: 700px;
  margin-top: 10px;
  padding: 28px 20px 10px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.footer-heart {
  color: #b8860b; /* soft gold */
  font-size: 1.1rem;
  line-height: 1;
}

.footer-text {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  color: rgba(90, 12, 17, 0.85);
}

.footer-text a {
  color: #5a0c11;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(90, 12, 17, 0.4);
  padding-bottom: 1px;
  transition: opacity 0.25s ease;
}

.footer-text a:hover {
  opacity: 0.7;
}


/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 600px) {
  .glass-panel {
    padding: 30px 20px;
  }

  h1 {
    font-size: 2.8rem;
  }

  h2 {
    font-size: 2.2rem;
  }

  p {
    font-size: 1.2rem;
  }

  .form-group.row {
    flex-direction: column;
    gap: 15px;
  }

  .scratch-circles-wrapper {
    gap: 10px;
  }

  .scratch-circle-container {
    width: 80px;
    height: 80px;
  }

  .hidden-date-part {
    font-size: 1.8rem;
  }
}