/*
 * Катедра за математику — shared site theme.
 * Academic palette: ink navy, deep teal, warm gold and pale mineral surfaces.
 * Serif display headings; Cyrillic-safe system sans for information and controls.
 */
:root {
  --navy: #142f49;
  --ink: #233b48;
  --text-muted: #4b606a;
  --text-subtle: #536873;
  --accent: #096b70;
  --accent-strong: #075054;
  --accent-soft: #e4f2ee;
  --gold: #efc477;
  --gold-soft: #fbf2df;
  --on-dark: #dcece9;
  --surface: #ffffff;
  --surface-alt: #f2f6f4;
  --line: #d5e2df;
  --line-strong: #718c90;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 6px 22px -12px rgb(20 47 73 / 22%);
  --container: 1120px;
  --measure: 68ch;
  --header-h: 68px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

main[id],
main [id] {
  scroll-margin-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  color: var(--ink);
  background: #fafbf8;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

img,
svg {
  max-width: 100%;
}

img {
  display: block;
  height: auto;
}

h1,
h2,
h3,
h4 {
  color: var(--navy);
  line-height: 1.25;
  overflow-wrap: break-word;
  hyphens: auto;
}

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--accent-strong);
  text-decoration-thickness: 2px;
}

button,
input,
select,
textarea {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

[hidden],
html [hidden],
html body [hidden] {
  display: none !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.65rem 1rem;
  color: #fff;
  background: var(--navy);
  border-radius: var(--radius);
  font-weight: 600;
  transform: translateY(-200%);
}

.skip-link:focus {
  color: #fff;
  transform: none;
}

.container {
  width: min(calc(100% - 2rem), var(--container));
  margin-inline: auto;
}

/* Header + navigation */
.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  color: var(--navy);
  background: var(--surface);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 16px rgb(20 47 73 / 6%);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  color: var(--navy);
  text-decoration: none;
}

.brand:hover {
  color: var(--navy);
}

