/* =========================================================================
   Sigurna, zajednicki stil za sve strane.
   Boje i fontovi su na jednom mestu. Menjaj ih ovde.
   ========================================================================= */

/* Montserrat, lokalno (fonts/), bez poziva ka Google serverima */
@font-face {
  font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/montserrat-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { /* č ć đ š ž */
  font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/montserrat-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { /* cirilica, ucitava se samo ako je ima na strani */
  font-family: "Montserrat"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("fonts/montserrat-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  /* Paleta po brendu: tekst #58595b, akcenti #491775 i #E1CBFD */
  --brand:      #491775;   /* tamna ljubicasta, dugmad, linkovi, naslovi */
  --brand-700:  #371158;   /* jos tamnija, za hover */
  --brand-mid:  #865FAB;   /* svetlija ljubicasta za podnaslove, izmedju #491775 i #E1CBFD, citljiva na pozadini */
  --brand-soft: #E1CBFD;   /* svetla ljubicasta, pozadine, hover */
  --bg:         #F6F4FA;   /* pozadina, blago lila belo */
  --surface:    #FFFFFF;   /* kartice */
  --ink:        #58595B;   /* tekst, siva */
  --muted:      #58595B;   /* sporedni tekst, ista siva */
  --line:       #E6E0F0;   /* tanke linije */
  --focus:      #491775;   /* prsten fokusa */

  /* Tipografija */
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --maxw: 960px;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* podnozje uvek na dnu ekrana, i na kratkim stranama */
  min-height: 100vh; display: flex; flex-direction: column;
}

h1, h2, h3 { font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; color: var(--brand); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-soft); color: var(--brand); }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--brand); margin: 0 0 14px;
}
/* tekst samo za citace ekrana */
.vh { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Zaglavlje ---------- */
.site-head {
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.1) blur(6px);
  position: sticky; top: 0; z-index: 50;
}
.site-head .wrap { display: flex; align-items: center; justify-content: space-between; height: 66px; gap: 12px; }

/* brend, wordmark u stilu logotipa: sans sa razmakom izmedju slova */
.brand { display: flex; align-items: center; gap: 11px; }
.brand .mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 15px;
}
.brand .word { font-weight: 600; font-size: 18px; letter-spacing: 0.18em; color: var(--brand); }

/* mala Instagram ikonica pored natpisa Sigurna */
.brand-row { display: flex; align-items: center; gap: 8px; }
.brand-ig { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 8px; color: var(--brand); }
.brand-ig:hover { background: var(--brand-soft); }
.brand-ig svg { width: 20px; height: 20px; }

.nav { display: flex; gap: 20px; align-items: center; }
.nav a { color: var(--ink); font-size: 15px; white-space: nowrap; }
.nav a[aria-current="page"] { color: var(--brand); font-weight: 600; }
.nav-toggle { display: none; }

.head-actions { display: flex; align-items: center; gap: 12px; }

/* dugme za brzo napustanje, opciono, obrisi ako ne treba (vidi komentar u HTML) */
.quick-exit {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #fff; border: none;
  padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}
.quick-exit:hover { background: var(--brand-700); }

/* ---------- Dugmad ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font: inherit; font-size: 16px; cursor: pointer;
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  padding: 11px 20px; border-radius: var(--radius);
  transition: background .15s ease, transform .1s ease;
}
.btn:hover { background: var(--brand-700); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-soft); }

/* ---------- Strane ---------- */
.page { padding: 60px 0 72px; }
.page .wrap { max-width: 720px; }
.page .wrap.wide { max-width: var(--maxw); }
.page h1 { font-size: clamp(36px, 5.5vw, 52px); margin: 0 0 10px; }
.page .kicker { color: var(--muted); font-size: 18px; margin: 0 0 34px; }
.page h2 { font-size: 22px; margin: 40px 0 12px; }
.page p { margin: 0 0 18px; }
.page ul { margin: 0 0 18px; padding-left: 20px; }
.page li { margin-bottom: 9px; }
.page li > p { margin: 0; }   /* Pages CMS stavke liste cuva kao <li><p>...</p></li> */
.page .empty { color: var(--muted); }
.page .more { margin: 22px 0 0; font-weight: 600; }

/* blokovi na strani (Media: prilozi, pa Instagram) */
.blok { margin: 0 0 48px; }
.page .blok h2 { font-size: 24px; margin: 0 0 18px; }

