/* ========================================
   GLOBAL STYLES
   ======================================== */

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Color Variables */
:root {
  --dark-pink: #B8788A;
  --black-pink: #D4A8B4;
  --light-green: #92A47C;
  --dark-green: #607258;
  --gold: #BFA06A;
  --white: #f9f5f0;
  --black: #241e19;
  --bg-white: #FAF0E2;
  --bg-green: #e6e7d9;
  --shadow-light: 0 4px 8px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 5px 15px rgba(105, 124, 96, 0.2);
  --shadow-heavy: 0 10px 20px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.2);
  --transition-standard: all 0.3s ease;
  --transition-transform: transform 0.3s ease;
  --transition-color: color 0.3s ease;
  --transition-width: width 0.3s ease;
  --header-font: "Great Vibes", cursive, serif;
  --base-font: "Jost", sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--base-font);
  font-size: 16px;
  line-height: 1.6;
  background-color: var(--bg-white);
  color: var(--black);
  overflow-x: clip;
  /* overflow-x: clip (not hidden) — hidden creates a scroll container
     which can break nested sticky/fixed layout. */
}

/* Font Styles */
.handwritten {
  font-family: var(--header-font);
}

.content-section:not(#welcome-message) h2.handwritten::after {
  content: " ✦";
  color: var(--gold);
  font-size: 0.6em;
  vertical-align: middle;
  opacity: 0.7;
}

.header {
  font-family: "Jost", sans-serif;
}

/* ========================================
   SECTION FLOW
   Normal document scroll — no sticky stacked “cards”.
   ======================================== */

#hero,
#details,
#dress-code,
#countdown {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
}

#welcome-message {
  position: relative;
  border-radius: 0;
  box-shadow: none;
}

/* ========================================
   PARALLAX SECTIONS
   ======================================== */

.parallax-section {
  min-height: 100dvh;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  /* background-attachment: fixed doesn't work on iOS/Android;
     enabled on desktop only via the min-width block below. */
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  color: white;
  z-index: 1;
}

.parallax-section--shadow {
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

/* ========================================
   HERO SECTION
   ======================================== */

#hero {
  background-color: var(--bg-green);
  padding: 0.5rem;
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-particle {
  position: absolute;
  opacity: 0.22;
  pointer-events: none;
}

.hero-particle--heart {
  font-size: clamp(20px, 4vw, 32px);
  line-height: 1;
  transform: rotate(var(--rotate, 0deg));
}

.hero-decoration {
  position: absolute;
  left: auto;
  right: auto;
  width: calc(100% - 1rem);
  z-index: 0;
}

.hero-decoration--top {
  top: 0.5rem;
}

.hero-decoration--bottom {
  bottom: 0.5rem;
}

#hero h1 {
  color: var(--dark-green);
  font-size: clamp(2.5rem, 14vw, 4rem);
  margin-bottom: 1rem;
  line-height: 1.1;
  text-align: center;
  padding: 0 0.5rem;
}

#hero .date,
#hero .location {
  font-size: clamp(1.2rem, 10vw, 1.6rem);
  font-weight: 500;
  color: var(--dark-green);
  opacity: 0.86;
}

#hero .date {
  color: var(--gold);
  font-weight: 700;
}

/* ========================================
   CONTENT SECTIONS
   ======================================== */

.content-section {
  padding: 2rem 1rem;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
}

.content-section h2 {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 1.2rem;
  color: var(--dark-green);
}

/* ========================================
   STORY SECTION
   ======================================== */

#welcome-message {
  background-color: var(--white);
  min-height: 100dvh;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* allow top ornament to overflow upward */
  overflow: visible;
}

/* ---- arch frame ---- */
.welcome-arch {
  position: relative;
  width: 100%;
  max-width: 330px;
  margin: 0 auto;
  /* top padding clears the ornament overlap; bottom padding
     = half of welcome-bottom.svg height (132px / 2 = 66px)
     so the sides end exactly at the ornament's centre line */
  padding: 3.5rem 1.5rem 66px;
  margin-top: 3rem;

  border-top:   1.5px solid rgba(146, 164, 124, 0.7);
  border-left:  1.5px solid rgba(146, 164, 124, 0.7);
  border-right: 1.5px solid rgba(146, 164, 124, 0.7);
  /* top rounded like an arch; sides straight */
  border-radius: 50% 50% 0 0 / 72px 72px 0 0;
}

