/* =========================================================
   Ugradnja implanta — Design System
   Tokens sourced from DESIGN.md. Do not hand-edit values here
   without updating DESIGN.md first — this file is the CSS
   implementation of that spec, not an independent source.
   ========================================================= */

:root {
  /* Color — DESIGN.md */
  --ink: #00292F;
  --ink-soft: #3F575C;
  --surface: #F4FAFA;
  --surface-alt: #E6EFF0;
  --border: #CFDADB;
  --signal-teal: #00AEB4;   /* decorative only — icons, illustration, ≥24px */
  --accent: #00666C;        /* functional — buttons, links, focus */
  --accent-hover: #004B51;
  --accent-soft: #D5F2F3;
  --white: #FFFFFF;

  /* Typography */
  --font-body: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --fs-display: clamp(2.25rem, 1.4rem + 3.6vw, 3.5rem);
  --fs-headline: clamp(1.5rem, 1.15rem + 1.5vw, 2.25rem);
  --fs-title: 1.25rem;
  --fs-body: 1.0625rem;
  --fs-label: 0.8125rem;

  /* Spacing — 4pt scale */
  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Elevation — DESIGN.md */
  --shadow-rest: 0 1px 3px rgba(0, 41, 47, 0.06), 0 1px 2px rgba(0, 41, 47, 0.04);
  --shadow-lifted: 0 8px 24px rgba(0, 41, 47, 0.10), 0 2px 6px rgba(0, 41, 47, 0.06);

  /* Motion */
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 180ms;
  --dur-med: 320ms;
  --dur-slow: 640ms;

  /* Bootstrap overrides */
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: var(--fs-body);
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--surface);
  --bs-link-color: var(--accent);
  --bs-link-hover-color: var(--accent-hover);
  --bs-border-color: var(--border);
  --bs-primary: var(--accent);
  --bs-primary-rgb: 0, 102, 108;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-weight: 800;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 0;
}

p { margin-bottom: 0; }

.lede {
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 62ch;
  text-wrap: pretty;
}

.measure { max-width: 70ch; }

a { text-decoration-thickness: 1.5px; text-underline-offset: 3px; }

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

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

section { position: relative; }

/* =========================================================
   Buttons
   ========================================================= */

.btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.9375rem;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.5rem;
  transition: background-color var(--dur-fast) var(--ease-out-quart),
              border-color var(--dur-fast) var(--ease-out-quart),
              color var(--dur-fast) var(--ease-out-quart),
              transform var(--dur-fast) var(--ease-out-quart);
  min-height: 44px;
}

.btn-brand-primary {
  background-color: var(--accent);
  border: 1px solid var(--accent);
  color: var(--white);
}
.btn-brand-primary:hover,
.btn-brand-primary:focus-visible {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--white);
  transform: translateY(-1px);
}
.btn-brand-primary:active { transform: translateY(0); }

.btn-brand-outline {
  background-color: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn-brand-outline:hover,
.btn-brand-outline:focus-visible {
  background-color: var(--accent);
  color: var(--white);
  transform: translateY(-1px);
}

.btn-brand-on-dark {
  background-color: var(--white);
  border: 1px solid var(--white);
  color: var(--accent-hover);
}
.btn-brand-on-dark:hover,
.btn-brand-on-dark:focus-visible {
  background-color: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-lg { padding: 0.9375rem 2rem; font-size: 1rem; }

/* =========================================================
   Header / Nav
   ========================================================= */

.site-header {
  position: sticky;
  top: 0;
  z-index: 1030;
  background-color: rgba(244, 250, 250, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur-med) var(--ease-out-quart),
              box-shadow var(--dur-med) var(--ease-out-quart);
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-rest);
}

.site-nav { padding-block: 0.9rem; }

.navbar-brand img { display: block; }

.site-nav .nav-link {
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.9375rem;
  padding: 0.5rem 0.85rem;
  transition: color var(--dur-fast) var(--ease-out-quart);
}
.site-nav .nav-link:hover,
.site-nav .nav-link:focus-visible { color: var(--accent); }

.site-nav .navbar-toggler {
  border-color: var(--border);
  padding: 0.4rem 0.6rem;
}
.site-nav .navbar-toggler:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.site-nav .navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%2300292F' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* =========================================================
   Hero
   ========================================================= */

.hero { padding-block: var(--space-2xl) var(--space-3xl); overflow: clip; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-2xl);
  align-items: center;
}

.hero h1 {
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-md);
}

.hero h1 .accent-word { color: var(--accent); }

.hero-lede {
  font-size: 1.1875rem;
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 46ch;
  margin-bottom: var(--space-lg);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.hero-trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}
