/* ==============================================
   EBF UK Research Office — Site Styles
   UK brand: burgundy-deep + accent magenta on cream
   Typography: UK Sans (display) + Corbel / system-ui (body)
   Tone: academic document, not marketing campaign
   ============================================== */

/* --- Skip-to-content link (keyboard users) --- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  padding: 0.6rem 1rem;
  background: var(--accent-deep);
  color: var(--text-on-dark);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 200;
  transition: top 0.2s;
}
.skip-link:focus-visible {
  top: 0;
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Semantic palette (UK brand) */
  --accent-primary: #CF0072;   /* UK brand magenta — links, CTAs, accents */
  --accent-deep:    #52002e;   /* darkest — headings, dark bg surfaces */
  --accent-dark:    #7c0044;   /* mid-dark */
  --accent-light:   #f4cde3;   /* lightest accent tint */
  --bg-light:       #F5F0EB;   /* page bg (cream) */
  --bg-muted:       #E8DFD6;   /* alternating sections, subtle surfaces */
  --bg-surface:     #ffffff;   /* cards, content surfaces */
  --text-primary:   #52002e;   /* body text on light bg */
  --text-on-dark:   #F5F0EB;   /* text on dark bg */
  --text-muted:     rgba(82, 0, 46, 0.66);
  --text-subtle:    rgba(82, 0, 46, 0.85);
  --border-soft:    rgba(82, 0, 46, 0.12);
  --border-strong:  rgba(82, 0, 46, 0.28);

  /* Typography */
  --font-display: 'UK Sans', 'Corbel', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-body:    'Corbel', 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-width: 1120px;
  --radius: 4px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  line-height: 1.7;
  background: var(--bg-light);
  -webkit-font-smoothing: antialiased;
}

/* --- Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 {
  font-size: 1.6rem;
  margin-top: 2.75rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--accent-primary);
  display: inline-block;
}
h3 { font-size: 1.25rem; font-weight: 500; margin-top: 2rem; margin-bottom: 0.5rem; }
h4 { font-size: 1rem; font-weight: 500; margin-top: 1.5rem; margin-bottom: 0.5rem; color: var(--accent-deep); text-transform: uppercase; letter-spacing: 0.06em; }

p { margin-bottom: 1rem; }

a {
  color: var(--accent-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
  text-decoration-color: var(--accent-primary);
  border-bottom: 1px solid transparent;
  transition: color 0.2s, text-decoration-color 0.2s, border-color 0.2s;
}
a:hover {
  color: var(--accent-deep);
  text-decoration-color: var(--accent-deep);
  border-bottom-color: var(--accent-primary);
}
/* Unified keyboard-focus indicator. Kept separate from :hover so
   every focusable element — including .btn and .site-logo, which
   override text-decoration — still gets a visible focus ring. */
a:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 3px;
  /* No border-radius here — `.btn` and `.site-logo` have their own
     corner radii; a generic override would shrink focused buttons'
     corners because on `<a class="btn">`, the rule `a:focus-visible`
     (specificity 0,1,1) beats `.btn` (specificity 0,1,0) on the
     same element. */
}
/* Brighter outline on dark surfaces for contrast. */
.site-header a:focus-visible,
.site-footer a:focus-visible {
  outline-color: var(--accent-light);
}

ul, ol { margin-bottom: 1rem; padding-left: 1.5rem; }
li { margin-bottom: 0.4rem; }

hr { border: none; border-top: 1px solid var(--border-soft); margin: 2.5rem 0; }

blockquote {
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-muted);
  color: var(--text-subtle);
  font-style: italic;
}

code {
  font-size: 0.9em;
  font-family: 'Consolas', 'Monaco', monospace;
  background: var(--bg-muted);
  color: var(--accent-deep);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

strong { font-weight: 700; color: var(--accent-deep); }
em { font-style: italic; }

/* --- Header --- */
.site-header {
  background: var(--accent-deep);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(82, 0, 46, 0.18);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.1;
  border: none;
}
.site-logo:hover { border: none; text-decoration: none; }
.site-logo:focus-visible {
  /* Child spans carry the visible color, not the anchor, so a color
     change alone isn't a visible focus indicator — use an outline. */
  outline: 2px solid var(--accent-light);
  outline-offset: 4px;
  border-radius: 3px;
  text-decoration: none;
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-on-dark);
  letter-spacing: 0.02em;
}

