/* ===== Design tokens ===== */
:root {
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Literata", Georgia, "Times New Roman", serif;

  /* Warm paper background, white cards, dark masthead. */
  --bg: #f2ece1;
  --surface: #fffdf8;
  --surface-2: #ebe3d4;
  --ink: #1d1a16;
  --ink-2: #433d35;
  --muted: #72695c;
  --line: #e0d6c4;
  --accent: #d61f3a;
  --focus: #2b6cf6;
  --shadow: 0 1px 2px rgb(60 40 10 / .06), 0 4px 16px rgb(60 40 10 / .06);
  --shadow-hover: 0 2px 4px rgb(60 40 10 / .08), 0 14px 34px rgb(60 40 10 / .13);
  /* Masthead and footer stay dark in both themes. */
  --head-bg: #17140f;
  --head-ink: #f6f1e7;
  --head-muted: #b3a994;
  --head-line: #2e2920;
  --head-field: #26221b;

  --radius: 14px;
  --radius-sm: 8px;
  --gap: clamp(14px, 2vw, 22px);
  --wrap: 1240px;

  /* Category colors */
  --c-makedonija: #d61f3a;
  --c-skopje: #e8630a;
  --c-ekonomija: #12875a;
  --c-svet: #2563eb;
  --c-balkan: #6d4bd8;
  --c-sport: #0e8a9a;
  --c-hronika: #8a2b2b;
  --c-kultura: #b0368c;
  --c-tehnologija: #0f7bbf;
  --c-world: #1f2937;
  --c-none: #6b717d;
}

/* Dark theme: system preference unless the visitor picked light; or explicit choice. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13110e; --surface: #1c1a16; --surface-2: #26231e; --ink: #f0ebe2; --ink-2: #cdc5b8;
    --muted: #9b9282; --line: #2f2b24; --accent: #ff4d63; --focus: #6ea0ff;
    --head-bg: #0c0b09; --head-line: #24211b; --head-field: #1d1a15;
    --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-hover: 0 8px 28px rgb(0 0 0 / .45);
    --c-world: #9aa4b5; --c-hronika: #d0605f;
  }
}
:root[data-theme="dark"] {
  --bg: #13110e; --surface: #1c1a16; --surface-2: #26231e; --ink: #f0ebe2; --ink-2: #cdc5b8;
  --muted: #9b9282; --line: #2f2b24; --accent: #ff4d63; --focus: #6ea0ff;
    --head-bg: #0c0b09; --head-line: #24211b; --head-field: #1d1a15;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); --shadow-hover: 0 8px 28px rgb(0 0 0 / .45);
  --c-world: #9aa4b5; --c-hronika: #d0605f;
}

[data-cat="makedonija"] { --cat: var(--c-makedonija); }
[data-cat="skopje"] { --cat: var(--c-skopje); }
[data-cat="ekonomija"] { --cat: var(--c-ekonomija); }
[data-cat="svet"] { --cat: var(--c-svet); }
[data-cat="balkan"] { --cat: var(--c-balkan); }
[data-cat="sport"] { --cat: var(--c-sport); }
[data-cat="hronika"] { --cat: var(--c-hronika); }
[data-cat="kultura"] { --cat: var(--c-kultura); }
[data-cat="tehnologija"] { --cat: var(--c-tehnologija); }
[data-cat="world"] { --cat: var(--c-world); }
[data-cat="none"], [data-cat="home"] { --cat: var(--c-none); }
[data-cat="w_svet"] { --cat: var(--c-svet); }
[data-cat="w_amerika"] { --cat: var(--c-balkan); }
[data-cat="w_politika"] { --cat: var(--c-makedonija); }
[data-cat="w_biznis"] { --cat: var(--c-ekonomija); }
[data-cat="w_nauka"] { --cat: var(--c-tehnologija); }
[data-cat="w_zdravje"] { --cat: var(--c-sport); }
[data-cat="w_sport"] { --cat: var(--c-skopje); }
[data-cat="w_zabava"] { --cat: var(--c-kultura); }

/* ===== Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.5 var(--font-sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: max(16px, env(safe-area-inset-left)); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -48px; z-index: 50; background: var(--ink); color: var(--surface); padding: 8px 14px; border-radius: var(--radius-sm); }
.skip:focus { top: 12px; }
.muted { color: var(--muted); margin: 4px 0 0; }
.empty { color: var(--muted); padding: 48px 0; text-align: center; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: var(--head-bg); color: var(--head-ink);
  border-bottom: 1px solid var(--head-line);
  box-shadow: 0 6px 20px rgb(0 0 0 / .12);
}
.site-header .logo-text span { color: #ff5a70; }
.header-row { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo-mark {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
  background: var(--accent); color: #fff; font: 700 18px/1 var(--font-serif);
}
.logo-text { font: 700 22px/1 var(--font-serif); letter-spacing: -.02em; }
.logo-text span { color: var(--accent); }
.logo-text.small { font-size: 18px; }
.search {
  margin-left: auto; flex: 0 1 340px; min-width: 0; display: flex; align-items: center; gap: 8px;
  background: var(--head-field); border: 1px solid var(--head-line); border-radius: 999px; padding: 0 14px; color: var(--head-muted);
  transition: border-color .15s, background .15s;
}
.search:focus-within { border-color: var(--head-muted); }
.search input::placeholder { color: var(--head-muted); }
.search input { flex: 1; min-width: 0; width: 100%; height: 38px; border: 0; outline: 0; background: none; color: var(--head-ink); font: inherit; font-size: 15px; }
.icon-btn {
  display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; border-radius: 999px;
  border: 1px solid var(--head-line); background: var(--head-field); color: var(--head-ink); cursor: pointer;
}
.icon-btn:hover { border-color: var(--head-muted); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: none; }
  :root:not([data-theme="light"]) .i-moon { display: block; }
}

.nav {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; padding-bottom: 0;
  mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent);
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
  position: relative; padding: 10px 12px 12px; white-space: nowrap; color: var(--head-muted);
  font-size: 14px; font-weight: 600; transition: color .15s;
}
.nav a:hover { color: var(--head-ink); }
.nav a[aria-current="page"] { color: var(--head-ink); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--cat, var(--accent));
}
.nav-intl { margin-left: auto; }

/* ===== New stories pill ===== */
.new-pill {
  position: fixed; top: 116px; left: 50%; translate: -50% 0; z-index: 30;
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border: 0; border-radius: 999px;
  background: var(--accent); color: #fff; font: 600 14px var(--font-sans); cursor: pointer;
  box-shadow: 0 8px 24px rgb(214 31 58 / .35); animation: pill-in .3s ease-out;
}
.new-pill[hidden] { display: none; }
@keyframes pill-in { from { opacity: 0; translate: -50% -8px; } }

