/* JANOV.si design system
   Tokens per doc/JANOV_DESIGN.md */

:root {
  --gold: #d4af37;
  --gold-muted: #b09972;
  --dark: #141414;
  --blue: #2F5FA7;
  --blue-accent: #3776de;
  --success: #239515;
  --error: #D03939;
  --bg: #FAF7F0;
  --surface: #FFFFFF;
  --text-muted: #5c5c5c;

  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-wordmark: "Cooper Black", "Copperplate", serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --max-w: 1200px;
  --s-1: 8px;
  --s-2: 16px;
  --s-3: 24px;
  --s-4: 32px;
  --s-5: 48px;
  --s-6: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--dark);
  background: var(--bg);
}

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

a { color: var(--blue); }
a:hover { color: var(--blue-accent); }

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--s-3);
}

/* Typography */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; }
.headline-lg { font-size: 36px; }
.headline-md { font-size: 26px; }
@media (max-width: 640px) {
  .headline-lg { font-size: 28px; }
  .headline-md { font-size: 22px; }
}
.label-caps {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-muted);
}

/* Buttons */
.btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-primary {
  background: var(--gold);
  color: var(--dark);
}
.btn-primary:hover { background: var(--gold-muted); color: var(--dark); }
.btn-secondary {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
.btn-secondary:hover { color: var(--blue-accent); border-color: var(--blue-accent); }

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--gold-muted);
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-2) var(--s-3);
  max-width: var(--max-w);
  margin: 0 auto;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: var(--s-1);
  text-decoration: none;
  color: var(--dark);
}
.site-logo img { height: 40px; width: auto; }

.main-nav ul {
  display: flex;
  gap: var(--s-3);
  list-style: none;
}
.main-nav a {
  text-decoration: none;
  color: var(--dark);
  font-weight: 600;
  font-size: 14px;
}
.main-nav a:hover { color: var(--blue-accent); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 28px;
  cursor: pointer;
  color: var(--dark);
  line-height: 1;
}

@media (max-width: 800px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    width: 100%;
  }
  .main-nav.open { display: block; }
  .site-header .inner { flex-wrap: wrap; }
  .main-nav ul {
    flex-direction: column;
    gap: var(--s-2);
    padding: var(--s-2) 0;
  }
}

/* Hero */
.hero {
  background:
    linear-gradient(rgba(20, 20, 20, 0.55), rgba(20, 20, 20, 0.55)),
    url("../../media/products/pregibni-nosilec/05-enojni-lamelni.jpg") center / cover no-repeat;
  color: #fff;
  padding: var(--s-6) 0;
  text-align: center;
}
.hero h1 {
  font-family: var(--font-wordmark);
  font-weight: 400;
  font-size: 44px;
  max-width: 800px;
  margin: 0 auto var(--s-2);
}
.hero p {
  font-size: 18px;
  max-width: 620px;
  margin: 0 auto var(--s-4);
}
.hero .btn + .btn { margin-left: var(--s-1); }
@media (max-width: 640px) {
  .hero h1 { font-size: 32px; }
  .hero .btn + .btn { margin-left: 0; margin-top: var(--s-1); }
}

/* Hero video teaser strip - 3 product videos, 25% width each */
.hero-videos {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin: 0 auto var(--s-4);
}
.hero-video {
  display: block;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
  transition: transform 0.15s;
}
.hero-video:hover { transform: translateY(-2px); }
/* Vsak video ohrani svoje razmerje stranic (ležeči 16:9, pokončni 9:16),
   skupna višina ju poravna v lepo vrstico. */
.hero-video video {
  height: 240px;
  width: auto;
  aspect-ratio: auto;
  object-fit: cover;
  display: block;
  pointer-events: none;
}
@media (max-width: 640px) {
  .hero-video video { height: 170px; }
}