.brand-seal {
  width: 44px;
  height: auto;
  flex: 0 0 auto;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #fff;
  background: var(--accent);
  border-radius: var(--radius);
  box-shadow: 3px 3px 0 var(--gold);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.brand-text {
  display: grid;
  min-width: 0;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 1rem;
  font-weight: 700;
}

.brand-text span {
  color: var(--text-subtle);
  font-size: 0.78rem;
}

.nav-toggle {
  width: 44px;
  height: 44px;
  display: none;
  place-items: center;
  align-content: center;
  flex: 0 0 auto;
  padding: 0;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  width: 20px;
  height: 2px;
  display: block;
  content: "";
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle span {
  margin-block: 4px;
}

.nav-toggle[aria-expanded="true"] span {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"]::before {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"]::after {
  transform: translateY(-6px) rotate(-45deg);
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: 0.65rem 0.65rem;
  color: var(--ink);
  border-bottom: 2px solid transparent;
  border-radius: 6px 6px 0 0;
  font-size: 0.93rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--line-strong);
}

.site-nav a[aria-current="page"] {
  color: var(--navy);
  border-bottom-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

/* Display surfaces */
.hero {
  color: var(--on-dark);
  background:
    linear-gradient(90deg, transparent 98%, rgb(255 255 255 / 3%) 98%) 0 0 / 64px 64px,
    linear-gradient(0deg, transparent 98%, rgb(255 255 255 / 3%) 98%) 0 0 / 64px 64px,
    linear-gradient(115deg, #142f49 35%, #0c555b 100%);
  border-bottom: 5px solid var(--gold);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(0, 0.85fr);
  align-items: center;
  gap: clamp(1.75rem, 5vw, 3.5rem);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero-grid > :only-child {
  grid-column: 1 / -1;
  max-width: 50rem;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1 {
  max-width: 30ch;
  margin: 0;
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.5vw, 3.75rem);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.lead {
  max-width: 60ch;
  margin: 1rem 0 0;
  color: var(--text-muted);
  font-size: clamp(1.03rem, 1.6vw, 1.15rem);
}

.hero .lead {
  color: var(--on-dark);
}

.hero .eyebrow,
.page-hero .eyebrow {
  color: var(--gold);
}

.hero .small a {
  color: var(--on-dark);
}

.hero :focus-visible,
.page-hero :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--gold);
}

.hero-summary,
.formula-card {
  padding: 1.4rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.hero-summary h2,
.hero-summary h3 {
  margin: 0 0 0.6rem;
  font-size: 1.05rem;
}

.hero-summary p,
.formula-card p {
  margin: 0;
  color: var(--text-muted);
}

.hero-summary ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

.hero-summary li + li {
  margin-top: 0.35rem;
}

.hero-summary {
  padding: 1.5rem;
  border: 0;
  border-top: 4px solid var(--gold);
  box-shadow: 0 20px 50px rgb(0 0 0 / 15%);
  font-size: 0.97rem;
}

.mathematical-artwork {
  display: block;
  width: 192px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.25rem;
}

.hero-summary a {
  font-weight: 600;
}

.hero-summary :focus-visible {
  outline-color: var(--accent);
}

.hero-summary > * + *,
.formula-card > * + * {
  margin-top: 0.75rem;
}

/* Intro text, then a compact list of quick links separated by a hairline */
.hero-summary > p:first-of-type:not(:only-of-type) {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--line);
}

.hero-summary > p + p {
  margin-top: 0.45rem;
}

.hero-summary > p:first-of-type + p {
  margin-top: 0.75rem;
}

/* Archive compatibility: retired formula imagery stays quiet if present */
.formula-card .formula-label {
  color: var(--text-subtle);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.formula-card .formula {
  color: var(--navy);
  font-size: 1.15rem;
}

.formula-card .formula sub,
.formula-card .formula sup {
  font-size: 0.65em;
}

.hero-figure {
  display: block;
  width: 100%;
  height: auto;
  color: var(--accent);
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.6rem;
}

.button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  max-width: 100%;
  padding: 0.6rem 1.15rem;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.button:hover {
  color: #fff;
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  text-decoration: none;
}

.button-secondary,
.banner .button-secondary {
  color: var(--accent);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-secondary:hover,
.banner .button-secondary:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: var(--accent);
}

.hero .button:not(.button-secondary) {
  flex-basis: 100%;
  justify-content: flex-start;
  text-align: left;
  color: var(--navy);
  background: var(--gold);
  border-color: var(--gold);
}

.hero .button:not(.button-secondary):hover {
  background: #f9d99f;
  border-color: #f9d99f;
}

.hero .button-secondary {
  color: #fff;
  background: transparent;
  border-color: #88aaa9;
}

.hero .button-secondary:hover {
  color: var(--navy);
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

/* Sections */
.section {
  padding-block: clamp(2.5rem, 6vw, 4rem);
}

.section-alt {
  background: var(--surface-alt);
  border-block: 1px solid var(--line);
}

.section-alt + .section-alt {
  border-top: 0;
}

/* Kept for compatibility; intentionally a quiet tinted band, not a dark surface */
.section-dark {
  background: var(--accent-soft);
  border-block: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 1.75rem;
}

.section-heading h2 {
  margin: 0 0 0.6rem;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  font-weight: 700;
  letter-spacing: -0.005em;
}

.section-heading p {
  max-width: var(--measure);
  margin: 0;
  color: var(--text-muted);
}

.section-heading .eyebrow {
  margin-bottom: 0.4rem;
  color: var(--accent);
}

/* Grids + cards */
.grid {
  display: grid;
  gap: 1.25rem;
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card {
  min-width: 0;
  padding: 1.35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0.35rem 0 0.4rem;
  font-size: 1.12rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
}

.card p + p,
.card ul {
  margin-top: 0.6rem;
}

.card ul {
  margin-bottom: 0;
  padding-left: 1.15rem;
  color: var(--text-muted);
}

.card-number {
  display: block;
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.1;
}

.icon-box {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Link cards */
.section-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 1rem;
}

.section-links a {
  display: grid;
  align-content: start;
  gap: 0.3rem;
  min-width: 0;
  padding: 1.1rem 1.2rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.section-links a:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px -12px rgb(9 107 112 / 35%);
}

.section-links strong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  color: var(--navy);
  font-size: 1.02rem;
  line-height: 1.3;
}

.section-links strong::after {
  flex: 0 0 auto;
  content: "\2192";
  color: var(--accent);
  transition: transform 0.15s ease;
}

.section-links a:hover strong {
  color: var(--accent-strong);
}

.section-links a:hover strong::after {
  transform: translateX(3px);
}

.section-links span {
  color: var(--text-muted);
  font-size: 0.93rem;
}

/* Interior page heading */
.page-hero {
  padding-block: clamp(2.25rem, 5vw, 3.25rem);
  background: linear-gradient(115deg, var(--navy) 40%, #0c555b);
  border-bottom: 4px solid var(--gold);
}

.page-hero p {
  max-width: var(--measure);
  margin: 0.85rem 0 0;
  color: var(--on-dark);
  font-size: 1.05rem;
}

.page-hero .eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.8rem;
}

.page-hero .section-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.page-hero .section-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.6rem 1rem;
  color: var(--accent);
  border-color: var(--line-strong);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.93rem;
}

.page-hero .section-links a:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

/* Banner / callout panel */
.banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.5rem;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
}

.section:not(.section-alt) .banner {
  background: var(--surface-alt);
}

.banner h2,
.banner h3 {
  margin: 0 0 0.4rem;
  font-size: 1.3rem;
}

.banner p {
  margin: 0;
  color: var(--text-muted);
}

.banner p + p {
  margin-top: 0.35rem;
}

/* Status, tags, topics */
.status,
.tag {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 0.18rem 0.55rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
}

.topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.2rem 0;
  padding: 0;
  list-style: none;
}

.topic-list li {
  padding: 0.3rem 0.7rem;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.88rem;
}

.project-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

.project-list li {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--line);
}

.project-list li:last-child {
  border-bottom: 0;
}

.project-list b {
  min-width: 3rem;
  color: var(--accent);
}

.resource {
  padding: 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.resource strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--navy);
}

