/*
 * sodnamis — main.css
 * Global design tokens + base + layout primitives.
 * Author: sodnamis.lt
 * Tokens ported 1:1 from the Lovable reference (shadcn/ui HSL-triplet convention).
 */

/* ============================================================
   1. Design tokens
   ============================================================ */
:root {
  /* Core palette (HSL channels — use as hsl(var(--token) / <alpha>)) */
  --background: 0 0% 100%;
  --foreground: 220 50% 15%;          /* #132039 dark navy text */
  --card: 0 0% 100%;
  --card-foreground: 220 50% 15%;
  --popover: 0 0% 100%;
  --popover-foreground: 220 50% 15%;
  --primary: 220 53% 27%;             /* #203969 brand navy */
  --primary-foreground: 0 0% 100%;
  --secondary: 220 20% 95%;           /* #eef0f4 */
  --secondary-foreground: 220 50% 20%;
  --muted: 220 15% 95%;               /* #eef0f2 */
  --muted-foreground: 220 15% 45%;    /* #626d84 grey */
  --accent: 220 53% 35%;              /* lighter navy */
  --accent-foreground: 0 0% 100%;
  --destructive: 0 84% 60%;           /* sale / badge red */
  --destructive-foreground: 0 0% 100%;
  --success: 145 63% 32%;             /* cart / positive green (from catalog CTAs) */
  --success-foreground: 0 0% 100%;
  --border: 220 15% 90%;
  --input: 220 15% 90%;
  --ring: 220 53% 27%;
  --radius: 0.75rem;

  /* Gradients */
  --gradient-warm: linear-gradient(135deg, hsl(220 53% 27%) 0%, hsl(220 60% 22%) 100%);
  --gradient-hero-overlay: linear-gradient(180deg, hsl(220 30% 10% / 0.3) 0%, hsl(220 30% 10% / 0.7) 100%);
  --gradient-card: linear-gradient(180deg, hsl(0 0% 100% / 1) 0%, hsl(220 15% 97% / 1) 100%);

  /* Shadows */
  --shadow-soft: 0 4px 20px -2px hsl(220 50% 15% / 0.06);
  --shadow-card: 0 8px 30px -4px hsl(220 50% 15% / 0.1);
  --shadow-card-hover: 0 16px 40px -6px hsl(220 50% 15% / 0.16);
  --shadow-button: 0 4px 14px -2px hsl(220 53% 27% / 0.35);

  /* Typography */
  --font-heading: "Montserrat", system-ui, sans-serif;
  --font-body: "Open Sans", system-ui, sans-serif;

  /* Spacing scale (mirrors the Tailwind rhythm used in the reference) */
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;

  /* Layout */
  --container-max: 1200px;
  --container-pad: 1rem;
  --header-height: 4.5rem;
}

/* ============================================================
   2. Reset / base
   ============================================================ */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;               /* 16px */
  line-height: 1.625;            /* 26px */
  color: hsl(var(--foreground));
  background: hsl(var(--background));
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: hsl(var(--foreground));
  margin: 0 0 0.5em;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.025em;
}
h1 { font-size: clamp(2.25rem, 4vw + 1rem, 3.5rem); }   /* 36 → 56 */
h2 { font-size: clamp(1.75rem, 2vw + 1rem, 2.25rem); font-weight: 700; }  /* → 36px */
h3 { font-size: 1.125rem; line-height: 1.55; font-weight: 600; letter-spacing: -0.02em; }  /* 18px */
h4 { font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }

p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

a { color: hsl(var(--primary)); text-decoration: none; transition: color 0.2s ease; }
a:hover { color: hsl(var(--accent)); }

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

ul, ol { margin: 0 0 1rem; padding-left: 1.25rem; }

/* Accessible focus ring (keyboard only) */
:focus-visible {
  outline: 2px solid hsl(var(--ring));
  outline-offset: 2px;
  border-radius: 2px;
}

/* Screen-reader-only helper */
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  white-space: nowrap; border: 0;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 1000;
  padding: 0.75rem 1.25rem;
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; color: hsl(var(--primary-foreground)); }