.hero-trust-item { display: flex; align-items: flex-start; gap: var(--space-2xs); max-width: 22ch; }
.hero-trust-item svg { flex-shrink: 0; margin-top: 2px; color: var(--accent); }
.hero-trust-item span { font-size: 0.875rem; color: var(--ink-soft); line-height: 1.4; }

.hero-visual { position: relative; }

.hero-visual-blob {
  position: absolute;
  inset: -6% -10% -10% 8%;
  background: var(--signal-teal);
  border-radius: 38% 62% 55% 45% / 45% 40% 60% 55%;
  z-index: 0;
  opacity: 0.9;
}

.hero-photo {
  position: relative;
  z-index: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lifted);
  aspect-ratio: 4 / 5;
}
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }

.hero-photo-caption {
  position: absolute;
  z-index: 2;
  left: var(--space-md);
  bottom: var(--space-md);
  right: var(--space-md);
  background: rgba(244, 250, 250, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-rest);
}
.hero-photo-caption strong { display: block; font-size: 0.9375rem; color: var(--ink); }
.hero-photo-caption span { font-size: 0.8125rem; color: var(--ink-soft); }

@media (max-width: 991.98px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 420px; margin-inline: auto; width: 100%; }
  .hero-lede { max-width: 100%; }
}

/* =========================================================
   Section scaffolding
   ========================================================= */

.section-pad { padding-block: var(--space-3xl); }
.section-pad-sm { padding-block: var(--space-2xl); }

.section-alt { background-color: var(--surface-alt); }

.section-head { max-width: 56ch; margin-bottom: var(--space-2xl); }
.section-head h2 { font-size: var(--fs-headline); letter-spacing: -0.01em; line-height: 1.15; margin-bottom: var(--space-sm); }
.section-head .lede { margin-bottom: 0; }

.h2-lg { font-size: var(--fs-headline); letter-spacing: -0.01em; line-height: 1.15; margin-bottom: var(--space-sm); }

/* =========================================================
   Steps ("Kako radi poređenje")
   ========================================================= */

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); position: relative; }

.step { position: relative; padding-top: var(--space-md); }

.step-number {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 2.75rem;
  line-height: 1;
  color: var(--accent-soft);
  -webkit-text-stroke: 1.5px var(--accent);
  margin-bottom: var(--space-md);
  display: block;
}

.step h3 { font-size: var(--fs-title); font-weight: 700; margin-bottom: var(--space-2xs); }
.step p { color: var(--ink-soft); line-height: 1.6; }

.step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 1.6rem;
  left: calc(100% + var(--space-xl) / 2);
  width: var(--space-xl);
  height: 1px;
  background: var(--border);
}

@media (max-width: 767.98px) {
  .steps { grid-template-columns: 1fr; gap: var(--space-xl); }
  .step:not(:last-child)::after { display: none; }
}

/* =========================================================
   Differentiator ("Zašto implant-specifično")
   ========================================================= */

.differentiator-grid {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: var(--space-2xl);
  align-items: start;
}

.differentiator-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-md); }
.differentiator-list li {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-md);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.differentiator-list .icon-tick {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  justify-content: center;
}
.differentiator-list strong { display: block; color: var(--ink); margin-bottom: 2px; }
.differentiator-list span { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.55; }

@media (max-width: 991.98px) {
  .differentiator-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Featured ordinacije
   ========================================================= */

.ordinacije-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-lg);
}

.ordinacija-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-rest);
  transition: box-shadow var(--dur-med) var(--ease-out-quart),
              transform var(--dur-med) var(--ease-out-quart);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.ordinacija-card:hover,
.ordinacija-card:focus-within {
  box-shadow: var(--shadow-lifted);
  transform: translateY(-3px);
}

.ordinacija-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-hover);
  background: var(--accent-soft);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
}

.ordinacija-card h3 { font-size: 1.125rem; font-weight: 700; }
.ordinacija-card .grad { color: var(--ink-soft); font-size: 0.9375rem; display: flex; align-items: center; gap: 6px; }

.ordinacija-meta {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
  margin-top: auto;
  font-size: 0.875rem;
}
.ordinacija-meta dt { color: var(--ink-soft); display: inline; }
.ordinacija-meta dd { color: var(--ink); font-weight: 600; display: inline; margin: 0; }
.ordinacija-meta .row-line { display: flex; justify-content: space-between; gap: var(--space-sm); }

.ordinacija-price { font-size: 1.375rem; font-weight: 800; color: var(--ink); }
.ordinacija-price small { font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); }

.ordinacije-note {
  margin-top: var(--space-lg);
  font-size: 0.875rem;
  color: var(--ink-soft);
  line-height: 1.6;
}
.ordinacije-note-icon {
  display: inline-block;
  vertical-align: -3px;
  margin-right: var(--space-3xs);
  flex-shrink: 0;
}

