/* computing.matf.bg.ac.rs: the department's burgundy, warm paper background, gold accents, serif
   headings. Phones first; wider screens add columns (40rem: calendar column, 48rem: header in
   one row, 62rem: side column on the home page). */

:root {
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-head: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --page: 74rem;
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --radius: .75rem;

  --brand-bg: linear-gradient(120deg, #8e1818 0%, #741522 55%, #561019 100%);
  --on-brand: #fff;
  --on-brand-muted: #f2d3d0;
  --on-brand-pill: rgb(255 255 255 / .12);
  --on-brand-pill-hover: rgb(255 255 255 / .24);

  --accent: #e0a63a;          /* gold: header rule, heading bars, current year, upcoming */
  --on-accent: #2e1a00;
  --focus: #e0a63a;

  --bg: #f7f2ec;
  --surface: #fff;
  --card-line: #eadcd2;
  --shadow: 0 1px 2px rgb(80 30 20 / .05), 0 6px 18px -8px rgb(80 30 20 / .18);
  --text: #2b2224;
  --muted: #6e6062;
  --heading: #7c1620;
  --title: #7c1620;
  --date: #8d5a1d;
  --link: #9e1d28;
  --link-line: #dcaaa9;
  --tint: #f1e5dd;

  --chip: #f4e7df;
  --chip-hover: #ecd6ca;
  --chip-text: #7c1620;

  --cal-top: #8e1818;
  --on-cal-top: #fff;
  --cal-bg: #fffaf2;
  --cal-text: #5a1018;
  --cal-line: #ecd9cc;
  --abstract-bg: #fbf5ef;

  --footer-bg: #3b0c11;
  --footer-text: #f0d9d6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --brand-bg: linear-gradient(120deg, #5e1016 0%, #4a0d14 60%, #33090e 100%);
    --on-brand-muted: #e6c3c0;
    --bg: #191213;
    --surface: #241a1b;
    --card-line: #3a2b2c;
    --shadow: none;
    --text: #eee3e1;
    --muted: #b5a5a4;
    --heading: #f0b8b4;
    --title: #f3c2bd;
    --date: #e2b46e;
    --link: #f39b95;
    --link-line: #8a4a4a;
    --tint: #2c2021;
    --chip: #362425;
    --chip-hover: #46302f;
    --chip-text: #f6c9c4;
    --cal-top: #a3222b;
    --cal-bg: #2e2223;
    --cal-text: #f6dcd8;
    --cal-line: #46302f;
    --abstract-bg: #2c2122;
    --footer-bg: #120b0c;
    --footer-text: #c9b3b1;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1rem/1.6 var(--font);
  overflow-wrap: break-word;          /* long URLs in abstracts never widen the page */
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-color: var(--link-line); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.skriven { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.preskoci { position: absolute; left: .5rem; top: -3rem; z-index: 5; padding: .5rem .9rem; border-radius: .4rem;
  background: var(--surface); color: var(--link); font-weight: 700; }
.preskoci:focus { top: .5rem; }
h1, h2 { font-family: var(--font-head); color: var(--heading); line-height: 1.2; font-weight: 700; }
h2 { position: relative; font-size: 1.3rem; margin: 2.25rem 0 1rem; padding-bottom: .4rem; }
h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 2.4rem; height: 3px; border-radius: 2px; background: var(--accent); }

/* ---------- header ---------- */
.zaglavlje { background: var(--brand-bg); color: var(--on-brand); border-bottom: 4px solid var(--accent); }
.zaglavlje .unutra {
  max-width: var(--page); margin: 0 auto; padding: .85rem var(--gutter);
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .6rem .9rem; align-items: center;
}
.grb img { display: block; width: 42px; }
.ime p { margin: 0; }
.ustanova { font-size: .78rem; letter-spacing: .02em; color: var(--on-brand-muted); }
.ustanova a { color: inherit; text-decoration: none; font-weight: 600; }
.ustanova a:hover { text-decoration: underline; }
.ustanova span::before { content: "· "; }
.seminar { font: 700 1.08rem/1.25 var(--font-head); letter-spacing: .005em; }
.seminar a { color: var(--on-brand); text-decoration: none; }
.meni { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: .4rem; }
.meni a {
  color: var(--on-brand); text-decoration: none; font-size: .9rem; font-weight: 600;
  padding: .32rem .8rem; border-radius: 99px; background: var(--on-brand-pill);
}
.meni a:hover { background: var(--on-brand-pill-hover); }
.meni .jezik { background: none; box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / .45); }
.meni .jezik:hover { background: var(--on-brand-pill); }
@media (min-width: 48rem) {
  .zaglavlje .unutra { grid-template-columns: auto minmax(0, 1fr) auto; padding-block: 1.1rem; column-gap: 1.1rem; }
  .grb img { width: 54px; }
  .seminar { font-size: 1.45rem; }
  .ustanova { font-size: .82rem; }
  .meni { grid-column: auto; justify-content: flex-end; }
}

/* ---------- page ---------- */
main { max-width: var(--page); margin: 0 auto; padding: 1.5rem var(--gutter) 3.5rem; }
.raspored { display: grid; gap: 0 2.75rem; }
.glavno > section:first-child > h2, .strana > section:first-child > h2 { margin-top: .25rem; }
@media (min-width: 62rem) {
  .raspored { grid-template-columns: minmax(0, 1fr) 18.5rem; }
}
.prazno { margin: 0; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--tint); color: var(--muted); }
.dalje { margin: 1rem 0 0; font-weight: 600; }
.strana p { margin: 0 0 .8rem; }
.strana #o-seminaru { font-size: .95rem; }

