/* ============================================================
   STT Strojna tovarna Trbovlje — refurbished 2026
   Modern responsive rebuild keeping the 2002 visual DNA:
   steel blues, silver header band, Arial, sharp corners,
   original link blue and spec-table colours.
   ============================================================ */

:root {
  --bg: #EBE9ED;              /* original page background */
  --surface: #FFFFFF;
  --steel-900: #26303B;       /* nav / footer band */
  --steel-700: #3C4855;       /* original heading colour */
  --steel-500: #62788E;       /* original subheading colour */
  --steel-200: #C6CDD6;
  --red: #C13327;             /* STT logo red */
  --link: #0066CC;            /* original link colour */
  --link-hover: #003366;      /* original hover colour */
  --alt: #F7F7F7;             /* original alternating cell */
  --border: #D9D7DD;
  --table-head: #FFFFEA;      /* original spec-table header */
  --table-alt: #E6F4FF;       /* original spec-table stripe */
  --table-grid: #999999;      /* original spec-table grid */
  --wrap: 1040px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;   /* era-authentic */
  font-size: 16px;
  line-height: 1.6;
  color: #24292F;
  background: var(--bg);
}

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

a { color: var(--link); text-decoration: underline; }
a:hover { color: var(--link-hover); }

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

/* ---------- header ---------- */

.site-header { border-top: 4px solid var(--red); }

.brandbar {
  background: linear-gradient(180deg, #F7F8FA 0%, #E3E6EB 55%, #C9CFD8 100%);
  border-bottom: 1px solid #B7BEC9;
}

.brandbar .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-top: 16px;
  padding-bottom: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  text-decoration: none;
  color: var(--steel-900);
}

.brand img { width: 92px; height: auto; flex: none; }

.brand-text { line-height: 1.25; }

.brand-text strong {
  display: block;
  font-size: clamp(18px, 3.4vw, 26px);
  letter-spacing: -0.5px;
  color: #1E2833;
}

.brand-text small {
  display: block;
  font-size: clamp(12px, 2.2vw, 15px);
  font-weight: bold;
  color: var(--steel-700);
}

.mainnav { background: var(--steel-900); }

.mainnav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.mainnav li { display: flex; align-items: center; }

.mainnav li + li::before {
  content: "|";
  color: #55606C;
  padding: 0 2px;
}

.mainnav a {
  display: block;
  padding: 11px 12px;
  color: #FFFFFF;
  font-weight: bold;
  font-size: 15px;
  text-decoration: underline;
  transition: background-color 150ms ease, color 150ms ease;
}

.mainnav a:hover { color: #FFFFFF; background: #38434F; }

.mainnav a.active {
  color: #FFFFFF;
  background: var(--red);
  text-decoration: none;
}

.mainnav a:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 2px;
}

/* ---------- page body ---------- */

.page { padding: 28px 0 48px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: clamp(20px, 4vw, 40px);
}

.kicker {
  color: var(--steel-500);
  font-size: 18px;
  margin: 0 0 4px;
}

.page-title {
  color: var(--steel-700);
  font-size: clamp(24px, 4.5vw, 32px);
  font-weight: bold;
  letter-spacing: -1px;      /* original .productsTitle */
  margin: 0 0 22px;
  line-height: 1.2;
}

h2.section {
  color: var(--steel-500);
  font-size: 20px;
  font-weight: normal;
  margin: 34px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--steel-200);
}

h2.section:first-of-type { margin-top: 0; }

/* ---------- product grid (home / subpages) ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 14px;
  margin-top: 8px;
}

.product-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 12px;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.product-grid .product-card:nth-child(even) { background: var(--alt); }

.product-card:hover {
  border-color: var(--red);
  box-shadow: 0 2px 8px rgba(38, 48, 59, 0.14);
}

.product-card img {
  width: 120px;
  height: 90px;
  object-fit: cover;
  flex: none;
  border: 1px solid var(--border);
}

.product-card .pc-text { min-width: 0; }

.product-card .pc-text a { font-weight: bold; }

.product-card .pc-flag {
  display: block;
  margin-top: 6px;
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 0.5px;
  color: var(--red);
}

/* ---------- definition rows (company profile) ---------- */

.def-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 26px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}

.def-row:last-child { border-bottom: none; }

.def-row > h2 {
  color: var(--steel-500);
  font-size: 18px;
  font-weight: normal;
  margin: 0;
}

.def-row > div > p:first-child { margin-top: 0; }
.def-row > div > ul { margin: 0; padding-left: 20px; }
.def-row > div > ul li { margin: 4px 0; font-weight: bold; }

@media (max-width: 640px) {
  .def-row { grid-template-columns: 1fr; padding: 14px 0; }
}

/* ---------- tables ---------- */

.table-scroll { overflow-x: auto; margin: 14px 0; }

table.spec {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  background: var(--table-grid);   /* grid colour via gaps, as original */
  border: 1px solid var(--table-grid);
  font-size: 15px;
}

