/*
 * Savez društava Vojvodine za borbu protiv raka
 *
 * Palette taken from the live theme's own CSS rather than invented: the green
 * and the two blues are the site's real accents. Divi's default #2ea3f2 is
 * ignored — it is the page builder's factory setting, not a brand decision.
 *
 * Typography is Open Sans throughout. The live site pairs it with Didact Gothic
 * for headings, but that face has no Cyrillic coverage and a growing share of
 * recent posts are authored in Serbian Cyrillic, so their headings would fall
 * back to an unrelated typeface. One family that covers both scripts is the
 * more honest choice for this content.
 */

:root {
  color-scheme: light;

  /* --- Brand ------------------------------------------------------------
   * The literal palette. Nothing outside this block should reference these
   * directly; everything goes through a role token below, because in dark mode
   * a navy SURFACE has to stay dark while navy TEXT has to go light, and one
   * variable cannot do both.
   */
  --zelena: #63b18a;
  --zelena-tamna: #4a8e6c;
  --plava: #34587c;
  --plava-tamna: #26415d;
  --plava-svetla: #a0beef;
  --crvena: #c0392b;

  /* --- Roles ------------------------------------------------------------ */
  --naslov: var(--plava);            /* headings, card titles, form labels */
  --link: var(--plava);
  --akcenat: var(--zelena);          /* rules, active states, counters */
  --akcenat-jak: var(--zelena-tamna); /* the same accent, one step louder */

  /* Filled navy bars: hero, footer, PDF header, skip link. Always dark, so the
     text on them is always light — in both schemes. */
  --traka: var(--plava);
  --traka-tamna: var(--plava-tamna);
  --traka-tekst: #ffffff;
  --traka-tekst-tiho: #d7e2ec;
  --traka-tekst-tise: #b9c6d1;

  /* --- Surfaces --------------------------------------------------------- */
  --tekst: #333333;
  --tekst-tiho: #666666;
  --linija: #e2e6e9;
  --pozadina: #ffffff;               /* page */
  --pozadina-tiha: #f6f8f9;          /* recessed bands, table headers */
  --povrsina: #ffffff;               /* raised: cards, header, dropdowns, inputs */

  /* --- Spacing ----------------------------------------------------------
   * A 6-step scale. Section rhythm snaps to it; --razmak stays the mid step
   * because grid gaps across the site already reference it by that name.
   */
  --razmak-2xs: 0.5rem;
  --razmak-xs: 0.75rem;
  --razmak-sm: 1rem;
  --razmak: 1.5rem;
  --razmak-md: 2rem;
  --razmak-lg: 3rem;
  --razmak-xl: 4rem;

  --sirina: 1180px;
  --radijus: 4px;
  --senka: 0 1px 3px rgb(16 34 51 / 0.08), 0 6px 20px rgb(16 34 51 / 0.06);

  --font: 'Open Sans', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--pozadina);
  color: var(--tekst);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.7;
}

body.lightbox-otvoren { overflow: hidden; }

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

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--akcenat-jak); }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  margin: 0 0 0.5em;
  color: var(--naslov);
  font-weight: 700;
  text-wrap: balance;
}

:focus-visible { outline: 2px solid var(--akcenat); outline-offset: 2px; }

.wrap { width: min(100% - 2rem, var(--sirina)); margin-inline: auto; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px;
  background: var(--traka); color: var(--traka-tekst);
  padding: var(--razmak-xs) var(--razmak-sm); z-index: 200;
}
.skip-link:focus { left: 0; top: 0; }

/* ============================ Header / nav ============================ */

.site-header {
  background: var(--povrsina);
  border-bottom: 3px solid var(--akcenat);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 1px 4px rgb(16 34 51 / 0.06);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--razmak);
  padding-block: 0.75rem;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: inherit; }
.brand__logo { width: auto; height: 56px; flex: none; }

.nav__list, .nav__sub { list-style: none; margin: 0; padding: 0; }
.nav__list { display: flex; flex-wrap: wrap; align-items: center; gap: 0.1rem 1.15rem; }
.nav__item { position: relative; }

.nav__item > a {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--tekst);
  border-bottom: 2px solid transparent;
}
.nav__item > a:hover,
.nav__item > a[aria-current="page"] { color: var(--akcenat-jak); border-bottom-color: var(--akcenat); }

