/* =========================================================
   Variables
   ========================================================= */
:root {
  /* Color palette - warm, rustic, eco-friendly */
  --color-bg: #FAF7F2; /* warm cream background */
  --color-surface: #FFFFFF; /* cards, inputs */
  --color-text: #2E2A25; /* warm dark brown-gray */
  --color-primary: #3F7D4E; /* moss green */
  --color-primary-600: #376F46;
  --color-primary-700: #2F603D;
  --color-success: #2E7D32;
  --color-warning: #D9822B;
  --color-danger: #B34A3C;

  /* Neutral grays (warm) */
  --gray-50:  #FAF8F6;
  --gray-100: #F4F1EC;
  --gray-200: #E7E2DA;
  --gray-300: #D7D0C6;
  --gray-400: #BEB6AA;
  --gray-500: #A3988A;
  --gray-600: #7F7467;
  --gray-700: #61584E;
  --gray-800: #463F37;
  --gray-900: #2E2A25;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Inter", "Nunito Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Merriweather", Georgia, "Noto Serif", "Times New Roman", Times, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --fs-xs: 0.75rem;   /* 12px */
  --fs-sm: 0.875rem;  /* 14px */
  --fs-base: 1rem;    /* 16px */
  --fs-lg: 1.125rem;  /* 18px */
  --fs-xl: 1.25rem;   /* 20px */
  --fs-2xl: 1.5rem;   /* 24px */
  --fs-3xl: 1.875rem; /* 30px */
  --fs-4xl: 2.25rem;  /* 36px */
  --fs-5xl: 3rem;     /* 48px */
  --fs-6xl: 3.75rem;  /* 60px */

  --lh-tight: 1.2;
  --lh-snug: 1.35;
  --lh-normal: 1.6;
  --lh-relaxed: 1.75;

  /* Spacing scale (0–96px) */
  --space-0: 0px;
  --space-1: 2px;
  --space-2: 4px;
  --space-3: 8px;
  --space-4: 12px;
  --space-5: 16px;
  --space-6: 20px;
  --space-7: 24px;
  --space-8: 32px;
  --space-9: 40px;
  --space-10: 48px;
  --space-11: 56px;
  --space-12: 64px;
  --space-13: 72px;
  --space-14: 80px;
  --space-15: 88px;
  --space-16: 96px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-round: 9999px;

  /* Shadows (subtle, warm) */
  --shadow-sm: 0 1px 2px rgba(20, 16, 12, 0.06);
  --shadow-md: 0 4px 8px rgba(20, 16, 12, 0.08);
  --shadow-lg: 0 10px 24px rgba(20, 16, 12, 0.12);

  /* Transitions */
  --ease-out: cubic-bezier(0.2, 0, 0, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* Layout */
  --container-max: 72rem; /* ~1152px */
  --container-wide: 90rem; /* ~1440px for hero photography */
  --container-gutter: clamp(16px, 4vw, 32px);

  /* Focus ring */
  --focus-ring: 0 0 0 3px rgba(63, 125, 78, 0.3);
}

/* =========================================================
   Reset / Normalize
   ========================================================= */
* {
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: inherit;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd,
ul, ol {
  margin: 0;
}

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

/* Avoid text overflows */
:where(p, h1, h2, h3, h4, h5, h6) {
  overflow-wrap: anywhere;
}

/* Remove default list styles on ul, ol elements with a list role */
:where(ul[role="list"], ol[role="list"]) {
  list-style: none;
  padding: 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: 0;
  padding: 0;
}

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

/* =========================================================
   Base styles
   ========================================================= */

   body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-normal);
  background-color: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Headings: warm, serif for a rustic, trustworthy tone */
:where(h1, h2, h3, h4, h5, h6) {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: 0.005em;
  color: var(--color-text);
}

h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.25rem); margin-block: var(--space-9) var(--space-6); }
h2 { font-size: clamp(1.75rem, 1rem + 2vw, 2.5rem); margin-block: var(--space-8) var(--space-5); }
h3 { font-size: clamp(1.5rem, 0.9rem + 1.5vw, 2rem); margin-block: var(--space-7) var(--space-4); }
h4 { font-size: 1.25rem; margin-block: var(--space-6) var(--space-4); }
h5 { font-size: 1.125rem; margin-block: var(--space-5) var(--space-3); }
h6 { font-size: 1rem; margin-block: var(--space-4) var(--space-3); }