/* top ornament sits centered on the arch line */
.welcome-ornament-top {
  position: absolute;
  top: -20px;          /* half of svg height (40px / 2) */
  left: 50%;
  transform: translateX(-50%);
  width: 330px;
  max-width: 100%;
  display: block;
  pointer-events: none;
}

/* bottom ornament: absolutely positioned so its vertical
   centre aligns with the end of the arch side lines */
.welcome-ornament-bottom {
  position: absolute;
  bottom: -66px;       /* half of svg height (132px / 2) */
  left: 50%;
  transform: translateX(-50%);
  width: 333px;
  max-width: 100%;
  display: block;
  pointer-events: none;
}

/* ---- inner content ---- */
#welcome-message .story-content {
  max-width: 100%;
  margin: 0 auto;
  font-size: 1.1rem;
  text-align: center;
}

#welcome-message p {
  margin-bottom: 1.2rem;
}

#welcome-message p.date {
  font-size: 2rem;
  color: var(--gold);
  opacity: 0;
}

#welcome-message p.location .location-label {
  color: var(--dark-green);
  font-size: 2rem;
  display: block;
}

/* ========================================
   DRESS CODE SECTION
   ======================================== */

#dress-code {
  min-height: 100dvh;
  background-color: var(--bg-green);
  position: relative;
  overflow: visible;
}

#dress-code::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 50% 50%,
    rgba(184, 120, 138, 0.06),
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 1.2s ease;
}

#dress-code.wash-visible::before {
  opacity: 1;
}

#dress-code .dress-code-intro {
  color: var(--black);
}

/* Color Palette */
.color-palette {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
  margin-bottom: 1rem;
}

.color-swatch {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: var(--shadow-light);
  transition: var(--transition-standard);
  cursor: pointer;
}

/* Dress Code — новые компоненты */
.dress-code-badge {
  display: block;
  width: fit-content;
  margin: 0 auto 1rem;
  border: 1.5px solid var(--dark-pink);
  color: var(--dark-pink);
  padding: 5px 18px;
  border-radius: 20px;
  font-size: 0.75rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-family: var(--base-font);
}

.dress-code-intro {
  text-align: center;
  font-size: 0.95rem;
  color: var(--black-pink);
  margin-bottom: 1.5rem;
  line-height: 1.6;
  font-family: var(--base-font);
}

.dress-code-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.dress-code-card {
  background: var(--white);
  border-radius: 16px;
  padding: 20px 14px;
  text-align: center;
  box-shadow: var(--shadow-light);
  border: 1px solid rgba(96, 114, 88, 0.2);
}

.outfit-icon {
  width: 128px;
  height: 128px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
  background-color: var(--bg-green);
  border-radius: 50%;
  padding: 8px;
}

.outfit-label {
  font-family: var(--base-font);
  font-weight: 600;
  font-size: 1.2rem;
  color: var(--dark-green);
  margin-bottom: 4px;
}

.outfit-desc {
  font-family: var(--base-font);
  font-size: 1rem;
  color: var(--black);
  opacity: 0.88;
  margin-bottom: 12px;
  line-height: 1.4;
}

.color-palette--sm {
  gap: 5px;
  margin-top: 0;
  margin-bottom: 0;
}

.color-palette--sm .color-swatch {
  width: 32px;
  height: 32px;
}

.dress-code-avoid {
  background: var(--white);
  border: 2px solid var(--dark-pink);
  border-radius: 14px;
  padding: 1rem 1.25rem 1.15rem;
  text-align: center;
  box-shadow: var(--shadow-medium);
}

.dress-code-avoid__label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dark-pink);
  margin-bottom: 10px;
  font-family: var(--base-font);
  font-weight: 500;
}

.dress-code-avoid__list {
  font-size: clamp(0.95rem, 2.8vw, 1.05rem);
  font-weight: 400;
  color: var(--black);
  line-height: 1.45;
  font-family: var(--base-font);
  letter-spacing: 0.02em;
}

/* ========================================
   COUNTDOWN SECTION
   ======================================== */

#countdown {
  min-height: 100vh;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.countdown-heart {
  position: relative;
  width: min(420px, 92vw);
  aspect-ratio: 0.92;
  margin-top: 1.5rem;
  transform-origin: center center;
}