/* ===== Back to top ===== */
main:focus { outline: none; }
.to-top {
  position: fixed; z-index: 25;
  right: max(20px, env(safe-area-inset-right)); bottom: max(20px, env(safe-area-inset-bottom));
  display: grid; place-items: center; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%;
  background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--ink);
  backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  box-shadow: 0 1px 2px rgb(16 18 24 / .08), 0 8px 24px rgb(16 18 24 / .14);
  cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(12px) scale(.9);
  transition: opacity .25s, transform .25s cubic-bezier(.2, .8, .2, 1), visibility .25s, background .2s, color .2s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent); color: #fff; }
.to-top:hover .to-top-arrow { transform: translateY(-2px); }
.to-top:active { transform: scale(.94); }
.to-top-arrow { position: relative; transition: transform .2s; }
.to-top-ring { position: absolute; inset: 0; width: 100%; height: 100%; rotate: -90deg; }
.to-top-ring circle { fill: none; stroke-width: 2.5; }
.to-top-ring .track { stroke: var(--line); }
.to-top-ring .progress {
  stroke: var(--accent); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100;
  transition: stroke-dashoffset .1s linear;
}
.to-top:hover .to-top-ring .progress { stroke: #fff; }
:root[data-theme="dark"] .to-top { box-shadow: 0 8px 24px rgb(0 0 0 / .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .to-top { box-shadow: 0 8px 24px rgb(0 0 0 / .5); } }
@media (max-width: 600px) { .to-top { width: 46px; height: 46px; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); } }

/* ===== Cards ===== */
.card {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s, transform .2s, border-color .2s;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card:hover .headline a { color: var(--accent); }
/* Whole card is clickable through the headline link; other links sit above it. */
.stretch::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card .related a, .card .sources-link { position: relative; z-index: 2; }

.media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--surface-2); }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; transition: transform .4s ease; }
.card:hover .media img { transform: scale(1.03); }
.media-ph {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 0% 0%, color-mix(in srgb, var(--cat, var(--muted)) 45%, transparent), transparent 60%),
    linear-gradient(135deg, color-mix(in srgb, var(--cat, var(--muted)) 22%, var(--surface-2)), var(--surface-2));
}

.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 13px; color: var(--muted); }
.tag {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; letter-spacing: .02em;
  text-transform: uppercase; color: var(--cat);
}
.tag::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cat); }
.rising {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-size: 12px; font-weight: 600;
}
.rising::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