/* ---------- Kartice: Blog i Media (strane pravi alati/strane.mjs) ---------- */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.posts.two { grid-template-columns: repeat(2, 1fr); }
.post-card {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink);
  transition: border-color .15s ease, transform .12s ease, box-shadow .15s ease;
}
.post-card:hover { text-decoration: none; border-color: var(--brand); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(73,23,117,.10); }
.post-card .post-img { display: block; aspect-ratio: 16 / 10; background: var(--brand-soft); }
.posts.media .post-img { aspect-ratio: 16 / 9; }
.post-card .post-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.post-card .post-img.prazno { display: grid; place-items: center; }
.post-card .post-img.prazno > span:not(.play) { color: var(--brand); font-weight: 600; font-size: 15px; letter-spacing: 0.18em; }
.post-card .post-text { display: block; padding: 16px 18px 20px; }
.post-card time, .post-card .meta { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
.post-card h3 { font-size: 17px; margin: 0 0 6px; }
.post-card h3 a { color: inherit; }
.post-card .ext { font-weight: 400; }
.post-card p {
  margin: 0; font-size: 14.5px; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}

/* video iz medija: ucitava se tek na klik (site.js) */
.post-card.video .post-img { position: relative; width: 100%; padding: 0; border: 0; cursor: pointer; font: inherit; }
.post-card iframe.post-img { width: 100%; height: auto; border: 0; aspect-ratio: 16 / 9; }
.post-card .play {
  position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px;
  border-radius: 50%; background: var(--brand); box-shadow: 0 6px 18px rgba(0,0,0,.22);
}
.post-card .play::after {
  content: ""; position: absolute; left: 25px; top: 19px;
  border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff;
}
.post-card.video .post-img:hover .play { background: var(--brand-700); }

/* jedna objava na blogu */
.post .eyebrow a { color: inherit; }
.post .post-date { color: var(--muted); font-size: 15px; margin: -4px 0 26px; }
.post-cover { display: block; width: 100%; height: auto; border-radius: var(--radius); margin: 0 0 30px; }
.post-body img { max-width: 100%; height: auto; border-radius: var(--radius); }
.post-body a { text-decoration: underline; }
.post .post-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 0; }
.post .post-back { margin: 40px 0 0; font-size: 15px; }

/* ---------- Resursi: naslovna strana levo, tekst i dugmad desno ---------- */
.res-list { display: grid; gap: 18px; margin: 0 0 12px; }
.res-item {
  display: grid; grid-template-columns: 200px 1fr; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.res-item:hover { border-color: var(--brand-soft); box-shadow: 0 8px 22px rgba(73,23,117,.08); }
/* naslovna na svetloj lila podlozi, uspravna i polozena staju u isto polje */
.res-cover {
  display: grid; place-items: center; padding: 24px 22px;
  background: color-mix(in srgb, var(--brand-soft) 40%, var(--surface));
}
.res-cover:hover { text-decoration: none; }
.res-cover img {
  display: block; max-width: 100%; max-height: 200px; width: auto; height: auto;
  border-radius: 3px; box-shadow: 0 6px 16px rgba(73,23,117,.22);
  transition: transform .15s ease;
}
a.res-cover:hover img { transform: translateY(-3px); }
.res-znak { font-weight: 700; letter-spacing: .14em; color: var(--brand); }   /* kad nema naslovne */
.res-text { align-self: center; padding: 24px 26px; }
.res-item h3 { font-size: 18px; line-height: 1.35; margin: 0 0 8px; }
.res-item p { margin: 0 0 8px; }
.res-item .meta { font-size: 14px; color: var(--brand-mid); font-weight: 500; }
.res-item .res-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 0; }
.res-actions .btn { font-size: 15px; padding: 9px 18px; }

/* ---------- Adresar: podnaslovi veci i svetlije ljubicasti, ostalo sivo ---------- */
.page .adresar h2 { color: var(--brand-mid); font-size: 26px; margin: 44px 0 14px; }
.adresar li { margin-bottom: 12px; }
.adresar a { color: inherit; text-decoration: underline; text-decoration-color: var(--brand-mid); text-underline-offset: 3px; }
.adresar a:hover { color: var(--brand); }
.adresar a[href^="tel:"] { white-space: nowrap; }   /* broj telefona se ne lomi u dva reda */

