/* Jure Ravnik – osebna spletna stran */

:root {
  --bg: #f7f8f9;
  --surface: #ffffff;
  --text: #1c2329;
  --muted: #5b6770;
  --border: #dde3e7;
  --accent: #006385;
  --accent-soft: #e3f0f5;
  --accent-text: #ffffff;
  --link: #00648a;
  --shadow: 0 1px 2px rgba(16, 24, 32, .06), 0 2px 8px rgba(16, 24, 32, .04);
  --radius: 10px;
  --maxw: 1000px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12171b;
    --surface: #1a2126;
    --text: #e4e9ec;
    --muted: #9aa7b0;
    --border: #2b353c;
    --accent: #3fa9cf;
    --accent-soft: #1b3440;
    --accent-text: #0b1418;
    --link: #6cc3e3;
    --shadow: none;
  }
}

* { box-sizing: border-box; }

/* "hidden" must win over display rules (e.g. ol.papers > li is display:flex) */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- header ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; min-height: 60px; padding-top: 8px; padding-bottom: 8px;
}
.brand {
  font-weight: 650; font-size: 1.1rem; color: var(--text); text-decoration: none;
  letter-spacing: .01em;
}
.brand span { color: var(--accent); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--muted); padding: 6px 12px; border-radius: 6px;
  font-size: .95rem; font-weight: 500;
}
.nav a:hover { color: var(--text); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

/* ---------- banner ---------- */
.banner {
  margin: 24px 0 0; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--border); line-height: 0;
  background: var(--accent-soft);
}
.banner img {
  display: block; width: 100%; height: clamp(72px, 13vw, 128px);
  object-fit: cover; object-position: center;
}
.banner + .profile { margin-top: 20px; }

/* ---------- profile ---------- */
.profile {
  display: flex; gap: 24px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px; margin: 28px 0;
}
.profile img {
  width: 150px; height: 150px; object-fit: cover; border-radius: 8px; flex: none;
  border: 1px solid var(--border); background: var(--accent-soft);
}
.profile.compact { padding: 16px 20px; gap: 18px; align-items: center; }
.profile.compact img { width: 84px; height: 84px; }
.profile h1, .profile h2 { margin: 0 0 4px; font-size: 1.5rem; line-height: 1.25; }
.profile.compact h2 { font-size: 1.2rem; }
.profile .role { margin: 0 0 10px; color: var(--muted); }
.profile.compact .role { margin-bottom: 2px; }
.profile ul.contact { list-style: none; margin: 0; padding: 0; font-size: .95rem; }
.profile ul.contact li { margin: 2px 0; }
.profile ul.contact b { font-weight: 600; color: var(--muted); }
.profile .about { margin: 14px 0 0; }
.profile blockquote, .profile cite { color: var(--muted); }

/* ---------- content ---------- */
main { padding-bottom: 40px; }
.page-title { font-size: 1.9rem; line-height: 1.2; margin: 8px 0 4px; }
.lead { color: var(--muted); margin: 0 0 20px; }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 24px; margin: 0 0 20px;
}
.card > h2:first-child { margin-top: 0; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 28px 0 12px; }
h3 { font-size: 1.05rem; margin: 20px 0 6px; }
ul { padding-left: 1.3em; }
li { margin: 4px 0; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; padding: 0; list-style: none; }
.toc a {
  display: inline-block; text-decoration: none; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .92rem;
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }

/* home page tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 0 0 28px; }
.tile {
  display: block; text-decoration: none; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.tile h2 { margin: 0 0 6px; color: var(--accent); font-size: 1.2rem; }
.tile p { margin: 0; color: var(--muted); }

.links { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.links a {
  display: inline-block; padding: 6px 14px; border-radius: 999px; text-decoration: none;
  border: 1px solid var(--border); color: var(--text); font-size: .92rem; background: var(--surface);
}
.links a:hover { border-color: var(--accent); color: var(--accent); }

/* search box */
.search {
  width: 100%; padding: 10px 14px; font: inherit; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; margin: 0 0 16px;
}
.search:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.no-results { color: var(--muted); font-style: italic; }

/* ---------- exam results ---------- */
details.year {
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  margin: 0 0 8px; box-shadow: var(--shadow);
}
details.year > summary {
  cursor: pointer; padding: 10px 16px; font-weight: 600; font-size: 1.05rem;
  list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
details.year > summary::-webkit-details-marker { display: none; }
details.year > summary::after { content: "▸"; color: var(--muted); transition: transform .15s; }
details.year[open] > summary::after { transform: rotate(90deg); }
details.year > summary .count { font-weight: 400; color: var(--muted); font-size: .88rem; margin-left: auto; }
details.year > ul { margin: 0; padding: 4px 16px 12px 36px; }
details.year > ul li { margin: 3px 0; }

details.rules > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details.rules[open] > summary { margin-bottom: 8px; }

/* ---------- papers ---------- */
ol.papers { list-style: none; padding: 0; margin: 0; counter-reset: paper; }
ol.papers > li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: var(--shadow); padding: 14px 16px; margin: 0 0 10px;
}
ol.papers .cite { flex: 1; min-width: 0; overflow-wrap: anywhere; }
a.pdf {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 40px; border-radius: 6px; text-decoration: none;
  background: var(--accent); color: var(--accent-text); font-weight: 700; font-size: .8rem; letter-spacing: .04em;
}
a.pdf:hover { filter: brightness(1.12); }
.note { color: var(--muted); font-size: .92rem; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: .9rem; padding: 20px 0 28px; }
.site-footer p { margin: 2px 0; }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .profile { flex-direction: column; gap: 14px; padding: 18px; }
  .profile.compact { flex-direction: row; }
  .profile img { width: 120px; height: 120px; }
  .profile.compact img { width: 64px; height: 64px; }
  .card { padding: 16px; }
  .page-title { font-size: 1.55rem; }
  ol.papers > li { padding: 12px; gap: 10px; }
  a.pdf { width: 44px; height: 36px; }
}

@media print {
  .site-header, .search, .toc, .site-footer { display: none; }
  details.year { break-inside: avoid; }
}