.nav__item--highlight > a {
  background: var(--akcenat);
  color: var(--traka-tekst);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radijus);
  border-bottom: 0;
}
.nav__item--highlight > a:hover { background: var(--akcenat-jak); color: var(--traka-tekst); border-bottom-color: transparent; }

.nav__sub {
  position: absolute;
  top: 100%; left: 0;
  min-width: 15rem;
  background: var(--povrsina);
  border: 1px solid var(--linija);
  border-top: 2px solid var(--akcenat);
  border-radius: 0 0 var(--radijus) var(--radijus);
  padding: 0.35rem 0;
  display: none;
  box-shadow: var(--senka);
  z-index: 20;
}
.nav__item--has-children:hover .nav__sub,
.nav__item--has-children:focus-within .nav__sub,
.nav__item--open .nav__sub { display: block; }

.nav__sub a {
  display: block;
  padding: 0.45rem 1rem;
  text-decoration: none;
  color: var(--tekst);
  font-size: 0.9rem;
}
.nav__sub a:hover { background: var(--pozadina-tiha); color: var(--akcenat-jak); }

.nav-toggle { display: none; }

@media (max-width: 980px) {
  .brand__logo { height: 44px; }
  .has-js .nav { display: none; width: 100%; padding-bottom: 0.5rem; }
  .has-js .nav--open { display: block; }
  .has-js .nav-toggle {
    display: block;
    background: none;
    border: 1px solid var(--linija);
    border-radius: var(--radijus);
    padding: 0.55rem 0.7rem;
    cursor: pointer;
  }
  .nav-toggle__bar,
  .nav-toggle__bar::before,
  .nav-toggle__bar::after {
    display: block; width: 20px; height: 2px; background: var(--naslov);
  }
  .nav-toggle__bar { position: relative; }
  .nav-toggle__bar::before, .nav-toggle__bar::after { content: ""; position: absolute; }
  .nav-toggle__bar::before { top: -6px; }
  .nav-toggle__bar::after { top: 6px; }

  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__item > a { padding: 0.6rem 0; border-bottom: 1px solid var(--linija); }
  .nav__item--highlight > a { margin-top: 0.5rem; text-align: center; }
  .nav__sub { position: static; display: block; border: 0; box-shadow: none; padding: 0 0 0 1rem; }
}

/* ============================== Content ============================== */

/* The footer used to add its own margin-top on top of this padding, so every
   page ended on 7rem of dead space. The gap lives here now, in one place. */
main { min-height: 55vh; padding-bottom: var(--razmak-lg); }

/* A section that paints its own full-width band already ends the page; padding
   under it just pushes the footer away. */
main:has(.prijatelji) { padding-bottom: 0; }
main > .wrap:first-child,
main > article:first-child { padding-top: var(--razmak-md); }

.stranica__header { margin-bottom: var(--razmak); }
.stranica__title { font-size: clamp(1.7rem, 4vw, 2.4rem); }
.stranica__meta { color: var(--tekst-tiho); font-size: 0.9rem; margin-top: -0.5rem; }

.prose > * + * { margin-top: 1.05rem; }
.prose h2 { margin-top: 2.2rem; font-size: 1.5rem; }
.prose h3 { margin-top: 1.8rem; font-size: 1.2rem; }
.prose h4, .prose h5, .prose h6 { margin-top: 1.5rem; font-size: 1.05rem; }
.prose img { display: block; margin-block: 1.4rem; border-radius: var(--radijus); }
.prose figure { margin: 1.6rem 0; }
.prose figcaption { font-size: 0.87rem; color: var(--tekst-tiho); }
.prose iframe { max-width: 100%; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: var(--radijus); }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li + li { margin-top: 0.3rem; }
.prose blockquote {
  margin-inline: 0;
  padding: 0.6rem 0 0.6rem 1.1rem;
  border-left: 3px solid var(--akcenat);
  color: var(--tekst-tiho);
  font-style: italic;
}
.prose hr { border: 0; border-top: 1px solid var(--linija); margin-block: 2rem; }