.headline { margin: 0; font-family: var(--font-serif); font-weight: 700; letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.headline a { transition: color .15s; }
.headline.xl { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.18; }
.headline.md { font-size: 18px; line-height: 1.3; }
.headline.sm { font-size: 16px; line-height: 1.35; font-weight: 600; }
.summary { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; text-wrap: pretty; }
.summary.lg { font-size: 18px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

.related { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.related li { border-bottom: 1px solid var(--line); }
.related a {
  display: block; padding: 9px 0 9px 16px; font-size: 14px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.related a::before { content: "↳"; position: absolute; left: 0; color: var(--muted); }
.related a:hover { color: var(--accent); }

.sources-link { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.sources-link:hover { color: var(--accent); }
.dots { display: inline-flex; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--surface); background: var(--muted); margin-left: -5px; opacity: .55; }
.dots i:first-child { margin-left: 0; opacity: 1; background: var(--accent); }
.dots i:nth-child(2) { opacity: .8; }

/* Hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); }
.hero .media { aspect-ratio: 2 / 1; }
.hero-body { display: flex; flex-direction: column; gap: 14px; padding: clamp(18px, 2.4vw, 30px); }
.hero .sources-link { margin-top: auto; }

/* Side rows */
.row { display: flex; gap: 14px; padding: 14px; }
.row-body { flex: 1; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.row .media { flex: 0 0 104px; aspect-ratio: 1; border-radius: var(--radius-sm); }

/* Tiles */
.tile { display: flex; flex-direction: column; }
.tile-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px 16px; }
.tile .sources-link { margin-top: auto; padding-top: 4px; }

/* ===== Layout ===== */
main { padding-block: clamp(18px, 3vw, 32px) 24px; }
.lead { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(0, 1fr); gap: var(--gap); margin-bottom: var(--gap); }
.lead-side { display: flex; flex-direction: column; gap: 10px; }
.lead-side .row { flex: 1; }
.eyebrow { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.grid { display: grid; gap: var(--gap); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.section { margin-top: clamp(32px, 5vw, 52px); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding-top: 12px; border-top: 3px solid var(--cat, var(--ink));
}
.section-head h2 { margin: 0; font: 700 clamp(20px, 2vw, 24px)/1.2 var(--font-serif); letter-spacing: -.01em; }
.section-head > a { font-size: 14px; font-weight: 600; color: var(--cat, var(--ink)); }
.section-head > a:hover { text-decoration: underline; text-underline-offset: 3px; }
.section-title { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); transition: color .15s; }
.section-title .chev {
  display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font: 600 20px/1 var(--font-sans); color: var(--cat, var(--ink));
  background: color-mix(in srgb, var(--cat, var(--ink)) 10%, transparent);
  transition: transform .2s, background .2s, color .2s;
}
.section-title:hover { color: var(--cat, var(--accent)); }
.section-title:hover .chev { transform: translateX(3px); background: var(--cat, var(--accent)); color: #fff; }

.page-head { margin-bottom: 20px; padding-top: 4px; }
.page-head h1 { margin: 0; font: 700 clamp(28px, 3.4vw, 40px)/1.15 var(--font-serif); letter-spacing: -.02em; }
.page-head[data-cat] h1::before {
  content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 12px;
  vertical-align: middle; background: var(--cat, var(--accent));
}

/* Sub-categories (Светски медиуми) */
.subnav { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin: -4px 0 8px; padding-bottom: 4px; }
.subnav::-webkit-scrollbar { display: none; }
.subnav a {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: background .15s, color .15s, border-color .15s;
}
.subnav a:hover { border-color: var(--cat, var(--ink)); color: var(--cat, var(--ink)); }
.subnav a[aria-current="page"] { background: var(--cat, var(--ink)); border-color: var(--cat, var(--ink)); color: #fff; }
.subnav + .section { margin-top: 20px; }
.subnav + .lead { margin-top: 20px; }

/* Story page / timeline */
.story-page { max-width: 820px; margin-inline: auto; }
.story-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 22px; }
.story-head .meta { gap: 6px 14px; }
.story-media { margin: 0 0 28px; border-radius: var(--radius); overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.story-media img { width: 100%; height: 100%; object-fit: cover; }
.timeline { list-style: none; margin: 12px 0 0; padding: 0; }
.timeline li {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  padding: 16px 18px 16px 30px; margin-bottom: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.timeline li::before { content: ""; position: absolute; left: 14px; top: 22px; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.timeline .headline:hover { color: var(--accent); }
.source { color: var(--ink); font-weight: 700; }

/* Sources table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.tbl th, .tbl td { padding: 11px 16px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-2); }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl tr.sep td { border-top: 2px solid var(--ink); }

/* Footer */
.site-footer { margin-top: 56px; background: var(--head-bg); color: var(--head-ink); }
.site-footer .logo-text span { color: #ff5a70; }
.footer-row { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding-block: 28px; font-size: 13px; color: var(--head-muted); }
.footer-row p { margin: 0; flex: 1; min-width: 240px; }
.footer-row a { font-weight: 600; color: var(--head-ink); }
.footer-row a:hover { color: var(--accent); }

/* ===== Responsive ===== */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero .media { aspect-ratio: 16 / 9; }
}
@media (max-width: 860px) {
  .lead { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .nav-intl { margin-left: 0; }
}
@media (max-width: 600px) {
  .header-row { height: 56px; gap: 8px; }
  .logo-text { font-size: 20px; }
  .search { flex-basis: auto; flex-grow: 1; }
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-4 .tile { flex-direction: row-reverse; }
  .grid-4 .tile .media { flex: 0 0 96px; aspect-ratio: 1; margin: 12px 12px 12px 0; border-radius: var(--radius-sm); }
  .grid-4 .tile-body { padding: 12px 14px; }
  .headline.md { font-size: 16px; }
  .row .media { flex-basis: 84px; }
  .hero .summary { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .new-pill { top: 108px; }
}
@media (max-width: 420px) {
  .logo-text { display: none; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .card:hover { transform: none; }
}

/* Fuel prices strip (home page, under the lead stories). */
.fuel { display: flex; align-items: center; gap: 12px 28px; flex-wrap: wrap; padding: 14px 18px; margin-bottom: var(--gap); }
.fuel-head { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.fuel-head svg { flex: none; color: var(--c-ekonomija); }
.fuel-head h2 { margin: 0; font-size: 15px; font-weight: 700; }
.fuel-head p { margin: 1px 0 0; font-size: 12px; color: var(--muted); }
.fuel-head a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.fuel-list { display: flex; flex-wrap: wrap; gap: 8px 26px; margin: 0; padding: 0; list-style: none; flex: 1; justify-content: flex-end; }
.fuel-list li { display: grid; grid-template-columns: auto auto; column-gap: 8px; align-items: baseline; }
.fuel-name { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.fuel-price { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fuel-price small { font-size: 11px; font-weight: 500; color: var(--muted); }
.fuel-change { white-space: nowrap; font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.fuel-change.up { color: #c62828; }
.fuel-change.down { color: #12875a; }
.fuel-change.same { color: var(--muted); font-weight: 500; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fuel-change.up { color: #ff6b6b; } :root:not([data-theme="light"]) .fuel-change.down { color: #3ccf8e; } }
:root[data-theme="dark"] .fuel-change.up { color: #ff6b6b; }
:root[data-theme="dark"] .fuel-change.down { color: #3ccf8e; }
@media (max-width: 700px) {
  .fuel-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; width: 100%; }
}

/* Home strip is a link to /goriva; static pages' cards should not lift on hover. */
.fuel-head h2 a { color: inherit; text-decoration: none; }
.fuel:hover .fuel-head h2 a { color: var(--accent); }
.fuel .chev { color: var(--muted); margin-left: 2px; }

/* Fuel page */
.page-sub { margin: 6px 0 0; color: var(--muted); }
.fuel-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.fuel-card { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; }
.fuel-card .fuel-price { font-size: 26px; }
.chart-card, .crude-card { padding: 18px 20px; margin-bottom: var(--gap); }
.chart-card:hover, .crude-card:hover, .fuel-card:hover { transform: none; box-shadow: var(--shadow); }
.card-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.chart-box { position: relative; height: clamp(260px, 42vw, 400px); }
.chart-legend { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.legend-item { display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: none; color: var(--ink); font: 500 13px var(--font-sans); cursor: pointer; }
.legend-item i { width: 10px; height: 10px; border-radius: 50%; }
.legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.crude-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.crude-table th, .crude-table td { padding: 11px 8px; text-align: left; border-bottom: 1px solid var(--line); }
.crude-table thead th { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.crude-table tbody th { font-weight: 700; }
.crude-table .num { text-align: right; }
.crude-table thead th:nth-child(2), .crude-table thead th:nth-child(3) { text-align: right; }
.crude-table td:first-of-type { font-size: 17px; font-weight: 700; }
.crude-table .muted { color: var(--muted); font-size: 13px; }
.note { margin: 12px 0 0; font-size: 12px; color: var(--muted); }
@media (max-width: 800px) { .fuel-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .crude-table th:nth-child(5), .crude-table td:nth-child(5) { display: none; } .spark { width: 64px; } .crude-table th, .crude-table td { padding: 10px 4px; } }

/* Period switch on the fuel chart. */
.chart-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.chart-top .card-title { margin: 0; }
.range { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.range button { min-width: 44px; padding: 6px 12px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 600 13px var(--font-sans); cursor: pointer; }
.range button:hover { color: var(--ink); }
.range button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Crude table: sparkline per row; a row is a toggle that isolates that blend on the chart. */
.crude-table .spark-col { text-align: center; width: 110px; }
.spark { display: block; margin: 0 auto; overflow: visible; }
.spark path { fill: none; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.spark.up path { stroke: #c62828; }
.spark.down path { stroke: #12875a; }
.crude-row { cursor: pointer; transition: background .15s; }
.crude-row:hover, .crude-row:focus-visible { background: var(--bg); outline: none; }
.crude-row[aria-pressed="false"] > * { opacity: .4; }
.crude-row[aria-pressed="false"] th { text-decoration: line-through; }
.crude-table .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.crude-card .chart-legend { margin-top: 18px; }

/* ===== "Денес" strip: weather, air, rates, fuel ===== */
.today { margin-bottom: var(--gap); }
.today-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.today-head h2 { margin: 0; font: 700 clamp(20px, 2vw, 24px)/1.2 var(--font-serif); letter-spacing: -.01em; }
.city-pick { display: inline-flex; align-items: center; gap: 6px; padding: 0 4px 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); }
.city-pick select { border: 0; background: none; color: var(--ink); font: 600 14px var(--font-sans); padding: 8px 6px; cursor: pointer; outline: none; }
.city-pick:focus-within { border-color: var(--focus); }
.today-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.today-card { padding: 14px 16px 16px; display: flex; flex-direction: column; }
.today-card:hover { transform: none; }
.today-label { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.today-label small { font-weight: 500; letter-spacing: 0; text-transform: none; }
.today-label a { color: var(--ink); }
.today-card:hover .today-label a { color: var(--accent); }
.today-label .chev { color: var(--muted); }
.today-empty { margin: 0; color: var(--muted); font-size: 14px; }

.wx-now { display: flex; align-items: center; gap: 10px; }
.wx-icon { font-size: 34px; line-height: 1; }
.wx-temp { font: 700 34px/1 var(--font-sans); letter-spacing: -.03em; }
.wx-desc { font-size: 13px; font-weight: 600; line-height: 1.3; }
.wx-desc small { color: var(--muted); font-weight: 500; }
.wx-days { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); list-style: none; }
.wx-days li { display: grid; justify-items: center; gap: 1px; font-size: 12px; color: var(--muted); }
.wx-days li > span:nth-child(2) { font-size: 18px; }
.wx-days b { color: var(--ink); font-size: 13px; }

.air { --lv: #2e9e5b; }
.air[data-level="1"] { --lv: #8bbf3a; }
.air[data-level="2"] { --lv: #e0b400; }
.air[data-level="3"] { --lv: #e8630a; }
.air[data-level="4"] { --lv: #d61f3a; }
.air[data-level="5"] { --lv: #7b2d8e; }
.air-badge { display: inline-block; padding: 6px 12px; border-radius: 999px; background: color-mix(in srgb, var(--lv) 16%, transparent); color: color-mix(in srgb, var(--lv) 75%, var(--ink)); font-weight: 700; font-size: 15px; }
.air-meter { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; margin: 12px 0; }
.air-meter i { height: 6px; border-radius: 3px; background: var(--surface-2); }
.air-meter i.on { background: var(--lv); }
.air-vals { display: flex; gap: 20px; margin: 0; }
.air-vals dt { font-size: 12px; color: var(--muted); }
.air-vals dd { margin: 0; font-weight: 700; font-size: 18px; font-variant-numeric: tabular-nums; }
.air-vals small { font-size: 11px; font-weight: 500; color: var(--muted); }

.rates { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; }
.rates li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.rates .cur { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.rates .rate { font-weight: 700; white-space: nowrap; }
.rates .cur { white-space: nowrap; }
.today-label small { display: block; margin-top: 2px; }
.rates .rate small { font-size: 11px; font-weight: 500; color: var(--muted); }
.rates .fuel-change { min-width: 44px; text-align: right; font-size: 11.5px; }

@media (max-width: 1000px) { .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
/* Phones: swipe through the cards instead of stacking them above the news. */
@media (max-width: 560px) {
  .today-grid {
    grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none;
    margin-inline: -16px; padding: 2px 16px 6px; scroll-padding-inline: 16px;
  }
  .today-grid::-webkit-scrollbar { display: none; }
  .today-card { scroll-snap-align: start; }
}

/* Денес cards are links: lift on hover like news cards. */
.today-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* ===== Info pages: air, rates, weather ===== */
.info-card { padding: 18px 20px; margin-bottom: var(--gap); }
.info-card:hover { transform: none; box-shadow: var(--shadow); }
.card-title small { font-weight: 500; font-size: 13px; color: var(--muted); }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.chart-box.sm { height: clamp(220px, 30vw, 300px); }
.legend-item.static { cursor: default; }

/* Air */
.air-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--gap); }
.air-layout > .info-card { margin-bottom: 0; }
.air-layout + .info-card { margin-top: var(--gap); }
.air-rank { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.air-row { width: 100%; display: grid; grid-template-columns: 118px minmax(0, 1fr) 64px 96px; align-items: center; gap: 10px;
  padding: 8px 10px; border: 0; border-radius: var(--radius-sm); background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.air-row:hover, .air-row[aria-pressed="true"] { background: var(--surface-2); }
.air-city { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.air-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.air-bar i { display: block; height: 100%; border-radius: 4px; background: var(--lv); }
.air-num { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.air-num small { font-size: 10px; font-weight: 500; color: var(--muted); }
.air-badge.sm { padding: 3px 10px; font-size: 12px; text-align: center; }
.air-scale ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 18px; }
.air-scale li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-2); }
.air-scale .air-badge { min-width: 104px; }

/* Rates */
.rates-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: var(--gap); margin-bottom: var(--gap); }
.rates-layout > .info-card { margin-bottom: 0; }
.calc { display: grid; gap: 8px; }
.calc-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); overflow: hidden; }
.calc-field:focus-within { border-color: var(--focus); }
.calc-field input, .calc-field output { flex: 1; min-width: 0; padding: 12px 14px; border: 0; background: none; color: var(--ink);
  font: 700 22px var(--font-sans); font-variant-numeric: tabular-nums; outline: none; }
.calc-field select { border: 0; border-left: 1px solid var(--line); background: var(--surface); color: var(--ink); font: 600 15px var(--font-sans); padding: 0 12px; align-self: stretch; cursor: pointer; }
.calc-swap { justify-self: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: var(--surface); color: var(--ink); font-size: 18px; cursor: pointer; }
.calc-swap:hover { border-color: var(--accent); color: var(--accent); }
.rates-table .muted { font-weight: 400; margin-left: 6px; font-size: 13px; }
.pick-row { cursor: pointer; }
.pick-row:hover, .pick-row:focus-visible { background: var(--bg); outline: none; }
.pick-row[aria-pressed="true"] { background: var(--bg); box-shadow: inset 3px 0 0 var(--accent); }

/* Weather */
.wx-hero { display: flex; align-items: center; gap: 18px 28px; flex-wrap: wrap; }
.wx-icon.xl { font-size: 64px; }
.wx-temp.xl { font: 700 56px/1 var(--font-sans); letter-spacing: -.04em; }
.wx-hero .wx-desc { font-size: 15px; margin-top: 4px; }
.wx-facts { display: grid; grid-template-columns: repeat(4, auto); gap: 4px 28px; margin: 0 0 0 auto; }
.wx-facts dt { font-size: 12px; color: var(--muted); }
.wx-facts dd { margin: 0; font-weight: 700; font-size: 17px; }
.wx-hours { display: grid; grid-auto-flow: column; grid-auto-columns: 58px; overflow-x: auto; gap: 4px; margin: 0; padding: 0 0 6px; list-style: none; scroll-snap-type: x proximity; }
.wx-hours li { display: grid; justify-items: center; gap: 4px; padding: 8px 0; border-radius: var(--radius-sm); scroll-snap-align: start; }
.wx-hours li:first-child { background: var(--surface-2); }
.muted-sm { font-size: 12px; color: var(--muted); }
.wx-h-icon { font-size: 22px; line-height: 1; }
.wx-rain { font-size: 11px; color: var(--muted); white-space: nowrap; }
.wx-rain.on { color: #2563eb; font-weight: 600; }
.wx-week { list-style: none; margin: 0; padding: 0; }
.wx-week li { display: grid; grid-template-columns: 90px 32px minmax(0, 1fr) 56px minmax(150px, 220px); align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.wx-week li:first-child { border-top: 0; }
.wx-day small { color: var(--muted); font-size: 12px; }
.wx-label { font-size: 14px; color: var(--ink-2); }
.wx-range { display: grid; grid-template-columns: 30px minmax(0, 1fr) 30px; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.wx-range small { color: var(--muted); text-align: right; }
.wx-bar { position: relative; height: 6px; border-radius: 3px; background: var(--surface-2); }
.wx-bar i { position: absolute; top: 0; bottom: 0; border-radius: 3px; background: linear-gradient(90deg, #2563eb, #e8630a); }

@media (max-width: 860px) {
  .air-layout, .rates-layout { grid-template-columns: 1fr; }
  .air-scale ul { grid-template-columns: 1fr 1fr; }
  .wx-facts { grid-template-columns: repeat(2, auto); margin-left: 0; }
}
@media (max-width: 560px) {
  .air-row { grid-template-columns: 112px minmax(0, 1fr) 48px; }
  .air-row .air-badge { display: none; }
  .air-scale ul { grid-template-columns: 1fr; }
  .wx-week li { grid-template-columns: 64px 28px minmax(0, 1fr) 96px; }
  .wx-week .wx-label { display: none; }
  .wx-range { grid-template-columns: 24px minmax(0, 1fr) 28px; gap: 6px; }
}

/* Place picker with "where am I" button. */
.place-pick { display: inline-flex; align-items: center; gap: 6px; }
.city-pick select { max-width: 190px; }
.locate-btn { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--ink-2); font: 600 13px var(--font-sans); cursor: pointer; white-space: nowrap; }
.locate-btn:hover { border-color: var(--accent); color: var(--accent); }
.locate-btn:disabled { opacity: .6; cursor: progress; }
.locate-msg { flex-basis: 100%; margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: right; }
.today-head { flex-wrap: wrap; }
.air-near { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.4; }
.card-title.gap-top { margin-top: 22px; }
@media (max-width: 560px) {
  .locate-text { display: none; }
  .locate-btn { width: 36px; padding: 0; justify-content: center; }
  .city-pick select { max-width: 150px; }
}

.city-pick[hidden] { display: none; }
.muni-pick select { max-width: 150px; }

/* ===== Single place dropdown (Skopje opens its municipalities) ===== */
.place-dd { position: relative; }
.pd-btn { gap: 8px; height: 38px; padding: 0 12px; cursor: pointer; font: 600 14px var(--font-sans); color: var(--ink); }
.pd-btn #pd-label { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-btn svg:first-child { color: var(--muted); }
.pd-caret { color: var(--muted); transition: transform .15s; }
.pd-btn[aria-expanded="true"] { border-color: var(--focus); }
.pd-btn[aria-expanded="true"] .pd-caret { transform: rotate(180deg); }
.pd-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; width: 250px; max-height: min(420px, 60vh); overflow-y: auto;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 12px 36px rgb(0 0 0 / .16); overscroll-behavior: contain;
}
.pd-panel[hidden] { display: none; }
.pd-row { display: flex; align-items: center; gap: 4px; }
.pd-row .pd-opt { flex: 1; font-weight: 700; }
.pd-opt { display: block; width: 100%; padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--ink);
  font: 500 14px var(--font-sans); text-align: left; cursor: pointer; }
.pd-opt:hover, .pd-opt:focus-visible { background: var(--surface-2); outline: none; }
.pd-opt[aria-selected="true"] { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 700; }
.pd-sub { padding-left: 26px; position: relative; }
.pd-sub::before { content: ""; position: absolute; left: 14px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.pd-expand { display: inline-flex; align-items: center; gap: 4px; padding: 6px 8px; border: 0; border-radius: 8px; background: var(--surface-2);
  color: var(--ink-2); font: 600 12px var(--font-sans); cursor: pointer; white-space: nowrap; }
.pd-expand:hover { color: var(--accent); }
.pd-expand svg { transition: transform .15s; }
.pd-expand[aria-expanded="true"] svg { transform: rotate(90deg); }
.pd-munis[hidden] { display: none; }
.pd-sep { height: 1px; margin: 6px 4px; background: var(--line); }
@media (max-width: 560px) {
  .pd-btn #pd-label { max-width: 150px; }
  .pd-panel { width: min(280px, calc(100vw - 32px)); }
}

/* ===== Statistics dashboard ===== */
.range-link { display: inline-block; padding: 6px 12px; border-radius: 999px; color: var(--muted); font: 600 13px var(--font-sans); }
.range-link:hover { color: var(--ink); }
.range-link[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.stat-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.kpi { display: flex; flex-direction: column; gap: 4px; }
.kpi span { font-size: 13px; color: var(--muted); }
.kpi b { font: 700 30px/1.1 var(--font-sans); font-variant-numeric: tabular-nums; }
.stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--gap); }
.stat-bars, .stat-articles { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stat-bars li { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr) 44px; align-items: center; gap: 10px; font-size: 14px; }
.sb-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-bar { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.sb-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.stat-bars b, .stat-articles b { text-align: right; font-variant-numeric: tabular-nums; }
.stat-articles li { display: grid; grid-template-columns: minmax(0, 1fr) auto 44px; gap: 12px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.stat-articles a:hover { color: var(--accent); }
.stat-articles .muted { font-size: 12px; margin: 0; }
@media (max-width: 900px) { .stat-grid { grid-template-columns: 1fr 1fr; } .stat-kpis { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .stat-grid { grid-template-columns: 1fr; } }

/* ===== Archive ===== */
.arch-nav { display: flex; align-items: center; gap: 6px; }
.arch-nav a.locate-btn { width: 38px; padding: 0; justify-content: center; font-size: 20px; }
.arch-nav input[type="date"] { border: 0; background: none; color: var(--ink); font: 600 14px var(--font-sans); padding: 8px 6px; outline: none; }
.arch-jump small { color: var(--muted); font-weight: 500; }
.arch-list { list-style: none; margin: 0; padding: 6px 18px; }
.arch-list li { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 9px 0; border-bottom: 1px solid var(--line); }
.arch-list li:last-child { border-bottom: 0; }
.arch-list time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.arch-list a { font-weight: 500; }
.arch-list a:hover { color: var(--accent); }
.arch-src { color: var(--muted); font-size: 12px; white-space: nowrap; }
@media (max-width: 560px) { .arch-list li { grid-template-columns: 40px minmax(0, 1fr); } .arch-src { grid-column: 2; } }

/* Footer links, text pages */
.footer-links { display: flex; gap: 18px; flex-wrap: wrap; }
.prose { max-width: 760px; line-height: 1.65; }
.prose h2 { margin: 22px 0 6px; font: 700 19px/1.3 var(--font-serif); }
.prose h2:first-child { margin-top: 4px; }
.prose p, .prose ul { margin: 0 0 10px; color: var(--ink-2); }
.prose ul { padding-left: 20px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* Footer buttons */
.footer-top { padding-top: 26px; }
.footer-btns { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.footer-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--head-line); background: var(--head-field); color: var(--head-ink); font: 600 15px var(--font-sans);
  transition: background .15s, border-color .15s, transform .15s; }
.footer-btn:hover { border-color: var(--head-muted); transform: translateY(-1px); }
.footer-btn span { font-size: 18px; }
.footer-btn.sm { padding: 7px 14px; border-radius: 999px; font-size: 13px; }
.footer-links .footer-btn { color: var(--head-ink); }
.footer-links .footer-btn:hover { color: var(--head-ink); }
@media (max-width: 700px) { .footer-btns { grid-template-columns: 1fr 1fr; } }

/* Footer stays at the bottom on short pages. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
body > main { flex: 1 0 auto; width: 100%; }

/* Public sources list */
.src-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.src-list a, .src-list .src-name { display: flex; flex-direction: column; padding: 8px 10px; border-radius: 8px; font-weight: 600; }
.src-list a:hover { background: var(--surface-2); }
.src-list a span { font-size: 12px; font-weight: 400; color: var(--muted); }

/* ===== Lead story fits one laptop screen =====
   Wide screens: picture left, text right, so the whole lead story is visible without scrolling.
   The side column ("Во фокус") follows the lead's height instead of stretching it. */
@media (min-width: 1101px) {
  .lead { align-items: stretch; }
  .lead-side { justify-content: space-between; }
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .hero .media { aspect-ratio: auto; height: 100%; min-height: 340px; }
  .hero-body { gap: 12px; padding: 22px 24px; }
  .hero .headline.xl { font-size: clamp(22px, 1.9vw, 30px); }
  .hero .summary { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin: 0; }
  .hero .related li:nth-child(n+3) { display: none; }
  .lead-side .row { flex: 0 0 auto; }
}
/* Short screens (laptops): tighter still. */
@media (min-width: 1101px) and (max-height: 820px) {
  .hero .headline.xl { font-size: clamp(21px, 1.7vw, 27px); }
}

/* Lead block height follows the screen, not the headline lengths: long headlines are cut
   with "…" instead of stretching the block below the fold. */
@media (min-width: 1101px) {
  .lead { height: clamp(440px, calc(100vh - 165px), 620px); }
  .lead > .hero, .lead > .lead-side { min-height: 0; height: 100%; }
  .hero { overflow: hidden; }
  .hero .media { min-height: 0; }
  .hero-body { min-height: 0; overflow: hidden; }
  .hero .headline.xl { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
  .lead-side { overflow: hidden; }
  .lead-side .row { flex: 1 1 0; min-height: 0; overflow: hidden; }
  .lead-side .row .headline { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
}

/* ---- Ads ---- */
.ad { margin: 18px auto; width: 100%; max-width: 970px; box-sizing: border-box; text-align: center; }
.ad-label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #8a8076); margin-bottom: 4px; }
.ad-box { display: block; width: 100%; }
.ad-box img { display: block; width: 100%; height: auto; border-radius: 6px; }
.ad-preview { display: flex; align-items: center; justify-content: center; width: 100%; border: 2px dashed var(--line, #d8cfc4); border-radius: 6px; color: var(--muted, #8a8076); font-size: 14px; background: repeating-linear-gradient(45deg, transparent 0 12px, rgba(0,0,0,.025) 12px 24px); }
.ad-top .ad-preview { max-height: 250px; }
.section + .ad, .ad + .section { margin-top: 28px; }
@media (max-width: 640px) { .ad-top .ad-preview { aspect-ratio: 320 / 100 !important; } }

.ad-open, .ad-open body { overflow: hidden; }
.ad-full { position: fixed; inset: 0; z-index: 1000; background: rgba(20, 16, 12, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; gap: 10px; }
.ad-full[hidden] { display: none; }
.ad-full-bar { width: min(800px, 100%); display: flex; align-items: center; justify-content: flex-end; }
.ad-full-bar .ad-label { color: #d9cfc3; margin: 0; }
.ad-skip { font: inherit; font-weight: 600; font-size: 15px; padding: 10px 18px; border: 0; border-radius: 999px; background: #fff; color: #1f1a15; cursor: pointer; }
.ad-skip:hover, .ad-skip:focus-visible { background: var(--accent, #c2410c); color: #fff; outline: none; }
.ad-full-box { display: block; width: min(800px, 100%); }
.ad-full-box img { display: block; width: 100%; max-height: calc(100vh - 110px); object-fit: contain; border-radius: 8px; }
.ad-full-box.ad-preview { display: flex; aspect-ratio: 800 / 600; max-height: calc(100vh - 110px); background-color: #f7f2ec; color: #6b6158; font-size: 18px; }
.ad-wrap { width: 100%; box-sizing: border-box; }
.table-wrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ad-table th, .ad-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line, #e6ddd2); white-space: nowrap; }
.ad-table th { font-weight: 600; color: var(--muted, #8a8076); font-size: 12px; }
.ad-table td:nth-child(3), .ad-table td:nth-child(4), .ad-table td:nth-child(5), .ad-table td:nth-child(6) { text-align: right; }
.lead-side .ad-side { margin: 0; flex: 0 0 auto; max-width: none; }
.lead-side .ad-side .ad-box { max-width: 300px; margin: 0 auto; }
.lead-side .ad-side .ad-preview { max-width: 300px; margin: 0 auto; }

/* ---- Error pages ---- */
.error-page { max-width: 560px; margin: 8vh auto; text-align: center; }
.error-code { font: 800 72px/1 var(--font-serif); color: var(--accent); margin: 0 0 12px; }
.error-page h1 { font-family: var(--font-serif); font-size: 28px; margin: 0 0 10px; }
.error-page p { color: var(--muted); }
.error-links { display: flex; gap: 18px; justify-content: center; align-items: center; margin-top: 24px; }
.error-links .btn { background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 999px; font-weight: 600; text-decoration: none; }

/* ---- Contact ---- */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--gap); }
.contact-card h2 { font-family: var(--font-serif); font-size: 20px; margin: 0 0 8px; }
.contact-card p { color: var(--ink-2); margin: 0 0 14px; }
.contact-mail { display: inline-block; font-weight: 600; color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }

/* ---- Admin login ---- */
.login { max-width: 380px; margin: 8vh auto; }
.login h1 { font-family: var(--font-serif); font-size: 24px; margin: 0 0 16px; }
.login form { display: grid; gap: 14px; }
.login label { display: grid; gap: 6px; font-weight: 600; font-size: 14px; color: var(--ink-2); }
.login input { font: inherit; font-size: 16px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink); }
.login input:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
.login .btn { font: inherit; font-weight: 600; border: 0; border-radius: 999px; padding: 11px 18px; background: var(--accent); color: #fff; cursor: pointer; }
.login-error { background: #fde8eb; color: #a0162b; border-radius: var(--radius-sm); padding: 10px 12px; margin: 0 0 14px; font-size: 14px; }
.admin-nav { display: flex; gap: 14px; font-size: 14px; }
.admin-nav a { color: var(--muted); }

/* ---- Towns ---- */
.town-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.town-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; text-decoration: none; color: var(--ink); }
.town-card:hover { box-shadow: var(--shadow-hover); }
.town-name { font-family: var(--font-serif); font-weight: 700; font-size: 18px; }
.town-n { font-size: 13px; color: var(--muted); }
.town-empty { opacity: .6; }
.stale-note { background: #fff4d6; color: #7a5600; border-radius: var(--radius-sm); padding: 8px 12px; font-size: 14px; margin-top: 8px; }
.footer-copy { border-top: 1px solid var(--head-line); padding-top: 14px; padding-bottom: 18px; font-size: 12.5px; color: var(--head-muted); text-align: center; }
.staging-badge { background: #f5b301; color: #1d1a16; font: 800 11px/1 var(--font-sans); letter-spacing: .08em; padding: 5px 8px; border-radius: 6px; flex: 0 0 auto; }

/* Narrow phones (e.g. Samsung with larger display zoom): nothing may push the page sideways. */
html, body { max-width: 100%; overflow-x: clip; }
@media (max-width: 380px) {
  .header-row { gap: 6px; }
  .search { padding: 0 10px; }
  .search input { font-size: 14px; }
}

/* ---- Cookie consent ---- */
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 900; max-width: 640px; margin-inline: auto;
  background: var(--head-bg); color: var(--head-ink); border: 1px solid var(--head-line); border-radius: var(--radius);
  box-shadow: 0 10px 40px rgb(0 0 0 / .35); padding: 14px 16px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.consent[hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 260px; font-size: 14px; line-height: 1.45; color: var(--head-ink); }
.consent a { color: #ff8c9c; }
.consent-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.consent-btn { font: inherit; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 999px; cursor: pointer;
  border: 1px solid #fff; background: #fff; color: #1d1a16; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: inherit; text-decoration: underline; cursor: pointer; }

/* ---- Fuel calculator ---- */
.calc-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 26px 28px; margin-bottom: var(--gap); max-width: 920px; }
.calc-card:hover { transform: none; box-shadow: var(--shadow); }
.calc-title { margin: 0 0 6px; font: 700 22px/1.2 var(--font-serif); }
.calc-hint { margin: 0 0 18px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.calc-fuels { display: grid; gap: 8px; margin-bottom: 18px; }
.calc-fuel { font: inherit; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; transition: border-color .15s, background .15s; }
.calc-fuel span { font-weight: 600; font-size: 15px; }
.calc-fuel small { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.calc-fuel:hover { border-color: var(--muted); }
.calc-fuel[aria-checked="true"] { border-color: var(--c-ekonomija); box-shadow: inset 0 0 0 1px var(--c-ekonomija);
  background: color-mix(in srgb, var(--c-ekonomija) 7%, var(--surface)); }
.calc-card label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); min-width: 0; }
.calc-field { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.calc-field:focus-within { outline: 2px solid var(--focus); outline-offset: 1px; }
.calc-field input { flex: 1; min-width: 0; font: inherit; font-size: 26px; font-weight: 700; padding: 12px 14px; border: 0; background: none;
  color: var(--ink); outline: 0; font-variant-numeric: tabular-nums; }
.calc-field.sm input { font-size: 17px; padding: 10px 12px; }
.calc-field span { padding-right: 14px; font-size: 14px; color: var(--muted); white-space: nowrap; }
.calc-main { display: grid; gap: 10px; align-content: center; padding: 22px; border-radius: 16px;
  background: color-mix(in srgb, var(--c-ekonomija) 6%, var(--bg)); }
#calc-mkd { color: var(--c-ekonomija); }
.calc-eq { justify-self: center; font-size: 20px; color: var(--muted); line-height: 1; }
.calc-out { margin: 6px 0 0; font-size: 14px; color: var(--muted); text-align: center; }
.calc-out #calc-l { font-weight: 700; color: var(--ink); }
@media (max-width: 760px) {
  .calc-card { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
  .calc-fuel { padding: 10px 12px; }
  .calc-main { padding: 16px; }
}
@media (max-width: 420px) {
  .fuel-card { padding: 12px 14px; }
  .fuel-card .fuel-price { font-size: 22px; }
  .fuel-card .fuel-change { white-space: normal; }
}
