/* --- Font (must be first) --- */
@import url("https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,300..900;1,300..900&display=swap");

/* ==========================================================
   Robert Frenken — Quarto theme overrides (cosmo / darkly)
   Order: tokens → typography → content → chrome → components
   ========================================================== */

/* --- Tokens --- */
:root {
  --scarlet: #bb0000;
  --scarlet-dark: #990000;
  --scarlet-light: #dd2222;
  --scarlet-on-dark: #ff4444;
  --gray-700: #333;
  --font-body: "Source Sans 3", "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* --- Typography --- */
body { font-family: var(--font-body); }

/* --- Content links --- */
main.content a,
.quarto-title-block a {
  color: var(--scarlet);
  text-decoration-color: transparent;
  transition: text-decoration-color 0.15s ease;
}
main.content a:hover,
.quarto-title-block a:hover {
  color: var(--scarlet-dark);
  text-decoration-color: var(--scarlet-dark);
}
.quarto-dark main.content a,
.quarto-dark .quarto-title-block a { color: var(--scarlet-light); }
.quarto-dark main.content a:hover,
.quarto-dark .quarto-title-block a:hover {
  color: var(--scarlet-on-dark);
  text-decoration-color: var(--scarlet-on-dark);
}

/* --- Headings --- */
main.content h2 {
  border-bottom: 2px solid var(--scarlet);
  padding-bottom: 0.3rem;
  margin-top: 2rem;
}
main.content h2 a,
main.content h3 a {
  color: inherit !important;
  text-decoration: none !important;
}

/* --- Chrome hover (navbar, sidebar, TOC, footer, theme toggle) --- */
.navbar .nav-link:hover,
.navbar .navbar-brand:hover,
.sidebar a:hover,
#TOC a:hover,
.sidebar-toc a:hover,
.nav-footer a:hover,
.quarto-color-scheme-toggle:hover {
  color: var(--scarlet) !important;
}

/* --- Chrome active state --- */
.navbar .nav-link.active,
.navbar .nav-link[aria-current="page"],
.sidebar-item-text.active,
.sidebar-link.active,
.sidebar nav a.active {
  color: var(--scarlet) !important;
  font-weight: 600;
}
#TOC .active,
#TOC a.active,
.sidebar-toc a.active {
  color: var(--scarlet) !important;
  border-left-color: var(--scarlet) !important;
}

/* --- Search --- */
.aa-DetachedSearchButton:hover,
.aa-DetachedSearchButton:focus-within,
input.aa-Input:focus {
  border-color: var(--scarlet) !important;
  outline-color: var(--scarlet) !important;
}

/* --- Components: profile image --- */
.rounded-image,
img.rounded-image {
  border-radius: 50%;
  max-width: 200px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* --- Components: profile links row --- */
.profile-links,
.profile-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  list-style: none;
  padding-left: 0;
  margin: 1rem 0 1.5rem;
}
.profile-links li { font-weight: 500; }
.profile-links a { color: var(--gray-700); transition: color 0.15s ease; }
.profile-links a:hover { color: var(--scarlet); }
.quarto-dark .profile-links a { color: #e5e5e5; }
.quarto-dark .profile-links a:hover { color: var(--scarlet-light); }
