/* ==========================================================================
   Adventure Nomad — Main CSS
   Design system: variables, resets, typography, utilities
   ========================================================================== */

/* --------------------------------------------------------------------------
   Google Fonts
   -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&display=swap');

/* --------------------------------------------------------------------------
   CSS Custom Properties (Design Tokens)
   -------------------------------------------------------------------------- */
:root {
  /* --- Brand Colours --- */
  --teal:          #00B4C8;   /* Main brand teal — CTAs, links, icons, accents */
  --teal-dark:     #0093A8;   /* Hover state for teal elements */
  --teal-deep:     #006E7F;   /* Deep teal — footer background, dark sections */
  --teal-light:    #E0F7FA;   /* Very light teal — subtle backgrounds, pill tags */
  --teal-mid:      #B2EBF2;   /* Mid teal — borders, dividers */

  /* --- Neutrals --- */
  --charcoal:      #1A1F2E;   /* Primary text, dark section backgrounds */
  --charcoal-mid:  #2D3548;   /* Slightly lighter dark — card dark areas */
  --off-white:     #F8F7F4;   /* Page background, section alternates */
  --white:         #FFFFFF;   /* Card backgrounds, nav */
  --warm-grey:     #6B7280;   /* Body text, secondary text */
  --light-grey:    #E5E7EB;   /* Borders, dividers, input outlines */

  /* --- Accent --- */
  --gold:          #E8B84B;   /* Star ratings, highlight details */
  --gold-light:    #FEF3C7;   /* Gold tint background */

  /* --- Semantic --- */
  --success:       #10B981;
  --error:         #EF4444;

  /* --- Typography --- */
  --font-display: 'Sora', -apple-system, sans-serif;
  --font-body:    'DM Sans', -apple-system, sans-serif;

  /* --- Spacing Scale (4px base unit) --- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  80px;
  --space-10: 96px;

  /* --- Border Radius --- */
  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --radius-xl:   32px;
  --radius-full: 9999px;

  /* --- Shadows --- */
  --shadow-sm:   0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow:      0 4px 24px rgba(0, 0, 0, 0.09);
  --shadow-lg:   0 12px 48px rgba(0, 0, 0, 0.14);
  --shadow-xl:   0 24px 64px rgba(0, 0, 0, 0.18);
  --shadow-teal: 0 6px 24px rgba(0, 180, 200, 0.30);

  /* --- Transitions --- */
  --transition: 0.25s ease;
  --transition-slow: 0.5s ease;

  /* --- Nav height --- */
  --nav-height: 72px;

  /* --- Max content width --- */
  --max-width: 1280px;
  --content-padding: 6vw;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: clip; /* prevents iOS Safari from allowing horizontal scroll when body has overflow-x:hidden */
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--charcoal);
  background-color: var(--off-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

/* --------------------------------------------------------------------------
   Typography Scale
   -------------------------------------------------------------------------- */
h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--charcoal);
}

h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--charcoal);
}

h3 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  font-weight: 700;
  line-height: 1.3;
  color: var(--charcoal);
}

h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--charcoal);
}

p {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  color: var(--warm-grey);
}

.lead {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--warm-grey);
}

small {
  font-size: 0.85rem;
}

.label {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--space-3);
}

/* --------------------------------------------------------------------------
   Layout Utilities
   -------------------------------------------------------------------------- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--content-padding);
}

.section {
  padding: var(--space-9) var(--content-padding);
}

.section--white { background-color: var(--white); }
.section--off-white { background-color: var(--off-white); }
.section--charcoal { background-color: var(--charcoal); }
.section--charcoal-mid { background-color: var(--charcoal-mid); }
.section--teal { background-color: var(--teal); }
.section--teal-deep { background-color: var(--teal-deep); }

/* Visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Grid system */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-7);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-5);
}

.grid-auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

/* Text alignment */
.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

/* Flex utilities */
.flex        { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col    { display: flex; flex-direction: column; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-5 { gap: var(--space-5); }

/* Spacing utilities */
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

/* Section heading block */
.section-header {
  margin-bottom: var(--space-7);
}

.section-header--center {
  text-align: center;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
  margin-bottom: var(--space-7);
}

.section-header p {
  margin-top: var(--space-4);
  font-size: 1.05rem;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-in {
  animation: fadeInUp 0.8s ease forwards;
}

.animate-fade {
  animation: fadeIn 0.6s ease forwards;
}

/* Stagger delays for grids */
.stagger > *:nth-child(1) { animation-delay: 0s; }
.stagger > *:nth-child(2) { animation-delay: 0.1s; }
.stagger > *:nth-child(3) { animation-delay: 0.2s; }
.stagger > *:nth-child(4) { animation-delay: 0.3s; }
.stagger > *:nth-child(5) { animation-delay: 0.4s; }

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* --------------------------------------------------------------------------
   Focus Styles (Accessibility — WCAG AA)
   -------------------------------------------------------------------------- */
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  :root { --content-padding: 5vw; }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  :root {
    --content-padding: 5vw;
    --nav-height: 64px;
  }

  .section {
    padding: var(--space-7) var(--content-padding);
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .grid-4 {
    grid-template-columns: 1fr 1fr;
  }

  h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); }
  h2 { font-size: clamp(1.5rem, 5vw, 2rem); }
}

@media (max-width: 480px) {
  .grid-4 {
    grid-template-columns: 1fr;
  }
}