.logo-subtitle {
  font-family: var(--font-display);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--accent-light);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-top: 2px;
}

.site-nav { display: flex; gap: 0.15rem; }

.site-nav a {
  font-family: var(--font-display);
  color: rgba(245, 240, 235, 0.80);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.45rem 0.8rem;
  border-radius: var(--radius);
  border: none;
  text-decoration: none;
  transition: color 0.2s, background 0.2s;
}
.site-nav a:focus-visible {
  /* Overrides the generic dark-surface focus ring with a tighter
     offset, since nav items are chips rather than inline text. */
  outline: 2px solid var(--accent-light);
  outline-offset: 2px;
}
.site-nav a:hover { color: var(--text-on-dark); background: rgba(255,255,255,0.08); border: none; }
.site-nav a.active { color: var(--accent-light); background: rgba(255,255,255,0.06); }

.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: 0.5rem; }
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text-on-dark); margin: 5px 0;
  transition: transform 0.3s;
}

/* --- Hero --- */
.hero {
  background: linear-gradient(135deg, var(--accent-deep) 0%, var(--accent-dark) 100%);
  padding: 4.5rem 0 4rem;
  margin-bottom: 2.5rem;
}

.hero h1 { color: var(--text-on-dark); font-size: 2.5rem; margin-bottom: 0.75rem; letter-spacing: -0.015em; }
.hero-subtitle {
  color: var(--accent-light);
  font-size: 1.15rem;
  font-weight: 400;
  max-width: 680px;
  line-height: 1.55;
}

/* --- Page Content --- */
.site-content { min-height: calc(100vh - 64px - 280px); padding-bottom: 3rem; }
/* Page title — dominant, full-width rule. Block-level so the first
   in-content h2 below it lands on a new line with its own short
   underline instead of colliding side-by-side (each was previously
   display:inline-block with an accent border, and their lines butted
   up against each other when the page had both). */
.page-title {
  display: block;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--accent-deep);
  letter-spacing: -0.015em;
  margin-top: 2.5rem;
  margin-bottom: 1.75rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border-strong);
}
/* The first in-content h2 directly follows the page title — drop its
   top margin so the rhythm reads as "title → section" rather than
   title + awkward gap. */
.page-title + h2 { margin-top: 1.25rem; }

