/* =====================
   Bismillah
   ===================== */
.bismillah {
  font-family: 'Scheherazade New', 'Amiri', serif;
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--accent2);
  opacity: 0.82;
  margin-bottom: 1rem;
  letter-spacing: 0.04em;
  line-height: 1.6;
  direction: rtl;
}

.hero-assalamu {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: clamp(0.85rem, 2.5vw, 1.1rem);
  margin-bottom: 0.5rem;
  opacity: 0.72;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

/* =====================
   Hero Fade-in
   ===================== */
.hero-fade {
  opacity: 0;
}
.hero-reveal {
  animation: heroFadeIn 0.6s ease-out forwards;
  animation-delay: calc(var(--order, 0) * 0.25s);
}

@keyframes heroFadeIn {
  to { opacity: 1; }
}

/* =====================
   Opening Cover
   ===================== */
.opening-cover {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

.opening-cover.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.opening-inner {
  text-align: center;
  padding: 2rem;
}

.opening-invitation-text {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 3.5vw, 1.3rem);
  line-height: 1.7;
  opacity: 0.8;
  max-width: 480px;
  margin: 0.75rem auto 0;
}

.opening-to {
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  opacity: 0;
  animation: heroFadeIn 0.5s ease-out 0.3s forwards;
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

.opening-to-name {
  font-weight: 600;
  color: var(--text);
}

.opening-couple {
  font-family: var(--font-heading, 'Cormorant Garamond', serif);
  font-size: clamp(1.2rem, 4.5vw, 2rem);
  font-weight: 600;
  margin: 0.75rem 0 0.25rem;
  opacity: 0;
  animation: heroFadeIn 0.5s ease-out 0.4s forwards;
}

.opening-date, .opening-venue {
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  opacity: 0;
  animation: heroFadeIn 0.5s ease-out 0.5s forwards;
  margin-bottom: 0.15rem;
  line-height: 1.5;
}

.opening-venue {
  font-size: 0.75rem;
  opacity: 0.7;
}

/* =====================
   Section Divider
   ===================== */
.section-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 2rem;
  margin: 0 auto;
  max-width: 480px;
}

.section-divider span {
  position: relative;
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(138,158,133,0.35) 20%,
    rgba(201,168,76,0.5) 50%,
    rgba(138,158,133,0.35) 80%,
    transparent
  );
}

.section-divider span::before {
  content: "◆";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg);
  color: var(--accent2);
  font-size: 0.5rem;
  padding: 0 0.5rem;
  opacity: 0.7;
}

/* =====================
   CSS Variables
   ===================== */
:root {
  --bg: #FBF8F3;
  --text: #2C2C2C;
  --accent: #7D9478;
  --accent2: #C9A84C;
  --font-heading: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --max-width: 640px;
  --section-pad: 4rem 1.5rem;
}

/* =====================
   Reset & Base
   ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

section, .section { scroll-margin-top: 72px; }

.top-nav { touch-action: pan-x; }

.top-nav::-webkit-scrollbar { display: none; }
.top-nav { scrollbar-width: none; }

.top-nav a { user-select: none; }

.top-nav a:focus-visible,
.lang-toggle:focus-visible,
.btn-primary:focus-visible,
.toggle-btn:focus-visible,
.stepper-btn:focus-visible,
.event-calendar-btn:focus-visible,
.map-link:focus-visible {
  outline: 2px solid var(--accent2);
  outline-offset: 2px;
}

html { scroll-behavior: smooth; }

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

img { max-width: 100%; display: block; }
a { color: inherit; }
textarea, input { font-family: inherit; font-size: inherit; }

/* =====================
   Utilities
   ===================== */
.hidden { display: none !important; }