/* Sections */
.section { padding: var(--s-6) 0; }
.section-alt { background: var(--surface); }
.section-head {
  text-align: center;
  margin-bottom: var(--s-4);
}
.section-head p {
  color: var(--text-muted);
  max-width: 640px;
  margin: var(--s-1) auto 0;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--s-3);
}
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--s-3);
  box-shadow: 0 1px 4px rgba(20, 20, 20, 0.08);
  text-decoration: none;
  color: var(--dark);
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  transition: box-shadow 0.15s, transform 0.15s;
}
.section-alt .card { background: var(--bg); }
.card:hover {
  box-shadow: 0 4px 16px rgba(20, 20, 20, 0.14);
  transform: translateY(-2px);
  color: var(--dark);
}
.card img {
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
.card h3 { font-size: 18px; }
.card p { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
.card .price-note {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-muted);
  margin-top: auto;
}

/* Featured article */
.featured {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  align-items: center;
}
.featured img {
  border-radius: var(--radius-lg);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
@media (max-width: 800px) {
  .featured { grid-template-columns: 1fr; }
}

/* Reference strip */
.ref-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--s-2);
}
.ref-grid img {
  border-radius: var(--radius-md);
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}
@media (max-width: 800px) {
  .ref-grid { grid-template-columns: repeat(2, 1fr); }
}

/* CTA block */
.cta-block {
  background: var(--dark);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--s-5) var(--s-4);
  text-align: center;
}
.cta-block h2 { margin-bottom: var(--s-2); }
.cta-block p {
  color: #d9d9d9;
  max-width: 560px;
  margin: 0 auto var(--s-3);
}

/* Content prose (O nas, pravne strani) */
.prose { max-width: 720px; }
.prose p + p { margin-top: var(--s-2); }
.prose h2 { font-size: 20px; margin-top: var(--s-4); margin-bottom: var(--s-2); }
.prose h3 { font-size: 16px; margin-top: var(--s-3); margin-bottom: var(--s-1); }
.prose ul, .prose ol { margin: var(--s-2) 0 var(--s-2) var(--s-3); }
.prose li + li { margin-top: 6px; }
.prose .meta { color: var(--text-muted); font-size: 14px; margin-bottom: var(--s-3); }
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s-4);
  align-items: start;
}
@media (max-width: 800px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Patent badges */
.badge {
  display: inline-block;
  background: var(--surface);
  border: 1px solid var(--gold-muted);
  color: var(--dark);
  border-radius: var(--radius-full);
  padding: 4px 14px;
  font-size: 13px;
  font-weight: 600;
  margin: var(--s-1) var(--s-1) 0 0;
}

/* Contact */
.contact-list {
  list-style: none;
  display: grid;
  gap: var(--s-2);
}
.contact-list strong { display: block; font-size: 13px; }

/* Form */
.form-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: var(--s-4);
  box-shadow: 0 1px 4px rgba(20, 20, 20, 0.08);
}
.form-card .form-tag {
  color: var(--gold);
  margin-bottom: var(--s-1);
}
.field { margin-bottom: var(--s-3); }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: var(--s-1);
}
.field input,
.field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 12px 14px;
  border: 1px solid var(--gold-muted);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--dark);
}
.field textarea { min-height: 120px; resize: vertical; }
.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--blue-accent);
  border-color: var(--blue-accent);
}
.form-note { font-size: 13px; color: var(--text-muted); margin-top: var(--s-2); }
.form-status {
  margin-top: var(--s-2);
  font-size: 14px;
  font-weight: 600;
  display: none;
}
.form-status.success { display: block; color: var(--success); }
.form-status.error { display: block; color: var(--error); }

/* Footer */
.site-footer {
  background: var(--dark);
  color: #d9d9d9;
  margin-top: var(--s-6);
}
.site-footer .inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--s-5) var(--s-3) var(--s-3);
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--s-4);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid #333;
}
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.site-footer h3 {
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--s-2);
}
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: var(--s-1); }
.site-footer a { color: #d9d9d9; text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.subfooter {
  display: flex;
  justify-content: space-between;
  gap: var(--s-2);
  flex-wrap: wrap;
  padding-top: var(--s-3);
  font-size: 13px;
  color: #8a8a8a;
}

