/* =====================================================================
   Devmajstori — dizajn sustav
   Pikselni akcenti (kao logo) + čista moderna tipografija.
   ===================================================================== */

:root {
  --accent: #ff6a13;
  --accent-2: #ff8a3d;
  --accent-ink: #1a0b00;
  --font-pixel: "Silkscreen", ui-monospace, monospace;
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-px: 4px 4px 0 var(--px-shadow);
  --container: 1200px;
  --header-h: 72px;
}

[data-theme="dark"] {
  --bg: #0c0c10;
  --bg-2: #111117;
  --surface: #16161e;
  --surface-2: #1d1d27;
  --border: #2a2a36;
  --border-strong: #3a3a4a;
  --text: #ececf1;
  --text-2: #a9a9b8;
  --muted: #7d7d8f;
  --px-shadow: #000;
  --grid-line: rgba(255, 255, 255, .035);
  --code-bg: #0a0a0e;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: #f7f6f3;
  --bg-2: #efede8;
  --surface: #ffffff;
  --surface-2: #f4f3ef;
  --border: #e2dfd8;
  --border-strong: #cfcbc2;
  --text: #16161c;
  --text-2: #4a4a57;
  --muted: #77778a;
  --px-shadow: #16161c;
  --grid-line: rgba(0, 0, 0, .045);
  --code-bg: #16161e;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 2.4vw, 1.9rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
code, pre { font-family: var(--font-mono); }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #000; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.container--narrow { max-width: 780px; }
.container--wide { max-width: 1040px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hide-mobile { }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #000; padding: 8px 14px; z-index: 999; }
.skip-link:focus { left: 8px; top: 8px; }
.hp { position: absolute !important; left: -9999px !important; }

.pixel-label {
  font-family: var(--font-pixel);
  font-size: .78rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-block;
}

/* ---------------------------------------------------------- Gumbi */
.btn {
  --b: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.25em;
  border: 2px solid var(--b);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-weight: 600; font-size: .95rem; line-height: 1.2;
  transition: transform .12s ease, box-shadow .12s ease, background .15s;
  white-space: nowrap;
}
.btn:hover { color: inherit; transform: translate(-2px, -2px); box-shadow: 4px 4px 0 var(--px-shadow); }
.btn:active { transform: translate(0, 0); box-shadow: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { color: var(--accent-ink); background: var(--accent-2); }
.btn--ghost { background: transparent; }
.btn--sm { padding: .45em .9em; font-size: .85rem; }
.btn--lg { padding: .9em 1.6em; font-size: 1.02rem; }
.btn--block { width: 100%; }
.link-more { font-weight: 600; font-size: .9rem; color: var(--accent); }
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); font-size: .85rem; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover { color: var(--accent); }
.link-btn--danger { color: #ef4444; }

.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border: 2px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-2);
}
.icon-btn:hover { color: var(--text); border-color: var(--border); background: var(--surface); }

/* ---------------------------------------------------------- Oznake */
.tag {
  --c: var(--accent);
  display: inline-flex; align-items: center; gap: .35em;
  padding: .18em .6em;
  font-size: .75rem; font-weight: 600; letter-spacing: .01em;
  color: var(--c);
  background: color-mix(in srgb, var(--c) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--c) 35%, transparent);
  border-radius: 4px;
  white-space: nowrap;
}
.tag:hover { color: var(--c); background: color-mix(in srgb, var(--c) 22%, transparent); }
.tag--sm { font-size: .7rem; padding: .08em .45em; }
.dot { --c: var(--accent); width: 8px; height: 8px; background: var(--c); flex: none; border-radius: 1px; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list--scroll { margin-top: 1.4rem; }
.chip {
  --c: var(--text-2);
  display: inline-flex; align-items: center; gap: .45em;
  padding: .4em .85em; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: .87rem; font-weight: 500;
}
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 1px; background: var(--c); }
.chip small { color: var(--muted); font-size: .78em; }
.chip:hover, .chip.is-active { border-color: var(--c); color: var(--text); }
.chip.is-active { background: color-mix(in srgb, var(--c) 14%, var(--surface)); }
.chip.is-active:first-child::before { background: var(--accent); }
.status { font-size: .75rem; font-weight: 600; padding: .15em .55em; border-radius: 4px; }
.status--published { color: #22c55e; background: rgba(34, 197, 94, .12); }
.status--draft { color: #eab308; background: rgba(234, 179, 8, .12); }

/* ---------------------------------------------------------- Header */
.announce { background: var(--accent); color: var(--accent-ink); font-size: .88rem; font-weight: 600; text-align: center; padding: 8px 0; }
.site-header {
  position: sticky; top: 0; z-index: 50;
  border-bottom: 1px solid var(--border);
}
/* zamućena pozadina na pseudo-elementu, da fiksni mobilni izbornik ne bude zarobljen u zaglavlju */
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
}
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 28px; }
.brand img { height: 38px; width: auto; image-rendering: auto; }
.brand:hover { filter: drop-shadow(0 0 12px rgba(255, 106, 19, .35)); }

