/*
Theme Name: AMT-METRIKS
Theme URI: https://amt-metriks.ba/
Author: AMT-METRIKS d.o.o.
Description: Moderna responzivna tema za AMT-METRIKS d.o.o. Tešanj: meteorološka, hidrološka i seizmološka oprema, mjerna i laboratorijska tehnika. Svijetli i tamni režim, galerije s uvećanjem, kartice podstranica, kontakt forma.
Version: 1.0.2
Requires at least: 6.4
Requires PHP: 8.0
License: GNU General Public License v2 or later
Text Domain: amt-metriks
*/

:root {
  --bg: #f4f7fb; --surface: #ffffff; --surface-2: #eaf0f7; --text: #0f1b2a; --muted: #586a7e; --line: #d6e0eb;
  --primary: #0a5fa8; --primary-ink: #ffffff; --primary-soft: #e3f0fb; --accent: #e8930c; --accent-soft: #fff3df;
  --hero-1: #0a2a4a; --hero-2: #0b4f86; --shadow: 0 1px 2px rgba(15,27,42,.06), 0 8px 24px rgba(15,27,42,.06);
  --radius: 14px; --max: 1200px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0a111d; --surface: #101a2b; --surface-2: #16233a; --text: #e5edf6; --muted: #9db0c6; --line: #22324b;
  --primary: #4fb0ff; --primary-ink: #04121f; --primary-soft: #10294a; --accent: #fbbf24; --accent-soft: #2b2210;
  --hero-1: #050b15; --hero-2: #0b2440; --shadow: 0 1px 2px rgba(0,0,0,.4), 0 10px 30px rgba(0,0,0,.35);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.65 var(--font); transition: background .25s, color .25s; }
img { max-width: 100%; height: auto; }
a { color: var(--primary); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.screen-reader-text, .skip-link:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 10px; left: 10px; z-index: 999; background: var(--surface); padding: .6rem 1rem; border-radius: 8px; }
.container { width: min(var(--max), 100% - 2.5rem); margin-inline: auto; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; margin: 1.6em 0 .6em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.4vw, 2.8rem); margin-top: 0; }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); }
h3 { font-size: 1.2rem; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--text); margin-right: auto; }
.brand svg { width: 42px; height: 42px; flex: none; }
.brand-name { font-weight: 800; letter-spacing: .04em; font-size: 1.15rem; line-height: 1; }
.brand-tag { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; letter-spacing: .02em; margin-top: .25rem; }
.main-nav ul { list-style: none; margin: 0; padding: 0; }
.main-nav > ul { display: flex; gap: .15rem; }
.main-nav li { position: relative; }
.main-nav a { display: block; padding: .55rem .8rem; border-radius: 9px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current-menu-ancestor > a, .main-nav .current_page_item > a { background: var(--primary-soft); color: var(--primary); }
.main-nav .sub-menu { position: absolute; left: 0; top: 100%; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem; opacity: 0; visibility: hidden; transform: translateY(6px); transition: .15s; }
.main-nav li:hover > .sub-menu, .main-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.main-nav .sub-menu a { font-weight: 500; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; }
.theme-toggle .moon { display: none; } :root[data-theme="dark"] .theme-toggle .sun { display: none; } :root[data-theme="dark"] .theme-toggle .moon { display: block; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; }
  .main-nav { position: fixed; inset: 72px 0 0 0; background: var(--surface); overflow-y: auto; padding: 1rem 1.25rem 2rem; transform: translateX(100%); transition: transform .25s; }
  .main-nav.open { transform: none; }
  .main-nav > ul { flex-direction: column; }
  .main-nav .sub-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; border-left: 2px solid var(--line); border-radius: 0; margin: 0 0 .4rem .8rem; padding: 0; min-width: 0; }
  .main-nav a { padding: .7rem .6rem; }
  .nav-search { margin-top: 1rem; }
}
@media (min-width: 961px) { .nav-search { display: none; } }