.top-nav {
  position: sticky;
  top: 0;
  z-index: 90;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  overflow-x: auto;
  white-space: nowrap;
  padding: 0.75rem 1rem;
  background: rgba(250, 247, 242, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(44,44,44,0.08);
}

.top-nav a {
  flex: 0 0 auto;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--text);
  opacity: 0.75;
  transition: opacity 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.top-nav a:hover { opacity: 1; }

.top-nav a.active {
  opacity: 1;
  font-weight: 600;
  color: var(--text);
  background: rgba(138, 158, 133, 0.14);
  border-bottom: 1px solid rgba(138, 158, 133, 0.55);
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
}

.nav-invite-only { display: none; }

@media print {
  .top-nav,
  .lang-toggle,
  .hero-actions,
  .hero-cta,
  .event-calendar-links,
  .map-link,
  .form,
  .btn-primary,
  .stepper,
  .stepper-btn,
  .toggle-group,
  .toggle-btn {
    display: none !important;
  }
  body { background: #fff !important; }
  .section-hero { background: #fff !important; }
  .hero-to, .hero-label, .hero-date, .hero-city { color: #222 !important; opacity: 1 !important; }
  .wish-card { background: #f9f9f9 !important; box-shadow: none !important; border: 1px solid #ddd !important; }
  .event-card, .map-card { background: #f9f9f9 !important; box-shadow: none !important; border: 1px solid #ddd !important; }
  .section-divider span { background: #ccc !important; }
  .section { page-break-inside: avoid; }
}

@media (min-width: 769px) {
  .top-nav {
    gap: 1.25rem;
    padding: 0.9rem 1.5rem;
  }
  body::before {
    content: "";
    position: fixed;
    top: 12px; left: 12px; right: 12px; bottom: 12px;
    border: 1px solid rgba(44,44,44,0.06);
    border-radius: 4px;
    pointer-events: none;
    z-index: 9999;
  }
}

@media (max-width: 480px) {
  .top-nav {
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
  }

  .top-nav a {
    font-size: 0.72rem;
  }
}

.section {
  padding: var(--section-pad);
  max-width: var(--max-width);
  margin: 0 auto;
}

.section-hidden {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .section-hidden { opacity: 1; transform: none; transition: none; }
}

.section-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 2rem;
  letter-spacing: 0.03em;
}

/* =====================
   Language Toggle
   ===================== */
.lang-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 100;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 2rem;
  padding: 0.5rem 1rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  transition: opacity 0.2s;
}
.lang-toggle:hover { opacity: 0.8; }

/* =====================
   Hero Section
   ===================== */
.section-hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem 4.5rem;
  position: relative;
  max-width: 100%;
}

@media (min-width: 769px) {
  .section-hero {
    padding-top: 6.5rem;
    padding-bottom: 5.75rem;
  }
}

.ornament { width: 100%; max-width: 280px; margin: 0 auto; }
.ornament-top { margin-bottom: 2rem; }
.ornament-bottom { margin-top: 2rem; }

.hero-to {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(44, 44, 44, 0.66);
  margin-bottom: 0.5rem;
}

.hero-to-name {
  color: rgba(44, 44, 44, 0.9);
  font-weight: 600;
}

.hero-to-suffix {
  color: rgba(44, 44, 44, 0.62);
}

.hero-label {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.74;
  margin-bottom: 1.15rem;
  line-height: 1.5;
  text-align: center;
}

.hero-label-line {
  display: block;
}

.hero-label-line + .hero-label-line {
  margin-top: 0.15rem;
}

.hero-names {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 11vw, 4.8rem);
  font-weight: 500;
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  letter-spacing: 0.01em;
}

@media (min-width: 769px) {
  .hero-names {
    font-size: clamp(3.4rem, 6vw, 5.4rem);
  }
}

.hero-ampersand {
  font-style: italic;
  color: var(--accent2);
  font-size: 0.62em;
  line-height: 0.8;
}

.hero-date {
  margin-top: 1.25rem;
  font-size: 0.88rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.72;
}

.hero-city {
  font-size: 0.82rem;
  opacity: 0.5;
  margin-top: 0.3rem;
}

.hero-actions {
  margin-top: 1.6rem;
}

.hero-cta {
  display: inline-block;
  padding: 0.75rem 1.2rem;
  border: 1px solid rgba(44,44,44,0.45);
  border-radius: 999px;
  background: rgba(255,255,255,0.4);
  color: var(--text);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: background 0.2s ease, border-color 0.2s ease;
}
}

.hero-cta:hover { background: rgba(255,255,255,0.7); }

/* =====================
   Couple Section
   ===================== */
.couple-grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  text-align: center;
}

@media (min-width: 769px) {
  .couple-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
  }
}

