/* sdvplotR pkgdown theme -- the SportsDataverse house recipe (cfbfastR / hoopR /
   fastRhockey share it): Lato body, Chivo headings, Fira Mono code and navbar,
   Bungee brand with a glow, written for Bootstrap 5 (bare .navbar-brand /
   .navbar-nav selectors; BS5 has no .navbar-dark class). Palette: the hex logo's
   navy sky and the SDV gradient (#3346F0 -> #7FE6DC). */

@import url('https://fonts.googleapis.com/css2?family=Chivo:wght@400;500;800');
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@400;700');
@import url('https://fonts.googleapis.com/css2?family=Fira+Mono');
@import url('https://fonts.googleapis.com/css2?family=Bungee&display=swap');

:root {
  --sdv-navy: #0B1A33;
  --sdv-navy-2: #16305C;
  --sdv-blue: #3346F0;
  --sdv-cyan: #7FE6DC;
  --sdv-ice: #9CCBFF;
  --sdv-accent: #2680E4;
  --sdv-glow: #7FE6DC;
}

/* ---- type -------------------------------------------------------------- */
body {
  font-family: "Lato", "Segoe UI", system-ui, sans-serif;
  color: #0f0f0f;
  font-size: 18px;
}
h1, h2, .h1, .h2 {
  font-family: "Chivo", "Lato", sans-serif;
  letter-spacing: 1px;
  /* unitless, so wrapped titles keep their spacing at every heading size; a
     fixed 2.2rem overlapped the lines once a desktop h1 outgrew it */
  line-height: 1.2;
  color: #0f0f0f;
  font-weight: 500;
}
h3, h4, h5, h6, .h3, .h4 {
  font-family: "Chivo", "Lato", sans-serif;
  letter-spacing: 1px;
  line-height: 1.3;
  color: #0f0f0f;
  font-weight: 500;
}
pre, code {
  font-family: "Fira Mono", Consolas, Inconsolata, monospace;
}
pre {
  border-left: 4px solid var(--sdv-accent);
  border-radius: 0.25rem;
}
.figure { margin-top: 10px; margin-bottom: 10px; }

/* ---- navbar (BS5 markup: <nav class="navbar"> ... <a class="nav-link">) ---- */
.navbar {
  background-color: var(--sdv-navy) !important;
}
@keyframes glow {
  from { text-shadow: 0 0 8px var(--sdv-glow), 0 0 10px var(--sdv-glow); }
  to   { text-shadow: 0 0 10px var(--sdv-glow), 0 0 14px var(--sdv-glow); }
}
.navbar-brand {
  font-family: "Bungee", "Chivo", sans-serif;
  font-size: 16px;
  color: var(--sdv-cyan) !important;
  animation: glow 3s ease-in-out infinite alternate;
}
small.nav-text.text-muted {
  color: var(--sdv-ice) !important;
}
.navbar-nav .nav-link {
  font-family: "Fira Mono", monospace;
  font-size: small;
  color: #B7C4DA;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link:focus,
.navbar-nav .nav-link.active,
.navbar-nav .show > .nav-link {
  color: #ffffff;
  background: var(--sdv-navy-2);
  border-radius: 0.25rem;
}
.navbar input[type="search"] {
  border-color: #3b4f78;
  background-color: #ffffff;
  color: #3b3e3f;
}
/* the box stays white in dark mode, so pin a placeholder that reads on white
   (Bootstrap's dark placeholder is a pale grey) */
.navbar input[type="search"]::placeholder {
  color: #5B6B86;
  opacity: 1;
}
.dropdown-menu {
  box-shadow: 0 6px 12px rgba(5, 5, 5, 0.18);
  background-color: var(--sdv-navy);
}
.dropdown-header {
  font-family: "Chivo", sans-serif;
  letter-spacing: 0.1px;
  line-height: 1.3rem;
  color: var(--sdv-cyan);
  font-weight: 700;
  font-size: 14px;
  animation: glow 2.5s ease-in-out infinite alternate;
}
.dropdown-item {
  color: #EAEBEC;
  font-family: "Fira Mono", monospace;
  font-size: small;
}
.dropdown-item:hover, .dropdown-item:focus {
  color: #fff;
  background-color: var(--sdv-navy-2);
}
.dropdown-divider {
  border-top: 1px solid #ffffff;
}
[role="button"] { color: var(--sdv-ice); }

/* ---- sidebar / toc ------------------------------------------------------ */
#toc ul.nav li a {
  font-family: "Fira Mono", monospace;
  margin-left: 5px;
  font-size: 14px;
  line-height: 1.65rem;
}

/* the home sidebar is ~180px wide at tablet widths; keep README badges inside it */
aside img {
  max-width: 100%;
  height: auto;
}

/* ---- reference index ----------------------------------------------------- */
.reference-index h2 {
  border-bottom: 2px solid var(--sdv-accent);
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

/* ---- articles index: rule between per-sport and cookbook groups ---------- */
.template-article-index main .section + .section {
  border-top: 1px solid rgba(128, 132, 128, 0.35);
  margin-top: 2.25rem;
  padding-top: 1.75rem;
}

footer {
  border-top: 2px solid var(--sdv-accent);
  padding-top: 1rem;
  margin-top: 2rem;
}
.pkgdown-footer-right { display: none; }

/* ---- dark mode: content only, navbar/glow untouched ---------------------- */
[data-bs-theme="dark"] body { color: #EAEBEC; }
[data-bs-theme="dark"] :is(#main, aside) h1,
[data-bs-theme="dark"] :is(#main, aside) h2,
[data-bs-theme="dark"] :is(#main, aside) h3,
[data-bs-theme="dark"] :is(#main, aside) h4,
[data-bs-theme="dark"] :is(#main, aside) h5,
[data-bs-theme="dark"] :is(#main, aside) h6,
[data-bs-theme="dark"] :is(#main, aside) .h1,
[data-bs-theme="dark"] :is(#main, aside) .h2,
[data-bs-theme="dark"] :is(#main, aside) .h3,
[data-bs-theme="dark"] :is(#main, aside) .h4 {
  color: #EAEBEC;
}
[data-bs-theme="dark"] :is(#main, aside) a { color: var(--sdv-ice); }
[data-bs-theme="dark"] pre { border-left-color: var(--sdv-cyan); }

/* ---- phones: a smaller logo so the title and intro keep a readable measure */
@media (max-width: 575.98px) {
  /* .template-home is pkgdown's own home-page selector (120px); match it */
  img.logo,
  .template-home img.logo {
    width: 72px;
    margin-left: 12px;
  }
}

/* ---- honour reduced-motion: keep the glow, stop it pulsing ---------------- */
@media (prefers-reduced-motion: reduce) {
  .navbar-brand, .dropdown-header {
    animation: none;
    text-shadow: 0 0 8px var(--sdv-glow);
  }
}