/* --- Cards --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
  margin: 1.75rem 0;
}

.card {
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--bg-surface);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  box-shadow: 0 4px 14px rgba(82, 0, 46, 0.08);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

.card h3 { margin-top: 0; font-size: 1.1rem; font-weight: 500; border: none; }
.card p { color: var(--text-subtle); font-size: 0.95rem; }

/* --- Funding Cards --- */
.funding-card {
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
  background: var(--bg-surface);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.funding-card:hover { border-color: var(--accent-primary); box-shadow: 0 2px 10px rgba(82, 0, 46, 0.06); }

.funding-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.funding-card-header h3 { margin: 0; font-size: 1.1rem; font-weight: 700; color: var(--accent-deep); }

.funding-card-fullname {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.funding-card-meta {
  display: flex;
  gap: 0.9rem;
  margin: 0.75rem 0;
  font-size: 0.85rem;
  flex-wrap: wrap;
}

/* --- Badges --- */
.badge {
  font-family: var(--font-display);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.22rem 0.7rem;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-national      { background: var(--accent-light); color: var(--accent-deep); }
.badge-eu,
.badge-european      { background: var(--accent-deep); color: var(--text-on-dark); }
.badge-regional      { background: var(--bg-muted); color: var(--accent-dark); }
.badge-international { background: var(--accent-primary); color: var(--text-on-dark); }
.badge-church        { background: var(--accent-dark); color: var(--text-on-dark); }

.relevance { font-weight: 500; }
.relevance-high   { color: var(--accent-primary); }
.relevance-medium { color: var(--accent-dark); }
.relevance-low    { color: var(--text-muted); }

.country { color: var(--text-muted); }

/* --- Opportunity cards (extends .funding-card) --- */
.opportunity-card { border-left-width: 4px; }
.opportunity-fit-high      { border-left-color: var(--accent-primary); }
.opportunity-fit-medium    { border-left-color: var(--accent-dark); }
.opportunity-fit-low       { border-left-color: var(--border-soft); }
.opportunity-fit-unreviewed { border-left-color: var(--text-muted); border-left-style: dashed; }
.opportunity-fit-exclude   { border-left-color: #999; opacity: 0.55; }

.opportunity-meta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.opportunity-deadline strong { color: var(--accent-deep); }
.opportunity-deadline em { color: var(--text-muted); font-style: italic; }
.opportunity-no-deadline { color: var(--text-muted); }
.opportunity-category { font-family: var(--font-mono, monospace); font-size: 0.8rem; }

.opportunity-flags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.5rem 0;
  font-size: 0.78rem;
}
.opportunity-fit, .opportunity-impact, .opportunity-theme {
  padding: 0.18rem 0.55rem;
  border-radius: 12px;
  background: var(--bg-muted);
  color: var(--text-subtle);
  white-space: nowrap;
}
.opportunity-fit-high-badge { background: var(--accent-light); color: var(--accent-deep); }
.opportunity-fit-medium-badge { background: var(--bg-muted); color: var(--accent-dark); }
.opportunity-fit-low-badge,
.opportunity-fit-unreviewed-badge { background: transparent; border: 1px dashed var(--border-soft); color: var(--text-muted); }

.opportunity-impact-strong { background: var(--accent-primary); color: var(--text-on-dark); }
.opportunity-impact-moderate { background: var(--accent-light); color: var(--accent-deep); }
.opportunity-impact-minimal { color: var(--text-muted); }
.opportunity-impact-infrastructure { background: var(--accent-deep); color: var(--text-on-dark); }
.opportunity-impact-unknown { color: var(--text-muted); }

.opportunity-theme { font-family: var(--font-mono, monospace); }

.opportunity-note {
  border-left: 3px solid var(--accent-primary);
  padding: 0.5rem 0.9rem;
  margin: 0.75rem 0;
  background: var(--bg-muted);
  font-size: 0.95rem;
  color: var(--text-default);
}
.opportunity-note p { margin: 0; }
.opportunity-unreviewed { color: var(--text-muted); font-size: 0.9rem; }

.opportunity-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.opportunity-reviewed-at {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Source-specific small badges (reuse funding badge styles for known sources) */
.badge-apvv, .badge-vega, .badge-kega { background: var(--accent-light); color: var(--accent-deep); }
.badge-vvi { background: var(--bg-muted); color: var(--accent-dark); }
.badge-horizon, .badge-eu_ft { background: var(--accent-deep); color: var(--text-on-dark); }
.badge-cost, .badge-visegrad { background: var(--bg-muted); color: var(--accent-dark); }
.badge-church { background: var(--accent-dark); color: var(--text-on-dark); }

/* --- Monitoring UX: freshness banner + filter bar (opportunities pages) --- */
:root {
  /* Warning pair — the brand palette has no semantic warning colour. */
  --warn-bg:     #fdf3d9;
  --warn-text:   #6a4a00;
  --warn-border: #d9a62e;
}

.freshness-banner {
  font-family: var(--font-display);
  font-size: 0.9rem;
  padding: 0.6rem 1rem;
  margin: 1.25rem 0;
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--accent-primary);
  border-radius: var(--radius);
  background: var(--bg-muted);
  color: var(--text-subtle);
}
.freshness-stale {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
  border-left-width: 4px;
}
.freshness-stale a { color: inherit; }

.call-filters {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.call-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.25rem;
  align-items: flex-end;
}
.call-filter-field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.call-filter-field-search { flex: 1 1 14rem; }
.call-filter-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.call-filters input[type="search"],
.call-filters select {
  font: inherit;                 /* form controls don't inherit fonts */
  color: var(--text-primary);
  background: var(--bg-light);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
}
.call-filters input[type="search"]:focus-visible,
.call-filters select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-color: var(--accent-primary);
}
.call-filter-count { margin: 0.75rem 0 0; font-size: 0.85rem; color: var(--text-muted); }
.call-filter-empty { color: var(--text-muted); font-style: italic; margin: 1.5rem 0; }

@media (max-width: 768px) {
  .call-filters-row { gap: 0.75rem; }
  .call-filter-field { flex: 1 1 calc(50% - 0.75rem); }
  .call-filters input[type="search"],
  .call-filters select { width: 100%; }
}
@media (max-width: 480px) {
  .call-filters { padding: 0.75rem 0.9rem; }
  .call-filter-field, .call-filter-field-search { flex-basis: 100%; }
}
@media (prefers-color-scheme: dark) {
  :root {
    --warn-bg:     #2b2008;
    --warn-text:   #f0d48a;
    --warn-border: #8a6d1f;
  }
  .call-filters input[type="search"],
  .call-filters select {
    color-scheme: dark;          /* native dropdown + search-cancel render dark */
    background: rgba(245, 240, 235, 0.06);
  }
}
@media print {
  .call-filters { display: none !important; }
  /* freshness banner intentionally prints — a stale-data warning is content */
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  padding: 0.55rem 1.3rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  text-decoration: none;
  border-bottom: none;
}
.btn:hover { border-bottom: none; }
.btn:focus-visible {
  /* Deep burgundy outline shows on both btn-primary (magenta fill)
     and btn-outline (transparent with magenta border). */
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent-primary);
  color: var(--text-on-dark);
  border: 1px solid var(--accent-primary);
}
.btn-primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--text-on-dark); }

