:root {
  --bg: #faf7f1;
  --card-bg: #ffffff;
  --primary: #d7a24f;
  --primary-soft: #f4e4c5;
  --accent: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-soft: 0 14px 30px rgba(15, 23, 42, 0.18);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg);
  color: var(--accent);
  line-height: 1.5;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

/* PAGE WRAP */

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding-bottom: 4.5rem;
}

/* HERO */

.hero {
  background: #111827;
  color: #f9fafb;
  padding: 1.5rem 1.25rem 2.25rem;
  position: relative;
  overflow: hidden;
}

.hero-inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  align-items: center;
}

.hero-photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 2px solid rgba(249, 250, 251, 0.12);
}

.hero-text h1 {
  font-size: 1.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}

.hero-text h2 {
  font-weight: 500;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  opacity: 0.9;
}

.hero-text p {
  font-size: 0.95rem;
  opacity: 0.8;
  max-width: 30rem;
}

.hero-rsvp-btn {
  margin-top: 1.1rem;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: none;
  background: #f9fafb;
  color: #111827;
  font-weight: 700;
  font-size: 0.98rem;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.hero-rsvp-btn:hover {
  filter: brightness(1.05);
}

.welcome-name {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  opacity: 0.85;
}

/* TIMELINE TABS */

.timeline-wrap {
  margin-top: 1.5rem; /* space below hero; no overlap */
  padding: 0 1.25rem;
}

.timeline {
  max-width: 1000px;
  margin: 0 auto;
  background: var(--card-bg);
  border-radius: 999px;
  box-shadow: var(--shadow-soft);
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.25rem;
  gap: 0.25rem;
}

.timeline::-webkit-scrollbar {
  display: none;
}

.timeline-tab {
  flex: 1 0 auto;
  padding: 0.6rem 0.95rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-width: 120px;
  position: relative;
  align-items: center;
}

.timeline-day {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.timeline-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
}

.timeline-tab.active {
  background: var(--primary-soft);
}

.timeline-tab.active .timeline-label {
  color: var(--accent);
}

.timeline-indicator {
  position: absolute;
  inset: auto 0 -0.25rem 0;
  margin-inline: auto;
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 999px;
}

/* MAIN CONTENT */

.content {
  padding: 2rem 1.25rem 0;
  padding-bottom: 5rem; /* extra spacing below events */
}

.day-heading {
  max-width: 1000px;
  margin: 0 auto 1.75rem;
}

.day-heading-date {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.day-heading-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.day-heading-sub {
  font-size: 0.92rem;
  color: var(--muted);
}

.events {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* EVENT CARD */

.event-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: 1fr;
  overflow: hidden;
}

.event-media {
  position: relative;
  max-height: 100%;
  overflow: hidden;
}

.event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.event-body {
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border);
}

.event-time-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #ecfdf3;
  color: #166534;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
}

.event-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.event-desc {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.event-venue {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.event-venue strong {
  font-weight: 600;
}

.event-venue-address {
  font-size: 0.86rem;
  color: var(--muted);
}

.event-actions-top,
.event-actions-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.btn-chip {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.8rem;
  background: #f9fafb;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.btn-chip.primary {
  background: var(--primary-soft);
  border-color: #f3c987;
}

.event-footer-note {
  font-size: 0.78rem;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

/* RSVP TOGGLE */

.rsvp-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
}

.rsvp-toggle-label {
  font-size: 0.85rem;
  color: var(--muted);
}

.toggle-switch {
  width: 48px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  cursor: pointer;
  transition: background 0.25s ease;
}

.toggle-switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
}

.toggle-switch.on {
  background: #10b981;
}

.toggle-switch.on::after {
  transform: translateX(24px);
}

.rsvp-text {
  font-weight: 600;
  color: var(--accent);
}

/* MODAL */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.78);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  z-index: 50;
}

.modal {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  max-width: 400px;
  width: 100%;
  padding: 1.5rem 1.6rem 1.75rem;
  box-shadow: var(--shadow-soft);
}

.modal h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
}

.modal p {
  font-size: 0.86rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.modal-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.modal input[type="date"],
.modal input[type="text"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn-secondary {
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  border: none;
  background: #e5e7eb;
  font-size: 0.85rem;
}

.btn-primary {
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: none;
  background: var(--primary);
  color: #111827;
  font-weight: 600;
  font-size: 0.86rem;
}

.modal-error {
  font-size: 0.8rem;
  color: #b91c1c;
  min-height: 1rem;
}

/* DESKTOP LAYOUT TWEAKS */

@media (min-width: 768px) {
  .hero-inner {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

  .hero {
    padding: 2.2rem 2rem 3rem;
  }

  .timeline-wrap {
    padding: 0 2rem;
  }

  .content {
    padding: 2.5rem 2rem 0;
  }

  .event-card {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.15fr);
  }

  /* alternate image side */
  .event-card.alt-layout {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.05fr);
  }

  .event-card.alt-layout .event-media {
    order: 2;
  }

  .event-card.alt-layout .event-body {
    order: 1;
    border-left: 1px solid var(--border);
    border-top: none;
  }

  .event-body {
    border-top: none;
    border-left: 1px solid var(--border);
  }
}
