/* ==========================================================================
   Web CV — single stylesheet. Colours are tokens; dark mode follows the OS.
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #efede7;
  --text: #1c2330;
  --muted: #5d6676;
  --line: #e1ded6;
  --accent: #1f5f8b;
  --accent-strong: #174a6d;
  --accent-soft: #e3edf5;
  --owner: #0f3d5c;
  --link-hover: #b45309;
  --mark: #fde7b0;       /* search matches */

  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;

  --radius: 10px;
  --sidebar-w: 280px;
  --content-w: 860px;
  --gutter: clamp(16px, 4vw, 48px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11151b;
    --surface: #181e26;
    --surface-2: #1f2630;
    --text: #e4e8ee;
    --muted: #9aa4b3;
    --line: #2a323e;
    --accent: #7db5e0;
    --accent-strong: #a6cdec;
    --accent-soft: #1c2c3b;
    --owner: #cfe4f5;
    --link-hover: #f5b14c;
    --mark: #5a4214;
  }
}

/* ---- Base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; transition: color 0.15s; }
a:hover, a:focus-visible { color: var(--link-hover); }
/* Button-like links never show an underline. */
.nav a, .lang-switch a, .chip, .badge-link, .profile-link, .metric-panel, .stat, .identity, .button, .tile, .admin-nav a, .admin-brand { text-decoration: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.25; margin: 0; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 10;
  background: var(--accent); color: #fff; padding: 0.5rem 1rem; border-radius: var(--radius);
}
.skip-link:focus { top: 1rem; }

/* ---- Shell: sidebar + main ---------------------------------------------- */

.shell { min-height: 100vh; }

.sidebar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}

.sidebar-top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.75rem var(--gutter);
}

.identity { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: inherit; min-width: 0; }
.identity:hover { color: inherit; }

.avatar {
  flex: none; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font: 600 1.05rem/1 var(--font-display); letter-spacing: 0.02em;
  object-fit: cover;
}

.identity-text { display: flex; flex-direction: column; min-width: 0; }
.identity-name { font: 600 1.05rem/1.25 var(--font-display); }
.identity-role { color: var(--muted); font-size: 0.82rem; line-height: 1.35; }

.nav-toggle {
  flex: none; width: 44px; height: 44px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer;
  display: grid; place-items: center;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-panel { display: none; padding: 0 var(--gutter) 1rem; }
.nav-panel.is-open { display: block; }

.nav { list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 0.55rem 0.75rem; border-radius: 8px;
  color: var(--text); text-decoration: none; font-size: 0.95rem;
}
.nav a:hover { background: var(--surface-2); }
.nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
/* Low-key link under the menu (Affiliations & links, a page outside the menu) */
.nav a.nav-extra, .nav-extra {
  display: block; margin-top: 0.5rem; padding: 0.4rem 0.75rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem; text-decoration: none;
}
.nav-extra[aria-current="page"] { color: var(--accent-strong); font-weight: 600; }
.nav-extra + .nav-extra { margin-top: 0; border-top: 0; } /* Contact, right under Affiliations & links */

/* Language switch: segmented pill with a globe icon */
.lang-switch {
  display: inline-flex; align-items: center; gap: 0.15rem; margin: 0.9rem 0 0 0.75rem; padding: 0.2rem;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
}
.lang-icon { display: grid; place-items: center; padding: 0 0.35rem 0 0.4rem; color: var(--muted); }
.lang-switch a {
  min-width: 2.6rem; padding: 0.3rem 0.65rem; border-radius: 999px; text-align: center;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; color: var(--muted);
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.lang-switch a:hover { color: var(--accent-strong); background: var(--surface); }
.lang-switch a[aria-current="true"] {
  background: var(--accent); color: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.15), 0 2px 6px -2px color-mix(in srgb, var(--accent) 60%, transparent);
}
@media (prefers-color-scheme: dark) { .lang-switch a[aria-current="true"] { color: #0d1a26; } }

.main {
  max-width: calc(var(--content-w) + 2 * var(--gutter));
  padding: 2rem var(--gutter) 3rem;
}

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); }
  .sidebar {
    height: 100vh; border-bottom: 0; border-right: 1px solid var(--line);
    display: flex; flex-direction: column; overflow-y: auto;
  }
  .sidebar-top { padding: 2rem 1.5rem 1.5rem; }
  .identity { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .avatar { width: 72px; height: 72px; font-size: 1.6rem; }
  .identity-name { font-size: 1.2rem; }
  .nav-toggle { display: none; }
  .nav-panel { display: block; padding: 0 0.75rem 1.5rem; }
  .main { padding-top: 3rem; padding-bottom: 4rem; }
}

/* ---- Page furniture ------------------------------------------------------ */

.page-header { margin-bottom: 1.75rem; }
.page-header h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }

.section { margin-top: 2.5rem; }
.section:first-child { margin-top: 0; }
.section-title {
  font-size: 1.3rem; padding-bottom: 0.5rem; margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: baseline; gap: 0.6rem;
}
.subsection-title {
  font-size: 1.05rem; color: var(--muted); margin: 1.75rem 0 0.5rem;
  display: flex; align-items: baseline; gap: 0.6rem;
}
.section-title + .subsection-title { margin-top: 0.5rem; }

/* "On this page" cards (partials/jump-cards.php) and "↑ Top" links (partials/to-top.php) */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
.main [id] { scroll-margin-top: 5.5rem; } /* clears the sticky top bar on phones */
@media (min-width: 960px) { .main [id] { scroll-margin-top: 1.5rem; } }
.page-intro { margin-top: 1rem; }
.page-intro p:last-child { margin-bottom: 0; }
.jump { margin: 0 0 2.5rem; }
.jump-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 720px) {
  .jump-grid { grid-template-columns: repeat(3, 1fr); }
  .jump-grid--2, .jump-grid--4 { grid-template-columns: repeat(2, 1fr); } /* two cards share the full width; four make 2 × 2 */
  .jump-grid--2.jump-grid--wide-first { grid-template-columns: 1.1fr 1fr; } /* Publications: each card's pills on one row in EN and RO (measured with Segoe UI: 375 / 319 px needed, 403 / 362 px available at 860 px) */
}
.main .jump-card {
  position: relative; display: flex; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.2rem 1.15rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left; -webkit-hyphens: manual; hyphens: manual;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.jump-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.jump-icon {
  display: grid; place-items: center; width: 2.8rem; height: 2.8rem; margin-bottom: 0.4rem; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.jump-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem; }
.jump-title { font: 600 1.02rem/1.3 var(--font-display); color: var(--text); }
.jump-title::after { content: ""; position: absolute; inset: 0; border-radius: inherit; } /* whole card is clickable */
.jump-card:hover .jump-title { color: var(--accent-strong); }
.jump-text { font-size: 0.88rem; color: var(--muted); }
.jump-links { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.jump-links a {
  position: relative; z-index: 1; font-size: 0.8rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong);
}
.jump-links a:hover { color: var(--link-hover); }
.to-top { margin-left: auto; font: 600 0.78rem/1 var(--font-body); color: var(--muted); white-space: nowrap; }
.to-top:hover { color: var(--link-hover); }
@media print { .jump, .to-top { display: none !important; } }

.part-title { font-size: 1.6rem; margin: 3rem 0 0; }
.part-title:first-of-type { margin-top: 0; }
.count {
  font: 600 0.75rem/1 var(--font-body); color: var(--muted);
  background: var(--surface-2); padding: 0.3rem 0.55rem; border-radius: 999px;
}

.lead { font-size: 1.1rem; color: var(--text); max-width: 65ch; }
.note, .legend { color: var(--muted); font-size: 0.85rem; }
.empty { color: var(--muted); font-style: italic; }
.more-link { font-weight: 600; text-decoration: none; }
.main .section-more { margin: 1rem 0 0; text-align: right; }

.plain-list { margin: 0; padding-left: 1.2rem; }
.plain-list li { margin: 0.35rem 0; }

.columns { display: grid; gap: 0 2.5rem; }
@media (min-width: 720px) { .columns { grid-template-columns: 1fr 1fr; } }

.site-footer {
  margin-top: 4rem; padding-top: 1.25rem; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 0.82rem;
}
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; }
.site-footer p { margin: 0; }
.footer-link { color: var(--muted); }

