/* =========================================
   Variables
   Modern, clean, pastel palette for a nutritionist site
   ========================================= */
:root {
  /* Color system */
  --color-bg: #f6fbf8;              /* soft, fresh background */
  --color-surface: #ffffff;          /* cards, panels */
  --color-text: #1f2937;             /* neutral slate/gray 800 */
  --color-text-muted: #4b5563;       /* gray 600 */
  --color-primary: #2f855a;          /* fresh, trustworthy green */
  --color-primary-contrast: #ffffff; /* text on primary */
  --color-success: #2f855a;          /* aligned with primary */
  --color-warning: #b7791f;          /* warm amber */
  --color-danger: #c53030;           /* confident red */
  /* Neutral grays */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --color-border: var(--gray-200);
  --color-tint: #e9f7f1;             /* subtle green tint for accents */

  /* Typography */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  --text-xs: 12px;
  --text-sm: 14px;
  --text-base: 16px;
  --text-lg: 18px;
  --text-xl: 20px;
  --text-2xl: 24px;
  --text-3xl: 30px;
  --text-4xl: 36px;
  --leading-tight: 1.2;
  --leading-normal: 1.6;
  --leading-relaxed: 1.7;
  --measure: 65ch; /* comfortable reading width */

  /* Spacing scale (0–96px in 4px steps) */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 28px;
  --space-8: 32px;
  --space-9: 36px;
  --space-10: 40px;
  --space-11: 44px;
  --space-12: 48px;
  --space-13: 52px;
  --space-14: 56px;
  --space-15: 60px;
  --space-16: 64px;
  --space-17: 68px;
  --space-18: 72px;
  --space-19: 76px;
  --space-20: 80px;
  --space-21: 84px;
  --space-22: 88px;
  --space-23: 92px;
  --space-24: 96px;

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

  /* Shadows (soft, natural) */
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 6px 12px rgba(17, 24, 39, 0.08);
  --shadow-lg: 0 12px 24px rgba(17, 24, 39, 0.10);

  /* Transitions */
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --ease-standard: cubic-bezier(0.2, 0.6, 0.2, 1);

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

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

html,
body {
  height: 100%;
}

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

body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
  -webkit-hyphens: auto; /* Safari / старые WebKit */
  -ms-hyphens: auto;     /* старые IE/Edge */
  hyphens: auto;
}

img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
  display: block;
  max-width: 100%;
}

img,
video {
  height: auto;
}

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

/* Remove tap highlight on mobile */
* {
  -webkit-tap-highlight-color: transparent;
}

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

/* Headings */
h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--color-text);
  font-weight: 700;
  line-height: var(--leading-tight);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 1.35rem + 2vw, 3rem); margin-block: 0 0.6em; }
h2 { font-size: clamp(1.75rem, 1.25rem + 1.4vw, 2.25rem); margin-block: 0 0.6em; }
h3 { font-size: clamp(1.375rem, 1.05rem + 0.9vw, 1.75rem); margin-block: 0 0.5em; }
h4 { font-size: 1.25rem; margin-block: 0 0.5em; }
h5 { font-size: 1.125rem; margin-block: 0 0.5em; }
h6 { font-size: 1rem; margin-block: 0 0.5em; }

/* Typography */
p { margin-block: 0 1em; max-width: var(--measure); color: var(--color-text); }
small { font-size: var(--text-sm); color: var(--color-text-muted); }
mark { background: var(--color-tint); color: inherit; padding: 0 0.2em; border-radius: var(--radius-sm); }

/* Links */
a { color: var(--color-primary); text-decoration: none; text-underline-offset: 3px; }
a:hover,
a:focus-visible { text-decoration: underline; }
a:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; border-radius: 2px; }

/* Lists */
ul, ol { padding-left: 1.25rem; margin-block: 0 1em; }

/* Horizontal rule */
hr { border: 0; border-top: 1px solid var(--color-border); margin: var(--space-8) 0; }

/* Selection */
::selection { background: rgba(47, 133, 90, 0.18); color: inherit; }

/* =========================================
   Utilities
   ========================================= */
.container {
  width: 100%;
  margin-inline: auto;
  max-width: var(--container-xl);
  padding-inline: clamp(var(--space-4), 4vw, var(--space-6));
}

/* Flex helpers */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

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

/* Gap utilities (lightweight) */
.gap-xs { gap: var(--space-2); }
.gap-sm { gap: var(--space-4); }
.gap-md { gap: var(--space-6); }
.gap-lg { gap: var(--space-8); }

