/*
  Nomadiq Travel Destinations – styles.css
  - Color palette (calming greens & blues)
  - Accessible typography
  - Responsive layout with media queries (>= 600px)
*/

:root {
  /* Calming eco palette */
  --green-700: #2f855a; /* deep leaf */
  --green-500: #38a169; /* fresh leaf */
  --green-100: #e6f4ea; /* mint wash */
  --teal-700: #0f766e; /* deep teal */
  --teal-500: #14b8a6; /* sea foam */
  --blue-100: #e6f1fb; /* soft sky */
  --sand-50: #f7f7f2;  /* off-white */
  --ink-900: #0b3d3c;  /* near-black teal */
  --ink-700: #23424a;  /* dark slate */
  --ink-500: #3d5b5b;  /* slate */
  --white: #ffffff;
  --error: #e11d48; /* raspberry for errors */

  --bg: var(--sand-50);
  --text: var(--ink-900);
  --muted: var(--ink-500);
  --brand: var(--green-700);
  --brand-contrast: var(--white);
  --surface: var(--white);
  --surface-alt: var(--green-100);
  /* Default hero overlay image (can be changed or removed) */
  --hero-image: url('https://images.unsplash.com/photo-1501785888041-af3ef285b470?q=80&w=1600&auto=format&fit=crop');

  color-scheme: light dark;
}

/* Typography */
html { font-size: 100%; }
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  margin: 0;
}
h1, h2, h3 { font-family: "Poppins", "Inter", system-ui, sans-serif; color: var(--text); }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3rem); line-height: 1.2; }
h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem); line-height: 1.25; }
h3 { font-size: 1.125rem; }
.lead { font-size: clamp(1rem, 0.5vw + 1rem, 1.125rem); color: color-mix(in oklab, var(--text) 85%, transparent); }

/* Utilities */
.container { width: min(1100px, 90%); margin-inline: auto; }
.section { padding: 3rem 0; }

/* Dark theme overrides */
html[data-theme="dark"] {
  --bg: #0e1a18; /* deep evergreen */
  --text: #e8f3ef; /* pale mint text */
  --muted: #a2c2bb; /* soft slate */
  --brand: #94d3ac; /* light leaf accent */
  --brand-contrast: #0b3d3c; /* dark for contrast on brand */
  --surface: #132421; /* card/header surface */
  --surface-alt: #0f2a26; /* subtle alt surface */
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden;
}
.skip-link:focus { left: 1rem; top: 1rem; width: auto; height: auto; padding: .5rem .75rem; background: var(--ink-900); color: var(--white); border-radius: .375rem; z-index: 999; }