/* Pull quote. Was a bare italic line followed by "– Name –". */
.citat {
  margin: var(--razmak-md) 0;
  padding: var(--razmak) 0 var(--razmak) var(--razmak);
  border-left: 4px solid var(--akcenat);
  font-size: clamp(1.05rem, 2.2vw, 1.3rem);
  font-style: italic;
  color: var(--tekst);
  line-height: 1.5;
}
.citat p { margin: 0; }
.citat footer {
  margin-top: var(--razmak-2xs);
  font-size: 0.88rem;
  font-style: normal;
  font-weight: 600;
  color: var(--tekst-tiho);
}
.citat footer::before { content: "— "; }

/* Embedded video with a source line under it. */
.video { margin: var(--razmak-md) 0; }
.video iframe { display: block; }
.video figcaption {
  margin-top: var(--razmak-2xs);
  font-size: 0.87rem;
  color: var(--tekst-tiho);
}
.prose table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.prose th, .prose td { border: 1px solid var(--linija); padding: 0.5rem 0.7rem; text-align: left; }
.prose th { background: var(--pozadina-tiha); }

/* Wide content must scroll inside itself, never the page. */
.prose { overflow-wrap: break-word; }
.prose table { display: block; overflow-x: auto; }

/* ============================ Single post ============================ */

.vest { max-width: 54rem; }
.vest__title { font-size: clamp(1.6rem, 4vw, 2.3rem); }
.vest__meta {
  color: var(--tekst-tiho);
  font-size: 0.88rem;
  margin-top: 0;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.vest__featured { margin: 0 0 var(--razmak); }
.vest__featured img { width: 100%; border-radius: var(--radijus); }

.vest__nav {
  display: flex;
  justify-content: space-between;
  gap: var(--razmak);
  margin-top: var(--razmak-lg);
  padding-top: var(--razmak);
  border-top: 1px solid var(--linija);
  font-size: 0.9rem;
}
.vest__nav a { text-decoration: none; font-weight: 600; max-width: 22rem; }
.vest__nav a:hover { text-decoration: underline; }
.vest__nav-next { text-align: right; margin-left: auto; }

/* ============================= PDF reader ============================= */

.pdf {
  margin: var(--razmak) 0;
  border: 1px solid var(--linija);
  border-radius: var(--radijus);
  overflow: hidden;
  background: var(--pozadina-tiha);
}

.pdf__zaglavlje {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: var(--razmak-xs) var(--razmak-sm);
  background: var(--traka);
  color: var(--traka-tekst);
  font-size: 0.92rem;
}
.pdf__naslov { font-weight: 600; }

.pdf__preuzmi {
  background: var(--akcenat);
  color: var(--traka-tekst);
  text-decoration: none;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radijus);
  font-weight: 600;
  white-space: nowrap;
}
.pdf__preuzmi:hover { background: var(--akcenat-jak); color: var(--traka-tekst); }

.pdf__citac {
  display: block;
  width: 100%;
  height: min(80vh, 780px);
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
  background: #fff;
}

.pdf__napomena {
  margin: 0;
  padding: 0.5rem 1rem;
  font-size: 0.84rem;
  color: var(--tekst-tiho);
  border-top: 1px solid var(--linija);
}

/*
 * Mobile browsers do not render PDFs inside an iframe — iOS Safari shows an
 * empty box and Android is inconsistent. Hide the reader there; the header link
 * above is always present, so the document stays one tap away.
 */
@media (max-width: 720px) {
  .pdf__citac { display: none; }
  .pdf__napomena { border-top: 0; }
}

/* =========================== News listing =========================== */

.vesti-lista {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--razmak);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
}