.btn-outline {
  background: transparent;
  color: var(--accent-primary);
  border: 1px solid var(--accent-primary);
}
.btn-outline:hover { background: var(--accent-primary); color: var(--text-on-dark); }

/* --- Stat boxes (landing page) --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin: 2rem 0;
}

.stat-box {
  text-align: center;
  padding: 1.5rem 1rem;
  background: var(--bg-muted);
  border-radius: var(--radius);
  border-left: 3px solid var(--accent-primary);
}

.stat-number {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-deep);
  display: block;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  display: block;
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  /* `overflow: hidden` was removed because on narrow viewports it
     clipped wide tables with no scroll affordance. The mobile
     breakpoint below switches tables to block + overflow-x: auto so
     their own content scrolls horizontally instead. */
}

th {
  text-align: left;
  padding: 0.8rem 1rem;
  background: var(--accent-deep);
  color: var(--text-on-dark);
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border-soft); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg-muted); }

/* --- Progress/Milestones --- */
.milestone-list { list-style: none; padding: 0; }
.milestone-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.milestone-list li:last-child { border-bottom: none; }

.milestone-status { font-size: 1.1rem; flex-shrink: 0; }

/* --- Footer --- */
.site-footer {
  background: var(--accent-deep);
  color: rgba(245, 240, 235, 0.80);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
  font-size: 0.9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.site-footer h4 {
  font-family: var(--font-display);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  margin-bottom: 0.9rem;
  margin-top: 0;
}

.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 0.4rem; }
.site-footer a {
  color: rgba(245, 240, 235, 0.75);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-footer a:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}
.site-footer p { margin-bottom: 0.4rem; }
.footer-address { font-size: 0.85rem; color: rgba(245, 240, 235, 0.55); }

.footer-bottom {
  border-top: 1px solid rgba(245, 240, 235, 0.14);
  padding-top: 1.25rem;
  text-align: center;
  font-size: 0.8rem;
  color: rgba(245, 240, 235, 0.45);
}