p {
  max-width: 68ch;
  line-height: var(--lh-relaxed);
  margin-block-end: var(--space-8);
}

/* Links */
a {
  color: var(--color-primary);
  text-decoration: none;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: rgba(0,0,0,0);
}

a:hover { text-decoration: underline; }

/* Code */
code, pre, kbd, samp { font-family: var(--font-mono); font-size: 0.95em; }

hr {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: var(--space-10) 0;
}

/* Forms base */
label { display: inline-block; margin-bottom: var(--space-3); }

/* =========================================================
   Header & Footer styles
   ========================================================= */
/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--color-surface); border-bottom: 1px solid var(--gray-200); box-shadow: var(--shadow-sm); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; }
.brand__link { font-family: var(--font-serif); font-weight: 800; font-size: 1.25rem; color: var(--color-text); }

/* Navigation */
.site-nav { display: flex; }
.site-nav__list { display: flex; align-items: center; gap: var(--space-6); }
.site-nav a { color: var(--color-text); font-weight: 600; }
.site-nav a:hover { color: var(--color-primary); text-decoration: none; }

/* Mobile nav toggle */
.nav-toggle { display: none; width: 44px; height: 44px; border-radius: var(--radius-md); border: 1px solid var(--gray-300); background-color: var(--color-surface); }
.nav-toggle:focus-visible { box-shadow: var(--focus-ring); }
.nav-toggle__bar { display: block; width: 20px; height: 2px; margin: 4px auto; background: var(--color-text); border-radius: 2px; transition: transform var(--dur-base) var(--ease-out); }

@media (max-width: 900px) {
  .nav-toggle { flex-direction: column !important; display: inline-flex; align-items: center; justify-content: center; }
  .site-nav { position: fixed; inset: 34px 0 auto 0 !important; background: var(--color-surface); border-bottom: 1px solid var(--gray-200); transform: translateY(-120%); transition: transform var(--dur-base) var(--ease-out); }
  .site-nav.is-open { top: 64px !important; transform: translateY(0); }
  .site-nav__list { padding: var(--space-6) var(--container-gutter); flex-direction: column; align-items: flex-start; gap: var(--space-5); }
  .small-hide { display: none; }
}

/* Skip link */
.skip-link { position: absolute; left: -9999px; top: auto; }
.skip-link:focus { left: 16px; top: 16px; background: var(--color-primary); color: #fff; padding: 8px 12px; border-radius: var(--radius-md); z-index: 100; }

/* Footer */
.site-footer { background: var(--gray-100); border-top: 1px solid var(--gray-200); padding-top: var(--space-10); }
.footer__inner { display: grid; gap: var(--space-8); grid-template-columns: 1.2fr 1fr 1fr; }
.footer-links { display: grid; gap: var(--space-3); }
.footer__bottom { border-top: 1px solid var(--gray-200); padding: var(--space-6) 0; margin-top: var(--space-8); }
@media (max-width: 900px) { .footer__inner { grid-template-columns: 1fr; } }

/* Cookie banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; background: var(--color-surface); border-top: 1px solid var(--gray-200); box-shadow: 0 -6px 20px rgba(20,16,12,0.08); z-index: 60; padding: var(--space-6) 0; }
.cookie-banner__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-6); }
.cookie-banner__text { margin: 0; max-width: 70ch; }
.cookie-banner__actions { display: flex; gap: var(--space-4); flex-wrap: wrap; }
@media (max-width: 700px) {
  .cookie-banner__inner { flex-direction: column; align-items: stretch; }
  .cookie-banner__actions { justify-content: flex-end; }
}

/* Age restriction modal (placeholder for popups - modal styles MUST be implemented for overlays) */
/* (No direct styles found in provided CSS, but you may add your own based on project needs.) */

/* =========================================================
   Utilities
   ========================================================= */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-gutter);
}