.countdown-heart-shape {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.25));
}

.countdown-heart-path {
  fill: var(--dark-pink);
  stroke: var(--dark-pink);
  stroke-width: 2.2;
  stroke-linejoin: round;
  transition:
    fill 0.3s ease,
    stroke 0.3s ease;
}

.countdown-heart-content {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1rem 3.5rem;
  box-sizing: border-box;
}

#countdown .countdown {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 0;
}

#countdown .countdown .countdown-item {
  margin: 0.4rem 0;
  text-align: center;
  position: relative;
}

#countdown .countdown-item::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 0.4rem;
  background-color: var(--white);
  opacity: 0.24;
}

#countdown .countdown-item::before {
  top: -0.6rem;
}

#countdown .countdown-item:first-child::before,
#countdown .countdown-item:last-child::after {
  display: none !important;
}

.countdown-number {
  display: flex;
  justify-content: center;
  gap: 0.15rem;
}

.countdown-digit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2em;
  height: 1.4em;
  perspective: 120px;
  overflow: hidden;
}

#countdown .countdown-digit-inner {
  font-size: clamp(1.35rem, 4.5vw, 2rem);
  font-family: var(--base-font);
  font-weight: 700;
  color: var(--white);
  display: block;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  transform-origin: center center;
}

.countdown-item .number {
  font-size: 2rem;
  font-weight: 700;
  display: block;
  color: var(--white);
}

#countdown .countdown-item .label {
  font-size: clamp(0.75rem, 2.2vw, 1rem);
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--white);
  opacity: 0.84;
}

/* ========================================
   DETAILS SECTION (ZIGZAG TIMELINE)
   Mobile base: single-column left-aligned layout
   ======================================== */

#details {
  background: var(--bg-white);
  min-height: 100vh;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.zigzag {
  position: relative;
  margin: 2rem auto 0;
}

/* Центральная линия.
   Центрируется через left + margin-left, а не transform,
   чтобы GSAP мог владеть transform для scaleY-анимации. */
.zigzag-line {
  position: absolute;
  /* Mobile: line aligned to dot center (half of 42px dot = 21px) */
  left: 21px;
  margin-left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(
    180deg,
    transparent 0%,
    var(--dark-green) 8%,
    var(--dark-green) 92%,
    transparent 100%
  );
  opacity: 0.3;
  transform-origin: top;
  transform: scaleY(0);
}

.zigzag-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  width: 100%;
  flex-direction: row;
}
.zigzag-item:last-child { margin-bottom: 0; }

/* Icon + time — left column; title + description — .zigzag-content on the right */
.zigzag-meta {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
  z-index: 2;
}

.zigzag-dot-wrap {
  position: static;
  transform: none;
  flex-shrink: 0;
}

.zigzag-content {
  width: auto;
  flex: 1;
  min-width: 0;
  margin-left: 0;
  margin-right: 0;
  text-align: left;
  padding: 1.1rem 1.2rem;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(255,255,255,0.95), rgba(249,245,240,0.98));
  border: 1px solid rgba(105,124,96,0.12);
  box-shadow: 0 4px 20px rgba(105,124,96,0.08), 0 1px 3px rgba(0,0,0,0.04);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.zz-time {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--bg-white);
  background: var(--dark-green);
  padding: 0.28rem 0.55rem;
  border-radius: 100px;
  flex-shrink: 0;
  white-space: nowrap;
}

.zz-title {
  font-family: var(--header-font);
  font-size: 1.5rem;
  color: var(--dark-green);
  line-height: 1.2;
  margin-bottom: 0.35rem;
}

.zz-desc {
  font-size: 0.9rem;
  color: var(--black);
  opacity: 0.75;
  line-height: 1.5;
}