/* ============================================================
   3. Layout primitives
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

.section { padding-block: var(--space-16); }
.section--lg { padding-block: var(--space-24); }
.section--muted   { background: hsl(var(--muted) / 0.3); }
.section--muted-50 { background: hsl(var(--muted) / 0.5); }
.section--secondary { background: hsl(var(--secondary) / 0.3); }
.section--accent  { background: hsl(var(--accent) / 0.1); }
.section--primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.section--primary h1, .section--primary h2, .section--primary h3 { color: hsl(var(--primary-foreground)); }
.section--dark    { background: hsl(var(--foreground)); color: hsl(0 0% 100% / 0.85); }
.section--dark h1, .section--dark h2, .section--dark h3 { color: #fff; }

@media (min-width: 768px) {
  .section { padding-block: var(--space-20); }
  .section--lg { padding-block: var(--space-28); }
}

/* Section heading block (pill + title + subtitle) */
.section-head { text-align: center; max-width: 46rem; margin: 0 auto var(--space-12); }
.section-head p.section-lead { color: hsl(var(--muted-foreground)); font-size: 1.0625rem; }
.section--primary .section-head p.section-lead,
.section--dark .section-head p.section-lead { color: hsl(0 0% 100% / 0.8); }

/* Eyebrow pill (e.g. "Produktai", "Kodėl mes") */
.pill {
  display: inline-block;
  padding: 0.25rem 0.9rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: hsl(var(--primary));
  background: hsl(var(--secondary));
  border-radius: 9999px;
  letter-spacing: 0.01em;
}
.section--primary .pill, .section--dark .pill {
  color: #fff; background: hsl(0 0% 100% / 0.15);
}

/* ============================================================
   4. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 9999px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
  text-align: center;
}
.btn:active { transform: translateY(1px); }
.btn--primary {
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  box-shadow: var(--shadow-button);
}
.btn--primary:hover { background: hsl(var(--accent)); color: #fff; }
.btn--outline {
  background: transparent;
  color: hsl(var(--primary));
  border-color: hsl(var(--border));
}
.btn--outline:hover { background: hsl(var(--secondary)); color: hsl(var(--primary)); }
.btn--success { background: hsl(var(--success)); color: #fff; }
.btn--success:hover { background: hsl(var(--success) / 0.9); color: #fff; }
.btn--white { background: #fff; color: hsl(var(--primary)); }
.btn--white:hover { background: hsl(var(--secondary)); }
.btn--block { width: 100%; }
.btn--sm { padding: 0.5rem 1rem; font-size: 0.875rem; }

/* ============================================================
   5. Cards & badges
   ============================================================ */
.card {
  background: var(--gradient-card);
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
.card:hover { box-shadow: var(--shadow-card-hover); transform: translateY(-4px); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}
.badge--sale { background: hsl(var(--destructive)); color: hsl(var(--destructive-foreground)); }

/* ============================================================
   6. Reusable grids
   ============================================================ */
.grid { display: grid; gap: 1.5rem; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

/* Utility */
.text-center { text-align: center; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }
.stack > * + * { margin-top: 1rem; }
.container--narrow { max-width: 820px; }
.no-scroll { overflow: hidden; }

/* Star rating (shared: topbar, testimonials) */
.stars { display: inline-flex; gap: 1px; line-height: 1; color: hsl(220 15% 80%); font-size: 1rem; }
.stars .star--on { color: #f5a623; }

/* Pagination */
.pagination { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 3rem; }
.pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2.5rem; height: 2.5rem; padding: 0 0.6rem;
  border: 1px solid hsl(var(--border)); border-radius: var(--radius);
  color: hsl(var(--foreground)); font-weight: 600;
}
.pagination .page-numbers.current,
.pagination .page-numbers:hover { background: hsl(var(--primary)); color: #fff; border-color: hsl(var(--primary)); }

/* Entry (WYSIWYG) content spacing */
.entry-content { font-size: 1.0625rem; }
.entry-content > * + * { margin-top: 1.25rem; }
.entry-content h2 { margin-top: 2rem; }
.entry-content img { border-radius: var(--radius); }
.entry-content a { text-decoration: underline; }