.resource p {
  margin: 0;
  color: var(--text-muted);
}

/* Toolbars: people + course catalogue */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.filter-button {
  min-height: 44px;
  max-width: 100%;
  padding: 0.45rem 0.9rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: normal;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.filter-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.filter-button[aria-pressed="true"] {
  color: #fff;
  background: var(--navy);
  border-color: var(--navy);
}

.people-toolbar,
.catalog-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.1rem;
  background: var(--accent-soft);
  border: 1px solid #bdd6ce;
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
}

.people-toolbar > div,
.catalog-tools .field,
.catalog-tools .catalog-field {
  display: grid;
  gap: 0.3rem;
  align-content: start;
  flex: 1 1 13rem;
  min-width: min(100%, 11rem);
}

.people-toolbar label,
.catalog-tools label {
  display: block;
  color: var(--navy);
  font-size: 0.86rem;
  font-weight: 600;
}

.people-toolbar .filter-bar,
.catalog-tools .filter-bar {
  margin-bottom: 0;
}

.people-toolbar > .filter-bar {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
}

.catalog-tools .filter-bar {
  flex: 1 1 100%;
}

.catalog-tools > .button,
.catalog-tools > .filter-button {
  flex: 0 0 auto;
  align-self: flex-end;
  min-height: 44px;
}

.people-toolbar p,
.catalog-tools .result-count {
  flex: 1 1 100%;
  margin: 0;
}

.text-input,
.catalog-tools select {
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--ink);
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.text-input::placeholder {
  color: var(--text-subtle);
  opacity: 1;
}

.text-input:hover,
.catalog-tools select:hover {
  border-color: var(--text-subtle);
}

