/* FKN Nastavnici — javni stil. Vizuelni jezik usklađen sa fkn.unsa.ba */
:root {
  --navy: #0d2748;
  --navy-2: #1e5288;
  --gold: #c8a04b;
  --gold-dark: #8a6a24;        /* zlatna za tekst na bijelom (kontrast ≥ 4.5:1) */
  --ink: #1b2430;
  --muted: #5a6573;
  --line: #dfe4ea;
  --bg: #ffffff;
  --bg-soft: #f4f6f9;
  --radius: 10px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 17px/1.6 var(--sans); color: var(--ink); background: var(--bg); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-2); text-underline-offset: 2px; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { font-family: var(--serif); color: var(--navy); line-height: 1.25; font-weight: 700; }
h2 { font-size: 1.45rem; margin: 0 0 .8rem; }
h3 { font-size: 1.15rem; margin: 0 0 .6rem; }
p { margin: 0 0 1rem; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--navy); padding: .5rem 1rem; z-index: 99; font-weight: 600; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.note { color: var(--muted); font-size: .92rem; font-style: italic; }

/* ---------- top bar ---------- */
.topbar { background: var(--navy); color: #fff; border-bottom: 3px solid var(--gold); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.brand { display: flex; align-items: center; gap: .75rem; color: #fff; text-decoration: none; min-width: 0; }
.brand-mark { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--gold); border-radius: 50%; font: 700 .8rem/1 var(--serif); letter-spacing: .04em; color: var(--gold); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-uni { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .75; }
.brand-fac { font: 600 .95rem/1.25 var(--serif); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lang { display: flex; gap: .25rem; flex: none; }
.lang a { color: #fff; text-decoration: none; font-weight: 600; font-size: .85rem; padding: .35rem .6rem; border-radius: 6px; border: 1px solid transparent; }
.lang a[aria-current] { border-color: var(--gold); color: var(--gold); }
.lang a:hover { background: rgba(255,255,255,.1); color: #fff; }

.demo-bar { background: #fbf6ea; color: #6b5217; border-bottom: 1px solid #e8d9b2; font-size: .9rem; font-weight: 600; padding: .55rem 0; text-align: center; }

/* ---------- hero ---------- */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: 2rem 0; }
.hero-in { display: flex; gap: 1.75rem; align-items: center; }
.avatar { flex: none; width: 140px; height: 175px; border-radius: var(--radius); overflow: hidden; border: 3px solid rgba(255,255,255,.85); background: rgba(255,255,255,.12); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-ph { display: grid; place-items: center; height: 100%; font: 700 2.6rem var(--serif); color: var(--gold); }
.hero-name { margin: 0 0 .25rem; font-size: clamp(1.6rem, 3.5vw, 2.3rem); color: #fff; }
.hero-name a { color: inherit; text-decoration: none; }
.hero-rank { margin: 0; font-size: 1.08rem; color: #e8eef6; }
.hero-sub { margin: .15rem 0 0; color: #c9d5e5; font-size: .95rem; }
.hero-func { margin: .4rem 0 0; display: inline-block; padding: .15rem .6rem; border-radius: 99px; background: var(--gold); color: var(--navy); font-weight: 600; font-size: .85rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; margin-top: 1rem; }
.ids { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.id { display: inline-block; padding: .3rem .65rem; border-radius: 6px; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.3); color: #fff; text-decoration: none; font-size: .82rem; font-weight: 600; }
.id:hover { background: #fff; color: var(--navy); }
.id-orcid::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: #a6ce39; margin-right: .4em; vertical-align: .05em; }

.btn { display: inline-block; padding: .55rem 1.1rem; border-radius: 8px; background: var(--navy); color: #fff; text-decoration: none; font-weight: 600; font-size: .92rem; border: 0; cursor: pointer; font-family: inherit; }
.btn:hover { background: var(--navy-2); color: #fff; }
.btn-gold { background: var(--gold); color: var(--navy); }
.btn-gold:hover { background: #d9b465; color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border: 1px solid var(--line); }

/* ---------- person nav ---------- */
.pnav { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.pnav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.pnav a { display: block; padding: .9rem .85rem; color: var(--ink); text-decoration: none; font-weight: 600; font-size: .93rem; border-bottom: 3px solid transparent; }
.pnav a:hover { color: var(--navy-2); }
.pnav a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--gold); }
.pnav-toggle { display: none; }

/* ---------- layout ---------- */
.main { padding-top: 2rem; padding-bottom: 3rem; min-height: 40vh; }
.section { margin-bottom: 2.25rem; }
.grid-home { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 2.5rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.card { background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.card-h { font-size: 1.05rem; margin: 0 0 .75rem; padding-bottom: .5rem; border-bottom: 2px solid var(--gold); display: inline-block; }
.page-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .75rem 1.5rem; margin-bottom: 1.5rem; border-bottom: 1px solid var(--line); padding-bottom: .75rem; }
.page-title { margin: 0; font-size: 1.75rem; }
.prose { max-width: 72ch; }
.more { font-weight: 600; text-decoration: none; }
.more:hover { text-decoration: underline; }
.callout { background: #fbf6ea; border-left: 4px solid var(--gold); padding: .75rem 1rem; border-radius: 0 8px 8px 0; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.chips li { padding: .35rem .8rem; border-radius: 99px; background: #eaf0f7; color: var(--navy); font-size: .9rem; font-weight: 500; }

.plain { list-style: none; padding: 0; margin: 0 0 .75rem; }
.plain li { padding: .3rem 0; border-bottom: 1px dashed var(--line); }
.news { list-style: none; padding: 0; margin: 0 0 .75rem; }
.news li { padding: .45rem 0; border-bottom: 1px dashed var(--line); font-size: .93rem; line-height: 1.45; }
.news time, .news .muted { display: block; font-size: .8rem; color: var(--muted); }

.contact { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; font-size: .95rem; }
.contact dt { font-weight: 600; color: var(--muted); }
.contact dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- publications ---------- */
.pubs { list-style: none; padding: 0; margin: 0 0 1rem; }
.pub { padding: .85rem 0; border-bottom: 1px solid var(--line); }
.pub-cite { line-height: 1.55; }
.pub-meta { color: var(--muted); font-size: .88rem; }
.pub-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.tag { font-size: .76rem; padding: .12rem .5rem; border-radius: 4px; background: #eef1f5; color: var(--muted); }
.tag-idx { background: #fbf6ea; color: var(--gold-dark); }
.pill { font: 600 .76rem/1.4 var(--sans); padding: .14rem .55rem; border-radius: 4px; border: 1px solid var(--navy-2); color: var(--navy-2); background: #fff; text-decoration: none; cursor: pointer; }
.pill:hover { background: var(--navy-2); color: #fff; }
.pub-abs summary { cursor: pointer; font-size: .85rem; color: var(--navy-2); margin-top: .35rem; }
.counts { list-style: none; padding: 0; margin: 0 0 1.25rem; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.counts li { color: var(--muted); font-size: .92rem; }
.counts span { font: 700 1.25rem var(--serif); color: var(--navy); }
.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; align-items: end; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1rem; margin-bottom: 1.5rem; }
.filters label { display: flex; flex-direction: column; gap: .25rem; font-size: .8rem; font-weight: 600; color: var(--muted); }
.filters select, .f-search input { font: inherit; font-size: .95rem; padding: .45rem .6rem; border: 1px solid #c4ccd6; border-radius: 6px; background: #fff; color: var(--ink); min-width: 140px; }
.f-search { flex: 1 1 220px; }
.f-search input { width: 100%; }
.year-h { font-size: 1.3rem; color: var(--navy-2); border-bottom: 2px solid var(--gold); display: inline-block; padding-bottom: .1rem; margin-top: .5rem; }

.dlg { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; width: min(640px, 92vw); }
.dlg::backdrop { background: rgba(13,39,72,.45); }
.dlg textarea { width: 100%; font: .88rem/1.45 ui-monospace, Consolas, monospace; border: 1px solid var(--line); border-radius: 6px; padding: .6rem; }
.dlg-actions { display: flex; justify-content: flex-end; gap: .5rem; margin-top: .75rem; }

/* ---------- CV / timeline ---------- */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.tl-date { color: var(--gold-dark); font-weight: 600; font-size: .92rem; }
.tl-inst { display: block; color: var(--muted); font-size: .93rem; }
.tl-body p { margin: .3rem 0 0; font-size: .95rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: .95rem; }
.tbl th, .tbl td { text-align: left; padding: .6rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl thead th { background: var(--bg-soft); color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.tbl tbody th { font-weight: 600; color: var(--navy); }
.tbl .links { white-space: nowrap; }

/* ---------- projects / media ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.proj h3 { margin-bottom: .75rem; }
.meta { display: grid; grid-template-columns: auto 1fr; gap: .25rem .9rem; font-size: .92rem; margin: 0 0 .75rem; }
.meta dt { color: var(--muted); font-weight: 600; }
.meta dd { margin: 0; }
.media-list { list-style: none; padding: 0; margin: 0; }
.media-item { display: flex; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.media-thumb { flex: none; width: 160px; border-radius: 6px; overflow: hidden; }
.media-meta { margin: 0 0 .2rem; color: var(--muted); font-size: .85rem; }
.media-title { margin: 0; font-weight: 600; }

/* ---------- directory ---------- */
.dir-head { align-items: end; }
.dir-search { flex: 0 1 300px; }
.staff { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.staff a { display: flex; gap: 1rem; align-items: center; padding: .9rem; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--ink); background: #fff; height: 100%; transition: border-color .15s, box-shadow .15s; }
.staff a:hover { border-color: var(--gold); box-shadow: 0 4px 14px rgba(13,39,72,.08); }
.staff-av { flex: none; width: 64px; height: 80px; border-radius: 6px; overflow: hidden; background: var(--navy); display: grid; place-items: center; color: var(--gold); font: 700 1.3rem var(--serif); }
.staff-av img { width: 100%; height: 100%; object-fit: cover; }
.staff-txt { display: flex; flex-direction: column; font-size: .92rem; line-height: 1.35; }
.staff-txt strong { font-family: var(--serif); color: var(--navy); font-size: 1.02rem; margin-bottom: .15rem; }
.notfound { text-align: center; padding: 3rem 0; }
.notfound h1 { font-size: 4rem; margin: 0; }

/* ---------- footer ---------- */
.footer { background: var(--navy); color: #c9d5e5; font-size: .9rem; padding: 2rem 0; margin-top: 2rem; }
.footer strong { color: #fff; }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem; }
.footer-links { display: flex; flex-direction: column; gap: .3rem; }
.footer a { color: #fff; }
.footer-upd { align-self: end; font-size: .82rem; opacity: .8; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid-home { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .brand-fac { white-space: normal; font-size: .85rem; }
  .brand-uni { display: none; }
  .hero { padding: 1.5rem 0; }
  .hero-in { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .avatar { width: 112px; height: 140px; }
  .pnav-toggle { display: block; width: 100%; text-align: left; padding: .85rem 0; background: none; border: 0; font: 600 1rem var(--sans); color: var(--navy); cursor: pointer; }
  .pnav-toggle::after { content: " ▾"; }
  .pnav ul { display: none; flex-direction: column; padding-bottom: .5rem; }
  .pnav.open ul { display: flex; }
  .pnav a { padding: .6rem 0; border-bottom: 0; border-left: 3px solid transparent; padding-left: .6rem; }
  .pnav a[aria-current="page"] { border-left-color: var(--gold); }
  .timeline li { grid-template-columns: 1fr; gap: .2rem; }
  .media-thumb { width: 110px; }
  .tbl thead { display: none; }
  .tbl, .tbl tbody, .tbl tr, .tbl th, .tbl td { display: block; width: 100%; }
  .tbl tr { border: 1px solid var(--line); border-radius: 8px; margin-bottom: .75rem; padding: .4rem .2rem; }
  .tbl th, .tbl td { border: 0; padding: .25rem .6rem; }
  .tbl td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); font-size: .82rem; font-weight: 600; }
  .tbl td:empty { display: none; }
}

/* ---------- print (CV) ---------- */
@media print {
  .topbar, .pnav, .footer, .filters, .hero-actions .btn, .skip, .pill, .dlg, .lang { display: none !important; }
  .hero { background: none; color: #000; padding: 0 0 1rem; border-bottom: 2px solid #000; }
  .hero-name, .hero-rank, .hero-sub { color: #000; }
  .ids .id { color: #000; border-color: #999; background: none; }
  body { font-size: 11pt; }
  a { color: #000; text-decoration: none; }
  .grid-home { display: block; }
  .card { border: 0; padding: 0; background: none; }
  .section { break-inside: avoid-page; }
}

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