/* Product hero carousel (doc/SITE_STRUCTURE.md §6a).
   Max 50% širine strani (lastnik 2026-08-24): čez celo stran je preveliko,
   posebej pri portretnih videih. Mobilno čez celo širino. */
.carousel {
  position: relative;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(20, 20, 20, 0.08);
  overflow: hidden;
  max-width: 50%;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-lg);
}
@media (max-width: 900px) {
  .carousel { max-width: 100%; border-radius: 0; }
}
.carousel-track {
  display: flex;
  transition: transform 0.35s ease;
}
.carousel-slide {
  min-width: 100%;
  margin: 0;
}
.carousel-slide img,
.carousel-slide video {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}
/* V karuseli video-polnilo polni cel slide 16:9 - omejitev video-portrait
   (270px, mišljena za članke) tu NE velja. */
.carousel-slide video.video-portrait {
  max-width: none;
  margin: 0;
}
/* Portretni slide (razred doda main.js, ko zazna višjo-kot-široko sliko/video):
   media se pokaže cela, omejena po višini, na sredini temne podlage.
   Ležeči slide ostane polni 16:9. */
.carousel-slide.slide-portrait {
  display: flex;
  justify-content: center;
  align-items: center;
}
.carousel-slide.slide-portrait img,
.carousel-slide.slide-portrait video {
  width: auto;
  height: auto;
  max-height: min(70vh, 640px);
  max-width: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  margin: 0 auto;
}
.carousel-dots {
  position: absolute;
  bottom: var(--s-2);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 2;
}
.carousel-dots button {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  border: none;
  padding: 0;
  cursor: pointer;
  background: var(--gold-muted);
  opacity: 0.7;
}
.carousel-dots button.active {
  background: var(--gold);
  opacity: 1;
}
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(20, 20, 20, 0.5);
  color: #fff;
  border: none;
  border-radius: var(--radius-full);
  width: 40px;
  height: 40px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.carousel-btn:hover { background: rgba(20, 20, 20, 0.75); }
.carousel-btn.prev { left: var(--s-2); }
.carousel-btn.next { right: var(--s-2); }

/* Spec tables on product pages */
.spec-table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
}
.spec-table th,
.spec-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--gold-muted);
}
.spec-table th {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-muted);
  width: 40%;
}

/* Article pages (Dobro vedeti) */
.article-wrap { max-width: 760px; margin: 0 auto; }
.prose figure { margin: var(--s-3) 0; }
.prose figure img,
.prose figure video {
  border-radius: var(--radius-md);
  width: 100%;
}
.prose figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--s-1);
  line-height: 1.5;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: var(--s-2) 0;
}
.prose th,
.prose td {
  text-align: left;
  padding: 8px 10px;
  border-bottom: 1px solid var(--gold-muted);
}
.prose th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.related-list { list-style: none; margin: var(--s-2) 0; }
.related-list li + li { margin-top: var(--s-1); }
.back-link { font-size: 14px; }

.article-sources { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-top: var(--s-2); }
.article-sources h2 { font-size: 14px; margin-bottom: var(--s-1); }
.article-sources ol { margin: 0; padding-left: 1.2em; }
.article-sources li { margin-top: 4px; }
.article-sources a { word-break: break-word; }

/* Reference carousel (/nase-delo/) - scoped under .carousel-showall.
   Bug fixed 2026-08-24: these rules used to target the bare .carousel/.carousel-slide/
   .carousel-dots classes, which are ALSO used by the product hero carousel (§6a). Since
   .carousel-slide{display:none} had no scope, it applied to every carousel on the site,
   including product pages - and product pages' JS slides via `transform`, never adding
   `.is-active`, so their hero media was permanently invisible (confirmed with a headless
   screenshot of /produkti/vrtljivi-drog/: carousel rendered empty). Fix: every selector
   below is scoped to .carousel-showall (already present on the /nase-delo/ container
   alongside .carousel), so it can never again leak onto the product carousel. */