.main-nav { flex: 1; display: flex; align-items: center; }
.nav-list { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav-list > li { position: relative; }
.nav-link {
  display: inline-flex; align-items: center; gap: .4em;
  padding: .55em .85em; border-radius: var(--radius-sm);
  font-weight: 500; font-size: .95rem; color: var(--text-2);
}
.nav-link:hover, .nav-link.is-active { color: var(--text); background: var(--surface); }
.nav-link.is-active { box-shadow: inset 0 -2px 0 var(--accent); border-radius: var(--radius-sm) var(--radius-sm) 2px 2px; }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .6; }
.badge-live {
  font-family: var(--font-pixel); font-size: .6rem; text-transform: uppercase;
  color: #22c55e; border: 1px solid rgba(34, 197, 94, .45); padding: 0 .35em; border-radius: 3px; line-height: 1.5;
}
.dropdown-toggle { display: none; }

.dropdown {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px;
  padding: 8px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--px-shadow), 0 20px 40px rgba(0, 0, 0, .25);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .15s, transform .15s, visibility .15s;
  z-index: 60;
}
.dropdown::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.dropdown--right { left: auto; right: 0; }
.dropdown--forum { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; min-width: 470px; }
.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown,
.has-dropdown.is-open > .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown-label { display: block; font-family: var(--font-pixel); font-size: .68rem; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.dropdown-item {
  display: flex; align-items: center; gap: .6em; width: 100%;
  padding: .5em .7em; border-radius: var(--radius-sm);
  font-size: .9rem; color: var(--text-2); text-align: left;
  background: none; border: 0;
}
.dropdown-item small { margin-left: auto; color: var(--muted); font-size: .75rem; }
.dropdown-item:hover { background: var(--surface-2); color: var(--text); }
.dropdown-item--strong { color: var(--text); font-weight: 600; }

.header-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.i-sun { display: none; }
[data-theme="light"] .i-sun { display: block; }
[data-theme="light"] .i-moon { display: none; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: 8px; padding: 4px 10px 4px 4px; border: 2px solid var(--border); border-radius: 999px; background: var(--surface); }
.user-btn:hover { border-color: var(--accent); }
.user-name { font-size: .88rem; font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); max-width: none; aspect-ratio: 1; }
.avatar--letter { display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-family: var(--font-display); }

.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle span { display: block; width: 18px; height: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.nav-mobile-extra { display: none; }

/* ---------------------------------------------------------- Pretraga */
.search-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: blur(8px);
  display: grid; place-items: start center; padding-top: 14vh;
}
.search-overlay[hidden] { display: none; }
.search-box {
  width: min(680px, 92vw);
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 18px; background: var(--surface);
  border: 2px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--px-shadow);
}
.search-box .pixel-label { grid-column: 1 / -1; }
.search-box input, .search-inline input {
  width: 100%; padding: .8em 1em; font-size: 1.05rem;
  background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius-sm); outline: 0;
}
.search-box input:focus, .search-inline input:focus { border-color: var(--accent); }
.search-inline { display: flex; gap: 10px; max-width: 620px; margin-top: 1rem; }