/* ---------- Kontakt blok (strana O nama) ---------- */
#kontakt { scroll-margin-top: 90px; }   /* da naslov ne ode ispod zaglavlja */
.contact {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 24px; margin: 0 0 22px;
}
.contact dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 28px; margin: 0; }
.contact dt { font-weight: 600; color: var(--brand); }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Instagram ---------- */
.ig-box {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px 24px; text-align: center;
}
.ig-box p { max-width: 52ch; margin: 0 auto 18px; color: var(--muted); font-size: 15px; }
.ig-box .ig-alt { margin: 16px auto 0; font-size: 14px; }
/* embed zauzima celu sirinu polja; visina prati sirinu (zaglavlje profila + dva reda
   po tri objave), izmereno: 540px -> 583px, 864px -> 799px, pa nema skrolovanja */
.ig-frame { margin: 0 auto; container-type: inline-size; }
.ig-frame iframe { display: block; width: 100%; height: 820px; height: calc(225px + 66.7cqw); border: 0; }

/* ---------- Sia, prozor za razgovor (pravi ga site/sia.js, tekst je u site/sia-razgovor.js) ---------- */
/* dugme je uvek na istom mestu: otvara razgovor, a dok je otvoren postaje X */
.sia-dugme {
  position: fixed; right: 20px; bottom: 20px; z-index: 61;
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 56px; min-width: 56px; padding: 0 22px 0 18px;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #fff; border: 0; border-radius: 999px;
  box-shadow: 0 10px 28px rgba(73,23,117,.30);
  transition: background .15s ease;
}
.sia-dugme:hover { background: var(--brand-700); }
.sia-dugme svg { flex: none; width: 22px; height: 22px; }
.sia-dugme .i-x { display: none; }
.sia-dugme.otvoreno { width: 56px; padding: 0; }
.sia-dugme.otvoreno .i-cet, .sia-dugme.otvoreno span { display: none; }
.sia-dugme.otvoreno .i-x { display: block; }

