/* ==========================================================
   Budak – stilovi
   Boje i fontovi se mijenjaju ovdje, u :root
   ========================================================== */

:root {
  --paper:    #F4F4F1;   /* pozadina */
  --tint:     #E4EAE2;   /* blaga zelenkasta pozadina sekcija */
  --ink:      #1B2433;   /* tekst */
  --muted:    #566070;   /* sporedni tekst */
  --oxblood:  #7A1F2B;   /* boja kože / glavni akcent */
  --oxblood-d:#5F1722;
  --line:     #CFD3CB;

  --font-display: "Public Sans", "Segoe UI", system-ui, sans-serif;
  --font-body:    "Public Sans", "Segoe UI", system-ui, sans-serif;

  --wrap: 68rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

img, iframe { max-width: 100%; }

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--oxblood);
  outline-offset: 3px;
}

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.08;
  margin: 0;
  letter-spacing: -0.01em;
}

h2 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 0.5rem; }

p { margin: 0 0 1rem; }

.prose > h3:first-child { margin-top: 0; }

.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* ---------- Obavijest ---------- */
.notice {
  background: var(--oxblood);
  color: #fff;
  padding: 0.7rem var(--gutter);
  text-align: center;
  font-size: 0.975rem;
}
.notice[hidden] { display: none; }
.notice p { margin: 0; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0.85rem var(--gutter);
  background: rgba(244, 244, 241, 0.94);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}
.wordmark img {
  display: block;
  height: 3rem;
  width: auto;
}

.site-nav {
  position: relative;
  display: flex;
  gap: clamp(0.9rem, 2.5vw, 1.75rem);
}

.site-nav a {
  text-decoration: none;
  font-weight: 500;
  padding: 0.35rem 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s, color 0.2s;
}
.site-nav a:hover { border-bottom-color: rgba(122, 31, 43, 0.45); }

/* Dio stranice na kojem se posjetitelj trenutno nalazi (postavlja js/main.js) */
.site-nav a[aria-current="location"] {
  border-bottom-color: var(--oxblood);
  color: var(--oxblood);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: clamp(0.75rem, 2vw, 1.25rem) 0 clamp(2.5rem, 6vw, 4rem);
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 2.5rem 3.5rem;
}
.hero-copy { max-width: 46rem; }

/* Fotografija pored naslova; kad ne stane uz tekst (jedan stupac) uopće se ne prikazuje */
.hero-photo { display: none; }

@media (min-width: 56rem) {
  .hero-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); }
  .hero-photo { display: block; }
}

.hero-photo a {
  display: block;
  cursor: zoom-in;
  text-decoration: none;
  transition: transform 0.25s ease;
}
.hero-photo a:hover, .hero-photo a:focus-visible { transform: translateY(-4px); }
.hero-photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;     /* cijeli letak, bez rezanja */
  border-radius: 0.6rem;
  box-shadow: 0 14px 34px rgba(27, 36, 51, 0.28);
}
.zoom-hint {
  display: block;
  margin-top: 0.7rem;
  text-align: right;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 500;
}
.hero-photo a:hover .zoom-hint { color: var(--oxblood); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 0.95rem;
  font-weight: 500;
}