/* hero */
.hero { position: relative; overflow: hidden; color: #eaf4ff; background: radial-gradient(1200px 500px at 85% -10%, rgba(79,176,255,.35), transparent 60%), linear-gradient(135deg, var(--hero-1), var(--hero-2)); }
.hero .container { position: relative; z-index: 1; padding: clamp(3.5rem, 8vw, 6.5rem) 0 clamp(3rem, 7vw, 5.5rem); display: grid; gap: 2.5rem; grid-template-columns: 1.2fr .8fr; align-items: center; }
.hero h1 { color: #fff; font-size: clamp(2rem, 1.2rem + 3.4vw, 3.4rem); margin-bottom: .4em; }
.hero p.lead { font-size: 1.15rem; color: #c9defa; max-width: 40ch; }
.hero .eyebrow { font: 600 .8rem/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.hero-lines { position: absolute; inset: 0; opacity: .25; pointer-events: none; }
.gauge { width: 100%; max-width: 360px; justify-self: center; filter: drop-shadow(0 20px 40px rgba(0,0,0,.35)); }
.gauge .needle { transform-origin: 160px 160px; animation: sweep 6s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: rotate(-58deg); } to { transform: rotate(38deg); } }
@media (prefers-reduced-motion: reduce) { .gauge .needle { animation: none; transform: rotate(-10deg); } html { scroll-behavior: auto; } }
.readouts { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.4rem; }
.readout { font: 500 .82rem var(--mono); padding: .45rem .7rem; border: 1px solid rgba(201,222,250,.3); border-radius: 8px; background: rgba(255,255,255,.06); color: #dbeafe; }
.readout b { color: #fff; }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } .gauge { max-width: 240px; order: -1; } }

.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .8rem 1.2rem; border-radius: 11px; font-weight: 700; text-decoration: none; border: 1px solid transparent; transition: .15s; }
.btn-primary { background: var(--accent); color: #1b1300; }
.btn-primary:hover { filter: brightness(1.08); color: #1b1300; }
.btn-ghost { border-color: rgba(255,255,255,.35); color: #fff; }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--text); background: var(--surface); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* sections & cards */
.section { padding: clamp(3rem, 6vw, 5rem) 0; }
.section-alt { background: var(--surface-2); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.kicker { font: 600 .75rem var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--primary); }
.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.card:hover { transform: translateY(-3px); border-color: var(--primary); color: var(--text); }
.card-media { aspect-ratio: 4/3; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); }
:root[data-theme="dark"] .card-media { background: #f2f5f9; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: .8rem; }
.card-media .ph { color: var(--primary); width: 54px; height: 54px; opacity: .55; }
.card-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-title { font-weight: 700; line-height: 1.3; }
.card-meta { font-size: .85rem; color: var(--muted); }
.card-more { margin-top: auto; font-size: .85rem; font-weight: 700; color: var(--primary); }
.features { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; }
.feature svg { width: 34px; height: 34px; color: var(--accent); }
.feature h3 { margin: .6rem 0 .3rem; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--muted); font-size: .95rem; }

/* page */
.page-hero { background: linear-gradient(135deg, var(--hero-1), var(--hero-2)); color: #eaf4ff; padding: 2.4rem 0 2.2rem; }
.page-hero h1 { color: #fff; margin: .4rem 0 0; }
.breadcrumbs { font-size: .85rem; color: #b9d3f3; }
.breadcrumbs a { color: #dbeafe; text-decoration: none; } .breadcrumbs a:hover { color: var(--accent); }
.breadcrumbs span.sep { opacity: .6; margin: 0 .35rem; }
.page-wrap { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr) 280px; padding: 2.4rem 0 4rem; }
@media (max-width: 960px) { .page-wrap { grid-template-columns: 1fr; } }
.entry { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(1.2rem, 3vw, 2.2rem); box-shadow: var(--shadow); min-width: 0; }
.entry > :first-child { margin-top: 0; }
.entry table { width: 100%; border-collapse: collapse; margin: 1.2rem 0; font-size: .95rem; display: block; overflow-x: auto; }
.entry td, .entry th { border: 1px solid var(--line); padding: .55rem .7rem; vertical-align: top; }
.entry tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.entry img { border-radius: 10px; }
.entry figure { margin: 1rem 0; }
.amt-gallery { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); margin: 1.2rem 0; }
.amt-gallery figure { margin: 0; }
.amt-gallery a, .amt-zoom { display: block; background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.amt-gallery img { width: 100%; aspect-ratio: 1; object-fit: contain; padding: .5rem; border-radius: 0; }
.entry .amt-inline { max-width: min(100%, 520px); }
.entry a[href$=".pdf"]::before { content: "PDF"; font: 700 .68rem var(--mono); background: var(--accent-soft); color: var(--accent); border: 1px solid currentColor; padding: .05rem .3rem; border-radius: 4px; margin-right: .4rem; }
.sidebar .box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; margin-bottom: 1rem; }
.sidebar h2 { font-size: .8rem; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .7rem; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li a { display: block; padding: .4rem .5rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .95rem; }
.sidebar li a:hover, .sidebar li.current a { background: var(--primary-soft); color: var(--primary); }
.children-title { margin-top: 2.2rem; }

/* forms */
.form-grid { display: grid; gap: .9rem; }
.form-grid label { font-weight: 600; font-size: .92rem; display: grid; gap: .35rem; }
.form-grid input, .form-grid textarea, .search-form input { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .8rem; width: 100%; }
.form-grid input:focus, .form-grid textarea:focus, .search-form input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px var(--primary-soft); }
.form-grid button, .search-form button { font: inherit; font-weight: 700; cursor: pointer; background: var(--primary); color: var(--primary-ink); border: 0; border-radius: 10px; padding: .8rem 1.2rem; justify-self: start; }
.hp { position: absolute; left: -9999px; }
.notice { padding: .8rem 1rem; border-radius: 10px; margin-bottom: 1rem; border: 1px solid; }
.notice.ok { background: #e7f7ee; border-color: #9fd9b6; color: #0f5132; } .notice.err { background: #fdecec; border-color: #f1aeae; color: #842029; }
.search-form { display: flex; gap: .5rem; }
.contact-cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 1.4rem; }
.contact-card { background: var(--surface-2); border-radius: 12px; padding: 1rem; }
.contact-card strong { display: block; font-size: .78rem; font-family: var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .25rem; }

/* footer */
.site-footer { background: var(--hero-1); color: #c7d7ea; padding: 3rem 0 1.4rem; margin-top: 0; }
.site-footer a { color: #e5efff; text-decoration: none; } .site-footer a:hover { color: var(--accent); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h2 { color: #fff; font-size: .85rem; font-family: var(--mono); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 .8rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); margin-top: 2rem; padding-top: 1rem; font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* lightbox */
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(4,10,20,.9); display: none; align-items: center; justify-content: center; padding: 1.5rem; }
.lb.open { display: flex; }
.lb img { max-width: min(1100px, 100%); max-height: 86vh; background: #fff; border-radius: 10px; }
.lb button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 46px; height: 46px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lb .lb-close { top: 1rem; right: 1rem; } .lb .lb-prev { left: 1rem; } .lb .lb-next { right: 1rem; }
.lb .lb-cap { position: absolute; bottom: 1rem; left: 0; right: 0; text-align: center; color: #dbeafe; font-size: .9rem; }

/* cookie bar */
.cookie-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px rgba(0,0,0,.12); padding: 1rem 0; animation: cookieUp .3s ease-out; }
.cookie-bar[hidden] { display: none; }
.cookie-inner { display: flex; gap: 1rem 1.5rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.cookie-inner p { margin: 0; flex: 1 1 420px; font-size: .95rem; color: var(--text); }
.cookie-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.cookie-actions .btn { padding: .65rem 1rem; cursor: pointer; font: inherit; font-weight: 700; }
@keyframes cookieUp { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .cookie-bar { animation: none; } }

/* fit */
.main-nav a { white-space: nowrap; }
@media (min-width: 961px) and (max-width: 1320px) { .brand-tag { display: none; } .main-nav a { padding: .5rem .55rem; font-size: .9rem; } }
@media (max-width: 600px) {
  .brand-tag { display: none; }
  .hero .eyebrow { letter-spacing: .08em; font-size: .7rem; line-height: 1.6; }
  .gauge { max-width: 190px; }
  .hero .container { gap: 1.5rem; padding-top: 2rem; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
}