table.spec th,
table.spec td {
  border: 1px solid var(--table-grid);
  padding: 6px 10px;
  background: var(--surface);
  text-align: left;
}

table.spec th { background: var(--table-head); }

table.spec tr:nth-child(even) td { background: var(--table-alt); }

table.spec td.num, table.spec th.num { text-align: right; }
table.spec td.ctr, table.spec th.ctr { text-align: center; }

table.machinery { min-width: 420px; }

/* ---------- product detail layout (clamp set / mesh device) ---------- */

.detail {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 30px;
}

.detail > * { min-width: 0; }

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

.side-nav {
  border: 1px solid var(--border);
  background: var(--alt);
  padding: 14px;
  align-self: start;
  font-size: 15px;
}

.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li { padding: 5px 0; }
.side-nav li.current { font-weight: bold; color: var(--steel-700); }
.side-nav li.dl { margin-top: 14px; border-top: 1px solid var(--border); padding-top: 12px; }

.patent-badge {
  display: inline-block;
  border: 2px solid var(--red);
  color: var(--red);
  font-weight: bold;
  font-size: 12px;
  letter-spacing: 1px;
  padding: 3px 10px;
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.figure-pair {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 18px;
  margin: 14px 0;
}

.figure-pair > * { min-width: 0; }

@media (max-width: 620px) {
  .figure-pair { grid-template-columns: 1fr; }
}

figure { margin: 0 0 14px; }

figure img { border: 1px solid var(--border); background: var(--alt); }

figcaption { font-weight: bold; margin-top: 6px; font-size: 15px; }

.leaflet-img {
  display: block;
  margin: 0 auto;
  border: 1px solid var(--border);
}

.pager {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

.pager a, .pager span {
  display: inline-block;
  min-width: 44px;
  padding: 9px 16px;
  border: 1px solid var(--border);
  font-weight: bold;
  text-decoration: none;
  text-align: center;
}

.pager span { background: var(--steel-700); color: #FFF; border-color: var(--steel-700); }
.pager a:hover { border-color: var(--red); color: var(--link-hover); }

/* ---------- maps / find us ---------- */

.map-holder { position: relative; max-width: 550px; margin: 10px auto; }
.map-holder img { display: block; width: 100%; border: 1px solid var(--border); }

.map-hotspot {
  position: absolute;
  display: block;
  /* Slovenia rect on europe.gif: 322,238 → 392,292 of 550×460 */
  left: 58.5%; top: 51.7%; width: 12.8%; height: 11.8%;
  border: 2px solid var(--red);
  transition: background-color 150ms ease;
}

.map-hotspot:hover { background: rgba(193, 51, 39, 0.18); }

.way-links { margin: 0 0 6px; }

/* ---------- gallery ---------- */

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.gallery-grid a {
  display: block;
  border: 1px solid var(--border);
  background: var(--alt);
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.gallery-grid a:hover {
  border-color: var(--red);
  box-shadow: 0 2px 8px rgba(38, 48, 59, 0.18);
}

.gallery-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 10px;
}

.cat-card {
  border: 1px solid var(--border);
  background: var(--surface);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.cat-card:hover {
  border-color: var(--red);
  box-shadow: 0 2px 8px rgba(38, 48, 59, 0.18);
}

.cat-card img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.cat-card .cc-label {
  display: block;
  padding: 10px 12px;
  font-weight: bold;
  color: var(--steel-700);
}

.cat-card .cc-count {
  display: block;
  padding: 0 12px 10px;
  font-size: 13px;
  color: var(--steel-500);
}

.gallery-meta { color: var(--steel-500); font-size: 14px; margin: 0 0 4px; }

/* ---------- lightbox ---------- */

.lb-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  background: rgba(16, 21, 27, 0.92);
  align-items: center;
  justify-content: center;
}

.lb-overlay.open { display: flex; }

.lb-img {
  max-width: min(92vw, 1200px);
  max-height: 84vh;
  display: block;
  border: 1px solid #4A545F;
  background: #000;
}

.lb-btn {
  position: absolute;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid #5A646F;
  background: rgba(38, 48, 59, 0.85);
  color: #FFF;
  font-size: 22px;
  font-weight: bold;
  font-family: Arial, Helvetica, sans-serif;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.lb-btn:hover { background: var(--red); }

.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

.lb-count {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: #C6CDD6;
  font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- footer ---------- */

.site-footer {
  background: var(--steel-900);
  color: #D6DBE1;
  border-top: 4px solid var(--red);
  margin-top: 20px;
}

.site-footer .wrap {
  padding-top: 26px;
  padding-bottom: 30px;
  text-align: center;
  font-size: 15px;
  line-height: 1.7;
}

.site-footer strong { color: #FFFFFF; }
.site-footer a { color: #9FC4EE; }
.site-footer a:hover { color: #FFFFFF; }
.site-footer .f-red { color: #E4574A; }