.footer-bottom a { color: rgba(245, 240, 235, 0.55); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .site-nav {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: var(--accent-deep);
    padding: 1rem;
    box-shadow: 0 4px 8px rgba(82, 0, 46, 0.24);
  }
  .site-nav.open { display: flex; }
  .nav-toggle { display: block; }

  .hero { padding: 3rem 0 2.5rem; }
  .hero h1 { font-size: 1.85rem; }
  .hero-subtitle { font-size: 1rem; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  /* `.page-title` has higher specificity than the bare `h1` rule
     above, so without this override it would stay at 2.5rem on
     mobile. Keep it slightly larger than body h1 to preserve its
     dominant role. */
  .page-title { font-size: 1.9rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.5rem; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }

  /* Tables scroll horizontally on narrow viewports instead of
     forcing the whole page to scroll. */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .hero h1 { font-size: 1.6rem; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .logo-text { font-size: 1.05rem; }
  .logo-subtitle { font-size: 0.62rem; }
  .page-title { font-size: 1.8rem; }
}

/* ==========================================================
   Dark mode — honours `prefers-color-scheme: dark`.
   Flips page bg + primary text. Header / hero / footer are
   already deep burgundy and stay as-is. Accent colors work
   on both light and dark backgrounds unchanged.
   ========================================================== */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-light:       #0a0308;       /* near-black page bg */
    --bg-muted:       #1a0a12;       /* alternating sections */
    --bg-surface:     #1a0a12;       /* cards */
    --text-primary:   #F5F0EB;       /* cream text */
    --text-on-dark:   #F5F0EB;       /* unchanged */
    --text-muted:     rgba(245, 240, 235, 0.66);
    --text-subtle:    rgba(245, 240, 235, 0.85);
    --border-soft:    rgba(245, 240, 235, 0.12);
    --border-strong:  rgba(245, 240, 235, 0.28);
  }
  code {
    background: rgba(245, 240, 235, 0.08);
    color: var(--accent-light);
  }
  /* Table row hover: cream on burgundy-muted */
  tr:hover td { background: rgba(245, 240, 235, 0.05); }
  /* Stat box — slightly lighter than surface for separation */
  .stat-box { background: rgba(245, 240, 235, 0.04); }
  /* Blockquote — keep accent border, lighten bg */
  blockquote { background: rgba(245, 240, 235, 0.04); }
  /* Badges: the regional tint uses --bg-muted in light mode, which
     loses all contrast on a dark page. Give it a visible surface. */
  .badge-regional { background: rgba(245, 240, 235, 0.08); color: var(--accent-light); }
}

/* ==========================================================
   Print stylesheet — strip navigation chrome, keep content.
   Optimised for A4 and letter; black-on-white to save ink.
   ========================================================== */
@media print {
  @page { margin: 1.5cm; }

  body {
    background: #fff;
    color: #000;
    font-size: 11pt;
    line-height: 1.5;
  }

  /* Hide navigation, hero emphasis, and interactive chrome. */
  .site-header,
  .site-footer,
  .nav-toggle,
  .skip-link,
  .hero {
    display: none !important;
  }

  .site-content { min-height: auto; padding: 0; }
  .container { max-width: none; padding: 0; }

  h1, h2, h3, h4 {
    color: #000;
    border: none;
    display: block;
    page-break-after: avoid;
  }
  /* `.page-title` has higher specificity than `h1` above, so its
     border-bottom + padding-bottom + color would otherwise survive
     into print. Clear them explicitly so the title prints in black
     without the accent rule. */
  .page-title {
    border-bottom: none;
    padding-bottom: 0;
    font-size: 1.6rem;
    color: #000;
  }

  a {
    color: #000;
    text-decoration: underline;
    border: none;
  }

  /* Cards and funding-cards become simple bordered blocks. */
  .card,
  .funding-card,
  .stat-box {
    border: 1px solid #999;
    background: #fff;
    color: #000;
    page-break-inside: avoid;
  }

  /* Badges and buttons: strip colored fills so funding cards print
     in ink-efficient black and white with thin borders instead. */
  .badge,
  .badge-national,
  .badge-eu,
  .badge-european,
  .badge-regional,
  .badge-international,
  .badge-church,
  .btn,
  .btn-primary,
  .btn-outline {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #999 !important;
  }

  .card-grid,
  .stat-grid {
    display: block;
  }

  table {
    border-color: #000;
    page-break-inside: avoid;
  }
  th {
    background: #eee;
    color: #000;
  }

  /* Reset dark-mode variable overrides — printing always uses
     black text on white. UA, ktorý vyhodnotí prefers-color-scheme: dark
     aj pri tlači, by inak vytlačil stale banner ako tmavý box. */
  :root {
    --text-primary: #000;
    --text-muted: #333;
    --text-subtle: #111;
    --bg-light: #fff;
    --bg-surface: #fff;
    --bg-muted: #f4f4f4;
    --warn-bg: #fdf3d9;
    --warn-text: #6a4a00;
    --warn-border: #d9a62e;
  }
}

/* ==========================================================
   Researchers — directory + individual profiles
   Reuses the brand tokens above. Bilingual EN/SK blocks are
   toggled by assets/js/researchers.js (it sets inline display);
   the SK blocks carry an inline style="display:none" in markup,
   so NO `.l-sk { display:none }` rule belongs here.
   ========================================================== */