.text-input:focus,
.catalog-tools select:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent);
  outline-offset: 1px;
}

.result-count {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.result-count b {
  color: var(--navy);
}

.empty-state {
  padding: 2rem 1.25rem;
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--navy);
}

/* Course catalogue */
.language-link {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.programme-group {
  margin-top: 2rem;
}

.programme-group > h3 {
  padding: 0.8rem 1rem;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 1.4rem;
}

.catalogue-group {
  margin-top: 1.5rem;
}

.catalogue-group > h4 {
  margin: 0 0 1rem;
  color: var(--accent-strong);
  font-size: 1rem;
}

.subject-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr));
  gap: 1rem;
}

.subject-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.2rem 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.subject-card h5 {
  margin: 0.1rem 0 0;
  font-size: 1.08rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.subject-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.subject-card .subject-role {
  color: var(--accent-strong);
  font-size: 0.88rem;
  font-weight: 600;
}

.subject-meta {
  display: grid;
  grid-template-columns: minmax(5.5rem, max-content) minmax(0, 1fr);
  gap: 0.3rem 0.8rem;
  align-items: baseline;
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
}

.subject-meta dt {
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.subject-meta dd {
  min-width: 0;
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.subject-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

/* Documents */
.document-list {
  display: grid;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-list li {
  margin: 0;
}

.document-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  color: var(--navy);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.document-list a:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.document-list a::after {
  flex: 0 0 auto;
  content: "\2193";
  color: var(--accent);
}

.document-preview {
  display: block;
  width: 100%;
  height: 75vh;
  min-height: 24rem;
  margin-top: 1.25rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.schedule-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.schedule-list li {
  display: grid;
  grid-template-columns: 7.25rem minmax(0, 1fr);
  gap: 0.75rem;
  padding-block: 0.8rem;
}

.schedule-list li + li {
  border-top: 1px solid var(--line);
}

.schedule-time {
  color: var(--accent-strong);
  align-self: start;
  justify-self: start;
  padding: 0.25rem 0.4rem;
  background: var(--accent-soft);
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-list p {
  margin: 0.2rem 0 0;
}

.schedule-meta {
  display: grid;
  grid-template-columns: minmax(4.5rem, max-content) minmax(0, 1fr);
  gap: 0.25rem 0.75rem;
  align-items: baseline;
  margin: 0.6rem 0 0;
  font-size: 0.86rem;
}

.schedule-meta dt {
  margin: 0;
  color: var(--text-subtle);
  font-size: 0.8rem;
}

.schedule-meta dd {
  margin: 0;
}

.schedule-list .schedule-discrepancy,
.schedule-list .schedule-provenance {
  margin-top: 0.7rem;
}

.schedule-discrepancy {
  border-left: 3px solid var(--accent-strong);
  padding-left: 0.6rem;
}

@media (max-width: 600px) {
  .schedule-list li {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }
}

/* Notices */
.notice,
.archive-note {
  margin-block: 1.25rem;
  padding: 0.9rem 1.1rem;
  color: var(--ink);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.archive-note {
  margin-top: 0;
  background: var(--gold-soft);
  border-left-color: #a26d21;
}

.notice > :first-child,
.archive-note > :first-child {
  margin-top: 0;
}

.notice > :last-child,
.archive-note > :last-child {
  margin-bottom: 0;
}

.notice h3 {
  margin: 0 0 0.3rem;
  font-size: 1.05rem;
}

.notice p {
  margin: 0;
}

.notice strong {
  color: var(--navy);
}

/* People */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  gap: 1rem;
}

.person-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  align-items: start;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.person-photo,
.person-initials {
  width: 72px;
  height: 88px;
  object-fit: cover;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.person-initials {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.person-card > div {
  min-width: 0;
}

.person-card h2,
.person-card h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.person-role {
  display: block;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
  font-size: 0.86rem;
}

.person-meta {
  display: grid;
  gap: 0.2rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.person-meta a {
  overflow-wrap: anywhere;
  min-height: 24px;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 1.25rem;
}

.contact-card {
  min-width: 0;
  padding: clamp(1.25rem, 3vw, 1.75rem);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-top: 4px solid var(--accent);
  box-shadow: var(--shadow);
}

.contact-card h2 {
  margin-top: 0;
  font-size: 1.3rem;
}

.contact-card address {
  font-style: normal;
}

.contact-list {
  display: grid;
  gap: 0.9rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

.contact-list li {
  display: block;
  min-width: 0;
}

.contact-list a {
  overflow-wrap: anywhere;
}

.contact-list strong {
  display: block;
  color: var(--text-subtle);
  font-size: 0.82rem;
  font-weight: 600;
}

/* Footer */
.site-footer {
  padding-block: 2.5rem;
  color: var(--on-dark);
  background: var(--navy);
  border-top: 4px solid var(--gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  align-items: center;
  gap: 1.25rem 2rem;
}

.site-footer p {
  margin: 0;
}

.site-footer strong {
  color: #fff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
}

.site-footer a {
  color: var(--on-dark);
  display: inline-flex;
  align-items: center;
  min-height: 32px;
}

.site-footer a:hover {
  color: var(--gold);
}

/* Utilities */
.muted {
  color: var(--text-subtle);
}

.small {
  font-size: 0.88rem;
}

.stack-sm > * + * {
  margin-top: 1rem;
}

.mt-lg {
  margin-top: 2rem;
}

.lead-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1rem;
  font-weight: 600;
}

.lead-link::after {
  content: "\2192";
}

/* Section identity and compact data surfaces */
#pristup {
  background: var(--gold-soft);
  border-bottom: 1px solid #e8dcc5;
}

#pristup .section-links + .section-links {
  margin-top: 1rem;
}

#pristup .section-heading + .section-links a {
  padding: 1.5rem;
  background: var(--navy);
  border-color: var(--navy);
}

#pristup .section-heading + .section-links strong {
  color: #fff;
  font-size: 1.2rem;
}

#pristup .section-heading + .section-links span {
  color: var(--on-dark);
}

#pristup .section-heading + .section-links strong::after {
  color: var(--gold);
}

#pristup .section-heading + .section-links a:hover {
  background: var(--accent-strong);
}

#nastava {
  background: var(--surface);
}

#nastava .card {
  border-top: 4px solid var(--accent);
  background: var(--surface-alt);
}

#istrazivanje,
#raspodela {
  background: var(--accent-soft);
  border-block: 1px solid #c9ddd5;
}