/* prozor iznad dugmeta; nikad ne prekriva zaglavlje, da dugme za brzo napustanje ostane vidljivo */
.sia {
  position: fixed; right: 20px; bottom: 88px; z-index: 60;
  width: 390px; height: min(640px, calc(100vh - 67px - 88px - 16px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: 0 18px 50px rgba(40,10,70,.24);
  animation: sia-otvori .18s ease-out;
}
.sia[hidden] { display: none; }
.sia.odmah { animation: none; }
.sia:focus { outline: none; }
@keyframes sia-otvori { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.sia-vrh { display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 14px; background: var(--brand); color: #fff; }
.sia-lik {
  flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700;
}
.sia-ime { flex: 1; min-width: 0; margin: 0; line-height: 1.25; }
.sia-ime strong { display: block; font-size: 16px; }
.sia-ime small { display: block; font-size: 12.5px; opacity: .85; }
.sia-vrh button {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px;
  border: 0; border-radius: 8px; background: transparent; color: #fff; cursor: pointer;
}
.sia-vrh button:hover { background: rgba(255,255,255,.15); }
.sia-vrh button:focus-visible { outline-color: #fff; }
.sia-vrh svg { width: 20px; height: 20px; }

.sia-telo { position: relative; flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 16px 14px 4px; background: var(--bg); }
.sia-log { display: flex; flex-direction: column; gap: 10px; }
.sia-poruka { max-width: 88%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; animation: sia-pojava .2s ease-out; }
.sia-poruka.stara { animation: none; }
.sia-poruka p { margin: 0 0 8px; }
.sia-poruka ul { margin: 0 0 8px; padding-left: 18px; }
.sia-poruka li { margin-bottom: 5px; }
.sia-poruka > :last-child, .sia-poruka li:last-child { margin-bottom: 0; }
.sia-poruka a { text-decoration: underline; overflow-wrap: anywhere; }
.sia-poruka a[href^="tel:"] { white-space: nowrap; }
.od-sie { align-self: flex-start; background: var(--surface); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.od-tebe { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 4px; }
@keyframes sia-pojava { from { opacity: 0; transform: translateY(6px); } }

/* Sia kuca... */
.sia-kuca {
  align-self: flex-start; display: flex; gap: 5px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; border-bottom-left-radius: 4px;
}
.sia-kuca span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-mid); animation: sia-kuca 1s infinite ease-in-out; }
.sia-kuca span:nth-child(2) { animation-delay: .15s; }
.sia-kuca span:nth-child(3) { animation-delay: .3s; }
@keyframes sia-kuca { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }

/* ponudjeni odgovori, desno kao poruke korisnice */
.sia-opcije { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; padding: 12px 0; }
.sia-opcije button {
  font: inherit; font-size: 14.5px; line-height: 1.35; text-align: left; cursor: pointer;
  background: var(--surface); color: var(--brand); border: 1.5px solid var(--brand);
  border-radius: 999px; padding: 8px 14px;
}
.sia-opcije button:hover { background: var(--brand-soft); }

.sia-napomena { margin: 0; padding: 8px 14px; font-size: 12px; text-align: center; color: var(--muted); background: var(--surface); border-top: 1px solid var(--line); }
.sia-napomena a { text-decoration: underline; }

/* ---------- Podnozje ---------- */
.site-foot { margin-top: auto; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 14px; }
.foot-bar { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; padding-top: 24px; padding-bottom: 28px; }
.site-foot .nav { flex-wrap: wrap; gap: 8px 20px; }
.site-foot .nav a { color: var(--muted); font-size: 14px; }

/* logoi partnera i disklejmer, EU logo ne sme biti manji od ostalih */
.partners { padding: 40px 0 30px; border-bottom: 1px solid var(--line); }
.partners .logos { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 28px 52px; margin: 0 0 26px; }
.partners .logos img { display: block; width: auto; height: 48px; }
.partners .logos .logo-oev { height: 62px; }
.partners .logos .logo-hf  { height: 34px; }
.partners .disclaimer { max-width: 720px; margin: 0 auto; text-align: center; font-size: 13px; line-height: 1.6; }

/* ---------- Responsivno ---------- */
@media (max-width: 980px) {
  .posts { grid-template-columns: repeat(2, 1fr); }
  /* meni u zaglavlju prelazi u "hamburger" cim nema mesta za sve stavke */
  .nav { display: none; }
  .nav.show { display: flex; position: absolute; top: 66px; right: 0; left: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 24px 16px; }
  .nav.show a { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .nav-toggle { display: grid; place-items: center; background: none; border: 1px solid var(--line); border-radius: 8px; width: 40px; height: 40px; cursor: pointer; color: var(--ink); }
  .nav-toggle svg { width: 20px; height: 20px; }
}

@media (max-width: 760px) {
  .posts, .posts.two { grid-template-columns: 1fr; }
  .brand .word { letter-spacing: 0.12em; font-size: 17px; }
  .res-item { grid-template-columns: 140px 1fr; }
  .res-cover { padding: 18px 16px; }
  .res-text { padding: 18px 20px; }
  .res-item h3 { font-size: 17px; }
  .ig-box { padding: 20px 10px; }   /* na telefonu sire objave */
  .contact dl { grid-template-columns: 1fr; gap: 0; }
  .contact dd { margin: 0 0 12px; }
  .partners .logos { gap: 22px 34px; }
  .partners .logos img { height: 40px; }
  .partners .logos .logo-oev { height: 52px; }
  .partners .logos .logo-hf  { height: 28px; }
}

@media (max-width: 540px) {
  /* resursi: naslovna iznad teksta */
  .res-item { grid-template-columns: 1fr; }
  .res-cover { padding: 22px 16px; }
  .res-cover img { max-height: 230px; }
  /* Sia preko celog ekrana ispod zaglavlja; dugme (X) stoji desno u donjoj traci prozora */
  .sia { top: 67px; right: 0; bottom: 0; left: 0; width: auto; height: auto; border: 0; border-radius: 0; }
  .sia-napomena { display: flex; align-items: center; min-height: 84px; padding: 8px 84px 8px 16px; text-align: left; }
  /* na telefonu samo okrugla ikonica, natpis ostaje za citace ekrana */
  .sia-dugme { right: 14px; bottom: 14px; width: 56px; padding: 0; }
  .sia-dugme span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .sia-dugme svg { width: 26px; height: 26px; }
}

@media (max-width: 400px) {
  .head-actions { gap: 8px; }
  .quick-exit { padding: 7px 10px; font-size: 12.5px; }
  .brand .word { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Stampa ---------- */
@media print {
  .site-head, .foot-bar, .sia, .sia-dugme { display: none; }
  .site-foot, .partners { border: none; }
  .page { padding: 0; }
  body { background: #fff; }
}