.carousel-showall {
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(20, 20, 20, 0.08);
  padding: var(--s-3);
}
.carousel-showall .carousel-slide {
  display: none;
  margin: 0;
}
.carousel-showall .carousel-slide.is-active { display: block; }
.carousel-showall .carousel-slide img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: var(--radius-md);
}
.carousel-showall .carousel-slide figcaption {
  margin-top: var(--s-2);
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
}
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--surface);
  color: var(--dark);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(20, 20, 20, 0.25);
  z-index: 2;
}
.carousel-arrow:hover { background: var(--gold); }
.carousel-prev { left: var(--s-2); }
.carousel-next { right: var(--s-2); }
.carousel-showall .carousel-dots {
  position: static;
  transform: none;
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: var(--s-2);
}
.carousel-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: var(--radius-full);
  border: none;
  background: var(--gold-muted);
  opacity: 0.4;
  cursor: pointer;
}
.carousel-dot.is-active { background: var(--gold); opacity: 1; }
@media (max-width: 640px) {
  .carousel-arrow { width: 36px; height: 36px; font-size: 16px; }
}

/* Portrait videos (1080x1920) render too tall at full container width.
   Rule (owner, 2026-08-24): portrait videos are capped at 270px width
   (25% of native 1080px; halved once more after first attempt at 540px),
   centered. Apply class="video-portrait" to any portrait video embed. */
.video-portrait {
  display: block;
  width: 100%;
  max-width: 270px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-md);
}

/* Lightbox: klik na sliko v karuseli ali članku odpre original (SITE_STRUCTURE §2a-1) */
.lightbox {
  border: none;
  background: rgba(20, 20, 20, 0.92);
  max-width: 96vw;
  max-height: 96vh;
  padding: 0;
  cursor: zoom-out;
}
.lightbox img {
  max-width: 96vw;
  max-height: 96vh;
  width: auto;
  height: auto;
  display: block;
}
.lightbox::backdrop { background: rgba(20, 20, 20, 0.75); }
.zoomable { cursor: zoom-in; }

/* Lightbox galerija: X za zaprtje, puscici za listanje */
.lightbox {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: none;
  max-height: none;
  width: 100vw;
  height: 100vh;
  background: rgba(20, 20, 20, 0.94);
}
.lightbox[open] { display: flex; }
.lightbox img { max-width: 92vw; max-height: 88vh; }
.lightbox-close {
  position: absolute;
  top: var(--s-2);
  right: var(--s-2);
  z-index: 2;
  background: none;
  border: none;
  color: #fff;
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  padding: var(--s-1);
}
.lightbox-close:hover { color: var(--gold); }
.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  background: rgba(20, 20, 20, 0.6);
  border: none;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  padding: var(--s-2) var(--s-2);
  border-radius: var(--radius-md);
}
.lightbox-nav:hover { background: var(--gold); color: var(--dark); }
.lightbox-prev { left: var(--s-2); }
.lightbox-next { right: var(--s-2); }

/* Lightbox "kartica" za produktne karusele: svetla, sredinska, elegantna -
   NE čez cel zaslon črno (za to je navadni .lightbox na Naše delo / člankih). */
.lightbox-card {
  background: transparent;
  width: 100vw;
  height: 100vh;
  flex-direction: column;
  gap: 0;
  overflow: visible;
}
.lightbox-card::backdrop {
  background: rgba(20, 20, 20, 0.35);
  backdrop-filter: blur(3px);
}
.lightbox-card figure {
  margin: 0;
  background: var(--surface);
  padding: var(--s-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 48px rgba(20, 20, 20, 0.35);
  max-width: 88vw;
  max-height: 84vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-card figure img,
.lightbox-card figure video {
  max-width: 84vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
  display: block;
}
.lightbox-card .lightbox-close { color: var(--dark); text-shadow: 0 1px 4px rgba(255,255,255,0.8); }
.lightbox-card .lightbox-nav { background: rgba(255, 255, 255, 0.9); color: var(--dark); box-shadow: 0 2px 10px rgba(20,20,20,0.2); }
.lightbox-card .lightbox-nav:hover { background: var(--gold); }
/* video v lightboxu (oba izgleda): naravna velikost, kontrolne tipke */
.lightbox video {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-md);
}