#konferencije {
  padding-top: 1.5rem;
  border-top: 2px solid #a9c7bc;
}

#predmeti .section-heading .section-links {
  margin-top: 1.25rem;
}

#program-itm > h3 {
  background: #e8eef5;
  border-left-color: var(--navy);
}

#program-itm .subject-card {
  border-top-color: var(--navy);
}

.schedule-day {
  align-self: start;
  padding-top: 0;
}

.schedule-day > h3 {
  margin: 0 -1.35rem 0.5rem;
  padding: 0.85rem 1.35rem;
  color: #fff;
  background: var(--navy);
  border-radius: 13px 13px 0 0;
  border-bottom: 3px solid var(--gold);
}

.schedule-room {
  color: var(--accent-strong);
  font-weight: 700;
}

.contact-card + .contact-card {
  background: var(--gold-soft);
  border-top-color: #a26d21;
}

.contact-list li + li {
  padding-top: 0.75rem;
  border-top: 1px solid var(--line);
}

/* Tablet */
@media (max-width: 960px) {
  .hero-grid,
  .contact-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-3,
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}

/* Navigation collapses at 900px (matches navBreakpoint in js/site.js) */
@media (max-width: 900px) {
  /* Without JS: links wrap below the brand and stay visible */
  html:not(.js) .site-header {
    position: static;
  }

  html:not(.js) .header-inner {
    flex-wrap: wrap;
    padding-block: 0.75rem;
  }

  html:not(.js) .site-nav {
    width: 100%;
  }

  html:not(.js) .site-nav ul {
    margin-inline: -0.75rem;
  }

  /* With JS: toggle + drop-down panel */
  .js .nav-toggle {
    display: grid;
  }

  /* Positioned against the sticky .site-header so the panel spans the viewport */
  .js .site-nav {
    position: absolute;
    z-index: 99;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
    padding: 0.25rem 1rem 0.75rem;
    background: var(--surface);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 16px -12px rgba(19, 41, 75, 0.35);
  }

  .js .site-nav[data-open="true"] {
    display: block;
  }

  .js .site-nav ul {
    width: min(100%, var(--container));
    margin-inline: auto;
    display: grid;
    gap: 0;
  }

  .js .site-nav li + li {
    border-top: 1px solid var(--line);
  }

  .js .site-nav a {
    padding: 0.75rem 0.25rem;
    border-bottom: 0;
    border-left: 3px solid transparent;
  }

  .js .site-nav a[aria-current="page"] {
    padding-left: 0.6rem;
    border-left-color: var(--accent);
  }

  .banner,
  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .banner .button {
    justify-self: start;
  }
}