.couple-fullname {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.couple-prefix {
  font-size: 0.85rem;
  opacity: 0.6;
  margin-bottom: 0.25rem;
}

.couple-parents {
  font-size: 0.85rem;
  opacity: 0.65;
  line-height: 1.5;
}

.couple-divider {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 2rem;
  color: var(--accent2);
}

/* =====================
   Events Section
   ===================== */
.events-list { display: flex; flex-direction: column; gap: 2rem; }

.event-card {
  border: 1px solid rgba(44,44,44,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.32);
  padding: 1.2rem 1.15rem;
  box-shadow: 0 10px 30px rgba(44,44,44,0.04);
}

.event-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.event-datetime {
  font-size: 0.92rem;
  opacity: 0.8;
  margin-bottom: 0.35rem;
}

.event-venue {
  font-size: 0.98rem;
  font-weight: 600;
  opacity: 0.95;
  margin-bottom: 0.22rem;
}

.event-address {
  font-size: 0.86rem;
  line-height: 1.55;
  opacity: 0.68;
}

.event-calendar-links {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.event-calendar-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  background: rgba(138,158,133,0.08);
  border: 1px solid rgba(138,158,133,0.18);
  border-radius: 999px;
  padding: 0.5rem 0.75rem;
  font-family: inherit;
  transition: background 0.2s ease;
}

.event-calendar-btn:hover { background: rgba(138,158,133,0.14); }

.map-card {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  border: 1px solid rgba(44,44,44,0.08);
  border-radius: 16px;
  background: rgba(255,255,255,0.36);
  padding: 1rem;
  box-shadow: 0 10px 30px rgba(44,44,44,0.04);
}

.map-title {
  font-family: var(--font-heading);
  font-size: 1.08rem;
  font-weight: 600;
}

.map-address { font-size: 0.86rem; opacity: 0.7; line-height: 1.55; }

.map-venue { font-size: 0.9rem; opacity: 0.82; font-style: italic; margin-bottom: 0.25rem; }

.map-embed {
  width: 100%;
  height: 250px;
  border: none;
  border-radius: 12px;
}

.map-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  padding: 0.7rem 0.95rem;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 0.8rem;
  text-decoration: none;
  letter-spacing: 0.05em;
}

/* =====================
   Countdown Section
   ===================== */
.section-countdown {
  background: var(--text);
  color: var(--bg);
  max-width: 100%;
  text-align: center;
}

.section-countdown .section-title { color: var(--bg); }

.countdown-grid {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.countdown-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.countdown-number {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 8vw, 4rem);
  line-height: 1;
  font-weight: 500;
}

.countdown-label {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-top: 0.5rem;
}

.countdown-passed {
  font-size: 1rem;
  opacity: 0.8;
  margin-top: 1.5rem;
}

/* =====================
   Maps Section
   ===================== */
.maps-list { display: flex; flex-direction: column; gap: 2rem; }

.map-card { display: flex; flex-direction: column; gap: 0.75rem; }

.map-title {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 600;
}

.map-address { font-size: 0.9rem; opacity: 0.7; }

.map-embed {
  width: 100%;
  height: 240px;
  border: none;
  border-radius: 8px;
}

.map-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: underline;
  letter-spacing: 0.05em;
}

/* =====================
   RSVP & Wish Forms
   ===================== */
.form { display: flex; flex-direction: column; gap: 1.25rem; }