/* Visually hidden (screen readers only) */
.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;
}

/* Constrain content width when desired */
.prose { max-width: var(--measure); }

/* =========================================
   Components
   ========================================= */
/* Buttons */
.btn {
  --_btn-bg: var(--gray-100);
  --_btn-color: var(--color-text);
  --_btn-border: var(--color-border);

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: calc(var(--space-2) + 2px) var(--space-4);
  border: 1px solid var(--_btn-border);
  border-radius: var(--radius-lg);
  background: var(--_btn-bg);
  color: var(--_btn-color);
  line-height: 1.2;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration-base) var(--ease-standard),
              color var(--duration-base) var(--ease-standard),
              border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              transform var(--duration-fast) var(--ease-standard);
}

.btn:hover { filter: brightness(0.98); }
.btn:active { transform: translateY(1px); }
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  --_btn-bg: var(--color-primary);
  --_btn-color: var(--color-primary-contrast);
  --_btn-border: var(--color-primary);
}

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

.btn--ghost {
  --_btn-bg: transparent;
  --_btn-color: var(--color-text);
  --_btn-border: transparent;
  background: transparent;
}

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

/* 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'],
input[type='date'],
input[type='time'] {
  width: 100%;
  padding: calc(var(--space-2) + 2px) var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  line-height: 1.3;
  transition: border-color var(--duration-base) var(--ease-standard),
              box-shadow var(--duration-base) var(--ease-standard),
              background-color var(--duration-base) var(--ease-standard);
}

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

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(47, 133, 90, 0.35);
  outline-offset: 2px;
  border-color: var(--color-primary);
}

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

/* Field grouping */
.field { display: grid; gap: var(--space-2); }
.label { font-weight: 600; color: var(--color-text); }
.help-text { color: var(--color-text-muted); font-size: var(--text-sm); }

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: var(--space-6);
}

.card--muted { background: var(--color-tint); border-color: transparent; }


.card a:hover { text-decoration: underline; }

/* =========================================
   Header & Footer styles
   ========================================= */

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.skip-link:focus {
  left: 16px;
  top: 16px;
  width: auto;
  height: auto;
  background: var(--color-primary);
  color: var(--color-primary-contrast);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-lg);
  z-index: 1000;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 999;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-3);
}
.brand__link {
  color: var(--color-text);
  font-weight: 800;
  font-size: var(--text-xl);
}

/* Nav */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 8px;
  border-radius: var(--radius-md);
      position: relative;
    z-index: 10;
}
.nav-toggle__bar {
  width: 22px;
  height: 2px;
  background: var(--color-text);
}
.site-nav {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(88vw, 320px);
  max-width: 100%;
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  transform: translateX(100%);
  transition: transform var(--duration-slow) var(--ease-standard);
  padding: var(--space-8) var(--space-6);
}
.site-nav.is-open { transform: translateX(0); }

.nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.nav-list a { font-weight: 600; color: var(--color-text); }
.nav-list a.btn { color: var(--color-primary-contrast); }

/* Desktop nav */
@media (min-width: 992px) {
  .nav-toggle { display: none; }
  .site-nav {
    position: static;
    transform: none;
    width: auto;
    border: 0;
    padding: 0;
  }
  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-6);
  }
}

/* Footer */
.site-footer { background: var(--color-surface); border-top: 1px solid var(--color-border); }
.footer__grid { display: grid; gap: var(--space-8); padding-block: var(--space-10); grid-template-columns: 1fr; }
.footer__title { font-weight: 800; font-size: var(--text-xl); margin-bottom: var(--space-2); }
.footer__heading { font-size: var(--text-lg); margin-bottom: var(--space-3); }
.footer__links { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.footer__bottom { padding-block: var(--space-4); border-top: 1px solid var(--color-border); font-size: var(--text-sm); color: var(--color-text-muted); }
@media (min-width: 992px) { .footer__grid { grid-template-columns: 1.2fr 1fr 1fr; } }

/* Cookie banner */
.cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  background: transparent;
  z-index: 1000;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__inner {
  margin: var(--space-4);
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}
.cookie-banner__actions { display: flex; gap: var(--space-3); flex-wrap: wrap; justify-content: flex-end; }

/* Minor tweaks */
.btn--sm { padding: 8px 14px; font-size: var(--text-sm); }

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

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

/* =========================================
   Pastel accents for sections (optional helpers)
   ========================================= */
.section--tint {
  background: linear-gradient(0deg, rgba(233, 247, 241, 0.6), rgba(233, 247, 241, 0.6));
}

/* End of base.css */