/* Mobile */
@media (max-width: 620px) {
  .mathematical-artwork {
    width: 152px;
  }

  .hero-grid {
    gap: 1.5rem;
  }

  .brand-text span {
    display: none;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }

  .actions .button {
    flex: 1 1 100%;
  }

  .people-toolbar,
  .catalog-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.85rem;
  }

  .people-toolbar > div,
  .catalog-tools .field,
  .catalog-tools .catalog-field,
  .catalog-tools .result-count {
    flex: 0 1 auto;
    min-width: 0;
  }

  .catalog-tools > .button,
  .catalog-tools > .filter-button {
    align-self: stretch;
  }

  .person-card {
    grid-template-columns: 60px minmax(0, 1fr);
    gap: 0.85rem;
  }

  .person-photo,
  .person-initials {
    width: 60px;
    height: 74px;
  }

  .person-initials {
    font-size: 1.05rem;
  }

  .subject-meta {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .subject-meta dd + dt {
    margin-top: 0.35rem;
  }
}

@media (max-width: 380px) {
  .container {
    width: calc(100% - 1.5rem);
  }

  .brand {
    gap: 0.55rem;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .brand-text strong {
    font-size: 0.94rem;
  }

  .card,
  .subject-card,
  .person-card {
    padding: 0.9rem;
  }

  .schedule-day {
    padding-top: 0;
  }

  .schedule-day > h3 {
    margin-inline: -0.9rem;
    padding-inline: 0.9rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0s !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  *,
  *::before,
  *::after {
    color: #000 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  .skip-link,
  .nav-toggle,
  .site-nav,
  .actions,
  .filter-bar,
  .catalog-tools,
  .people-toolbar,
  .document-preview,
  .footer-links {
    display: none !important;
  }

  body {
    color: #000;
    background: #fff;
    font-size: 11pt;
  }

  .site-header {
    position: static;
    border-bottom: 1px solid #999;
  }

  .hero,
  .page-hero,
  .section-alt,
  .section-dark,
  .site-footer,
  .banner,
  .section:not(.section-alt) .banner {
    color: #000;
    background: #fff;
  }

  .section,
  .page-hero,
  .hero-grid {
    padding-block: 1rem;
  }

  h1,
  h2,
  h3,
  .brand,
  .eyebrow,
  .lead,
  .section-heading p,
  .page-hero p {
    color: #000;
  }

  .brand-mark {
    color: #000;
    background: #fff;
    border: 1px solid #000;
  }

  a {
    color: #000;
  }

  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    overflow-wrap: anywhere;
  }

  .card,
  .subject-card,
  .person-card,
  .contact-card,
  .banner,
  .section-links a {
    break-inside: avoid;
    border-color: #999;
    box-shadow: none;
  }
}