/* =========================================================
   Guide teaser
   ========================================================= */

.guide-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: var(--space-2xl);
  align-items: center;
}

.guide-photo { border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-rest); aspect-ratio: 5 / 4; }
.guide-photo img { width: 100%; height: 100%; object-fit: cover; }

.guide-steps { list-style: none; padding: 0; margin: var(--space-lg) 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.guide-steps li { display: flex; align-items: baseline; gap: var(--space-sm); font-size: 0.9375rem; color: var(--ink-soft); }
.guide-steps li b { color: var(--accent); font-weight: 800; min-width: 1.4rem; }

@media (max-width: 991.98px) {
  .guide-grid { grid-template-columns: 1fr; }
  .guide-photo { order: -1; max-width: 420px; margin-inline: auto; width: 100%; }
}

/* =========================================================
   Clinic CTA
   ========================================================= */

.clinic-cta {
  background: var(--ink);
  color: var(--white);
  border-radius: var(--radius-lg);
  padding: var(--space-2xl);
  position: relative;
  overflow: clip;
}

.clinic-cta::before {
  content: "";
  position: absolute;
  width: 60%;
  aspect-ratio: 1;
  right: -12%;
  top: -30%;
  background: var(--signal-teal);
  opacity: 0.18;
  border-radius: 50%;
  filter: blur(2px);
}

.clinic-cta-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: var(--space-2xl); align-items: center; position: relative; z-index: 1; }

.clinic-cta h2 { color: var(--white); font-size: var(--fs-headline); margin-bottom: var(--space-sm); letter-spacing: -0.01em; }
.clinic-cta p { color: rgba(244, 250, 250, 0.82); max-width: 52ch; line-height: 1.6; }

.clinic-cta-points { list-style: none; padding: 0; margin: var(--space-md) 0 0; display: flex; flex-direction: column; gap: var(--space-xs); }
.clinic-cta-points li { display: flex; gap: var(--space-2xs); align-items: flex-start; font-size: 0.9375rem; color: rgba(244, 250, 250, 0.92); }
.clinic-cta-points svg { flex-shrink: 0; color: var(--white); margin-top: 3px; }

.clinic-cta-actions { display: flex; flex-direction: column; gap: var(--space-sm); }
.clinic-cta-actions .btn { width: 100%; text-align: center; }
.clinic-cta-note { font-size: 0.8125rem; color: rgba(244, 250, 250, 0.65); text-align: center; }

@media (max-width: 991.98px) {
  .clinic-cta-grid { grid-template-columns: 1fr; }
  .clinic-cta { padding: var(--space-xl) var(--space-lg); }
}

/* =========================================================
   Footer
   ========================================================= */

.site-footer {
  background: var(--surface-alt);
  border-top: 1px solid var(--border);
  padding-block: var(--space-2xl) var(--space-lg);
}

.footer-logo { opacity: 0.85; }

.footer-lede { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.6; max-width: 42ch; }

.footer-heading {
  font-size: var(--fs-label);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  margin-bottom: var(--space-sm);
}

.footer-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-xs); }
.footer-list a { color: var(--ink-soft); font-size: 0.9375rem; overflow-wrap: anywhere; }
.footer-list a:hover { color: var(--accent); }

.footer-bottom {
  margin-top: var(--space-2xl);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--ink-soft);
}

/* =========================================================
   Motion — choreographed reveals
   ========================================================= */

/*
 * Visible by default — always. JS opts elements INTO the hidden-then-reveal
 * treatment at runtime (see main.js) by adding .is-pending; if JS never runs,
 * or hasn't run yet, content renders fully visible (no-JS, crawlers, print,
 * headless renderers that don't scroll). main.js also carries a hard timeout
 * that clears .is-pending regardless of scroll, so nothing can ship blank.
 */

.reveal,
.reveal-stagger > * {
  transition: opacity var(--dur-slow) var(--ease-out-quart),
              transform var(--dur-slow) var(--ease-out-quart);
}

.reveal-stagger > *:nth-child(1) { transition-delay: 0ms; }
.reveal-stagger > *:nth-child(2) { transition-delay: 90ms; }
.reveal-stagger > *:nth-child(3) { transition-delay: 180ms; }
.reveal-stagger > *:nth-child(4) { transition-delay: 270ms; }

.reveal.is-pending,
.reveal-stagger.is-pending > * {
  opacity: 0;
  transform: translateY(18px);
}

@media (prefers-reduced-motion: reduce) {
  .reveal.is-pending,
  .reveal-stagger.is-pending > * {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =========================================================
   Utilities
   ========================================================= */

.text-accent { color: var(--accent); }
.bg-surface-alt { background-color: var(--surface-alt); }
.note-sm { color: var(--ink-soft); font-size: 0.875rem; }
