/* ==========================================================
   Variables
   ========================================================== */
:root {
  /* Brand palette inspired by warm markets: desert gold, sapphire, terracotta, deep brown */
  --color-background: #FFF8F0; /* warm parchment */
  --color-surface: #FFFFFF; /* cards, panels */
  --color-text: #2F241D; /* deep brown, high readability */
  --color-primary: #1F5BA3; /* sapphire blue */
  --color-success: #2E7D32; /* deep green */
  --color-warning: #CDA34F; /* desert gold */
  --color-danger: #C7523B; /* terracotta red */

  /* Optional accents */
  --color-accent-gold: #D9B15A;
  --color-accent-brown: #3E2C23;

  /* Neutral grays (warm-leaning) */
  --gray-50:  #FAF7F3;
  --gray-100: #F2ECE5;
  --gray-200: #E7DFD6;
  --gray-300: #D7CEC3;
  --gray-400: #B9ADA2;
  --gray-500: #9B8E83;
  --gray-600: #7A6F66;
  --gray-700: #5B524B;
  --gray-800: #3E3732;
  --gray-900: #271F1B;

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

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

  --leading-tight: 1.2;
  --leading-normal: 1.5;
  --leading-relaxed: 1.7;

  /* Comfortable reading measure */
  --measure: 65ch;

  /* Spacing scale (0–96px) */
  --space-0: 0;
  --space-2: 2px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --space-64: 64px;
  --space-72: 72px;
  --space-80: 80px;
  --space-96: 96px;

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

  /* Shadows (warm ambient) */
  --shadow-sm: 0 1px 2px rgba(24, 18, 14, 0.08);
  --shadow-md: 0 4px 14px rgba(24, 18, 14, 0.12);
  --shadow-lg: 0 12px 28px rgba(24, 18, 14, 0.18);

  /* Transitions */
  --duration-fast: 120ms;
  --duration-normal: 200ms;
  --duration-slow: 320ms;
  --easing-standard: cubic-bezier(0.2, 0.8, 0.2, 1);

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
}

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

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

body { margin: 0; min-height: 100vh; }

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

ul[role='list'], ol[role='list'] { list-style: none; }

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

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

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

/* Respect motion preferences */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}

/* ==========================================================
   Base styles
   ========================================================== */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--color-text);
  background-color: var(--color-background);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Headings: authoritative serif with responsive scale */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 800;
  line-height: var(--leading-tight);
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 2.5vw + 1.25rem, 3rem); margin-block: 0 var(--space-20); max-width: 28ch; }
h2 { font-size: clamp(1.5rem, 1.5vw + 1rem, 2.25rem); margin-block: var(--space-24) var(--space-12); max-width: 34ch; }
h3 { font-size: clamp(1.25rem, 1vw + 0.9rem, 1.75rem); margin-block: var(--space-20) var(--space-8); max-width: 40ch; }
h4 { font-size: var(--text-xl); margin-block: var(--space-16) var(--space-8); }
h5 { font-size: var(--text-lg); margin-block: var(--space-12) var(--space-8); }
h6 { font-size: var(--text-base); text-transform: uppercase; letter-spacing: 0.04em; margin-block: var(--space-12) var(--space-8); }

/* Paragraphs: comfortable reading measure */
p { margin-block: 0 var(--space-16);  }

/* Links: clean, emphasize on interaction */
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--color-accent-gold); }
a:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* Lists */
ul, ol { padding-left: var(--space-24); margin-block: 0 var(--space-16); }
li { margin-block: var(--space-8); }

/* Quotes and code */
blockquote { border-inline-start: 4px solid var(--color-accent-gold); padding-inline-start: var(--space-16); color: var(--gray-700); margin-block: var(--space-20); }
code, pre { font-family: var(--font-mono); font-size: 0.95em; }
pre { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: var(--radius-md); padding: var(--space-16); overflow: auto; }

hr { border: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gray-200), transparent); margin-block: var(--space-24); }

/* Forms base */
label { display: inline-block; font-weight: 600; margin-block-end: var(--space-8); }