.vest-kartica__link {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  text-decoration: none;
  color: inherit;
  background: var(--povrsina);
  border: 1px solid var(--linija);
  border-radius: var(--radijus);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.vest-kartica__link:hover { transform: translateY(-2px); box-shadow: var(--senka); }

/* The fallback emblem is cropped like any other card image. */
.vest-kartica__slika { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }

.vest-kartica__telo { display: grid; gap: 0.4rem; padding: 1rem 1.1rem 1.2rem; align-content: start; }
.vest-kartica__datum { font-size: 0.78rem; color: var(--akcenat-jak); font-weight: 600; letter-spacing: 0.02em; }
.vest-kartica__naslov { font-weight: 700; line-height: 1.35; color: var(--naslov); }
.vest-kartica__uvod { font-size: 0.88rem; color: var(--tekst-tiho); }

.paginacija {
  display: flex; align-items: center; justify-content: center;
  gap: var(--razmak-sm); margin-top: var(--razmak-lg); flex-wrap: wrap; font-size: 0.9rem;
}
.paginacija a { text-decoration: none; }
.paginacija__lista { list-style: none; display: flex; gap: 0.3rem; margin: 0; padding: 0; flex-wrap: wrap; }
.paginacija__lista a {
  display: block; min-width: 2.2rem; text-align: center;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--linija); border-radius: var(--radijus);
  color: var(--tekst);
}
.paginacija__lista a:hover { border-color: var(--akcenat); color: var(--akcenat-jak); }
.paginacija__lista a[aria-current="page"] {
  background: var(--akcenat); border-color: var(--akcenat); color: var(--traka-tekst); font-weight: 700;
}

/* ============================= Homepage ============================= */

/* ============================== Buttons ============================== */

.dugme {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radijus);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.dugme--primarno { background: var(--akcenat); border-color: var(--akcenat); color: var(--traka-tekst); }
.dugme--primarno:hover { background: var(--akcenat-jak); border-color: var(--akcenat-jak); color: var(--traka-tekst); }

/* Button rows. The conversion collapsed adjacent Divi buttons into a single
   paragraph with no separator ("saznaj višepodrška"); this is what they should
   have been. */
.akcije { display: flex; flex-wrap: wrap; gap: var(--razmak-xs); }
.akcije--centar { justify-content: center; }
.prose .akcije { margin-top: var(--razmak); }

/* For use on a filled dark bar, where a white outline reads as the quieter of
   two actions without introducing a third colour. */
.dugme--obrnuto { color: var(--traka-tekst); border-color: rgb(255 255 255 / 0.45); }
.dugme--obrnuto:hover { background: rgb(255 255 255 / 0.12); border-color: var(--traka-tekst); color: var(--traka-tekst); }

/* ============================= Homepage ============================= */

.hero {
  /* The flat 135° ramp read as a placeholder. A soft accent bloom off the
     bottom-right gives the band some depth without adding an image request. */
  background:
    radial-gradient(60rem 20rem at 85% 115%, rgb(99 177 138 / 0.3), transparent 68%),
    linear-gradient(135deg, var(--traka) 0%, var(--traka-tamna) 100%);
  color: var(--traka-tekst);
  padding-block: var(--razmak-xl);
  text-align: center;
}
.hero__inner { display: grid; justify-items: center; gap: var(--razmak-sm); }
.hero__title {
  font-size: clamp(1.5rem, 4.2vw, 2.5rem);
  margin: 0;
  color: var(--traka-tekst);
  max-width: 26ch;
}
.hero__motto {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.15rem);
  font-style: italic;
  color: var(--traka-tekst-tiho);
}
.hero__akcije {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: var(--razmak-xs);
  margin: var(--razmak-2xs) 0 0;
}

.brojaci { background: var(--pozadina-tiha); border-bottom: 1px solid var(--linija); padding-block: var(--razmak-md); }
.brojaci__lista {
  /* margin-BLOCK, not margin: the element also carries .wrap, whose
     margin-inline:auto is what centres it. A blanket `margin: 0` here wins on
     source order and pins the whole band to the left edge. */
  list-style: none; margin-block: 0; padding: 0;
  display: grid; gap: var(--razmak);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  text-align: center;
}
.brojac { display: grid; gap: 0.15rem; }
.brojac__broj { font-size: clamp(1.9rem, 5vw, 2.7rem); font-weight: 700; color: var(--akcenat); line-height: 1; }
.brojac__opis { font-size: 0.88rem; color: var(--tekst-tiho); }

/* Slot-machine digits. brojaci.js builds a 0-9 reel per digit and translates it
   by whole cells, so every height here must stay exactly 1em. */
.brojac__reel { display: inline-flex; }
.cifra { display: inline-block; height: 1em; overflow: hidden; }
.cifra__jedna { display: block; height: 1em; line-height: 1; }
.cifra__traka {
  display: block;
  transform: translateY(0);
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.16, 0.84, 0.24, 1);
  transition-duration: var(--cifra-trajanje, 0s);
  transition-delay: var(--cifra-kasnjenje, 0s);
  will-change: transform;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
  padding-bottom: 0.6rem; border-bottom: 2px solid var(--linija);
}
.section-head h2 { margin: 0; }
.section-head a { text-decoration: none; font-weight: 600; font-size: 0.9rem; }