/* ---------- one academic year ---------- */
.naslov-godine { margin: .25rem 0 1.5rem; }
.naslov-godine h1 { margin: 0; font-size: clamp(1.55rem, 1.2rem + 1.6vw, 2.2rem); }
.podnaslov { margin: .3rem 0 .9rem; color: var(--muted); }
.susedne { display: flex; flex-wrap: wrap; gap: .45rem; }
.susedne a, .godine a {
  display: inline-block; padding: .3rem .75rem; border-radius: 99px; text-decoration: none;
  font-weight: 600; font-size: .9rem; font-variant-numeric: tabular-nums;
  background: var(--chip); color: var(--chip-text);
}
.susedne a:hover, .godine a:hover { background: var(--chip-hover); }
.arhiva h2 { margin-top: 3rem; }

/* ---------- archive: all years ---------- */
.godine { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.godine a[aria-current] { background: var(--accent); color: var(--on-accent); }

/* ---------- meetings ---------- */
.sastanci { display: grid; gap: 1rem; }
.sastanci article {
  position: relative; min-width: 0;
  background: var(--surface); border: 1px solid var(--card-line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: .95rem 1rem 1rem;
}
.sastanci article > * { margin: 0; }
.sastanci article > * + * { margin-top: .55rem; }
.sastanci article > .kalendar + * { margin-top: 0; }
.sastanci article > .najava + * { margin-top: 0; }
/* the next talk of the same meeting */
.sastanci article > details + p:not(.prilozi), .sastanci article > .prilozi + p {
  border-top: 1px dashed var(--card-line); padding-top: .75rem; margin-top: .85rem;
}

/* calendar sheet: month on top, big day, year below. Phones: in the corner, the date line flows
   around it; wider screens: a column of its own. */
.sastanci article > .kalendar {
  float: left; width: 2.9rem; margin: .15rem .85rem .45rem 0;
  display: flex; flex-direction: column; align-items: stretch; text-align: center; line-height: 1;
  border-radius: .45rem; overflow: hidden; background: var(--cal-bg); color: var(--cal-text);
  box-shadow: 0 0 0 1px var(--cal-line);
}
.kalendar .mesec { order: -1; background: var(--cal-top); color: var(--on-cal-top); font-size: .62rem;
  font-weight: 700; text-transform: uppercase; letter-spacing: .08em; padding: .22rem 0 .18rem; }
.kalendar .dan { font: 700 1.3rem/1 var(--font-head); padding: .28rem 0 .1rem; }
.kalendar .god { font-size: .6rem; padding-bottom: .3rem; opacity: .8; font-variant-numeric: tabular-nums; }
@media (min-width: 40rem) {
  .sastanci article { padding: 1.1rem 1.35rem 1.15rem 5.6rem; }
  .sastanci article > .kalendar { float: none; position: absolute; left: 1.1rem; top: 1.15rem; width: 3.4rem; margin: 0; }
  .kalendar .dan { font-size: 1.55rem; }
  .kalendar .mesec { font-size: .68rem; }
  .kalendar .god { font-size: .66rem; }
}

/* upcoming */
.najava {
  position: absolute; right: .9rem; top: -.7rem;
  background: var(--accent); color: var(--on-accent);
  font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: .18rem .6rem; border-radius: 99px;
}
.sastanci article[data-najava] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), var(--shadow); }