/* ==========================================================
   Header & Footer Styles
   ========================================================== */
/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-12) var(--space-16);
  border-radius: var(--radius-md);
}
.skip-link:focus {
  left: var(--space-16);
  top: var(--space-16);
  z-index: 1000;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: linear-gradient(180deg, #FFF, #FFF8F0 70%);
  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: 900;
  font-size: 1.25rem;
  color: var(--color-accent-brown);
  letter-spacing: 0.5px;
}

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-20);
}
.nav__list {
  display: flex;
  gap: var(--space-16);
  padding: 0;
  margin: 0;
}
.nav__item a {
  display: inline-flex;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-800);
}
.nav__item a:hover {
  background: var(--gray-100);
  text-decoration: none;
}

.nav-search {
  display: flex;
  gap: var(--space-8);
  align-items: center;
}
.nav-search .input {
  max-width: 280px;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  padding: 10px;
  border-radius: var(--radius-sm);
  flex-direction: column;
}
.nav-toggle:focus-visible {
  outline: 3px solid var(--color-primary);
}
.nav-toggle__bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--gray-800);
  margin: 5px 0;
  border-radius: 2px;
  transition: transform var(--duration-fast) var(--easing-standard);
}

@media (max-width: 960px) {
  .nav-toggle {
    display: inline-flex;
  }
  .site-nav {
    position: fixed;
    inset-inline: 0;
    top: 64px;
    background: #fff;
    border-top: 1px solid var(--gray-200);
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-16);
    padding: var(--space-16);
  }
  .site-nav.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }
  .nav__list {
    flex-direction: column;
  }
  .nav-search .input {
    max-width: 100%;
  }
}

/* Footer */
.site-footer {
  background: #1E1A16;
  color: #F7F2EA;
  padding-top: var(--space-32);
  margin-top: var(--space-32);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: var(--space-24);
  padding-bottom: var(--space-24);
}
.footer__logo {
  color: #F7F2EA;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.25rem;
}
.footer__heading {
  font-size: var(--text-lg);
  margin-bottom: var(--space-12);
  color:#fff;
}
.footer__links {
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.footer__links a {
  color: #D9B15A;
}
.footer__links a:hover {
  color: #fff;
  text-decoration: underline;
}
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-block: var(--space-16);
  text-align: center;
}
@media (max-width: 960px) {
  .footer__grid {
    grid-template-columns: 1fr;
  }
}

/* Cookie banner */
.cookie-banner {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 1000;
  background: #FFFDF8;
  border-top: 1px solid var(--gray-200);
  box-shadow: 0 -6px 18px rgba(24,18,14,0.06);
}
.cookie-banner__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  padding-block: var(--space-16);
}
.cookie-banner__text {
  margin: 0;
  color: var(--gray-800);
}
.cookie-banner__actions {
  display: flex;
  gap: var(--space-8);
}
.cookie-banner.hidden {
  display: none;
}
@media (max-width: 720px) {
  .cookie-banner__inner {
    flex-direction: column;
    align-items: stretch;
  }
}
/* End Header & Footer Styles */

/* ==========================================================
   Utilities
   ========================================================== */
.container {
  width: 100%;
  margin-inline: auto;
  max-width: min(100% - 2*var(--space-24), var(--container-xl));
  padding-inline: var(--space-24);
}

@media (min-width: 40rem) { .container { max-width: min(100% - 2*var(--space-32), var(--container-xl)); padding-inline: var(--space-32); } }

/* Flex helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-xs { gap: var(--space-8); }
.gap-sm { gap: var(--space-12); }
.gap-md { gap: var(--space-16); }
.gap-lg { gap: var(--space-24); }

/* Grid helpers */
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto-fit-min-200 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Flow utilities for vertical rhythm */
.stack > * + * { margin-block-start: var(--space-16); }
.stack-lg > * + * { margin-block-start: var(--space-24); }

/* 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; }

/* Max text measure utility */


/* ==========================================================
   Components
   ========================================================== */
