/* ==========================================================================
   nezprod — app shell: masthead, primary nav, main, footer, mobile tab bar,
   "Više" sheet. Breakpoint: mobile mode below 820px (afweb).
   ========================================================================== */

.nz-container {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ── Skip link ────────────────────────────────────────────────────────── */
.nz-skip {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 200;
  padding: 12px 16px;
  background: var(--red-fill);
  color: var(--on-red);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform var(--dur-chip) var(--ease-out);
}
.nz-skip:focus,
.nz-skip:focus-visible {
  transform: translateY(0);
  color: var(--on-red);
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* ── Masthead ─────────────────────────────────────────────────────────── */
.nz-masthead {
  position: relative;
  background: var(--ink);
}

.nz-masthead__inner {
  display: flex;
  align-items: center;
  gap: var(--s-5);
  min-height: 84px;
  padding-block: 20px 18px;
}

.nz-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.nz-brand:hover {
  color: inherit;
}

.nz-brand__logo {
  display: block;
  flex: 0 0 auto;
  line-height: 0;
  text-decoration: none;
}
.nz-brand__logo img {
  width: auto;
  height: 24px;
}
/* The logo swaps by EFFECTIVE theme without JS: tokens.css sets
   --logo-on-dark / --logo-on-light per theme (incl. auto + OS preference). */
.nz-logo--on-dark {
  display: var(--logo-on-dark, inline-block);
}
.nz-logo--on-light {
  display: var(--logo-on-light, none);
}

.nz-brand__rule {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  min-height: 36px;
  background: var(--rule);
}

.nz-brand__text {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.nz-brand__text:hover {
  color: inherit;
}

.nz-brand__name {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.025em;
  color: var(--paper);
  white-space: nowrap;
}
.nz-brand__name em {
  font-style: normal;
  color: var(--red);
}

.nz-brand__sub {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.nz-masthead__meta {
  display: flex;
  align-items: center;
  gap: var(--s-4);
  margin-left: auto;
}

.nz-edition {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
}
.nz-edition b {
  font-weight: 500;
  color: var(--paper);
}

/* ── Theme toggle: ◐ auto → ☀ light → ☾ dark ─────────────────────────── */
.nz-theme {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 5px 12px;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--paper-dim);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: border-color var(--dur-hover) ease, color var(--dur-hover) ease;
}
.nz-theme:hover {
  border-color: var(--paper-dim);
  color: var(--paper);
}
/* Extend the hit area to 44px without growing the pill. */
.nz-theme::after {
  content: '';
  position: absolute;
  inset: -8px -4px;
}
.nz-theme__glyph {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  line-height: 1;
  color: var(--red);
  text-transform: none;
}
/* Only the option matching <html class="theme-*"> is shown, so the label is
   right from the first paint, before any module script runs. */
.nz-theme__opt {
  display: none;
  align-items: center;
  gap: 6px;
}
html.theme-auto .nz-theme__opt[data-theme-opt='auto'],
html.theme-light .nz-theme__opt[data-theme-opt='light'],
html.theme-dark .nz-theme__opt[data-theme-opt='dark'] {
  display: inline-flex;
}

/* ── Primary nav (desktop) ────────────────────────────────────────────── */
.nz-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.nz-nav__inner {
  display: flex;
  align-items: stretch;
  overflow-x: auto;
  scrollbar-width: none;
}
.nz-nav__inner::-webkit-scrollbar {
  display: none;
}

.nz-nav__group {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nz-nav__group:first-child {
  margin-left: -12px; /* optical alignment of the first label with the logo */
}

.nz-nav__sep {
  flex: 0 0 1px;
  width: 1px;
  margin: 14px 10px;
  background: var(--rule);
}

.nz-nav__link {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 12px;
  color: var(--paper-dim);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-hover) ease;
}
/* Reserve the bold width so the active weight never shifts the row. */
.nz-nav__link::after {
  content: attr(data-label);
  height: 0;
  overflow: hidden;
  visibility: hidden;
  font-weight: 700;
  pointer-events: none;
  user-select: none;
}
.nz-nav__link:hover {
  color: var(--paper);
}
.nz-nav__link:focus-visible {
  outline-offset: -4px;
}
.nz-nav__link[aria-current='page'] {
  color: var(--paper);
  font-weight: 700;
}
/* The 5px red dot under the active item (afweb TopNav). */
.nz-nav__link[aria-current='page']::before {
  content: '';
  position: absolute;
  bottom: 7px;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%);
}

/* ── Main ─────────────────────────────────────────────────────────────── */
.nz-main {
  display: block;
  min-height: 60vh;
  padding-block: 48px 96px;
  outline: none;
}

/* Router mount: each view enters with a 180ms fade + 4px rise. Fill mode is
   `backwards`, so once finished the animation leaves no transform behind
   (a lingering transform would trap position:fixed descendants). */
.nz-view {
  animation: nz-view-in var(--dur-view) var(--ease-out) backwards;
}
@keyframes nz-view-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* ── Footer ───────────────────────────────────────────────────────────── */
.nz-footer {
  border-top: 1px solid var(--rule);
  background: var(--ink);
  color: var(--text-dim);
  font-size: 13px;
}

.nz-footer__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: var(--s-6) var(--s-7);
  padding-block: 36px 40px;
}

.nz-footer__notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 560px;
}
.nz-footer__disclaimer {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--paper);
  text-wrap: balance;
}

.nz-footer .nz-facts {
  align-self: start;
}