/* date, time and place; speaker; title; kind of talk */
.sastanci article h3 { font: 600 .88rem/1.45 var(--font); color: var(--date); letter-spacing: .005em; }
.sastanci article > p > b { color: var(--title); font-size: 1.04em; }
.sastanci article > p { line-height: 1.55; }

/* abstract: a button that opens a tinted panel */
.sastanci details { border-radius: calc(var(--radius) - .2rem); }
.sastanci details[open] { background: var(--abstract-bg); padding: 0 .95rem .6rem; margin-left: -.1rem; }
.sastanci details[open] > summary { margin: .55rem 0 .15rem -.85rem; }
summary {
  display: inline-flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none;
  padding: .28rem .8rem .28rem .7rem; border-radius: 99px; font-size: .88rem; font-weight: 700;
  background: var(--chip); color: var(--chip-text); user-select: none;
}
summary::-webkit-details-marker { display: none; }
summary::before {
  content: ""; width: .42em; height: .42em; border: solid currentColor; border-width: 0 .14em .14em 0;
  transform: translateY(-.05em) rotate(-45deg); transition: transform .15s;
}
details[open] > summary::before { transform: translateY(-.12em) rotate(45deg); }
summary:hover { background: var(--chip-hover); }
details > p, details > ul, details > ol, details > table { margin: .6rem 0 0; }
details ul, details ol { padding-left: 1.3rem; }
details hr { border: 0; border-top: 1px solid var(--card-line); margin: .8rem 0; }
details code { font-size: .85em; overflow-wrap: anywhere; }
details .formula { text-align: center; }
details math[display="block"] { margin: .7rem 0; overflow-x: auto; overflow-y: hidden; }
details .napomena { font-size: .85em; color: var(--muted); }
details table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
details th, details td { border: 1px solid var(--card-line); padding: .25rem .6rem; text-align: center; }
details th { font-weight: 600; }

/* abstract files, slides, photos */
.prilozi { display: flex; flex-wrap: wrap; gap: .4rem; }
.prilozi a {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .28rem .8rem; border-radius: 99px; font-size: .88rem; font-weight: 700;
  background: var(--chip); color: var(--chip-text); text-decoration: none;
}
.prilozi a:hover { background: var(--chip-hover); }
.prilozi a[href$=".pdf" i]::after, .prilozi a[href$=".txt" i]::after, .prilozi a[href$=".jpg" i]::after,
.prilozi a[href$=".pps" i]::after, .prilozi a[href$=".php" i]::after {
  font-size: .68em; font-weight: 700; letter-spacing: .04em; opacity: .7;
}
.prilozi a[href$=".pdf" i]::after { content: "PDF"; }
.prilozi a[href$=".txt" i]::after, .prilozi a[href$=".php" i]::after { content: "TXT"; }
.prilozi a[href$=".jpg" i]::after { content: "JPG"; }
.prilozi a[href$=".pps" i]::after { content: "PPS"; }

/* a photo next to the text */
.slika { float: right; width: min(40%, 13rem); margin: .2rem 0 .5rem 1rem; border-radius: .4rem; }
.sastanci article::after { content: ""; display: block; clear: both; }

/* ---------- footer ---------- */
.podnozje { background: var(--footer-bg); color: var(--footer-text); font-size: .88rem; }
.podnozje .unutra { max-width: var(--page); margin: 0 auto; padding: 1.25rem var(--gutter); }
.podnozje p { margin: 0; }
.podnozje a { color: inherit; }

@media print {
  .zaglavlje, .podnozje { background: none; color: #000; border: 0; }
  .zaglavlje a, .podnozje a { color: #000; }
  .meni, .preskoci { display: none; }
  .sastanci article { box-shadow: none; break-inside: avoid; }
}
