/* Template 7: Love Journey Timeline — scroll-driven story */

:root {
  --accent: #9a8b7a;
  --accent-dark: #7a6d5e;
  --text: #3d3832;
  --text-light: #6b6560;
  --bg: #fdfcf9;
  --bg-warm: #f8f6f2;
  --font-serif: 'Playfair Display', Georgia, serif;
  --font-script: 'Great Vibes', cursive;
  --font-body: 'Inter', system-ui, sans-serif;
  --radius: 12px;
  --space: 1.5rem;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-section { transition: none !important; }
  .timeline-node { transition: none !important; }
  .timeline-line-fill { transition: none !important; }
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--text);
  background: var(--bg-warm);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Timeline nav (vertical default) ---------- */
.timeline-nav {
  position: fixed;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.timeline-line {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: rgba(154, 139, 122, 0.25);
  border-radius: 2px;
}

.timeline-line-fill {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 0%;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.4s var(--ease);
}

.timeline-nodes {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  padding: 1rem 0;
}

.timeline-node {
  width: 2.5rem;
  height: 2.5rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  border-radius: 50%;
  border: 2px solid rgba(154, 139, 122, 0.4);
  background: var(--bg);
  color: var(--text-light);
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.timeline-node:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.1);
}

.timeline-node:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.timeline-node.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  transform: scale(1.15);
  box-shadow: 0 2px 12px rgba(154, 139, 122, 0.35);
}

.timeline-node.past {
  border-color: rgba(154, 139, 122, 0.3);
  color: var(--text-light);
  opacity: 0.7;
}

/* ---------- Horizontal layout (when body has timeline-horizontal) ---------- */
body.timeline-horizontal .timeline-nav {
  left: 0;
  right: 0;
  top: auto;
  bottom: 1rem;
  transform: none;
  flex-direction: row;
  justify-content: center;
  padding: 0 2rem;
}

body.timeline-horizontal .timeline-line {
  left: 0;
  right: 0;
  top: 50%;
  bottom: auto;
  width: auto;
  height: 2px;
  margin-left: 0;
  margin-top: -1px;
}

body.timeline-horizontal .timeline-line-fill {
  width: 0%;
  height: 100%;
  transition: width 0.4s var(--ease);
}

body.timeline-horizontal .timeline-nodes {
  flex-direction: row;
  gap: 1.5rem;
  padding: 0 1rem;
}

/* ---------- Main content: static viewport, no scroll ---------- */
.timeline-main {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin-left: 4.5rem;
  overflow: hidden;
}

body.timeline-horizontal .timeline-main {
  margin-left: 0;
  margin-bottom: 0;
}

/* ---------- Sections: stacked, one visible at a time ---------- */
.timeline-section {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateX(20px);
  transition: opacity 1s var(--ease-smooth), transform 1s var(--ease-smooth), visibility 1s;
  pointer-events: none;
}

.timeline-section.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
  z-index: 1;
}

.timeline-section.active .section-title {
  color: var(--accent);
}

.timeline-section.slide-from-right {
  transform: translateX(24px);
}

.timeline-section.slide-from-right.active {
  transform: translateX(0);
}

.timeline-section.slide-from-left {
  transform: translateX(-24px);
}

.timeline-section.slide-from-left.active {
  transform: translateX(0);
}

.section-inner {
  text-align: center;
  max-width: 360px;
}

.section-label {
  display: block;
  font-family: var(--font-serif);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-bottom: 0.5rem;
}

.section-title {
  font-family: var(--font-script);
  font-size: 2.2rem;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 1rem;
  transition: color 0.3s var(--ease);
}

.section-text,
.section-date,
.section-location {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 1rem;
}

.section-date {
  font-weight: 600;
  color: var(--accent);
}

.section-location {
  font-weight: 600;
  letter-spacing: 0.15em;
  margin-bottom: 1.25rem;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-family: var(--font-serif);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  text-decoration: none;
  border-radius: 999px;
  transition: opacity 0.3s, transform 0.3s;
  min-height: 48px;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-map {
  background: var(--accent);
  color: #fff;
  border: 2px solid var(--accent);
}

.btn-map:hover { opacity: 0.9; transform: scale(1.02); }

.btn-whatsapp {
  background: #25d366;
  color: #fff;
  margin-bottom: 0.5rem;
}

.btn-phone {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
}

.btn-phone:hover { background: rgba(154, 139, 122, 0.1); }

.rsvp-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.rsvp-prompt {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.rsvp-signature {
  font-family: var(--font-script);
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

/* ---------- Countdown: small squares ---------- */
.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.countdown-box {
  width: 3.5rem;
  height: 3.5rem;
  min-width: 3.5rem;
  min-height: 3.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #f0ebe6;
  border-radius: 8px;
  padding: 0.25rem;
}

.countdown-value {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.2;
}

.countdown-label {
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-light);
  text-transform: uppercase;
}

.countdown-done {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--accent);
}

/* ---------- Calendar grid ---------- */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.3rem;
  max-width: 220px;
  margin: 0 auto;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  background: #f0ebe6;
  border-radius: 6px;
  color: var(--text-light);
}

.calendar-day.weekend {
  font-weight: 600;
}

.calendar-day.highlight-day {
  background: var(--accent);
  color: #fff;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .timeline-nav {
    left: 0.75rem;
  }

  .timeline-main {
    margin-left: 3.5rem;
  }

  .timeline-section {
    padding: 1.5rem 1rem;
  }

  .timeline-node {
    width: 2rem;
    height: 2rem;
    min-width: 2rem;
    min-height: 2rem;
    font-size: 0.65rem;
  }

  .timeline-nodes {
    gap: 1.75rem;
  }

  .section-title {
    font-size: 1.8rem;
  }

  body.timeline-horizontal .timeline-nav {
    bottom: 0.75rem;
  }
}