.container--wide { max-width: var(--container-wide); }

/* Layout helpers */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.space-between { justify-content: space-between; }
.gap-sm { gap: var(--space-4); }
.gap-md { gap: var(--space-6); }
.gap-lg { gap: var(--space-8); }

.grid { display: grid; gap: var(--space-8); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-8); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-8); }
.auto-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: var(--space-8); }

/* Screen-reader only */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}
p {
  max-width: 100% !important;
}
/* Utility spacing (examples) */
.mt-0 { margin-top: 0 !important; }
.mb-0 { margin-bottom: 0 !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.pt-8 { padding-top: var(--space-8) !important; }
.pb-8 { padding-bottom: var(--space-8) !important; }

/* =========================================================
   Components
   ========================================================= */
/* Buttons */
.btn {
  --btn-bg: var(--color-primary);
  --btn-bg-hover: var(--color-primary-600);
  --btn-border: transparent;
  --btn-color: #FFFFFF;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 0.625rem 1rem;
  border: 1px solid var(--btn-border);
  border-radius: var(--radius-md);
  background-color: var(--btn-bg);
  color: var(--btn-color);
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}

.btn:hover { background-color: var(--btn-bg-hover); }

.btn:active { transform: translateY(1px); }

.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--outline {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(63, 125, 78, 0.06);
  --btn-border: var(--color-primary);
  --btn-color: var(--color-primary);
  background-clip: padding-box;
}

.btn--ghost {
  --btn-bg: transparent;
  --btn-bg-hover: rgba(63, 125, 78, 0.06);
  --btn-border: transparent;
  --btn-color: var(--color-primary);
}

/* Inputs */
.input,
select,
textarea,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"] {
  width: 100%;
  appearance: none;
  padding: 0.625rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background-color: var(--color-surface);
  color: var(--color-text);
  line-height: 1.4;
  transition: border-color var(--dur-base) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}

.input::placeholder,
input::placeholder,
textarea::placeholder { color: var(--gray-500); }

.input:focus,
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary-600);
  box-shadow: var(--focus-ring);
}

textarea { min-height: 8rem; resize: vertical; }

input[type="checkbox"], input[type="radio"] {
  accent-color: var(--color-primary);
}

/* Cards */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.card--elevated { box-shadow: var(--shadow-lg); }

/* Focus-visible (accessibility) */
:where(a, button, input, select, textarea, [tabindex]:not([tabindex="-1"])):focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

/* Link focus variant for better visibility on cream background */
a:focus-visible {
  border-radius: 4px;
}

/* Media elements should not exceed container and keep rounded corners when inside cards */
.card :where(img, video) { border-radius: calc(var(--radius-lg) - 2px); }

/* =========================================================
   Theming helpers (optional but helpful)
   ========================================================= */
.accent-success { color: var(--color-success); }
.accent-warning { color: var(--color-warning); }
.accent-danger { color: var(--color-danger); }
.bg-surface { background-color: var(--color-surface); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* =========================================================
   Organic touches (subtle)
   ========================================================= */
/* Gentle paper-like background option for sections */
.section--paper { background-color: var(--gray-100); }

/* Optional subtle divider utility mimicking natural textures */
.divider {
  height: 1px;
  background-image: linear-gradient(to right, transparent, rgba(0,0,0,0.08), transparent);
}

/* Ensure images used as full-width hero respect aspect ratio */
.hero-media { width: 100%; height: auto; object-fit: cover; }

/* Utility */
.small { font-size: var(--fs-sm); }