/* ---------------------------------------------------------- Flash */
.flash { margin: 18px 0 0; padding: 12px 16px; border-radius: var(--radius-sm); border: 2px solid; font-weight: 500; }
.flash--success { border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .1); }
.flash--error { border-color: rgba(239, 68, 68, .5); background: rgba(239, 68, 68, .1); }

/* ---------------------------------------------------------- Hero */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--border); }
.hero-grid-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: radial-gradient(ellipse 80% 70% at 70% 30%, #000 30%, transparent 75%);
}
.hero::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -120px; top: -160px;
  background: radial-gradient(circle, rgba(255, 106, 19, .22), transparent 65%); pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding-top: 88px; padding-bottom: 88px; }
.hero h1 { margin-top: .4em; }
.lead { font-size: 1.15rem; color: var(--text-2); max-width: 60ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 2.4rem 0 0; }
.hero-stats div { border-left: 3px solid var(--accent); padding-left: 12px; }
.hero-stats dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.hero-stats dd { margin: 0; font-family: var(--font-pixel); font-size: 1.6rem; line-height: 1.2; }

.hero-terminal {
  background: var(--code-bg); color: #d8d8e2;
  border: 2px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 10px 10px 0 var(--px-shadow);
  overflow: hidden; transform: rotate(1.2deg);
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #1b1b24; border-bottom: 1px solid #2a2a36; }
.terminal-bar i { width: 11px; height: 11px; border-radius: 50%; background: #ff5f57; }
.terminal-bar i:nth-child(2) { background: #febc2e; }
.terminal-bar i:nth-child(3) { background: #28c840; }
.terminal-bar span { margin-left: 8px; font: 12px var(--font-mono); color: #8a8a9a; }
.hero-terminal pre { margin: 0; padding: 22px; font-size: .92rem; line-height: 1.75; white-space: pre-wrap; }
.c-mute { color: #6b6b7d; } .c-accent { color: var(--accent); } .c-blue { color: #7aa2ff; }
.cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------------------------------------------------------- Sekcije */
.section { padding: 64px 0; }
.section--tight { padding: 36px 0 64px; }
.section--alt { background: var(--bg-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head h2 { display: flex; align-items: baseline; gap: 12px; margin: 0; }
.page-head { padding: 64px 0 28px; border-bottom: 1px solid var(--border); background:
  linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 32px 32px,
  linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 32px 32px; }
.page-head h1 { margin: .3em 0 .3em; }
.page-head--forum { padding-bottom: 48px; }

.grid { display: grid; gap: 24px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.layout-split { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 40px; align-items: start; }
.layout-split--even { grid-template-columns: 1fr 1fr; gap: 24px; }
.sidebar { display: grid; gap: 24px; position: sticky; top: calc(var(--header-h) + 20px); }

/* ---------------------------------------------------------- Kartice */
.card {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s;
}
.card:hover { transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--px-shadow); border-color: var(--border-strong); }
.card-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); border-bottom: 2px solid var(--border); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-placeholder {
  --c: var(--accent);
  display: grid; place-items: center; width: 100%; height: 100%;
  background:
    linear-gradient(color-mix(in srgb, var(--c) 18%, transparent) 2px, transparent 2px) 0 0 / 20px 20px,
    linear-gradient(90deg, color-mix(in srgb, var(--c) 18%, transparent) 2px, transparent 2px) 0 0 / 20px 20px,
    color-mix(in srgb, var(--c) 8%, var(--surface-2));
}
.card-placeholder span { font-family: var(--font-pixel); font-size: 2.2rem; color: var(--c); }
.card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 22px; flex: 1; }
.card-title { font-size: 1.18rem; margin: 0; }
.card-title a:hover { color: var(--accent); }
.card-excerpt { color: var(--text-2); font-size: .94rem; margin: 0; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; font-size: .82rem; color: var(--muted); }
.meta--lg { font-size: .92rem; gap: 8px 14px; }
.meta form { display: inline; }

.card--big { display: grid; grid-template-columns: 1.15fr 1fr; }
.card--big .card-media { aspect-ratio: auto; min-height: 340px; border-bottom: 0; border-right: 2px solid var(--border); }
.card--big .card-body { padding: 36px; justify-content: center; gap: 14px; }
.card--big .card-title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }
.card--big .card-excerpt { font-size: 1.02rem; }
.card--big .btn { align-self: flex-start; margin-top: 8px; }

/* ---------------------------------------------------------- Paneli / forum */
.panel { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel--flush { padding: 0; overflow-x: auto; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { margin: 0; display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }

.topic-list { list-style: none; margin: 0 0 16px; padding: 0; }
.topic { display: grid; grid-template-columns: 36px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--border); }
.topic:first-child { border-top: 0; padding-top: 0; }
.topic-title { font-weight: 600; font-size: .93rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.topic-main .meta { margin-top: 3px; font-size: .76rem; }
.topic-stats { text-align: center; min-width: 40px; }
.topic-stats strong { display: block; font-family: var(--font-pixel); font-size: 1rem; line-height: 1.1; }
.topic-stats small { font-size: .68rem; color: var(--muted); }

.forum-cat {
  --c: var(--accent);
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px; background: var(--surface);
  border: 2px solid var(--border); border-left: 6px solid var(--c);
  border-radius: var(--radius);
  transition: transform .15s, box-shadow .15s;
}
.forum-cat:hover { color: inherit; transform: translate(-3px, -3px); box-shadow: 6px 6px 0 var(--px-shadow); }
.forum-cat strong { font-family: var(--font-display); font-size: 1.15rem; }
.forum-cat p { color: var(--text-2); font-size: .9rem; margin: 0; }

.news-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 32px; }
.news-item { display: grid; gap: 4px; padding: 18px 0; border-top: 1px solid var(--border); }
.news-item time { font-family: var(--font-pixel); font-size: .72rem; color: var(--accent); text-transform: uppercase; }
.news-item strong { font-family: var(--font-display); font-size: 1.1rem; }
.news-item span { color: var(--text-2); font-size: .92rem; }
.news-item:hover strong { color: var(--accent); }

.cta {
  display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding: 44px; border: 2px solid var(--accent); border-radius: var(--radius);
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 60%);
  box-shadow: 8px 8px 0 var(--px-shadow);
}
.cta h2 { margin: .3em 0; }
.cta p { color: var(--text-2); margin: 0; max-width: 56ch; }
.cta-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.empty { padding: 48px 24px; text-align: center; border: 2px dashed var(--border); border-radius: var(--radius); color: var(--text-2); }
.empty--small { padding: 20px; margin-bottom: 14px; }

.pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 40px; }
.pager-num { min-width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-pixel); font-size: .85rem; }
.pager-num.is-current { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------------------------------------------------------- Članak */
.article-head { padding: 48px 0 0; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85rem; color: var(--muted); margin-bottom: 18px; }
.breadcrumbs a:hover { color: var(--accent); }
.article-head h1 { margin: .35em 0 .5em; }
.author { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; }
.article-cover { width: 100%; max-height: 520px; object-fit: cover; border-radius: var(--radius); border: 2px solid var(--border); margin-top: 32px; box-shadow: 8px 8px 0 var(--px-shadow); }
.article-layout { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: 56px; justify-content: center; padding-top: 48px; padding-bottom: 64px; }
.article-layout:not(:has(.toc)) { grid-template-columns: minmax(0, 760px); }
.toc { position: sticky; top: calc(var(--header-h) + 24px); align-self: start; font-size: .86rem; max-height: calc(100vh - 120px); overflow: auto; }
.toc ol { list-style: none; padding: 0; margin: 12px 0 0; border-left: 2px solid var(--border); }
.toc li a { display: block; padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.35; }
.toc li a:hover, .toc li a.is-active { color: var(--text); border-left-color: var(--accent); }
.toc .toc-l3 a { padding-left: 26px; font-size: .82rem; }

.prose { font-size: 1.08rem; line-height: 1.8; color: var(--text); }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 1.7rem; margin-top: 2em; padding-top: .2em; }
.prose h2::before { content: "## "; font-family: var(--font-pixel); font-size: .55em; color: var(--accent); vertical-align: middle; }
.prose h3 { font-size: 1.3rem; margin-top: 1.6em; }
.prose p { margin-bottom: 0; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: 0; }
.prose li { margin: .35em 0; }
.prose ul li::marker { content: "▪  "; color: var(--accent); }
.prose blockquote { margin: 1.4em 0; padding: 14px 20px; border-left: 4px solid var(--accent); background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-2); }
.prose code { background: var(--surface-2); border: 1px solid var(--border); padding: .1em .4em; border-radius: 4px; font-size: .88em; }
.prose pre { background: var(--code-bg); color: #e3e3ea; padding: 18px 20px; border-radius: var(--radius); border: 2px solid var(--border); overflow-x: auto; font-size: .9rem; line-height: 1.6; }
.prose pre code { background: none; border: 0; padding: 0; color: inherit; }
.prose img { border-radius: var(--radius); border: 2px solid var(--border); }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose hr { border: 0; border-top: 2px dashed var(--border); margin: 2em 0; }

.share { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 3em !important; padding-top: 20px; border-top: 1px solid var(--border); font-size: .9rem; }
.share a { color: var(--text-2); text-decoration: none; }
.share a:hover { color: var(--accent); }
.forum-cta { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 22px 24px; border: 2px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); font-size: 1rem; }
.forum-cta p { margin: 0; color: var(--text-2); }
.forum-cta .btn { text-decoration: none; color: var(--accent-ink); }

.comments { margin-top: 3em !important; }
.comments h2::before { content: none; }
.comments h2 small { color: var(--muted); font-size: .6em; }
.comment { display: grid; grid-template-columns: 40px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--border); font-size: 1rem; }
.comment p { margin: 6px 0 0; }
.comment .meta a { text-decoration: none; color: var(--text); }
.comment-form, .login-box { display: grid; gap: 12px; margin-top: 18px; padding: 20px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); font-size: 1rem; }
.login-box { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.login-box p { margin: 0 auto 0 0; }
.login-box .btn { text-decoration: none; }
.login-box .btn--primary { color: var(--accent-ink); }
.comment-form-head { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--text-2); }
.comment-form textarea, .form input, .form textarea, .form select, .editor-form input, .editor-form textarea, .editor-form select, .filters input, .filters select, .table input {
  width: 100%; padding: .7em .9em;
  background: var(--bg); border: 2px solid var(--border); border-radius: var(--radius-sm); outline: 0;
  transition: border-color .15s;
}
.comment-form textarea:focus, .form input:focus, .form textarea:focus, .editor-form input:focus, .editor-form textarea:focus, .editor-form select:focus, .table input:focus { border-color: var(--accent); }
.comment-form .btn { justify-self: start; }