.form-group { display: flex; flex-direction: column; gap: 0.4rem; }

.form-group label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.65;
}

.form-group input,
.form-group textarea {
  border: 1px solid rgba(44,44,44,0.2);
  border-radius: 6px;
  padding: 0.6rem 0.8rem;
  background: transparent;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.toggle-group { display: flex; gap: 0.5rem; }

.toggle-btn {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid rgba(44,44,44,0.2);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: inherit;
  transition: all 0.2s;
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stepper-btn {
  width: 2rem;
  height: 2rem;
  border: 1px solid rgba(44,44,44,0.2);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  transition: background 0.2s;
  line-height: 1;
}

.stepper-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

#party-count {
  font-size: 1.1rem;
  min-width: 1.5rem;
  text-align: center;
}

.btn-primary {
  padding: 0.75rem 1.5rem;
  background: var(--text);
  color: var(--bg);
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: opacity 0.2s;
}

.btn-primary:hover { opacity: 0.8; }
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }

.form-feedback {
  font-size: 0.85rem;
  padding: 0.5rem;
  border-radius: 4px;
  text-align: center;
}

.form-feedback.success { color: var(--accent); }
.form-feedback.error { color: #c0392b; }

.rsvp-closed {
  text-align: center;
  padding: 1.5rem;
  border: 1px dashed rgba(44,44,44,0.2);
  border-radius: 8px;
  font-size: 0.9rem;
  opacity: 0.7;
}

/* RSVP Status Card */
.rsvp-status {
  text-align: center;
  padding: 1.5rem;
  border: 1px solid rgba(44,44,44,0.12);
  border-radius: 10px;
  background: rgba(255,255,255,0.5);
}

.rsvp-status-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.rsvp-status-text {
  font-size: 1rem;
  margin: 0 0 1rem;
  line-height: 1.6;
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  transition: background 0.2s, color 0.2s;
}

.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
}

/* =====================
   Wishes List
   ===================== */
.wishes-list {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.wish-card {
  padding: 1rem 1.25rem;
  border: 1px solid rgba(44,44,44,0.08);
  background: rgba(255,255,255,0.32);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(44,44,44,0.03);
  transition: box-shadow var(--transition), background var(--transition);
}

.wish-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.wish-message { font-size: 0.88rem; opacity: 0.8; line-height: 1.55; }
.wish-time { font-size: 0.75rem; opacity: 0.45; margin-top: 0.5rem; }

/* =====================
   Toast Notification
   ===================== */
.toast-notif {
  position: fixed;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: var(--text);
  color: var(--bg);
  padding: 0.85rem 1.8rem;
  border-radius: 12px;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  max-width: 85vw;
  pointer-events: none;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.toast-show { opacity: 1; visibility: visible; }
.toast-hide { opacity: 0; visibility: hidden; }

/* =====================
   Closing Section
   ===================== */
.section-closing { text-align: center; }

.closing-text {
  font-size: 0.9rem;
  opacity: 0.7;
  max-width: 360px;
  margin: 0 auto 1.5rem;
  line-height: 1.8;
}

.closing-names {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 400;
  font-style: italic;
}

.closing-hormat {
  font-size: 0.85rem;
  opacity: 0.6;
  font-style: italic;
  margin-bottom: 0.5rem;
}

.closing-parents-label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.4;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

.closing-parents {
  font-size: 0.88rem;
  opacity: 0.65;
  line-height: 1.7;
}

.closing-footer {
  margin-top: 2rem;
  font-size: 0.75rem;
  opacity: 0.35;
}

.closing-wassalamu {
  font-family: var(--font-body, 'Inter', sans-serif);
  font-size: clamp(0.85rem, 2.5vw, 1.05rem);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  opacity: 0.72;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

/* =====================
   Section Dividers
   ===================== */
.section + .section { border-top: 1px solid rgba(44,44,44,0.08); }
.section-countdown { border-top: none !important; }
.section-countdown + .section { border-top: none; }