.pocetna-vesti { margin-top: var(--razmak-lg); }

/* --- 12 koraka -------------------------------------------------------
 * Divi cards that the export flattened into thirty sibling <h3>s. Numbering is
 * a CSS counter so the markup carries no hardcoded digits — the source order
 * had been serialised column-first (1,4,7,10,2,5,…) and is now simply 1-12.
 */
/* Centred section header — an overline rule, the title, and a quieter subtitle
   under it. Replaces two left-aligned headings sitting on their own. */
.sekcija-glava { text-align: center; margin: var(--razmak-lg) 0 var(--razmak-md); }
.sekcija-glava h2 {
  margin: 0;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
}
.sekcija-glava h2::after {
  content: "";
  display: block;
  width: 3.5rem;
  height: 3px;
  margin: var(--razmak-xs) auto 0;
  border-radius: 2px;
  background: var(--akcenat);
}
.sekcija-glava h3 {
  margin: var(--razmak-xs) 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--tekst-tiho);
}

.koraci {
  list-style: none;
  counter-reset: korak;
  display: grid;
  gap: var(--razmak);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
  margin: var(--razmak) 0 0;
  padding: 0;
}
.prose .koraci > li + li { margin-top: 0; }

.korak {
  counter-increment: korak;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: var(--razmak-2xs);
  padding: var(--razmak);
  border: 1px solid var(--linija);
  border-top: 3px solid var(--akcenat);
  border-radius: var(--radijus);
  background: linear-gradient(160deg, var(--povrsina) 40%, rgb(99 177 138 / 0.1) 100%);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

/* Alternating accent gives the grid a rhythm without inventing colours the
   brand does not have — it is the same green and navy, taking turns. */
.korak:nth-child(even) {
  border-top-color: var(--plava);
  background: linear-gradient(160deg, var(--povrsina) 40%, rgb(52 88 124 / 0.09) 100%);
}

/* The step number as a watermark rather than a badge. The <ol> already carries
   the ordering semantically, so this is decorative and stays out of the
   accessibility tree. */
.korak::before {
  content: counter(korak);
  position: absolute;
  top: -0.24em;
  right: 0.06em;
  font-size: 5rem;
  font-weight: 800;
  line-height: 1;
  color: var(--akcenat);
  opacity: 0.16;
  pointer-events: none;
  user-select: none;
}
.korak:nth-child(even)::before { color: var(--plava); }

.korak:hover { transform: translateY(-2px); box-shadow: var(--senka); }

/* Keep the copy above the watermark. */
.korak > * { position: relative; }
.korak p { margin: 0; }
.korak__stavke {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.94rem;
  color: var(--tekst-tiho);
}

/* --- Prijatelji Saveza ------------------------------------------------
 * The logos used to be listed twice on this page, once as bold text links and
 * once as images. Only the images survive, in one continuously scrolling row.
 */
.prijatelji {
  margin-top: var(--razmak-lg);
  padding-block: var(--razmak-lg) var(--razmak-md);
  border-top: 1px solid var(--linija);
}
.prijatelji__naslov {
  font-size: 1.2rem;
  text-align: center;
  margin-bottom: var(--razmak);
}

.prijatelji__okvir {
  /* Scrollable by hand until prijatelji.js clones the row; once it does, the
     overflow is hidden and the animation takes over. */
  position: relative;
  overflow-x: auto;
  scrollbar-width: none;
  --rub: clamp(1.5rem, 6vw, 5rem);
}

/* The edges fade out through two gradients painted over the strip rather than
   through mask-image on this element. A mask forces its whole subtree onto the
   main thread, and Firefox then throttles the track's transform animation to a
   standstill: the animation runs, nothing repaints, and opening devtools — which
   turns those optimisations off — is enough to make it move again. */
.prijatelji__okvir::before,
.prijatelji__okvir::after {
  content: "";
  position: absolute;
  inset-block: 0;
  width: var(--rub);
  z-index: 1;
  pointer-events: none;
}
.prijatelji__okvir::before { left: 0; background: linear-gradient(90deg, var(--pozadina), transparent); }
.prijatelji__okvir::after { right: 0; background: linear-gradient(270deg, var(--pozadina), transparent); }
.prijatelji__okvir::-webkit-scrollbar { display: none; }
.prijatelji__okvir:has(.prijatelji__traka--u-petlji) { overflow: hidden; }

.prijatelji__traka {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  width: max-content;
}

/* Spacing lives on the item, not on a flex `gap`: with a gap, the duplicated
   row is one half-gap wider than twice a single set, and translateX(-50%)
   would jump by that much on every loop. */
.prijatelj { margin-right: clamp(2rem, 6vw, 4.5rem); }
.prijatelj img {
  display: block;
  height: 46px;
  width: auto;
  max-width: none;
  object-fit: contain;
}

/* The class carries no motion of its own. prijatelji.js writes the transform
   every frame — see the note there — and handles pausing on hover and focus.
   The class exists so :has() above can switch the frame to overflow: hidden.
   Deliberately no will-change: it asks Firefox for a compositor layer the width
   of the whole doubled row, which is past the size Firefox will prerender, and
   a partially prerendered layer reads as frozen. */

/* ============================== Gallery ============================== */

.galerija__broj { color: var(--tekst-tiho); font-size: 0.9rem; }

.album { margin-top: var(--razmak-md); }
.album__naslov {
  font-size: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--akcenat);
  display: inline-block;
}