.lang-switch {
  float: right;
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 1.5rem;
}
.lang-switch button {
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.3rem 0.85rem;
  border: none;
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] { background: var(--accent-deep); color: var(--text-on-dark); }
.lang-switch button:focus-visible { outline: 2px solid var(--accent-primary); outline-offset: -2px; }

.lead-text { font-size: 1.05rem; color: var(--text-subtle); max-width: 62ch; }

.r-back {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin: 1.5rem 0 0.25rem;
}

.r-consent {
  clear: both;
  font-size: 0.85rem;
  color: var(--accent-dark);
  background: var(--bg-muted);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0;
  padding: 0.7rem 1rem;
  margin: 1.25rem 0;
}

.r-filters {
  clear: both;
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.r-filters input[type="search"], .r-filters select {
  font: inherit;
  color: var(--text-primary);
  background: var(--bg-light);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 0.45rem 0.6rem;
}
.r-filters input[type="search"] { flex: 1 1 16rem; }
.r-filters input[type="search"]:focus-visible, .r-filters select:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-color: var(--accent-primary);
}

.researcher-grid {
  clear: both;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}
.researcher-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.researcher-card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 4px 14px rgba(82, 0, 46, 0.08);
  transform: translateY(-1px);
}
.rc-photo, .rp-photo {
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
}
.rc-photo { width: 56px; height: 56px; }
.rp-photo { width: 84px; height: 84px; }
.rc-photo img, .rp-photo img { width: 100%; height: 100%; object-fit: cover; }
.rc-initials { font-family: var(--font-display); font-weight: 700; color: var(--accent-deep); font-size: 1.15rem; }
.rp-initials { font-family: var(--font-display); font-weight: 700; color: var(--accent-deep); font-size: 1.9rem; }
.rc-body { min-width: 0; }
.rc-name { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; color: var(--accent-deep); }
.rc-titles { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.45rem; }
.rc-dept {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--accent-light);
  color: var(--accent-deep);
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  margin-bottom: 0.5rem;
}
.rc-chips, .r-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0; }
.r-chip {
  font-size: 0.75rem;
  background: var(--bg-muted);
  color: var(--accent-dark);
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
}
.rc-tag { font-size: 0.9rem; color: var(--text-subtle); margin: 0.4rem 0; }
.rc-more { font-family: var(--font-display); font-size: 0.82rem; font-weight: 500; color: var(--accent-primary); }
.researcher-card:hover .rc-more { color: var(--accent-deep); }
.r-count-line { clear: both; font-size: 0.85rem; color: var(--text-muted); margin-top: 1rem; }

.researcher-profile { clear: both; max-width: 780px; }
.rp-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: flex-start;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 1.25rem;
}
.rp-id { display: flex; gap: 1rem; align-items: center; }
.rp-name { font-size: 1.8rem; margin: 0; }
.rp-meta { font-size: 0.95rem; color: var(--text-muted); margin-top: 0.25rem; }
.rp-links { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.85rem; font-family: var(--font-display); }
.rp-section { margin-top: 1.75rem; }
.rp-section h2 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--accent-dark);
  border: none;
  display: block;
  margin: 0 0 0.6rem;
}
.rp-pubs { list-style: none; padding: 0; margin: 0; }
.rp-pubs li { font-size: 0.95rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border-soft); }
.rp-pubs li:last-child { border-bottom: none; }
.rp-projects { padding-left: 1.2rem; margin: 0; }
.rp-projects li { font-size: 0.95rem; margin-bottom: 0.5rem; }
.rp-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.rp-stat {
  background: var(--bg-muted);
  border-left: 3px solid var(--accent-primary);
  border-radius: 0;
  padding: 0.9rem 0.6rem;
  text-align: center;
}
.rp-stat b { display: block; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; color: var(--accent-deep); }
.rp-stat span { font-size: 0.72rem; color: var(--text-muted); }
.rp-consent { font-size: 0.82rem; color: var(--text-muted); border-top: 1px solid var(--border-soft); margin-top: 2rem; padding-top: 1rem; }

@media (max-width: 560px) {
  .researcher-card { flex-direction: column; }
  .rp-metrics { grid-template-columns: 1fr 1fr; }
  .rp-head { flex-direction: column; }
}