.status-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  background: var(--muted);
}
.status.is-open .status-dot,
.status.is-soon .status-dot   { background: #2E7D4F; }
.status.is-closed .status-dot { background: var(--oxblood); }
.status.is-break .status-dot  { background: #E0A100; }

.hero h1 {
  max-width: 32ch;
  font-size: clamp(2.4rem, 6.2vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  margin-bottom: 1.4rem;
}

.lead {
  max-width: 33rem;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--muted);
  margin-bottom: 1.9rem;
}

.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  border-radius: 0.4rem;
  border: 2px solid var(--oxblood);
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--oxblood); color: #fff; }
.btn-primary:hover { background: var(--oxblood-d); border-color: var(--oxblood-d); }
.btn-secondary { background: transparent; color: var(--oxblood); }
.btn-secondary:hover {
  background: rgba(122, 31, 43, 0.08);
  border-color: var(--oxblood-d);
  color: var(--oxblood-d);
}
/* ---------- Sekcije ---------- */
.section {
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.section h2 {
  margin-top: 0;
  padding-top: 0;
}
.section-tint { background: var(--tint); }

.two-col {
  display: grid;
  gap: 1.5rem 3rem;
  grid-template-columns: 1fr;
}

@media (min-width: 52rem) {
  .two-col { grid-template-columns: 1fr 2fr; }
}

.prose { max-width: 38rem; }

.text-link {
  font-weight: 600;
  color: var(--oxblood);
  text-underline-offset: 0.25em;
}
.text-link:hover { color: var(--oxblood-d); }

/* HZZO oznaka */
.hzzo {
  display: inline-flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 1.5rem;
  padding: 0.9rem 1.25rem;
  border-left: 5px solid var(--oxblood);
  background: #fff;
}
.hzzo span { color: var(--muted); font-size: 0.95rem; }

/* ---------- 3D prikaz skeniranja (Ortopedija) ---------- */
.scan3d { margin: 1.75rem 0 0; }

.scan3d-stage {
  position: relative;
  height: clamp(17rem, 34vw, 23rem);
  border-radius: 0.4rem;
  background: radial-gradient(ellipse at 50% 38%, #2A3853 0%, #141B29 72%);
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;          /* uspravno listanje stranice i dalje radi */
  user-select: none;
}
.scan3d-stage.is-drag { cursor: grabbing; }
.scan3d-stage canvas { display: block; width: 100%; height: 100%; }

/* Dok se 3D učitava */
.scan3d-stage:not(.is-ready)::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 45%, rgba(111, 216, 255, 0.10), transparent 60%);
}

.scan3d-legend {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #B7C4DA;
  font-size: 0.75rem;
  pointer-events: none;
}
.scan3d-bar {
  flex: 1;
  height: 0.4rem;
  border-radius: 999px;
  background: linear-gradient(to right, #12338C, #0DB3D9, #40CC59, #FAD61F, #DB1F29);
}

.scan3d figcaption {
  margin-top: 0.6rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.45;
}

/* ---------- Od skeniranja do uloška (Ortopedija) ---------- */
.steps-title { margin-top: 2.5rem; }

.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.step {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.step-img {
  display: grid;
  place-items: center;
  height: 9.5rem;
  padding: 0.75rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
/* slike su malih dimenzija: nikad se ne povećavaju preko vlastite veličine */
.step-img img {
  display: block;
  max-width: 100%;
  max-height: 8rem;               /* = visina okvira (9.5rem) minus razmak */
  width: auto;
  height: auto;
  object-fit: contain;
}

.step-body { position: relative; padding: 0.75rem 0.9rem 1rem 3rem; }
.step-body strong { display: block; line-height: 1.25; }
.step-body p { margin: 0.2rem 0 0; font-size: 0.9rem; color: var(--muted); line-height: 1.4; }

.step-no {
  position: absolute;
  left: 0.9rem;
  top: 0.75rem;
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  background: var(--oxblood);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

/* lijevi stupac (3D prikaz) ostaje na vidiku dok se čita duži desni tekst */
@media (min-width: 52rem) {
  #ortopedija .col-head { position: sticky; top: 5.5rem; align-self: start; }
}

/* ---------- Galerija ---------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.75rem;
}

.filter-btn {
  font: inherit;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border: 2px solid var(--oxblood);
  border-radius: 999px;
  background: transparent;
  color: var(--oxblood);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.filter-btn:hover { background: rgba(122, 31, 43, 0.08); }
.filter-btn[aria-pressed="true"] { background: var(--oxblood); color: #fff; }

.gallery {
  display: grid;
  gap: 0.75rem;
  margin-top: 1.5rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 40rem) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 64rem) { .gallery { grid-template-columns: repeat(4, 1fr); } }

.gallery figure { margin: 0; }
.gallery figure[hidden] { display: none; }

.gallery-item {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
}
.gallery-item[disabled] { cursor: default; }

.gallery img,
.ph {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 0.3rem;
}

/* Fotografije proizvoda: cijela cipela uvijek vidljiva, bez rezanja */
.gallery img {
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}

.ph {
  display: grid;
  place-items: center;
  background: var(--tint);
  border: 1px dashed #9AA698;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Paging galerije */
.pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem 0.5rem;
  margin-top: 1.75rem;
}
.pager[hidden] { display: none; }

.pager-nums { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.pager-btn {
  font: inherit;
  font-weight: 600;
  min-width: 2.6rem;
  height: 2.6rem;
  padding: 0 0.9rem;
  border: 2px solid var(--oxblood);
  border-radius: 0.4rem;
  background: transparent;
  color: var(--oxblood);
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}
.pager-btn:hover:not(:disabled) { background: rgba(122, 31, 43, 0.08); }
.pager-btn[aria-current="page"] { background: var(--oxblood); color: #fff; }
.pager-btn:disabled { opacity: 0.35; cursor: default; }

.pager-status { display: none; font-weight: 500; color: var(--muted); }

@media (max-width: 40rem) {
  .pager-nums { display: none; }
  .pager-status { display: block; order: -1; width: 100%; text-align: center; }
  .pager-step { flex: 1 1 0; }
}

#lightbox {
  max-width: min(92vw, 70rem);
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 0.4rem;
  background: var(--ink);
  overflow: hidden;
}
#lightbox::backdrop { background: rgba(10, 14, 22, 0.8); }
#lightbox img {
  display: block;
  max-width: 100%;
  max-height: 92vh;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0 auto;
  border-radius: 0;
}
.lb-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

/* ---------- Gdje smo ---------- */
.location {
  display: grid;
  gap: 2rem;
  margin-top: 2rem;
  grid-template-columns: 1fr;
}

@media (min-width: 52rem) {
  .location { grid-template-columns: 1fr 1.3fr; align-items: stretch; }
}

address { font-style: normal; font-size: 1.15rem; line-height: 1.5; }

.hours { border-collapse: collapse; width: 100%; max-width: 24rem; margin-bottom: 1.25rem; }
.hours th, .hours td {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 400;
}
.hours td { text-align: right; font-weight: 600; }
.hours .break {
  display: block;
  font-weight: 400;
  font-size: 0.875rem;
  color: var(--muted);
}

.map iframe {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 20rem;
  border: 0;
  border-radius: 0.3rem;
  background: #fff;
}

/* ---------- Kontakt ---------- */
.contact-line {
  display: grid;
  grid-template-columns: 7rem 1fr;
  align-items: baseline;
  max-width: 28rem;
  padding: 0.8rem 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.2rem;
}
.contact-label { color: var(--muted); font-size: 0.95rem; }
.contact-line a { font-weight: 600; text-underline-offset: 0.2em; }
.note { margin-top: 1.25rem; color: var(--muted); }

/* ---------- Sufinanciranje ---------- */
.funding {
  padding: clamp(2.5rem, 6vw, 4rem) 0;
  border-top: 1px solid var(--line);
}
.funding h2 { font-size: clamp(1.7rem, 3.2vw, 2.2rem); }

.funding-list { display: grid; gap: 1rem; margin-top: 1.75rem; }

.funding-card {
  padding: 1.25rem 1.4rem 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}
.funding-card h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.funding-card p { font-size: 0.95rem; max-width: 62rem; }
.funding-card > p:last-child { margin-bottom: 0; }

.logo-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem 1.75rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}
.logo-row img {
  display: block;
  height: 3.7rem;
  width: auto;
  max-width: 100%;
}

.funding-card details { margin-top: 0.4rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.funding-card summary { cursor: pointer; font-weight: 600; color: var(--oxblood); }
.funding-card details p { margin-top: 0.8rem; }

.small { font-size: 0.875rem; margin-top: 1rem; }
.funding .small { color: var(--muted); }
.funding-card .small { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--ink);
  color: #D8DCE3;
  padding: 3rem 0 2rem;
  font-size: 0.95rem;
}
.site-footer a { color: #fff; text-underline-offset: 0.2em; }

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem 4rem;
}
@media (min-width: 40rem) {
  .footer-grid { grid-template-columns: auto auto; justify-content: start; }
}

.site-footer address { font-style: normal; font-size: inherit; line-height: 1.7; }
.site-footer strong { color: #fff; }
.footer-contact { margin: 0; line-height: 1.7; }

.copyright {
  margin: 2.25rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #A9B0BC;
}

/* ---------- Mobilni ---------- */
@media (max-width: 40rem) {
  .site-header { flex-direction: column; align-items: flex-start; gap: 0.35rem; }
  .site-nav { width: 100%; overflow-x: auto; gap: 1.1rem; padding-bottom: 0.1rem; }
  .site-nav a { white-space: nowrap; }
  html { scroll-padding-top: 6.5rem; }
  .actions .btn { flex: 1 1 9rem; padding-left: 0.9rem; padding-right: 0.9rem; text-align: center; white-space: nowrap; }
  .wordmark { font-size: 1.3rem; }
  .wordmark img { height: 2.5rem; }
  .logo-row img { height: 2.7rem; }
  .contact-line { grid-template-columns: 5.5rem 1fr; font-size: 1.1rem; }
}

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