/* ---- Home ---------------------------------------------------------------- */

.hero { margin-bottom: 2.5rem; }
.hero-name { font-size: clamp(2rem, 5vw, 2.9rem); letter-spacing: -0.01em; }
.honorific { font-size: 0.5em; color: var(--muted); font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.hero-title { margin: 0.6rem 0 0; font-size: 1.15rem; font-weight: 600; color: var(--accent-strong); }
.hero-affiliation { margin: 0.15rem 0 0; font-size: 1.05rem; font-weight: 600; }
.hero-units { list-style: disc; margin: 0.5rem 0 0; padding-left: 1.25rem; color: var(--muted); font-size: 0.92rem; }
.hero-units li { padding-left: 0.15rem; }
.hero-units li::marker { color: var(--accent); }
.hero .lead { margin-top: 1.25rem; }

/* Free text with headings, icons, timeline and closing note (welcome text, Formatter::prose) */
.prose { margin-top: 1.75rem; font-size: 1.02rem; }
.prose p { margin: 0 0 0.9rem; }
.prose-section + .prose-section { margin-top: 2rem; }
.prose-heading { display: flex; align-items: center; gap: 0.75rem; font-size: 1.35rem; margin: 0 0 0.9rem; color: var(--text); }
.prose-badge {
  flex: none; display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}

/* The first section (welcome) is a highlighted card */
.welcome .prose-section:first-child {
  position: relative; overflow: hidden;
  padding: 1.4rem 1.6rem 0.6rem; border-radius: 14px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 12%, transparent) 0%, transparent 55%),
    var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 8px 24px -12px rgb(0 0 0 / 0.12);
}
.welcome .prose-section:first-child .prose-heading { font-size: 1.5rem; }
.welcome .prose-section:first-child .prose-badge { background: var(--accent); color: #fff; }
@media (prefers-color-scheme: dark) { .welcome .prose-section:first-child .prose-badge { color: #0d1a26; } }

/* Paragraphs with an icon form a small vertical timeline */
.prose-timeline { position: relative; display: flex; flex-direction: column; gap: 1.1rem; margin-bottom: 1.2rem; }
.prose-timeline::before {
  content: ""; position: absolute; left: calc(1.3rem - 1px); top: 1.3rem; bottom: 1.3rem; width: 2px;
  background: linear-gradient(var(--accent-soft), color-mix(in srgb, var(--accent) 35%, transparent), var(--accent-soft));
}
.prose-item { position: relative; display: grid; grid-template-columns: 2.6rem minmax(0, 1fr); gap: 1rem; align-items: start; }
.prose-item .prose-badge { position: relative; z-index: 1; box-shadow: 0 0 0 4px var(--bg); }
.prose-item p { margin: 0.35rem 0 0; }

/* Closing note */
.main .prose .prose-note {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem;
  margin: 1.5rem 0 0; padding: 0.9rem 1.2rem; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-strong); text-align: center; -webkit-hyphens: manual; hyphens: manual;
}
.prose-note-icon { display: grid; color: var(--accent); }

/* Counts: 2 × 2 on phones, one row of 4 from tablet width */
.stats { display: grid; gap: 0.75rem; margin: 0; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* Citation databases: one panel each with h-index + citations; stacked on phones, 3 in a row above */
.metric-panels { display: grid; gap: 0.75rem; margin-top: 0.75rem; grid-template-columns: 1fr; }
@media (min-width: 720px) { .metric-panels { grid-template-columns: repeat(3, 1fr); } }
.metric-panel {
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 1rem 1.1rem; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--brand);
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
a.metric-panel:hover {
  color: var(--text); border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface));
}
.metric-source { display: flex; align-items: center; gap: 0.5rem; font-weight: 600; font-size: 0.92rem; }
.metric-source svg { color: var(--brand); flex: none; }
.metric-values { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0; }
.metric-values div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 0.15rem; }
.metric-values dd { margin: 0; font: 600 1.75rem/1.1 var(--font-display); color: var(--accent-strong); }
.metric-values dt { font-size: 0.8rem; color: var(--muted); }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.2rem;
  color: var(--text); text-decoration: none;
  transition: border-color 0.15s, background-color 0.15s;
}
a.stat:hover { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.stat-value { font: 600 1.75rem/1.1 var(--font-display); color: var(--accent-strong); }
.stat-label { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }

/* Research interests panel: 1 / 2 / 3 cards per row */
.interest-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .interest-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .interest-grid { grid-template-columns: repeat(3, 1fr); } }
.main .interest-card {
  display: flex; flex-direction: column; gap: 0.35rem; padding: 1.15rem 1.2rem 1.2rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left; -webkit-hyphens: manual; hyphens: manual;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.interest-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.interest-icon {
  display: grid; place-items: center; width: 2.8rem; height: 2.8rem; margin-bottom: 0.4rem; border-radius: 12px;
  background: var(--accent-soft); color: var(--accent);
}
.interest-title { font-size: 1.02rem; line-height: 1.3; }
.main .interest-text { margin: 0; font-size: 0.88rem; color: var(--muted); text-align: left; }

/* Current research directions (Research & Teaching): illustration beside title + text, stacked on phones */
.directions { display: grid; gap: 1rem; }
.direction {
  display: flex; flex-direction: column; gap: 1rem; padding: 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.direction:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.direction-image { display: block; width: 100%; max-width: 240px; height: auto; align-self: center; border-radius: 22px; }
.direction-body { min-width: 0; }
.direction-title { font-size: 1.15rem; line-height: 1.3; margin-bottom: 0.4rem; }
.direction-text p { margin: 0 0 0.6rem; }
.direction-text p:last-child { margin-bottom: 0; }
/* Courses (Research & Teaching): badges (year, format, language), title, study program, description */
.entry-meta.course-meta { margin: 0 0 0.85rem; } /* beats the later .entry-meta margin */
.badge.badge-year { background: var(--accent-soft); color: var(--accent-strong); font-weight: 600; }
.main .course p { text-align: left; -webkit-hyphens: manual; hyphens: manual; } /* short texts in narrow cards: no justification gaps */
.main .course-program { margin: -0.2rem 0 0.5rem; font-size: 0.88rem; color: var(--accent-strong); text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.main .course-unit { margin: -0.3rem 0 0.5rem; font-size: 0.85rem; color: var(--muted); font-style: italic; }
/* Proposed thesis topics (Supervision & Mentoring): badges, title, text, collapsible references.
   One card per row at every level (owner: the texts are long). */
.main .supervision-intro { margin: 0 0 1rem; }
.supervision-intro p:last-child { margin-bottom: 0; }
.thesis-topic { border-top: 3px solid var(--accent); transition: transform 0.15s, box-shadow 0.15s; }
.thesis-topic:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.cards.thesis-topics { grid-template-columns: 1fr; }
.thesis-topic-title { font-size: 1.08rem; line-height: 1.35; }
.thesis-topic-text p { margin: 0 0 0.6rem; }
.thesis-topic-text p:last-child { margin-bottom: 0; }
.thesis-topic-refs { margin-top: 0.85rem; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.88rem; }
.thesis-topic-refs summary { cursor: pointer; color: var(--accent-strong); font-weight: 600; width: fit-content; }
.thesis-topic-refs summary:hover { color: var(--link-hover); }
.thesis-topic-refs ol { margin: 0.5rem 0 0; padding-left: 1.4rem; color: var(--muted); }
.main .thesis-topic-refs li { margin: 0.25rem 0; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.supervision-record { color: var(--text); }
.mentoring-list .past-group + .past-group { margin-top: 0.15rem; }
.main .mentoring-list .past-note { margin: 0.1rem 0 0; color: var(--muted); }
/* How the owner took part in a jury or committee, when not in person: a small pill at the end of the line */
.badge.participation { font-size: 0.72rem; padding: 0.05rem 0.45rem; margin-left: 0.15rem; vertical-align: 0.08em; white-space: nowrap;
  background: var(--accent-soft); color: var(--accent-strong); }
/* Notes under supervised theses (e.g. "Resulted in one published article"): amber, like the poster-award sponsor note */
.thesis-list .entry-desc { color: var(--link-hover); font-weight: 600; font-size: 0.88rem; }
/* Theses of the same academic year share one row (mergeSameDate); a light rule separates them */
.thesis-list .entry-part + .entry-part { margin-top: 0.8rem; padding-top: 0.8rem; border-top: 1px dashed var(--line); }
/* Main laboratory practicals: photo on top, title, introduction, what students learn; 1 / 2 / 3 per row */
.main .practicals-intro, .main .techniques-intro, .main .poster-awards-intro { margin: 0 0 1rem; font-size: inherit; }
.practicals-intro p:last-child, .techniques-intro p:last-child, .poster-awards-intro p:last-child { margin-bottom: 0; }
.practical-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .practical-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .practical-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.practical {
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.practical:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.practical-image { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid var(--line); }
.practical-body { display: flex; flex-direction: column; gap: 0.45rem; padding: 1rem 1.15rem 1.15rem; }
.practical-title { font-size: 1.05rem; line-height: 1.3; }
.main .practical-body p, .main .practical-learn { margin: 0; } /* left-aligned: see "Short or structured lines" below */
.main .practical-text { font-size: 0.9rem; color: var(--muted); }
.main .practical-learn-title { margin-top: 0.3rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent-strong); }
.main .practical-learn { padding-left: 1.1rem; font-size: 0.9rem; }
.practical-learn li + li { margin-top: 0.2rem; }
.main .practicals-credit { margin: 0.6rem 0 0; font-size: 0.78rem; }

/* Featured project (Projects & Awards, leader projects): head with key facts + schematic, figures, prose, phases */
.featured-project {
  display: flex; flex-direction: column; gap: 1.4rem; padding: 1.4rem;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 7%, var(--surface)), var(--surface) 55%);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); border-radius: calc(var(--radius) * 1.5);
}
.featured-project { container: fp / inline-size; }
.fp-head { display: grid; gap: 1.4rem; grid-template-columns: minmax(0, 1fr); align-items: start; }
/* Side by side (text 5/11, schematic 6/11) only when the card is wide enough for the longest key-fact line
   (RO host line, ~216 px beside the 6.5rem labels); narrower cards stack the schematic below the text. */
@container fp (min-width: 770px) { .fp-head { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); } }
.entry-meta.fp-badges { margin: 0 0 0.6rem; }
.main .fp-acronym { margin: 0; font: 700 clamp(1.9rem, 4vw, 2.6rem)/1.05 var(--font-display); letter-spacing: 0.06em; color: var(--accent-strong); text-align: left; }
.fp-title { margin: 0.45rem 0 0.9rem; font-size: 1.12rem; line-height: 1.35; }
.fp-meta { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.45rem 0.75rem; margin: 0; font-size: 0.88rem; }
.fp-meta div { display: contents; } /* one label column, the same width in EN and RO */
.fp-meta dt { color: var(--muted); }
.fp-meta dd { margin: 0; overflow-wrap: anywhere; }
.main .fp-actions { margin: 1rem 0 0; }
.fp-figure { margin: 0; }
.fp-figure img, .fp-phase img { display: block; width: 100%; height: auto; border-radius: 12px; background: #fff; border: 1px solid var(--line); }
.fp-figure img { padding: 0.6rem; box-sizing: border-box; }
.fp-figure figcaption { margin-top: 0.5rem; font-size: 0.8rem; color: var(--muted); line-height: 1.45; }
.fp-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 720px) { .fp-facts { grid-template-columns: repeat(4, 1fr); } }
.fp-body.prose { margin-top: 0; }
.fp-subtitle { margin: 0; font-size: 1.05rem; }
.fp-phases { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) { .fp-phases { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.fp-phase { display: flex; flex-direction: column; gap: 0.6rem; }
.fp-phase img { aspect-ratio: 16 / 9; object-fit: contain; }
.main .fp-phase-body p { margin: 0; font-size: 0.86rem; }
.main .fp-phase-body .fp-phase-title { margin-bottom: 0.2rem; font-weight: 600; color: var(--accent-strong); }
.main .fp-credit { margin: -0.4rem 0 0; font-size: 0.78rem; }

/* Key-expert projects (Projects & Awards): lighter cards in the style of the featured project, one below the other */
.cards.project-cards { grid-template-columns: 1fr; } /* full width at every screen size (owner's choice) */
.project-card {
  display: flex; flex-direction: column; gap: 0.6rem;
  border-top: 3px solid color-mix(in srgb, var(--accent) 55%, var(--line));
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.project-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.pc-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pc-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.pc-acronym { font: 700 0.95rem/1.2 var(--font-display); letter-spacing: 0.05em; color: var(--accent-strong); }
.pc-title { margin: 0; font-size: 1rem; line-height: 1.4; }
.pc-meta { font-size: 0.84rem; grid-template-columns: 6rem minmax(0, 1fr); }
.main .card .pc-note { font-size: 0.84rem; color: var(--muted); }
.main .pc-actions { margin-top: auto; padding-top: 0.2rem; }

/* Honours & awards: prizes and distinctions as cards with a pictogram tile; series (PRECISI) list years and articles */
.award-cards { display: grid; gap: 1rem; }
.award-card {
  display: flex; gap: 1rem; align-items: flex-start;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.award-card:hover, .poster-award:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); }
.award-icon { flex-shrink: 0; margin-bottom: 0; color: var(--link-hover); background: color-mix(in srgb, var(--link-hover) 14%, var(--surface)); }
.award-body { flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0.45rem; min-width: 0; }
.award-title { margin: 0; font-size: 1rem; line-height: 1.4; }
.main .card .award-note { font-size: 0.86rem; }
.main .award-actions { margin: 0.1rem 0 0; display: flex; gap: 0.4rem; }
.main .card ul.award-years { list-style: none; margin: 0.3rem 0 0; padding: 0; color: var(--text); display: grid; gap: 0.7rem; width: 100%; }
.award-years > li { display: grid; gap: 0.35rem 1rem; grid-template-columns: 1fr; padding-top: 0.7rem; border-top: 1px solid var(--line); }
@media (min-width: 640px) { .award-years > li { grid-template-columns: 9rem minmax(0, 1fr); } }
.award-year { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.award-count { font-size: 0.8rem; color: var(--muted); }
.main .card ul.award-articles { padding-left: 1.1rem; font-size: 0.86rem; color: var(--muted); }
.award-articles li + li { margin-top: 0.15rem; }
/* article text, then the quartile and DOI badges in aligned columns at the end of the line */
.award-article { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; column-gap: 0.9rem; align-items: baseline; }
.main .card .award-footnote { margin: 0.2rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); width: 100%; font-size: 0.78rem; color: var(--muted); }
.badge.badge-q { padding: 0 0.4rem; font-size: 0.7rem; font-weight: 600; align-items: center; justify-content: center; }
.entry-meta .badge.badge-q { padding: 0.22rem 0.5rem; min-width: 2.2rem; font-size: 0.76rem; } /* same height and text size as the IF and AIS badges beside it */
/* Journal quartiles: Q1 red, Q2 yellow (as on the PRECISI card), Q3 grey, Q4 white. Text centred in the box. */
.badge.badge-q1 { background: #fde3e1; color: #b42318; box-shadow: inset 0 0 0 1px #f5b5af; }
.badge.badge-q2 { background: #fdefc8; color: #9a5b00; box-shadow: inset 0 0 0 1px #f2cf7a; }
.badge.badge-q3 { background: #e4e7ec; color: #344054; box-shadow: inset 0 0 0 1px #c4c9d1; }
.badge.badge-q4 { background: #ffffff; color: #475467; box-shadow: inset 0 0 0 1px #d0d5dd; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.badge-q1 { background: rgb(240 82 70 / 0.18); color: #ff9b91; box-shadow: inset 0 0 0 1px rgb(240 82 70 / 0.4); }
  :root:not([data-theme="light"]) .badge.badge-q2 { background: rgb(245 177 40 / 0.18); color: #f7c35f; box-shadow: inset 0 0 0 1px rgb(245 177 40 / 0.4); }
  :root:not([data-theme="light"]) .badge.badge-q3 { background: rgb(152 162 179 / 0.22); color: #c4c9d1; box-shadow: inset 0 0 0 1px rgb(152 162 179 / 0.4); }
  :root:not([data-theme="light"]) .badge.badge-q4 { background: rgb(255 255 255 / 0.1); color: #e4e7ec; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.3); }
}

.badge-diploma { display: inline-flex; align-items: center; gap: 0.3rem; }

/* Image pop-up (main.js, data-lightbox): the scan centred on a dimmed page */
.lightbox {
  max-width: min(96vw, 1200px); max-height: 94vh; padding: 0; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px -20px rgb(0 0 0 / 0.6); overflow: visible;
}
.lightbox::backdrop { background: rgb(15 20 30 / 0.72); }
.lightbox figure { margin: 0; padding: 0.6rem; }
.lightbox img { display: block; max-width: 100%; max-height: calc(94vh - 4.5rem); width: auto; height: auto; margin: 0 auto; border-radius: 8px; }
.lightbox figcaption { padding: 0.55rem 2.5rem 0.2rem 0.3rem; font-size: 0.85rem; color: var(--muted); text-align: left; }
.lightbox-close {
  position: absolute; top: -0.9rem; right: -0.9rem; width: 2.2rem; height: 2.2rem; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1rem; cursor: pointer;
  box-shadow: 0 4px 12px -4px rgb(0 0 0 / 0.4);
}
.lightbox-close:hover { color: var(--link-hover); }
@media (max-width: 640px) { .lightbox-close { top: 0.4rem; right: 0.4rem; } }

/* Best-poster awards: compact cards, two per row */
.poster-award { display: flex; flex-direction: column; gap: 0.5rem; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s; }
.pa-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.pa-when { display: inline-flex; align-items: center; gap: 0.45rem; }
.pa-icon { display: inline-flex; color: var(--link-hover); }
.pa-acronym { font: 700 0.85rem/1.2 var(--font-display); letter-spacing: 0.05em; color: var(--accent-strong); }
.pa-title { margin: 0; font-size: 0.95rem; line-height: 1.4; }
.main .card .pa-people { font-size: 0.82rem; line-height: 1.45; text-align: left; }
.main .card .pa-extra { font-size: 0.82rem; font-weight: 600; color: var(--link-hover); }
.main .card .pa-venue { margin-top: auto; font-size: 0.82rem; }
/* Outreach tiles: the link buttons are the last row; without a venue they take its place at the bottom. */
.main .outreach-card .award-actions { margin-top: auto; }
.main .outreach-card .pa-venue + .award-actions { margin-top: 0.1rem; }
.pa-place { opacity: 0.85; }

/* Other collaborative projects: small group headings (where the owner worked) above simple lists */
.project-group { margin: 1.2rem 0 0.2rem; font-size: 0.95rem; color: var(--accent-strong); }
.project-group:first-of-type { margin-top: 0.4rem; }

/* Earlier teaching: deliberately low-key, a compact list grouped by the position held */
.past-teaching { display: grid; gap: 0.85rem; padding-left: 0.9rem; border-left: 2px solid var(--line); font-size: 0.88rem; }
.main .past-role { margin: 0 0 0.25rem; }
.past-period { color: var(--muted); }
.main .past-list { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.past-list li + li { margin-top: 0.15rem; }
.past-title { color: var(--text); }

/* News: "new" pill in the menu (gentle pulse, none with reduced motion), Home strip, news cards */
.nav-new {
  display: inline-block; margin-left: 0.35rem; padding: 0.05rem 0.45rem; border-radius: 999px; vertical-align: 0.1em;
  background: var(--link-hover); color: #fff; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
.nav-toggle { position: relative; }
.nav-toggle[data-news-new]::after {
  content: ""; position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--link-hover); box-shadow: 0 0 0 2px var(--surface);
}
.nav-new.is-seen, .nav-toggle.is-seen::after { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .nav-new, .nav-toggle[data-news-new]::after { animation: news-pulse 2.4s ease-in-out infinite; }
}
@keyframes news-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--link-hover) 55%, transparent); }
  50% { box-shadow: 0 0 0 5px color-mix(in srgb, var(--link-hover) 0%, transparent); }
}
@media (prefers-color-scheme: dark) { .nav-new { color: #11151b; } }

.news-strip {
  margin: 1.5rem 0 0; padding: 1rem 1.1rem 0.6rem; border-radius: var(--radius);
  background: color-mix(in srgb, var(--link-hover) 7%, var(--surface)); border: 1px solid color-mix(in srgb, var(--link-hover) 30%, var(--line));
}
.news-strip-title { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; font-size: 1.05rem; color: var(--link-hover); }
.news-strip-items { display: grid; gap: 0.6rem; }
@media (min-width: 720px) { .news-strip-items { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }
.news-strip .section-more { margin: 0.6rem 0 0; }

.news-list { display: grid; gap: 1rem; }
.news-card {
  --news: var(--accent);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--news); border-radius: var(--radius);
}
.news-card.is-pinned { box-shadow: 0 8px 22px -16px rgb(0 0 0 / 0.45); border-color: color-mix(in srgb, var(--news) 45%, var(--line)); border-left-color: var(--news); }
.news-award, .news-admission { --news: var(--link-hover); }
.news-outreach { --news: #7c3aed; }
.news-event { --news: #0f766e; }
@media (prefers-color-scheme: dark) { .news-outreach { --news: #b49cf5; } .news-event { --news: #5eead4; } }
.news-image { width: 100%; max-height: 260px; object-fit: cover; background: var(--surface-2); }
@media (min-width: 720px) {
  .news-card:has(.news-image) { flex-direction: row; }
  .news-card .news-image { width: 34%; max-height: none; flex-shrink: 0; }
}
.news-body { flex: 1; min-width: 0; padding: 0.9rem 1.15rem 1rem; display: flex; flex-direction: column; gap: 0.45rem; }
.news-card.is-compact .news-body { padding: 0.65rem 0.85rem 0.7rem; gap: 0.3rem; }
.main .news-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.8rem; color: var(--muted); text-align: left; }
.news-type { display: inline-flex; align-items: center; gap: 0.3rem; font-weight: 600; color: var(--news); text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.74rem; }
.news-new {
  padding: 0.05rem 0.45rem; border-radius: 999px; background: var(--link-hover); color: #fff;
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
}
@media (prefers-color-scheme: dark) { .news-new { color: #11151b; } }
.news-when { display: inline-flex; align-items: center; gap: 0.3rem; }
.main .news-title { margin: 0; font-size: 1.08rem; line-height: 1.35; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.news-card.is-compact .news-title { font-size: 0.95rem; }
.news-title a { color: var(--text); }
.news-title a:hover { color: var(--link-hover); }
.news-text p:last-child { margin-bottom: 0; }
.prose.news-text { margin-top: 0; font-size: 0.96rem; }
.prose.news-text p { margin: 0 0 0.6rem; }
.main .news-actions { margin: 0.2rem 0 0; }
.news-chips .chip svg { vertical-align: -2px; }

/* Affiliations & links: logo tiles in grey, colour on hover; useful links as a plain list */
.logo-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.logo-grid + .logo-grid { margin-top: 0.9rem; } /* one list per line of tiles (details.row) */
@media (min-width: 720px) { .logo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.logo-grid > li { display: flex; min-width: 0; }
.main .logo-tile {
  flex: 1; display: flex; flex-direction: column; gap: 0.2rem; padding: 0.75rem 0.75rem 0.85rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--text); text-align: center; -webkit-hyphens: manual; hyphens: manual; min-width: 0; overflow-wrap: break-word;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.logo-box {
  display: flex; align-items: center; justify-content: center; gap: 0.6rem; height: 5.5rem; margin-bottom: 0.45rem;
  padding: 0.6rem; border-radius: 8px; background: #fff; /* white also in dark mode, where most logos are drawn for */
}
.logo-box img {
  max-height: 100%; max-width: 100%; min-width: 0; object-fit: contain;
  filter: grayscale(1); opacity: 0.7; transition: filter 0.2s, opacity 0.2s;
}
.logo-box img + img { max-width: 45%; }
.logo-box--text { background: var(--surface-2); }
.logo-fallback { font-family: var(--font-display); font-weight: 600; font-size: 0.88rem; line-height: 1.25; color: var(--muted); display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; } /* until the logo file is added */
.logo-name { font-size: 0.86rem; font-weight: 600; line-height: 1.3; }
.logo-note { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.main .logo-tile:hover, .main .logo-tile:focus-visible { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); transform: translateY(-2px); box-shadow: 0 8px 20px -14px rgb(0 0 0 / 0.35); color: var(--text); }
.logo-tile:hover img, .logo-tile:focus-visible img { filter: none; opacity: 1; }
@media (hover: none) { .logo-box img { filter: none; opacity: 1; } } /* touch screens: no hover, show the colours */
.useful-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; font-size: 0.92rem; }
.useful-note { display: block; font-size: 0.82rem; color: var(--muted); }

/* Personal skills (end of Career & Education): CEFR table, driving licence, hobbies */
.main .mother-tongue { margin: 0 0 0.9rem; }
.cefr {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.88rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
}
.cefr caption { caption-side: top; text-align: left; font-weight: 600; padding: 0 0 0.45rem; }
.cefr th, .cefr td { padding: 0.55rem 0.6rem; text-align: center; border-bottom: 1px solid var(--line); }
.cefr thead th { font-weight: 600; color: var(--muted); font-size: 0.8rem; line-height: 1.25; background: var(--surface-2); }
.cefr thead td { background: var(--surface-2); }
.cefr .cefr-groups th { color: var(--text); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; border-bottom-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.cefr tbody th { text-align: left; font-weight: 600; }
.cefr tbody tr:last-child > * { border-bottom: 0; }
.cefr-level {
  display: inline-block; min-width: 2.4rem; padding: 0.2rem 0.45rem; border-radius: 6px;
  font-weight: 600; font-variant-numeric: tabular-nums; cursor: help;
}
.cefr-a { background: var(--surface-2); color: var(--text); }
.cefr-b { background: var(--accent-soft); color: var(--accent-strong); }
.cefr-c { background: var(--accent); color: var(--surface); }
.main .cefr-note { margin: 0.6rem 0 0; font-size: 0.82rem; color: var(--muted); }
.cefr-note p { margin: 0; }
.main .project-note { margin: 1.75rem 0 0; padding-top: 0.6rem; border-top: 1px solid var(--line); font-size: 0.82rem; color: var(--muted); }
.main .project-note p { margin: 0; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
/* Driving licence: one low-key line after the languages (owner, 2026-10-29). */
.main .licence-line { display: flex; align-items: baseline; gap: 0.45rem; margin: 1rem 0 0; font-size: 0.86rem; color: var(--muted); text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.licence-line svg { flex-shrink: 0; align-self: center; color: var(--muted); }
.licence-label { font-weight: 600; }
/* Phones: one block per language, one "skill – level" line per skill */
@media (max-width: 559px) {
  .cefr, .cefr tbody, .cefr tr, .cefr th, .cefr td { display: block; }
  .cefr { background: none; border: 0; border-radius: 0; overflow: visible; }
  .cefr thead { display: none; }
  .cefr caption { display: block; }
  .cefr tbody tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.35rem 0.9rem; }
  .cefr tbody tr + tr { margin-top: 0.6rem; }
  .cefr tbody th { padding: 0.4rem 0; }
  .cefr td { display: flex; justify-content: space-between; align-items: center; padding: 0.3rem 0; border-bottom: 1px dashed var(--line); }
  .cefr td::before { content: attr(data-label); color: var(--muted); }
  .cefr tbody tr:last-child > th { border-bottom: 1px solid var(--line); }
  .cefr tbody tr:last-child > td { border-bottom: 1px dashed var(--line); }
  .cefr tbody tr > td:last-child { border-bottom: 0; }
}
/* Communication and organizational skills: two cards (technique layout) between the languages and the hobbies */
.skill-cards { margin-top: 1.75rem; }
.personal-groups { display: grid; gap: 0 2rem; }
@media (min-width: 720px) {
  .personal-groups { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
  .personal-groups > :only-child { grid-column: 1 / -1; }
}
.personal-items { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
@media (min-width: 560px) { .personal-hobby .personal-items { grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); } }
.personal-item {
  display: flex; align-items: center; gap: 0.8rem; padding: 0.85rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.personal-item .interest-icon { margin-bottom: 0; flex-shrink: 0; }
.personal-text { display: flex; flex-direction: column; gap: 0.1rem; line-height: 1.35; }
.personal-sub { font-size: 0.86rem; color: var(--muted); }

/* Services & Outreach: editorial / evaluation / peer-review cards (award-card layout, accent tile instead of amber) */
.service-cards .award-icon { color: var(--accent-strong); background: var(--accent-soft); }
.service-periods { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.main .card .service-venue { margin: 0; font-size: 0.86rem; color: var(--muted); }
.main .card ul.service-lines { margin: 0; padding-left: 1.1rem; font-size: 0.86rem; color: var(--text); }
.service-lines li + li { margin-top: 0.15rem; }
.main .card .service-note { margin: 0; font-size: 0.86rem; color: var(--text); }
/* Peer review: the journals as chips, grouped by publisher */
.journals { margin: 0.1rem 0 0; display: grid; gap: 0.5rem; width: 100%; }
.journals > div { display: grid; gap: 0.3rem 0.8rem; grid-template-columns: 1fr; align-items: baseline; }
@media (min-width: 640px) { .journals > div { grid-template-columns: 11rem minmax(0, 1fr); } }
.journals dt { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.journals dd { margin: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.journal { padding: 0.12rem 0.55rem; border-radius: 999px; border: 1px solid var(--line); font-size: 0.8rem; line-height: 1.45; color: var(--text); }
.journal-link { transition: border-color 0.15s, color 0.15s; }
.journal-link span { font-size: 0.72rem; color: var(--muted); }
.journal-link:hover { color: var(--link-hover); border-color: var(--link-hover); }
.journal-link:hover span { color: inherit; }
/* Outreach: tiles in the best-poster-award layout (.poster-award, .pa-*); accent pictogram instead of the amber trophy */
.outreach-icon { color: var(--accent-strong); }

/* Experimental techniques: pictogram beside the group title, techniques listed below */
.technique-head { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.75rem; }
.technique-head .interest-icon { margin-bottom: 0; flex-shrink: 0; }
.technique-head .card-title { margin-bottom: 0; }
.technique li + li { margin-top: 0.2rem; }
@media (min-width: 720px) {
  .cards > .technique:last-child:nth-child(odd),
  .cards > .course:last-child:nth-child(odd) { grid-column: 1 / -1; } /* a lone last card fills the row */
  .cards > .technique:last-child:nth-child(odd) ul { columns: 2; column-gap: 2.5rem; }
  .cards > .technique:last-child:nth-child(odd) li { break-inside: avoid; }
}
@media (min-width: 640px) {
  .direction { flex-direction: row; align-items: center; gap: 1.4rem; }
  .direction-image { width: 180px; flex-shrink: 0; }
}

/* Contact section: details + click-to-load map */
.contact-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 760px) { .contact-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); } }
.contact-list {
  list-style: none; margin: 0; padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 1.1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.contact-list li { display: flex; gap: 0.85rem; align-items: flex-start; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.contact-icon {
  flex: none; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
}
.contact-label { display: block; font-size: 0.78rem; color: var(--muted); }
.contact-value { display: block; overflow-wrap: anywhere; }

.map {
  position: relative; min-height: 300px; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--surface-2);
}
.map iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-consent {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.75rem; padding: 1.5rem; text-align: center;
  background:
    radial-gradient(circle at 30% 40%, color-mix(in srgb, var(--accent) 10%, transparent) 0 18%, transparent 19%),
    repeating-linear-gradient(45deg, transparent 0 22px, color-mix(in srgb, var(--line) 60%, transparent) 22px 23px),
    var(--surface-2);
}
.map-consent p { margin: 0; max-width: 34ch; font-size: 0.86rem; color: var(--muted); }
.main .map .map-consent p { text-align: center; }
.map-pin { display: grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: 0 2px 8px rgb(0 0 0 / 0.08); }
.map-actions { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; justify-content: center; }
.map-external { font-size: 0.86rem; }

.contact { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; margin: 0; }
.contact dt { color: var(--muted); font-size: 0.85rem; padding-top: 0.1rem; }
.contact dd { margin: 0; overflow-wrap: anywhere; }
/* Profile links (Web of Science, Scopus, Scholar, ORCID, LinkedIn) */
.profile-links { list-style: none; display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0 0; padding: 0; }
.profile-link {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.8rem 0.4rem 0.6rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--text); text-decoration: none; font-size: 0.86rem; font-weight: 500; white-space: nowrap;
  transition: border-color 0.15s, background-color 0.15s;
}
.profile-link svg { color: var(--brand); flex: none; }
.profile-link:hover {
  color: var(--text); border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
}

/* ---- Research cards ------------------------------------------------------ */

.cards { display: grid; gap: 1rem; }
@media (min-width: 720px) { .cards { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem;
}
.card-title { font-size: 1.05rem; margin-bottom: 0.5rem; }
.card ul { margin: 0; padding-left: 1.1rem; color: var(--muted); }
.card p { margin: 0; color: var(--muted); }

/* ---- Entry lists (shared by every category) ------------------------------ */

.entries { list-style: none; margin: 0; padding: 0; }

.entry {
  display: grid; grid-template-columns: 1fr; gap: 0.15rem;
  padding: 0.9rem 0; border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: 0; }
/* Current → past boundary (entries.php with $pastLabel): accent line, then a small label. */
.entry.is-current-last { border-bottom: 2px solid var(--accent); padding-bottom: 1.1rem; }
.entry[data-divider] { padding-top: 1.1rem; }
.entry[data-divider]::before {
  content: attr(data-divider); grid-column: 1 / -1; margin-bottom: 0.35rem;
  font: 600 0.72rem/1 var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent);
}

.entry-aside { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.entry-num { font-weight: 600; }

@media (min-width: 640px) {
  .entry { grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.25rem; }
  .entries.is-numbered .entry { grid-template-columns: 2.75rem minmax(0, 1fr); }
  .entry-aside { padding-top: 0.12rem; }
  .entry-num { text-align: right; }
}

.entry-main { margin: 0; overflow-wrap: break-word; }
.entry-inline-meta { display: inline-flex; flex-wrap: wrap; gap: 0.3rem; vertical-align: 0.08em; margin-left: 0.2rem; }
.entry-inline-meta .badge { font-size: 0.72rem; padding: 0.05rem 0.45rem; white-space: nowrap; }
/* Several entries sharing one date (merged row) */
.entry-part + .entry-part { margin-top: 0.7rem; }
.entry-heading { font-weight: 600; }
.entry-title { color: var(--text); }
.entry-sub { display: block; color: var(--muted); font-size: 0.93rem; }
.entry-web { font-size: 0.88rem; }
.people { color: var(--muted); }
.owner { color: var(--owner); font-weight: 650; }

.entry-desc { color: var(--muted); font-size: 0.93rem; margin-top: 0.35rem; }
.entry-desc p, .entry-desc ul { margin: 0; }
.entry-desc ul { padding-left: 1.1rem; }

.entry-meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.5rem 0 0; }
.entry-meta.entry-prize { margin-top: 0.35rem; }
.badge {
  display: inline-flex; align-items: baseline; gap: 0.35rem;
  font-size: 0.76rem; line-height: 1.3; padding: 0.22rem 0.55rem;
  border-radius: 6px; background: var(--surface-2); color: var(--text);
}
.badge-label { color: var(--muted); }
/* The JCR edition before IF, AIS and quartile when it isn't the year of publication: a plain grey label, not a box */
.badge.badge-jcr { background: none; padding-left: 0; padding-right: 0.1rem; color: var(--muted); font-weight: 600; }
/* Recurring stays merged into one entry (mobility detail "stays"): one badge per year, professor stays tinted. */
.stay-years { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.35rem 0 0.1rem; }
.badge.stay { font-variant-numeric: tabular-nums; }
.badge.stay-professor { background: var(--accent-soft); color: var(--accent-strong); }
.badge.stay-professor .badge-label { color: inherit; opacity: 0.75; }
/* Researcher stays: filled in a soft teal (owner's choice, 2026-10-29), a colour used nowhere else, so not read as an award. */
.badge.stay-researcher { background: #dcefe9; color: #1d5e4f; }
.badge.stay-researcher .badge-label { color: inherit; opacity: 0.75; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.stay-researcher { background: rgb(64 170 140 / 0.2); color: #8fd6c2; }
}
.badge-link { background: var(--accent-soft); color: var(--accent-strong); text-decoration: none; font-weight: 600; }
.badge-link:hover { color: var(--link-hover); }

/* ---- Filters ------------------------------------------------------------- */

.filters { margin-bottom: 1.25rem; }
.filter-check { display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-end; padding: 0.45rem 0; font-size: 0.85rem; color: var(--text); cursor: pointer; white-space: nowrap; }
@media (max-width: 400px) { .filter-check { white-space: normal; } } /* the narrowest phones: the role label wraps */
.filter-check input { width: 1rem; height: 1rem; margin: 0; accent-color: var(--accent); cursor: pointer; }
.section + .filters { margin-top: 2.5rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.35rem 0.8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: 0.88rem;
}
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-n { font-size: 0.75rem; opacity: 0.7; font-variant-numeric: tabular-nums; }

.filter-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.75rem; }
.field { display: flex; flex-direction: column; gap: 0.25rem; }
.field-grow { flex: 1 1 12rem; } /* room for the role checkbox, Filter, Clear filters and the count on one row */
.field-label { font-size: 0.78rem; color: var(--muted); }
.field select, .field input {
  font: inherit; font-size: 0.92rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; padding: 0.5rem 0.65rem; min-height: 40px; width: 100%;
}
.button {
  font: inherit; font-size: 0.92rem; font-weight: 600; min-height: 40px; padding: 0.5rem 1rem;
  border: 0; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer;
}
.button:hover { background: var(--accent-strong); }
@media (prefers-color-scheme: dark) { .button, .chip[aria-current="true"] { color: #0d1a26; } }
/* level with the middle of the 40px Filter button (the row is aligned at the bottom, under the field labels) */
.filter-reset, .filter-count { align-self: flex-end; line-height: 40px; }
.filter-reset { font-size: 0.88rem; }
.filter-count { font-size: 0.85rem; color: var(--muted); }

/* ---- Justified text blocks (hyphenation follows <html lang>) -------------- */

.main p, .main li, .entry-main, .entry-desc {
  text-align: justify;
  -webkit-hyphens: auto;
  hyphens: auto;
}
/* Short or structured lines stay left-aligned. */
.main .entry-meta, .main .note, .main .legend, .main .empty, .site-footer p, .main .entry-sub,
.main .contact-list li, .main .map-consent p, .main .technique li, .main .practical, .main .practical p, .main .practical li, .main .past-teaching p, .main .past-teaching li, .main .mother-tongue, .main .cefr-note p, .main .personal-item, .main .fp-head, .main .fp-phase p, .main .fp-figure figcaption, .main .project-card, .main .project-card p, .main .award-card, .main .award-card p, .main .poster-award, .main .poster-award p, .main .outreach-card, .main .outreach-card p, .main .outreach-card li,
.hero-title, .hero-affiliation, .hero-units li, .card-title {
  text-align: left;
  -webkit-hyphens: manual; hyphens: manual;
}
/* Never hyphenate people's names. */
.people { -webkit-hyphens: manual; hyphens: manual; }

/* ---- Print: a clean paper CV --------------------------------------------- */

@media print {
  .sidebar, .filters, .skip-link { display: none !important; }
  .shell { display: block; }
  .main { max-width: none; padding: 0; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .badge-link::after { content: " " attr(href); font-weight: 400; }
}

/* ---- Publication statistics (partials/pub-stats.php) ---------------------- */
/* Quartile fills are the badge colours (Q1 red, Q2 yellow, Q3 grey, Q4 white, each with its outline);
   "no quartile" is hatched. */
/* the badge colours (.badge-q1…q4): fill = badge background, edge = badge text colour (for contrast) */
:root {
  --q1-fill: #fde3e1; --q1-edge: #b42318; --q2-fill: #fdefc8; --q2-edge: #9a5b00;
  --q3-fill: #e4e7ec; --q3-edge: #344054; --q4-fill: #ffffff; --q4-edge: #475467; --q-none: #98a2b3;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --q1-fill: rgb(240 82 70 / 0.18); --q1-edge: #ff9b91; --q2-fill: rgb(245 177 40 / 0.18); --q2-edge: #f7c35f;
    --q3-fill: rgb(152 162 179 / 0.22); --q3-edge: #c4c9d1; --q4-fill: rgb(255 255 255 / 0.1); --q4-edge: #e4e7ec; --q-none: #7d8696;
  }
}
.stats-open-row { margin: 0 0 0.6rem; }
.stats-open { display: inline-flex; align-items: center; gap: 0.45rem; }
.stats-dialog {
  width: min(94vw, 760px); max-height: 92vh; padding: 1.4rem 1.5rem 1.2rem; border: 0; border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px -20px rgb(0 0 0 / 0.6);
}
.stats-dialog[open] { display: flex; flex-direction: column; gap: 1.1rem; overflow-y: auto; position: fixed; }
.stats-dialog::backdrop { background: rgb(15 20 30 / 0.72); }
.stats-dialog .lightbox-close { top: 0.7rem; right: 0.7rem; z-index: 2; }
.stats-title { margin: 0; padding-right: 2.5rem; font-size: 1.3rem; }
.stats-figures { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin: 0; }
.stats-figures .if-tile { grid-column: 1 / -1; } /* phones: the impact-factor tile takes a full row */
@media (min-width: 640px) {
  .stats-figures { grid-template-columns: 1fr 1.2fr 1.35fr; } /* middle: room for "of 67 articles with a quartile" on one line */
  .stats-figures .if-tile { grid-column: auto; }
}
.stats-figures > div { padding: 0.75rem 0.85rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.stats-figures dt { font-size: 0.78rem; color: var(--muted); }
.stats-figures dd { margin: 0.15rem 0 0; font: 700 1.6rem/1.15 var(--font-display); color: var(--text); }
.stats-figures p { margin: 0.2rem 0 0; font-size: 0.78rem; color: var(--muted); line-height: 1.3; }
.stats-figures p.stats-sub { margin-top: 0.35rem; font-size: 0.95rem; font-weight: 600; color: var(--text); }
.stats-figures dd.if-steps { display: flex; flex-direction: column; gap: 0.1rem; font-size: 1rem; line-height: 1.35; }
.if-steps span { display: flex; justify-content: space-between; align-items: baseline; gap: 0.6rem; font-weight: 700; }
.if-steps small { font: 500 0.78rem/1 var(--font-body); color: var(--muted); }
.if-steps .if-max { margin-top: 0.25rem; padding-top: 0.3rem; border-top: 1px solid var(--line); }
/* "Highest IF 21.95": label and value in the same type as "of 67 articles with a quartile" (.stats-sub) */
.if-steps .if-max, .if-steps .if-max small { font: 600 0.95rem/1.35 var(--font-body); color: var(--text); }
.if-max-source { display: block; font: italic 400 0.72rem/1.3 var(--font-body); color: var(--muted); text-align: right; }
.stats-hindex { margin: -0.3rem 0 0; font-size: 0.85rem; color: var(--text); }
.stats-hindex span { color: var(--muted); }
.stats-block h3 { margin: 0 0 0.5rem; font-size: 1rem; }
.stats-legend, .quartile-legend { list-style: none; margin: 0 0 0.5rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; font-size: 0.8rem; color: var(--muted); }
.stats-legend li { display: inline-flex; align-items: center; gap: 0.35rem; }
.swatch { display: inline-block; width: 0.8rem; height: 0.8rem; border-radius: 3px; }
.swatch-q1, .seg-q1 { background: var(--q1-fill); fill: var(--q1-fill); box-shadow: inset 0 0 0 1.25px var(--q1-edge); stroke: var(--q1-edge); }
.swatch-q2, .seg-q2 { background: var(--q2-fill); fill: var(--q2-fill); box-shadow: inset 0 0 0 1.25px var(--q2-edge); stroke: var(--q2-edge); }
.swatch-q3, .seg-q3 { background: var(--q3-fill); fill: var(--q3-fill); box-shadow: inset 0 0 0 1.25px var(--q3-edge); stroke: var(--q3-edge); }
.swatch-q4, .seg-q4 { background: var(--q4-fill); fill: var(--q4-fill); box-shadow: inset 0 0 0 1.25px var(--q4-edge); stroke: var(--q4-edge); }
.seg-q1, .seg-q2, .seg-q3, .seg-q4 { stroke-width: 1.25; }
.swatch-none { background: repeating-linear-gradient(45deg, var(--q-none) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--q-none); }
.seg-none { fill: url(#hatch-none); stroke: var(--q-none); stroke-width: 1; }
.hatch-bg { fill: var(--surface); }
.hatch-line { stroke: var(--q-none); stroke-width: 2; }
.stats-chart { position: relative; }
.stats-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.stats-chart .grid { stroke: var(--line); stroke-width: 1; }
.stats-chart .tick { fill: var(--muted); font-size: 10px; font-family: var(--font-body); }
.stats-chart .hit { fill: transparent; }
.stats-chart .bar.is-hover .hit { fill: color-mix(in srgb, var(--accent) 10%, transparent); }
.chart-tip {
  position: absolute; transform: translate(-50%, -100%); pointer-events: none; white-space: nowrap;
  padding: 0.3rem 0.55rem; border-radius: 6px; font-size: 0.78rem; background: var(--text); color: var(--surface);
  box-shadow: 0 6px 16px -6px rgb(0 0 0 / 0.4);
}
.stats-table summary { cursor: pointer; font-size: 0.82rem; color: var(--muted); margin-top: 0.4rem; }
.stats-table summary:hover { color: var(--link-hover); }
.stats-table-wrap { max-height: 14rem; overflow: auto; margin-top: 0.4rem; }
.stats-table table { border-collapse: collapse; width: 100%; font-size: 0.8rem; font-variant-numeric: tabular-nums; }
.stats-table th, .stats-table td { padding: 0.2rem 0.5rem; border-bottom: 1px solid var(--line); text-align: right; }
.stats-table th:first-child { text-align: left; }
.quartile-bar { display: flex; gap: 2px; height: 1.1rem; margin: 0 0 0.55rem; }
.quartile-bar span { border-radius: 4px; }
.quartile-legend { gap: 0.4rem 1.2rem; color: var(--text); }
.quartile-legend .muted { color: var(--muted); }
.top-cited { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.7rem; font-size: 0.86rem; }
.top-cited li { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 0.8rem; row-gap: 0.15rem; }
.top-cited a { grid-column: 1 / -1; color: var(--text); font-weight: 600; }
.top-cited a:hover { color: var(--link-hover); }
.top-venue { grid-column: 1 / -1; font-size: 0.78rem; color: var(--muted); font-style: italic; }
.top-bar { align-self: center; height: 0.45rem; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.top-bar span { display: block; height: 100%; border-radius: 4px; background: var(--accent); }
.top-counts { font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.top-counts b { color: var(--text); }
.stats-note { margin: 0; font-size: 0.75rem; color: var(--muted); }

/* ---- Conference statistics (partials/conf-stats.php, partials/bar-chart.php) ---------------- */
/* Types: the first four slots of the dataviz reference palette (validated for stacked bars), with
   their dark-mode steps; the table view gives the values for the lighter ones. */
:root {
  --t-plenary: #2a78d6; --t-invited: #eb6834; --t-oral: #1baf7a; --t-poster: #eda100;
  --map-land: #e7e4dc; --map-visited: #c9dbe9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --t-plenary: #3987e5; --t-invited: #d95926; --t-oral: #199e70; --t-poster: #c98500;
    --map-land: #262e39; --map-visited: #2c4660;
  }
}
.seg-plenary { fill: var(--t-plenary); background: var(--t-plenary); }
.seg-invited { fill: var(--t-invited); background: var(--t-invited); }
.seg-oral    { fill: var(--t-oral); background: var(--t-oral); }
.seg-poster  { fill: var(--t-poster); background: var(--t-poster); }
.seg-person  { fill: var(--accent); background: var(--accent); }
.seg-online  { fill: url(#hatch-online); stroke: var(--accent); stroke-width: 1.25;
  background: repeating-linear-gradient(45deg, var(--accent) 0 2px, var(--surface) 2px 4px); box-shadow: inset 0 0 0 1.25px var(--accent); }
.hatch-online { stroke: var(--accent); stroke-width: 2; }
.stats-dialog p { text-align: left; -webkit-hyphens: manual; hyphens: manual; } /* short figures and notes: not justified like the page text */
.conf-figures { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .conf-figures { grid-template-columns: 0.95fr 1fr 1.2fr 0.85fr; } } /* Cities wider: "32 outside Romania" / „32 în afara României” on one line */

.stats-map { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.stats-map svg { overflow: hidden; border-radius: 12px; } /* the frame clips the map, not the tooltip */
.stats-map .chart-tip { white-space: normal; width: max-content; max-width: min(22rem, 90%); text-align: center; }
.stats-map .land { fill: var(--map-land); stroke: var(--surface); stroke-width: 0.6; }
.stats-map .land.visited { fill: var(--map-visited); }
.stats-map .map-window { fill: none; stroke: var(--muted); stroke-width: 1; stroke-dasharray: 4 3; }
.stats-map .dot { fill: var(--accent); fill-opacity: 0.85; stroke: var(--surface); stroke-width: 1.5; }
.stats-map .dot.online { fill: var(--surface); fill-opacity: 1; stroke: var(--accent); stroke-width: 2; }
.stats-map .hit { fill: transparent; }
.stats-map .city.is-hover .dot { fill: var(--link-hover); fill-opacity: 1; }
.stats-map .city.is-hover .dot.online { fill: var(--surface); stroke: var(--link-hover); }
.stats-map .map-label { font: 600 15px var(--font-body); fill: var(--text); stroke: var(--surface); stroke-width: 4px;
  paint-order: stroke; stroke-linejoin: round; pointer-events: none; }
.map-caption { margin: 0.8rem 0 0.4rem; font-size: 0.85rem; font-weight: 600; color: var(--muted); }
.swatch.map-dot { border-radius: 50%; background: var(--accent); }
.swatch.map-dot.online { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); }
.swatch.map-visited { background: var(--map-visited); }

.country-bars { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr) 2.2rem;
  gap: 0.3rem 0.7rem; align-items: center; font-size: 0.84rem; }
.country-bars li { display: contents; }
.country-bar { display: flex; gap: 2px; height: 0.7rem; }
.country-bar span { border-radius: 3px; min-width: 3px; }
.country-count { text-align: right; font-variant-numeric: tabular-nums; }

/* ---- Site search (partials/search-form.php, pages/search.php, main.js) ------------------------------------------- */

.search-form { position: relative; display: flex; align-items: center; gap: 0.5rem; }
.search-icon { position: absolute; left: 0.85rem; top: 50%; transform: translateY(-50%); display: grid; color: var(--muted); pointer-events: none; }
.search-input {
  flex: 1 1 auto; min-width: 0; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 999px; padding: 0.6rem 1rem 0.6rem 2.6rem; min-height: 44px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-input::placeholder { color: var(--muted); opacity: 1; }
.search-input:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.search-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.search-input::-webkit-search-cancel-button { cursor: pointer; }
.search-submit { flex: none; border-radius: 999px; min-height: 44px; padding: 0.5rem 1.2rem; }

/* Sidebar: small, under the menu (inside the menu on phones) */
.search-form--sidebar { margin: 0.9rem 0 0 0.75rem; }
.search-form--sidebar .search-icon { left: 0.7rem; }
.search-form--sidebar .search-input { font-size: 0.85rem; min-height: 38px; padding: 0.4rem 0.8rem 0.4rem 2.1rem; background: var(--surface-2); }
.search-form--sidebar .search-input:focus { background: var(--surface); }

/* Home (under the profile buttons) and the results page: wide, with a button */
.search-form--home { margin: 1.4rem 0 0; max-width: 42rem; }
.search-form--home .search-input, .search-form--page .search-input { min-height: 48px; font-size: 1rem; box-shadow: 0 6px 18px -16px rgb(0 0 0 / 0.5); }
.search-form--home .search-submit, .search-form--page .search-submit { min-height: 48px; }
.search-form--page { margin: 0 0 1.25rem; max-width: 42rem; }

/* Suggestions drop-down */
.search-suggest {
  position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; right: 0; max-height: min(70vh, 30rem); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.35rem;
  box-shadow: 0 16px 36px -18px rgb(0 0 0 / 0.45);
}
.search-form--home .search-suggest, .search-form--page .search-suggest { right: auto; width: 100%; }
.search-option, .search-all {
  display: block; padding: 0.45rem 0.65rem; border-radius: 8px; color: var(--text); text-decoration: none; line-height: 1.35;
}
.search-option:hover, .search-option[aria-selected="true"], .search-all:hover, .search-all[aria-selected="true"] { background: var(--accent-soft); color: var(--text); }
.search-option-page { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.search-option-title { display: block; font-size: 0.9rem; overflow-wrap: anywhere; }
.search-option-meta { display: block; font-size: 0.78rem; color: var(--muted); }
.search-all { margin-top: 0.25rem; border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; font-size: 0.86rem; font-weight: 600; color: var(--accent-strong); }
.search-empty { margin: 0; padding: 0.55rem 0.65rem; font-size: 0.86rem; color: var(--muted); }
.search-form--sidebar .search-option-title { font-size: 0.84rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.search-form--sidebar .search-option-meta { display: none; }

mark { background: var(--mark); color: inherit; border-radius: 2px; }

/* Results page */
.main .search-summary { font-weight: 600; margin: 0 0 1rem; text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.main .search-note { text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.search-jump { margin-bottom: 0.5rem; }
.search-group .section-title a { color: inherit; }
.search-group .section-title a:hover { color: var(--link-hover); }
.search-count { font-size: 0.8rem; font-weight: 600; color: var(--muted); font-family: var(--font-body); }
.search-group .to-top { margin-left: auto; }
.search-results { list-style: none; margin: 0; padding: 0; }
.main .search-result { padding: 0.75rem 0; border-bottom: 1px solid var(--line); text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.main .search-result:last-child { border-bottom: 0; }
.search-result-title { font-weight: 600; line-height: 1.4; }
.main .search-result-meta { margin: 0.15rem 0 0; font-size: 0.82rem; color: var(--muted); text-align: left; -webkit-hyphens: manual; hyphens: manual; }
.main .search-result-excerpt { margin: 0.25rem 0 0; font-size: 0.9rem; text-align: left; -webkit-hyphens: manual; hyphens: manual; }

/* Where a search result lands: an invisible anchor at the top of its card, and a short glow on the card */
.entry-anchor { position: absolute; width: 0; height: 0; overflow: hidden; }
@keyframes search-target { from { box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-hover) 70%, transparent); } to { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: no-preference) {
  .main :has(> .entry-anchor:target), .main .entry-part:target, .main .news-card:target { animation: search-target 2.6s ease-out; border-radius: var(--radius); }
}