/* Header */
.site-header {
  background: color-mix(in oklab, var(--surface) 82%, transparent);
  position: sticky;
  top: 0;
  border-bottom: 1px solid color-mix(in oklab, var(--text) 12%, transparent);
  z-index: 50;
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
}
.header-inner { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: .5rem .75rem; padding: .65rem 0; }
.brand { display: inline-flex; align-items: center; gap: .5rem; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .2px; min-width: 0; overflow: hidden; }
.brand-emoji { filter: saturate(1.1); }
.brand-text { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-logo { width: 24px; height: 24px; border-radius: .35rem; object-fit: cover; display: inline-block; }

.primary-nav { position: relative; }
.nav-toggle { display: inline-flex; flex-direction: column; gap: 4px; background: transparent; border: 1px solid color-mix(in oklab, var(--text) 20%, transparent); padding: .5rem; border-radius: .75rem; cursor: pointer; color: var(--text); min-width: 44px; min-height: 44px; align-items: center; justify-content: center; }
.nav-toggle .bar { display: block; width: 20px; height: 2px; background: currentColor; border-radius: 1px; }
.nav-list { list-style: none; margin: 0; padding: 0; display: none; position: absolute; right: 0; top: calc(100% + .5rem); background: var(--surface); border: 1px solid #e5e7eb; border-radius: .5rem; box-shadow: 0 8px 24px rgba(0,0,0,.06); min-width: 220px; }
.nav-list li { border-bottom: 1px solid #eef2f1; }
.nav-list li:last-child { border-bottom: none; }
.nav-list a { display: block; padding: .75rem 1rem; color: var(--text); text-decoration: none; }
.nav-list a:hover, .nav-list a:focus { background: var(--surface-alt); }

/* Nav underline for active/hover states */
.nav-list a { position: relative; }
.nav-list a::after {
  content: "";
  position: absolute;
  left: .75rem;
  right: .75rem;
  bottom: .35rem;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s ease;
  opacity: .85;
}
.nav-list a:hover::after, .nav-list a:focus::after, .nav-list a.is-active::after { transform: scaleX(1); }

/* Show menu when expanded */
.primary-nav[aria-expanded="true"] .nav-list { display: block; }

/* Hero */
.hero { position: relative; background: linear-gradient(180deg, color-mix(in oklab, var(--surface-alt) 85%, transparent), var(--blue-100)); }
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center;
  opacity: .22; /* keep text contrast high */
  mix-blend-mode: multiply;
  pointer-events: none;
}
.hero .container { padding-top: 3rem; padding-bottom: 2rem; }
.cta-group { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }

/* Cards */
.card-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
.card { background: var(--surface); border: 1px solid color-mix(in oklab, var(--text) 10%, transparent); border-radius: .9rem; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.card:hover { transform: translateY(-4px); box-shadow: 0 16px 28px rgba(0,0,0,.10); }
.card img { width: 100%; height: auto; display: block; }
.card-body { padding: 1rem; }
.card-body h3 { margin: 0 0 .25rem 0; }

/* CTA section */
.cta { background: var(--surface); border-top: 1px solid color-mix(in oklab, var(--text) 10%, transparent); border-bottom: 1px solid color-mix(in oklab, var(--text) 10%, transparent); text-align: center; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1rem; border-radius: .625rem; text-decoration: none; font-weight: 600; border: 1px solid transparent; transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease; }
.btn-primary { background: var(--brand); color: var(--brand-contrast); border-color: var(--brand); box-shadow: 0 6px 14px rgba(0,0,0,.06); }
.btn-primary:hover, .btn-primary:focus { background: var(--green-500); border-color: var(--green-500); transform: translateY(-1px); box-shadow: 0 10px 18px rgba(0,0,0,.10); }
.btn-ghost { background: transparent; color: var(--text); border-color: color-mix(in oklab, var(--text) 35%, transparent); }
.btn-ghost:hover, .btn-ghost:focus { background: color-mix(in oklab, var(--text) 8%, transparent); }

/* Footer */
.site-footer { padding: 2rem 0; color: var(--muted); font-size: .95rem; }

/* Images responsive rule */
img { max-width: 100%; height: auto; }

/* Icons */
.icon { display: inline-block; vertical-align: middle; color: currentColor; }
.brand .icon-leaf { color: var(--brand); }

/* Media query for >= 600px */
@media (min-width: 600px) {
  .brand-text { font-size: 1.125rem; }
  .brand-logo { width: 28px; height: 28px; }
  .nav-toggle { display: none; }
  .nav-list { position: static; display: flex !important; background: transparent; border: 0; box-shadow: none; min-width: unset; }
  .nav-list li { border: 0; }
  .nav-list a { padding: .5rem .75rem; border-radius: .5rem; }
  .nav-list a:hover, .nav-list a:focus { background: var(--surface-alt); }

  .hero .container { padding-top: 4rem; padding-bottom: 3rem; }
  .card-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}

/* Larger screens */
@media (min-width: 1024px) {
  h1 { font-size: clamp(2.5rem, 2vw + 1.5rem, 3.5rem); }
  .section { padding: 4rem 0; }
  .cta-group { gap: 1rem; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* Focus styles */
:where(a, button, [role="button"]) { outline: none; }
:where(a, button, [role="button"]):focus-visible { outline: 3px solid color-mix(in oklab, var(--brand) 70%, white 30%); outline-offset: 2px; border-radius: .25rem; }

/* Screen reader text */
.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; }

/* Theme toggle button */
.theme-toggle {
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--text) 20%, transparent);
  color: var(--text);
  padding: .5rem;
  border-radius: .75rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
}
.theme-toggle:hover { background: var(--surface-alt); }
.theme-toggle .theme-icon { font-size: 1rem; line-height: 1; }
.theme-toggle .icon { width: 22px; height: 22px; }

/* Contact form */
.contact-form { margin-top: 1.25rem; text-align: left; display: grid; gap: .75rem; }
.form-row { display: grid; gap: .375rem; }
.contact-form label { font-weight: 600; }
.contact-form input,
.contact-form textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid color-mix(in oklab, var(--text) 15%, transparent);
  border-radius: .5rem;
  padding: .65rem .75rem;
}
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: color-mix(in oklab, var(--text) 50%, transparent); }
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in oklab, var(--brand) 35%, transparent); }
.contact-form [aria-invalid="true"], .contact-form :invalid { border-color: var(--error); box-shadow: 0 0 0 3px color-mix(in oklab, var(--error) 25%, transparent); }
.form-errors { margin-top: .5rem; min-height: 1.25rem; color: var(--error); font-weight: 600; }
.form-errors.success { color: var(--brand); }

/* Back to top button */
.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  background: var(--surface);
  border: 1px solid color-mix(in oklab, var(--text) 20%, transparent);
  color: var(--text);
  padding: .55rem .6rem;
  border-radius: .6rem;
  box-shadow: 0 6px 18px rgba(0,0,0,.08);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.back-to-top:hover { background: var(--surface-alt); }