.galerija {
  list-style: none; margin: 1rem 0 0; padding: 0;
  display: grid; gap: 0.7rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 12rem), 1fr));
}

.galerija__link { display: block; text-decoration: none; }
.galerija__link img {
  width: 100%; aspect-ratio: 5 / 4; object-fit: cover; display: block;
  border-radius: var(--radijus); background: var(--pozadina-tiha);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.galerija__link:hover img { transform: scale(1.02); box-shadow: var(--senka); }

/* ============================= Lightbox ============================= */

.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
}
.lightbox[hidden] { display: none; }

.lightbox__backdrop { position: absolute; inset: 0; background: rgb(10 20 30 / 0.92); }

.lightbox__okvir {
  position: relative; margin: 0; z-index: 1;
  max-width: min(94vw, 1200px); max-height: 84vh;
  display: grid; gap: 0.6rem; justify-items: center;
}
.lightbox__slika {
  max-width: 100%; max-height: 76vh;
  object-fit: contain; border-radius: var(--radijus);
  background: #000;
}
.lightbox__opis { color: #e8eef2; font-size: 0.9rem; text-align: center; }
.lightbox__opis:empty { display: none; }

.lightbox__brojac {
  position: absolute; bottom: 1.1rem; left: 50%; transform: translateX(-50%);
  z-index: 1; margin: 0; color: #b9c6d1; font-size: 0.85rem;
}

/* The lightbox is its own dark surface in both schemes — the literals above and
   below are deliberate, not stragglers that missed the token pass. */

.lightbox button {
  position: absolute; z-index: 2;
  background: rgb(255 255 255 / 0.1);
  color: #fff; border: 0; cursor: pointer;
  border-radius: 50%;
  display: grid; place-items: center;
  transition: background 0.15s ease;
}
.lightbox button:hover { background: rgb(255 255 255 / 0.24); }
.lightbox button[hidden] { display: none; }

.lightbox__close {
  top: 1rem; right: 1rem;
  width: 2.75rem; height: 2.75rem;
  font-size: 1.9rem; line-height: 1;
}
.lightbox__prev, .lightbox__next {
  top: 50%; transform: translateY(-50%);
  width: 3.25rem; height: 3.25rem;
  font-size: 2.4rem; line-height: 1;
}
.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }

@media (max-width: 640px) {
  .lightbox__prev, .lightbox__next { width: 2.6rem; height: 2.6rem; font-size: 1.8rem; }
  .lightbox__prev { left: 0.4rem; }
  .lightbox__next { right: 0.4rem; }
}

/* ============================== Brochures ============================ */

.brosure-grid {
  display: grid; gap: 1.75rem 1.5rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  list-style: none; margin: 0 0 var(--razmak-md); padding: 0;
}
@media (max-width: 900px) { .brosure-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .brosure-grid { grid-template-columns: 1fr; } }