.nz-footer__credit {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.nz-footer__credit img {
  height: 14px;
  width: auto;
}

.nz-footer__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 14px 18px;
  border-top: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* ── Mobile tab bar (< 820px) ─────────────────────────────────────────── */
.nz-tabbar {
  display: none;
}

/* ── "Više" sheet content (rendered into an nz-modal--sheet) ─────────── */
.nz-more__group + .nz-more__group {
  margin-top: var(--s-5);
}
.nz-more__label {
  margin: 0 0 6px;
}
.nz-more__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--rule);
}
.nz-more__link {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: start;
  gap: 4px 12px;
  min-height: 60px;
  padding: 10px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--paper);
  text-decoration: none;
}
.nz-more__link:hover {
  color: var(--paper);
}
.nz-more__link:hover .nz-more__arrow {
  color: var(--red-text);
  transform: translateX(2px);
}
.nz-more__icon {
  justify-self: center;
  padding-top: 2px;
  font-size: 15px;
  color: var(--text-dim);
}
.nz-more__title {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.nz-more__desc {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--text-dim);
}
.nz-more__arrow {
  align-self: center;
  font-family: system-ui, sans-serif;
  color: var(--text-dim);
  transition: transform var(--dur-hover) ease, color var(--dur-hover) ease;
}
.nz-more__link[aria-current='page'] .nz-more__title::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--red);
  vertical-align: middle;
}
.nz-more__link[aria-current='page'] .nz-more__icon {
  color: var(--red-text);
}
.nz-more__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: var(--s-5);
  padding-top: var(--s-4);
  border-top: 1px solid var(--rule);
}

/* ── Desktop refinements ──────────────────────────────────────────────── */
@media (min-width: 820px) and (max-width: 1099.98px) {
  .nz-nav__link {
    padding: 0 9px;
    font-size: 13px;
  }
  .nz-nav__group:first-child {
    margin-left: -9px;
  }
  .nz-nav__sep {
    margin-inline: 6px;
  }
  .nz-edition {
    display: none;
  }
}

/* ── Phone masthead (< 600px): logo + theme on top, the name below ───── */
@media (max-width: 599.98px) {
  .nz-masthead__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      'logo meta'
      'text text';
    align-items: center;
    gap: 14px 12px;
    min-height: 0;
    padding-block: 14px 18px;
  }
  .nz-brand {
    display: contents;
  }
  .nz-brand__logo {
    grid-area: logo;
  }
  .nz-brand__logo img {
    height: 19px;
  }
  .nz-brand__rule {
    display: none;
  }
  .nz-brand__text {
    grid-area: text;
    gap: 7px;
    padding-top: 14px;
    border-top: 1px solid var(--rule);
  }
  .nz-brand__name {
    font-size: 26px;
    white-space: normal;
  }
  .nz-brand__sub {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .nz-masthead__meta {
    grid-area: meta;
    gap: 0;
  }
  .nz-edition {
    display: none;
  }
  .nz-theme {
    min-height: 34px;
    padding-inline: 12px;
    font-size: 10.5px;
  }
  .nz-theme::after {
    inset: -6px -4px;
  }
}

/* ── Mobile mode (< 820px) ────────────────────────────────────────────── */
@media (max-width: 819.98px) {
  .nz-edition {
    display: none;
  }

  .nz-nav {
    display: none;
  }

  .nz-main {
    padding-block: 28px calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 48px);
  }

  .nz-footer {
    padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  }
  .nz-footer__inner {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--s-5);
    padding-block: 28px;
  }
  .nz-footer__disclaimer {
    font-size: 18px;
  }
  /* Footer links stand alone on their line: a 44px hit area around the text. */
  .nz-footer .nz-facts a {
    position: relative;
  }
  .nz-footer .nz-facts a::after {
    content: '';
    position: absolute;
    inset: -14px -4px;
  }

  .nz-tabbar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 60;
    display: grid;
    /* Equal tabs where the labels allow; a long label ("Dokumentacija")
       takes only the extra width it needs instead of being truncated. */
    grid-template-columns: repeat(5, minmax(max-content, 1fr));
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
    padding: 0 max(4px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(4px, env(safe-area-inset-left, 0px));
    background: var(--ink);
    border-top: 1px solid var(--rule);
  }
  .nz-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-width: 0;
    min-height: var(--tap);
    padding: 6px 2px 4px;
    border: 0;
    background: transparent;
    color: var(--text-dim);
    font-family: var(--font-body);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: color var(--dur-hover) ease;
  }
  .nz-tab:hover {
    color: var(--paper);
  }
  .nz-tab:focus-visible {
    outline-offset: -3px;
  }
  .nz-tab i {
    font-size: 17px;
    line-height: 1;
  }
  .nz-tab__label {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .nz-tab[aria-current='page'],
  .nz-tab.is-active {
    color: var(--paper);
  }
  .nz-tab[aria-current='page'] i,
  .nz-tab.is-active i {
    color: var(--red);
  }
  /* Active marker: a short red rule on the bar's top edge. */
  .nz-tab[aria-current='page']::before,
  .nz-tab.is-active::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    width: 22px;
    height: 2px;
    background: var(--red);
    transform: translateX(-50%);
  }
}

@media (max-width: 379.98px) {
  .nz-tab {
    font-size: 10px;
    letter-spacing: 0;
  }
}

/* ── 404 page ─────────────────────────────────────────────────────────── */
.nz-notfound {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 640px;
  min-height: 100vh;
  min-height: 100dvh;
  margin-inline: auto;
  padding: 48px var(--gutter);
}
.nz-notfound .nz-brand__logo {
  margin-bottom: 18px;
}
.nz-notfound .nz-brand__logo img {
  height: 22px;
}
.nz-notfound__note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--text-dim);
}

/* Headings reached by the skip link / router clear the sticky nav. */
.nz-main h1,
.nz-main [data-nz-focus-target] {
  scroll-margin-top: 72px;
}