/* Buttons */
.btn {
  --_bg: var(--gray-800);
  --_fg: #FFF;
  --_bd: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  padding: calc(var(--space-12) - 1px) var(--space-20);
  border: 1px solid var(--_bd);
  border-radius: var(--radius-md);
  background: var(--_bg);
  color: var(--_fg);
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--easing-standard), box-shadow var(--duration-normal) var(--easing-standard), background-color var(--duration-normal) var(--easing-standard), border-color var(--duration-normal) var(--easing-standard), color var(--duration-normal) var(--easing-standard);
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: var(--shadow-sm); }
.btn:disabled, .btn[aria-disabled='true'] { opacity: 0.55; cursor: not-allowed; box-shadow: none; transform: none; }

.btn--primary { --_bg: var(--color-primary); --_bd: var(--color-primary); }
.btn--primary:hover { background: #174A88; border-color: #174A88; }

.btn--success { --_bg: var(--color-success); --_bd: var(--color-success); }
.btn--success:hover { background: #256628; border-color: #256628; }

.btn--warning { --_bg: var(--color-warning); --_bd: var(--color-warning); color: #2F241D; }
.btn--warning:hover { background: #B9913F; border-color: #B9913F; }

.btn--danger { --_bg: var(--color-danger); --_bd: var(--color-danger); }
.btn--danger:hover { background: #A23E2E; border-color: #A23E2E; }

.btn--outline {
  --_bg: transparent;
  --_fg: var(--color-text);
  --_bd: var(--gray-300);
  background: transparent;
  color: var(--_fg);
}
.btn--outline:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Inputs */
.input, input[type="text"], input[type="email"], input[type="url"], input[type="password"], input[type="search"], input[type="tel"], input[type="number"], select, textarea {
  width: 100%;
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  padding: var(--space-12) var(--space-16);
  line-height: var(--leading-normal);
  box-shadow: none;
  transition: border-color var(--duration-normal) var(--easing-standard), box-shadow var(--duration-normal) var(--easing-standard), background-color var(--duration-normal) var(--easing-standard);
}

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

.input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(31, 91, 163, 0.25); }

input:disabled, select:disabled, textarea:disabled { background: var(--gray-100); color: var(--gray-600); cursor: not-allowed; }

/* Field group spacing */
.field { margin-block-end: var(--space-20); }
.help-text { color: var(--gray-700); font-size: var(--text-sm); margin-block-start: var(--space-8); }

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

.card--elevated { box-shadow: var(--shadow-lg); }
.card__header { margin-block-end: var(--space-16); }
.card__title { font-family: var(--font-serif); font-size: clamp(1.25rem, 0.5vw + 1rem, 1.5rem); margin: 0; }
.card__body { color: var(--gray-800); }

/* Badges (lightweight) */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 700;
  background: var(--gray-100);
  color: var(--gray-800);
}
.badge--gold { background: #FFF1D1; color: #6A4E1A; border: 1px solid #F1DAA4; }

/* Banners / callouts (informational) */
.callout {
  border: 1px solid var(--gray-200);
  background: #FFFDF8;
  border-radius: var(--radius-md);
  padding: var(--space-16);
}
.callout--info { border-color: #CFE0F3; background: #F2F7FD; }
.callout--success { border-color: #CFE9D2; background: #F2FBF4; }
.callout--warning { border-color: #F0DFB7; background: #FFF8E6; }
.callout--danger { border-color: #F1C9C1; background: #FFF1EE; }

/* ==========================================================
   Accessibility
   ========================================================== */
:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* High-contrast link focus ring on warm backgrounds */
a:focus-visible { box-shadow: 0 0 0 3px rgba(31, 91, 163, 0.3); }

/* Prefer reduced motion: already handled in reset, also limit transforms */
@media (prefers-reduced-motion: reduce) {
  .btn:hover, .btn:active { transform: none !important; }
}

/* ==========================================================
   Theming hooks (optional)
   ========================================================== */
/* Surface modifiers for sections */
.surface-muted { background: var(--gray-50); border: 1px solid var(--gray-200); }
.surface-gold { background: #FFF7E6; }
.surface-deep { background: #1E1A16; color: #F7F2EA; }

/* End of base.css */