/* ---------------------------------------------------------- Obrasci */
.form { display: grid; gap: 16px; }
.form label, .editor-form label { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--text-2); }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.form .btn { justify-self: start; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
label.check input { width: auto; }
.simple-list { list-style: none; margin: 0; padding: 0; }
.simple-list li { display: grid; gap: 2px; padding: 10px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.simple-list li:first-child { border-top: 0; padding-top: 0; }
.simple-list .muted { font-size: .84rem; }

.profile-head { display: flex; align-items: center; gap: 28px; }
.profile-head .avatar { border: 3px solid var(--accent); box-shadow: 5px 5px 0 var(--px-shadow); }
.profile-head h1 { margin: .15em 0; }

.error-page { text-align: center; padding: 120px 0; }
.error-code { font-family: var(--font-pixel); font-size: clamp(5rem, 16vw, 9rem); line-height: 1; color: var(--accent); text-shadow: 6px 6px 0 var(--px-shadow); }
.error-page .hero-actions { justify-content: center; }
.error-page .lead { margin: 0 auto; }

/* ---------------------------------------------------------- Footer */
.site-footer { border-top: 1px solid var(--border); background: var(--bg-2); padding: 56px 0 0; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; }
.footer-grid > div { display: flex; flex-direction: column; gap: 8px; }
.footer-grid h4 { margin-bottom: 6px; }
.footer-grid a { color: var(--text-2); font-size: .93rem; }
.footer-grid a:hover { color: var(--accent); }
.footer-brand img { height: 34px; width: auto; margin-bottom: 8px; }
.footer-brand p { color: var(--muted); font-size: .92rem; max-width: 36ch; }
.socials { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; margin-top: 44px; border-top: 1px solid var(--border); font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------- Admin */
.admin { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 32px; padding-top: 36px; padding-bottom: 64px; }
.admin-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: calc(var(--header-h) + 20px); align-self: start; }
.admin-nav .pixel-label { margin-bottom: 10px; }
.admin-nav a:not(.btn) { padding: .5em .8em; border-radius: var(--radius-sm); color: var(--text-2); font-weight: 500; font-size: .93rem; }
.admin-nav a:not(.btn):hover { background: var(--surface); color: var(--text); }
.admin-nav a.is-active { background: var(--surface); color: var(--text); box-shadow: inset 3px 0 0 var(--accent); }
.admin-nav .btn { margin-top: 14px; }
.admin-main { display: grid; gap: 20px; align-content: start; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.admin-head h1 { font-size: 1.8rem; margin: 0; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { padding: 16px 18px; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); }
.stat span { font-size: .8rem; color: var(--muted); }
.stat strong { display: block; font-family: var(--font-pixel); font-size: 1.7rem; line-height: 1.3; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 12px 14px; border-bottom: 2px solid var(--border); white-space: nowrap; }
.table td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
.panel .table td:first-child { padding-left: 0; }
.panel--flush .table td:first-child, .panel--flush .table th:first-child { padding-left: 18px; }
.table input { padding: .45em .6em; font-size: .88rem; }
.table input[type=color] { padding: 2px; height: 34px; width: 48px; }
.input-xs { width: 70px !important; }
.actions { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.actions form { display: inline; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; }
.filters input { max-width: 280px; padding: .5em .8em; }
.filters select { width: auto; padding: .5em .8em; }
.message h3 { margin: 10px 0 6px; }
.message--new { border-color: var(--accent); }
.message .actions { margin-top: 10px; }
.danger-zone { margin-top: 10px; }

.editor-form { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.editor-main { display: grid; gap: 16px; }
.editor-side { display: grid; gap: 16px; position: sticky; top: calc(var(--header-h) + 20px); }
.editor-side .panel { display: grid; gap: 14px; }
.title-input { font-family: var(--font-display); font-size: 1.6rem !important; font-weight: 700; padding: .5em .7em !important; }
.slug-row { display: flex; align-items: center; gap: 6px; font-size: .88rem; }
.slug-row input { padding: .4em .6em !important; font-family: var(--font-mono); font-size: .85rem; }
.editor { border: 2px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; background: var(--surface); border-bottom: 2px solid var(--border); }
.editor-toolbar button { padding: .35em .65em; border: 1px solid var(--border); border-radius: 4px; background: var(--bg); font-size: .82rem; }
.editor-toolbar button:hover, .editor-toolbar button.is-on { border-color: var(--accent); color: var(--accent); }
.editor-toolbar .spacer { flex: 1; }
.editor-area { border: 0 !important; border-radius: 0 !important; font-family: var(--font-mono); font-size: .9rem !important; line-height: 1.65; min-height: 480px; resize: vertical; }
.editor-preview { padding: 24px; min-height: 480px; }
.cover-preview img { border-radius: var(--radius-sm); border: 2px solid var(--border); aspect-ratio: 16/9; object-fit: cover; width: 100%; }
.upload-btn { cursor: pointer; }

/* ---------------------------------------------------------- Responzivno */
@media (max-width: 1080px) {
  .layout-split { grid-template-columns: 1fr; }
  .sidebar { position: static; grid-template-columns: 1fr 1fr; }
  .article-layout { grid-template-columns: minmax(0, 760px); }
  .toc { display: none; }
  .editor-form { grid-template-columns: 1fr; }
  .editor-side { position: static; }
}

@media (max-width: 920px) {
  :root { --header-h: 64px; }
  .menu-toggle { display: inline-flex; }
  .hide-mobile { display: none !important; }
  .user-name { display: none; }
  .user-btn { padding: 2px; }
  .main-nav {
    position: fixed; inset: var(--header-h) 0 0 0; z-index: 40;
    flex-direction: column; align-items: stretch; gap: 20px;
    padding: 20px 24px 40px; overflow-y: auto;
    background: var(--bg);
    transform: translateX(100%); transition: transform .25s ease;
    visibility: hidden;
  }
  .nav-open .main-nav { transform: none; visibility: visible; }
  .nav-open .menu-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .nav-open .menu-toggle span:nth-child(2) { opacity: 0; }
  .nav-open .menu-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .nav-open { overflow: hidden; }
  .nav-list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav-list > li { border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr auto; }
  .nav-link { padding: 1em .2em; font-size: 1.1rem; font-family: var(--font-display); color: var(--text); background: none !important; box-shadow: none !important; }
  .nav-link .caret { display: none; }
  .dropdown-toggle { display: grid; place-items: center; width: 48px; background: none; border: 0; }
  .dropdown-toggle::after { content: ""; width: 9px; height: 9px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
  .has-dropdown.is-open > .dropdown-toggle::after { transform: rotate(-135deg); }
  .nav-list .dropdown {
    grid-column: 1 / -1; position: static; min-width: 0; display: none;
    opacity: 1; visibility: visible; transform: none;
    border: 0; box-shadow: none; background: var(--surface); margin-bottom: 12px;
  }
  .nav-list .has-dropdown:hover > .dropdown { display: none; }
  .nav-list .has-dropdown.is-open > .dropdown { display: block; }
  .nav-list .dropdown--forum.dropdown { grid-template-columns: 1fr; }
  .nav-list .has-dropdown.is-open > .dropdown--forum { display: grid; }
  .nav-mobile-extra { display: grid; gap: 10px; }
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; padding-bottom: 56px; }
  .hero-terminal { transform: none; }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .card--big { grid-template-columns: 1fr; }
  .card--big .card-media { min-height: 0; aspect-ratio: 16/9; border-right: 0; border-bottom: 2px solid var(--border); }
  .card--big .card-body { padding: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .admin { grid-template-columns: 1fr; }
  .admin-nav { position: static; flex-direction: row; flex-wrap: wrap; gap: 6px; }
  .admin-nav .pixel-label { width: 100%; margin-bottom: 0; }
  .admin-nav .btn { margin-top: 0; }
}

@media (max-width: 640px) {
  .container { padding: 0 18px; }
  .brand img { height: 30px; }
  .header-inner { gap: 10px; }
  .grid--2, .grid--3, .news-list, .layout-split--even, .sidebar { grid-template-columns: 1fr; }
  .section { padding: 44px 0; }
  .cta { padding: 28px; }
  .hero-stats dd { font-size: 1.3rem; }
  .profile-head { flex-direction: column; align-items: flex-start; }
  .search-box { grid-template-columns: 1fr auto; }
  .search-box .btn { grid-column: 1; grid-row: 3; }
  .prose { font-size: 1.02rem; }
}

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

/* ---------------------------------------------------------- Prijava / registracija */
.auth-wrap { display: grid; grid-template-columns: 1fr minmax(0, 460px); gap: 56px; align-items: center; max-width: 1040px; }
.auth-intro h1 { margin: .3em 0 .4em; }
.auth-card { padding: 28px; box-shadow: 8px 8px 0 var(--px-shadow); border-color: var(--border-strong); }
.auth-card .btn--block { margin-top: 4px; }
.auth-card p { margin: 0; }
.check-list { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: 10px; color: var(--text-2); }
.check-list li::before { content: "✓"; display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 10px; border-radius: 4px; background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent); font-weight: 700; font-size: .8rem; }
.input-sm { width: auto !important; padding: .4em .6em !important; font-size: .85rem; }
.header-actions .btn--ghost.btn--sm { border-color: transparent; }
@media (max-width: 920px) { .auth-wrap { grid-template-columns: 1fr; gap: 28px; } }

/* ---------------------------------------------------------- Tko je online */
.online-count { margin: -4px 0 12px; }
.online-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.online-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px 3px 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: .82rem; font-weight: 500; }
.online-chip:hover { border-color: var(--accent); color: var(--text); }
.online-chip .avatar--letter { font-size: .7rem; }
.online-chip em { font-style: normal; font-size: .65rem; font-family: var(--font-pixel); color: var(--accent); text-transform: uppercase; }
.online-newest { margin: 12px 0 0; }
.forum-side { display: grid; gap: 24px; align-content: start; }

/* ---------------------------------------------------------- Gumb "Na vrh" */
.to-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 45;
  display: inline-flex; align-items: center; gap: 6px;
  height: 46px; padding: 0 18px 0 14px;
  border: 2px solid var(--border-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: .9rem;
  box-shadow: 4px 4px 0 var(--px-shadow);
  opacity: 0; visibility: hidden; transform: translateY(12px);
  transition: opacity .2s, transform .2s, visibility .2s, background .15s, color .15s, border-color .15s, box-shadow .12s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--px-shadow); }
.to-top:active { transform: none; box-shadow: none; }
.nav-open .to-top { display: none; }
@media (max-width: 640px) {
  .to-top { right: 14px; bottom: 14px; width: 46px; padding: 0; justify-content: center; }
  .to-top span { display: none; }
}

/* ---------------------------------------------------------- Poruke */
.user-btn { position: relative; }
.msg-badge { position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-ink); font-size: .7rem; font-weight: 700; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg); }
.msg-count { margin-left: auto; color: var(--accent) !important; font-weight: 600; }
.comment-pm { font-size: .8rem; color: var(--muted) !important; text-decoration: none !important; }
.comment-pm:hover { color: var(--accent) !important; }

/* ---------------------------------------------------------- Mobilni izbornik: online + poruke */
.m-online { margin-top: 10px; padding: 16px; border: 2px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.m-online-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.m-online-head .link-more { margin-left: auto; }
.m-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-ink); color: var(--accent); font-size: .75rem; font-weight: 700; }
.menu-toggle { position: relative; }
.menu-dot { position: absolute; top: 6px; right: 5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.nav-open .menu-dot { display: none; }

/* izdvojeni članak: naslovna slika cijela (bez rezanja teksta na njoj) */
@media (min-width: 901px) {
  .card--big .card-media { display: grid; place-items: center; background: #0d111c; }
  .card--big .card-media img { width: 100%; height: auto; aspect-ratio: auto; object-fit: contain; }
}

.prose .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.prose .table-wrap table { min-width: 560px; }
.prose th { background: var(--surface-2); font-weight: 700; }

.forum-cta--topic { border-color: var(--accent); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 9%, var(--surface)), var(--surface)); }
.forum-cta--topic > div { display: grid; gap: 4px; min-width: 0; flex: 1 1 320px; }
.forum-cta--topic strong { font-size: 1.15rem; }
.forum-cta-people { display: flex; margin-top: 6px; }
.forum-cta-people .avatar { margin-right: -6px; border: 2px solid var(--surface); border-radius: 50%; }
