/* Design System & Variables */
:root {
  /* Colors */
  --color-bg: #faf8f5;
  --color-text: #2c2c2c;
  --color-text-muted: #4b4b4b;
  --color-primary: #2E5948; /* Elegant Dark Green */
  --color-accent: #3A6B58; /* Elegant Green */
  --color-accent-hover: #2E5948;
  --color-white: #ffffff;
  --color-border: #e6e0d4;
  --color-surface: #ffffff;
  --color-surface-alt: #f7f3ed;

  /* Typography */
  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Lora", Georgia, serif;

  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 48px;
  --spacing-xl: 48px;
  --spacing-xxl: 80px;

  /* Layout */
  --container-width: 1200px;
  --header-height: 80px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
}

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

html {
  scroll-behavior: smooth;
  font-size: 17px;
}

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-primary);
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2rem); }

p {
  margin-bottom: var(--spacing-md);
  color: var(--color-text-muted);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

img, video, iframe {
  max-width: 100%;
  display: block;
}

/* Form Controls */
input,
textarea,
select,
button,
.btn {
  font-family: var(--font-body);
}

input,
textarea,
select {
  font-size: 1rem;
  color: var(--color-text);
}

::placeholder {
  color: var(--color-text-muted);
}

/* Utility Classes */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

.section {
  padding: var(--spacing-xxl) 0;
}

/* Tighten spacing between Packages and FAQ */
#packages.section { padding-bottom: var(--spacing-lg); }
#faq.section { padding-top: var(--spacing-lg); }

/* Responsive: stack packages on mobile */
@media (max-width: 768px) {
  .package-grid { grid-template-columns: 1fr !important; gap: var(--spacing-md) !important; }
}

/* About page proportion tweaks */
.about.section { padding-top: calc(var(--spacing-xl) + var(--header-height)); padding-bottom: var(--spacing-xl); }
.about h1 { font-size: 2rem; line-height: 1.25; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: stretch; }
/* Ensure equal-height cards on About grid */
.about-grid > div { height: 100%; }
@media (max-width: 768px) {
  .about-grid { grid-template-columns: 1fr; gap: var(--spacing-md); }
}

.text-center { text-align: center; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }

/* Components */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 32px;
  background-color: var(--color-primary);
  color: var(--color-white);
  font-weight: 500;
  border-radius: var(--radius-md);
  letter-spacing: 0.02em;
  transition: all 0.3s ease;
  border: 1px solid transparent;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:hover {
  background-color: #2a2d35;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* Contact form layout and input normalization */
#contactForm .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }
@media (max-width: 768px) {
  #contactForm .form-row { grid-template-columns: 1fr; }
}
#contactForm input, #contactForm textarea, #contactForm select { width: 100%; font: inherit; }
#contactForm input[type="date"] { -webkit-appearance: none; appearance: none; height: 44px; line-height: 1.2; }
#contactForm input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0.6; }
#contactForm input, #contactForm textarea { padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-sm); }

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(250, 248, 245, 0.7);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  color: var(--color-text); /* ensure currentColor is neutral, not iOS link blue */
}

.header .container {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: start;
}

.logo img {
  height: 32px;
  width: auto;
  border-radius: var(--radius-md);
}

.nav-links {
  display: flex;
  gap: 32px;
  justify-self: center;
}

.header-cta {
  justify-self: end;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text);
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-accent);
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  justify-self: end;
  -webkit-appearance: none;
  appearance: none;
  color: var(--color-text) !important;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-fill-color: var(--color-text);
}

.mobile-toggle svg { color: inherit; stroke: currentColor; fill: none; }
.mobile-toggle:active, .mobile-toggle:focus { color: var(--color-text) !important; }
.mobile-toggle svg line, .mobile-toggle svg path, .mobile-toggle svg rect { stroke: currentColor !important; }

/* iOS Safari-specific reinforcement */
@supports (-webkit-touch-callout: none) {
  .mobile-toggle { color: var(--color-text) !important; -webkit-text-fill-color: var(--color-text) !important; }
  .mobile-toggle svg, .mobile-toggle svg *, .mobile-toggle { -webkit-tap-highlight-color: transparent !important; }
}

.mobile-toggle:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }

/* Hero Section */
.hero {
  position: relative;
  height: 100vh; /* fallback */
  height: 100svh; /* iOS Safari small viewport */
  height: 100dvh; /* dynamic viewport units */
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding-top: var(--header-height);
}

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-bg iframe {
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100vh;
  min-width: 177.77vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: brightness(0.6);
  opacity: 0;
  transition: opacity 0.6s ease;
}

/* Poster placeholder under hero video */
.hero-poster {
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  min-height: 100vh;
  min-width: 177.77vh;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  object-fit: cover;
  filter: brightness(0.65);
  transition: opacity 0.6s ease;
}

.hero-poster.hidden {
  opacity: 0;
}

.hero-content {
  text-align: center;
  color: var(--color-white);
  max-width: 800px;
  padding: 0 20px;
  padding-bottom: 96px; /* ensure CTA clears scroll indicator */
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s ease forwards 0.5s;
}

.hero h1 {
  color: var(--color-white);
  margin-bottom: 24px;
}

.hero p {
  color: rgba(255,255,255,0.9);
  font-size: 1.25rem;
  margin-bottom: 32px;
}
/* Hero crest logo */
.hero-logo {
  height: 56px;
  width: auto;
  border-radius: var(--radius-md);
  margin: 0 auto var(--spacing-md);
}

.scroll-indicator {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  gap: 8px;
  animation: bounce 2s infinite;
  pointer-events: none;
}

@media (max-width: 768px) {
  .hero-content { padding-bottom: 112px; }
  .scroll-indicator { bottom: 16px; }
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
  40% { transform: translateX(-50%) translateY(-10px); }
  60% { transform: translateX(-50%) translateY(-5px); }
}

/* Animations */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* Packages note and add-ons styling */
.packages-note {
  text-align: center;
  color: var(--color-text-muted);
  max-width: 820px;
  margin: 8px auto 24px;
  font-size: .95rem;
}

.addons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.addon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-alt);
  color: var(--color-text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.addon-pill:hover {
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Responsive */
@media (max-width: 900px) {
  .header .container {
    display: flex;
    justify-content: space-between;
  }

  .nav-links {
    display: none; /* Hidden by default on mobile */
    position: absolute;
    top: var(--header-height);
    left: 0;
    width: 100%;
    background: var(--color-bg);
    flex-direction: column;
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    align-items: center;
  }

  .nav-links.active {
    display: flex;
  }

  .header-cta {
    display: none; /* Hide header button on mobile, assume it's in nav or user uses contact link */
  }

  .mobile-toggle {
    display: block;
  }
}