.map-links {
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

.map-links--welcome {
  margin-top: 0.35rem;
  margin-bottom: 0;
  font-size: 0.95rem;
}

.map-links--zigzag {
  margin-top: 0.5rem;
  font-size: 0.82rem;
}

.map-link {
  color: var(--dark-green);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: var(--transition-color);
}

.map-link:hover {
  color: var(--dark-pink);
}

.map-link:focus {
  outline: none;
}

.map-link:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.map-link-sep {
  display: inline-block;
  margin: 0 0.4rem;
  opacity: 0.4;
  font-weight: 400;
  text-decoration: none;
  user-select: none;
}

.zigzag-dot {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-white);
  border: 2px solid var(--dark-green);
  box-shadow: 0 0 0 4px rgba(191,160,106,0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}


.rsvp-btn {
  background-color: var(--dark-green);
  color: white;
  border: 2px solid white;
  padding: 0.6rem 1.2rem;
  font-size: 1rem;
  font-family: var(--base-font);
  font-weight: 600;
  border-radius: 50px;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: var(--transition-standard);
  box-shadow: var(--shadow-light);
  position: relative;
  overflow: hidden;
  display: inline-block;
  text-align: center;
  text-decoration: none;
}

.rsvp-btn:focus {
  outline: none;
}

.rsvp-btn:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}

.rsvp-btn:active {
  transform: translateY(-1px);
}

.rsvp-btn .rsvp-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  transform: scale(0);
  pointer-events: none;
}

/* ========================================
   FOOTER
   ======================================== */

footer {
  background-color: var(--light-green);
  color: white;
  text-align: center;
  padding: 1.5rem 1rem;
  position: relative;
}

footer .handwritten {
  font-size: 2rem;
  margin-bottom: 0.6rem;
  display: block;
}

footer p {
  opacity: 0.9;
  font-size: 0.9rem;
}

footer .copyright {
  position: absolute;
  bottom: 1.5rem;
}


/* ========================================
   SCROLL ANIMATIONS (GSAP)
   ======================================== */

.gsap-animate {
  opacity: 0;
}

.scroll-trigger {
  will-change: transform, opacity;
}

/* Reduced motion */
.reduce-motion .hero-particles,
.reduce-motion .hero-particle--heart {
  display: none !important;
}

.reduce-motion * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

a:hover {
  text-decoration-color: var(--gold);
}

/* ========================================
   DESKTOP OVERRIDES (≥ 769px)
   Restore parallax, hover effects, zigzag two-column layout,
   and revert sticky card chrome.
   ======================================== */
@media (min-width: 769px) {
  /* Restore parallax background on desktop */
  .parallax-section {
    background-attachment: fixed;
    overflow: hidden;
    transition: transform 0.3s ease;
  }

  .parallax-section:hover {
    transform: scale(1.01);
  }

  /* Per-section overflow (dress-code ::before wash).
     Hero: scroll attachment so the block scrolls away with the page — not a fixed
     backdrop that the welcome section slides over. */
  #hero {
    overflow: hidden;
    background-attachment: scroll;
  }
  #dress-code { overflow: visible; }

  /* Hover effects — only meaningful with a pointer device */
  .color-swatch:hover {
    transform: scale(1.2);
    box-shadow: var(--shadow-medium);
  }

  .rsvp-btn:hover {
    background-color: var(--dark-green);
    transform: translateY(-3px);
    box-shadow: var(--shadow-medium);
  }

  .zigzag-content:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(105,124,96,0.12);
  }

  /* ---- Zigzag: two-column desktop layout ---- */
  #details .container {
    max-width: 860px;
  }

  /* ---- Dress code: two-column desktop layout ---- */
  #dress-code .container {
    max-width: 760px;
  }

  .dress-code-cards {
    grid-template-columns: 1fr 1fr;
  }

  /* Line centered between columns */
  .zigzag-line {
    left: 50%;
    margin-left: -1px;
  }

  /* [meta: icon+time | content: title+desc]; --left mirrors so text sits left of the timeline */
  .zigzag-item--left  { flex-direction: row-reverse; }
  .zigzag-item--right { flex-direction: row; }

  .zigzag-meta {
    width: calc(50% - 2rem);
    flex: none;
    align-items: center;
    gap: 0.65rem;
  }

  .zigzag-item--left .zigzag-meta {
    justify-content: flex-end;
  }

  .zigzag-item--right .zigzag-meta {
    justify-content: flex-start;
  }

  .zigzag-dot-wrap {
    position: static;
    transform: none;
  }

  .zigzag-content {
    width: calc(50% - 2rem);
    flex: none;
  }

  .zigzag-item--left .zigzag-content {
    margin-right: 4rem;
    margin-left: 0;
    text-align: right;
  }

  .zigzag-item--right .zigzag-content {
    margin-left: 4rem;
    margin-right: 0;
    text-align: left;
  }
}