.brosura__link {
  display: flex; flex-direction: column; gap: 0.6rem;
  text-decoration: none; color: inherit;
}
.brosura__slika {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--linija); border-radius: 4px;
}
.brosura__naslov { font-weight: 600; color: var(--naslov); line-height: 1.35; }
.brosura__link:hover .brosura__naslov,
.brosura__link:focus-visible .brosura__naslov { text-decoration: underline; }

/* ============================== Contact ============================== */

.kontakt-grid {
  display: grid; gap: var(--razmak-md);
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: start;
}
@media (max-width: 800px) { .kontakt-grid { grid-template-columns: 1fr; } }

.kontakt-podaci {
  background: var(--pozadina-tiha);
  border: 1px solid var(--linija);
  border-top: 3px solid var(--akcenat);
  border-radius: var(--radijus);
  padding: var(--razmak);
}
.kontakt-podaci h2 { font-size: 1.05rem; margin-top: 0; }
.kontakt-podaci h3 { font-size: 0.95rem; margin-top: 1.2rem; }
.kontakt-podaci address { font-style: normal; }
.kontakt-mejlovi { list-style: none; margin: 0; padding: 0; word-break: break-word; font-size: 0.9rem; }

.kontakt-forma { margin-top: var(--razmak-lg); max-width: 42rem; }
.kontakt-forma__uvod { color: var(--tekst-tiho); }

.polje { display: grid; gap: 0.3rem; margin-block: 0 1rem; }
.polje label { font-size: 0.88rem; font-weight: 600; color: var(--naslov); }
.polje input, .polje textarea {
  font: inherit;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--linija);
  border-radius: var(--radijus);
  background: var(--povrsina); color: var(--tekst); width: 100%;
}
.polje input:focus-visible, .polje textarea:focus-visible {
  outline: 2px solid var(--akcenat); outline-offset: 1px; border-color: var(--akcenat);
}
.polje--skriveno { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.kontakt-forma button {
  font: inherit; font-weight: 700;
  background: var(--akcenat); color: var(--traka-tekst);
  border: 0; border-radius: var(--radijus);
  padding: var(--razmak-xs) 1.8rem; cursor: pointer;
}
.kontakt-forma button:hover { background: var(--akcenat-jak); }
.kontakt-forma button:disabled { opacity: 0.6; cursor: default; }

.kontakt-forma__status { font-size: 0.92rem; }
.kontakt-forma__status:empty { display: none; }
.kontakt-forma__status--greska { color: var(--crvena); }
.kontakt-forma__status--uspeh { color: var(--akcenat-jak); font-weight: 600; }
.kontakt-forma__status--radi { color: var(--tekst-tiho); }

/* ============================== Footer ============================== */

.site-footer {
  background: var(--traka);
  color: var(--traka-tekst-tiho);
  padding-block: var(--razmak-lg) 0;
  font-size: 0.92rem;
}

.site-footer__cols {
  display: grid; gap: var(--razmak);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  padding-bottom: var(--razmak-md);
}

.footer-col__heading { font-size: 1rem; color: var(--traka-tekst); margin-bottom: 0.6rem; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.footer-col a { text-decoration: none; color: var(--traka-tekst-tiho); }
.footer-col a:hover { color: var(--traka-tekst); text-decoration: underline; }
.footer-col p { margin-block: 0 0.75rem; }

.footer-contact__mail { word-break: break-word; font-size: 0.86rem; }

.site-footer__bar { border-top: 1px solid rgb(255 255 255 / 0.15); padding-block: 1rem; }
.site-footer__bar .wrap {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.site-footer__bar p { margin: 0; color: var(--traka-tekst-tise); font-size: 0.86rem; }
.site-footer__bar a { color: var(--traka-tekst-tiho); }

.greska { text-align: center; padding-block: var(--razmak-xl); }

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

  /* A deliberate exemption, on the site owner's call: the counter roll is meant
     to run for every visitor. Everything else on the page still stops.
     The sponsor strip needs no exemption — it is not a CSS animation. */
  .cifra__traka {
    transition-duration: var(--cifra-trajanje, 0s) !important;
    transition-delay: var(--cifra-kasnjenje, 0s) !important;
  }
}
