/* ============================================================
   Design system —  local Didot /
   Baskerville / Avenir Next; other visitors see GFS Didot /
   Libre Baskerville / Nunito Sans loaded from Google Fonts.
   ============================================================ */

/* ---- 1. Palette + type tokens ----------------------------- */
:root {
  --athena:     #8B95C9;
  --rose:       #E8B5A8;
  --gold:       #C9A961;
  --night:      #2D3550;
  --terracotta: #8B4543;
  --storm:      #6B7894;
  --cream:      #EDE3D4;
  --paper:      #FBF7EF;
  --ink:        #1A1F2E;

  --font-display: 'Didot', 'GFS Didot', 'Bodoni 72', 'Bodoni MT', serif;
  --font-body:    'Baskerville', 'Libre Baskerville', 'Hoefler Text', Georgia, serif;
  --font-ui:      'Avenir Next', 'Avenir', 'Nunito Sans', 'Helvetica Neue', sans-serif;
}

/* ---- 2. Bootstrap variable overrides ---------------------- */
:root {
  --bs-body-font-family: var(--font-body);
  --bs-body-font-size: 1.02rem;
  --bs-body-line-height: 1.7;
  --bs-body-color: var(--ink);
  --bs-body-bg: var(--paper);
  --bs-link-color: var(--athena);
  --bs-link-hover-color: var(--terracotta);
  --bs-primary: var(--athena);
  --bs-primary-rgb: 139, 149, 201;
  --bs-border-color: rgba(139, 149, 201, 0.2);
  --bs-emphasis-color: var(--ink);
}

/* ---- 3. Body base ----------------------------------------- */
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.02rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- 4. Headings ------------------------------------------ */
h1, .h1, h2, .h2, h3, .h3 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
  margin-top: 2em;
  margin-bottom: 0.5em;
  line-height: 1.18;
}

h1, .h1 { font-size: 2.4rem; }
h2, .h2 { font-size: 1.75rem; }
h3, .h3 { font-size: 1.35rem; }

h4, h5, h6, .h4, .h5, .h6 {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta);
  font-size: 0.78rem;
  margin-top: 2em;
  margin-bottom: 0.6em;
}

/* ---- 5. Title block (page hero) --------------------------- */
.quarto-title-block {
  margin-bottom: 2.5rem;
}

.quarto-title-block .title {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--ink);
  font-size: 3rem;
  line-height: 1.05;
  margin-bottom: 0.25em;
  border-left: 3px solid var(--gold);
  padding-left: 1.25rem;
}

.quarto-title-block .subtitle {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--night);
  font-weight: 400;
  font-size: 1.4rem;
  padding-left: 1.25rem;
}

.quarto-title-block .description {
  font-family: var(--font-ui);
  color: var(--storm);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

/* ---- 6. Links --------------------------------------------- */
a {
  color: var(--athena);
  text-decoration: none;
  border-bottom: 0.5px solid rgba(139, 149, 201, 0.4);
  transition: color 0.15s ease, border-color 0.15s ease;
}

a:hover {
  color: var(--terracotta);
  border-bottom-color: var(--terracotta);
}

/* Strip underline from elements that should not have one */
a.navbar-brand,
.navbar-nav a,
.nav-footer a,
#TOC a,
.about-link,
.about-links a,
.quarto-about-trestles a,
.quarto-about-jolla a,
h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  border-bottom: none;
}

/* ---- 7. Navbar -------------------------------------------- */
.navbar {
  background: var(--night) !important;
  border-bottom: 0.5px solid rgba(139, 149, 201, 0.3);
  padding: 0.85rem 0;
  min-height: 64px;
}

.navbar-brand,
.navbar .navbar-title {
  font-family: var(--font-display) !important;
  font-weight: 400 !important;
  font-size: 1.4rem !important;
  color: var(--gold) !important;
  letter-spacing: 0.005em;
}

.navbar-nav .nav-link {
  font-family: var(--font-ui) !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--athena) !important;
  font-weight: 500 !important;
  padding: 0.5rem 1rem !important;
  position: relative;
}

.navbar-nav .nav-link:hover {
  color: var(--gold) !important;
}

.navbar-nav .nav-link.active {
  color: var(--athena) !important;
}

/* Active page indicator — small gold dot under the link */
.navbar-nav .nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background: var(--gold);
  border-radius: 50%;
}

/* Right-side icons */
.navbar .quarto-navbar-tools .quarto-navigation-tool {
  color: var(--gold) !important;
}

.navbar .quarto-navbar-tools .quarto-navigation-tool:hover {
  color: var(--athena) !important;
}

/* ---- 8. Footer -------------------------------------------- */
.nav-footer {
  background: var(--cream);
  border-top: 0.5px solid rgba(201, 169, 97, 0.5);
  font-family: var(--font-ui);
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  color: var(--storm);
  padding: 2rem 1rem;
  position: relative;
}

/* Tiny gold rule + dot above the footer text — the
   stripped-down ornament from the design system */
.nav-footer::before {
  content: '';
  display: block;
  width: 100%;
  height: 14px;
  margin-top: -2.5rem;
  margin-bottom: 1.25rem;
  background-image:
    linear-gradient(to right,
      transparent 0,
      transparent calc(50% - 60px),
      var(--gold) calc(50% - 60px),
      var(--gold) calc(50% - 12px),
      transparent calc(50% - 12px),
      transparent calc(50% + 12px),
      var(--gold) calc(50% + 12px),
      var(--gold) calc(50% + 60px),
      transparent calc(50% + 60px));
  background-repeat: no-repeat;
  background-size: 100% 0.5px;
  background-position: center center;
  position: relative;
}

.nav-footer::after {
  content: '';
  position: absolute;
  top: -2.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
  margin-top: 6px;
}

.nav-footer a {
  color: var(--storm);
  border-bottom: none;
}

.nav-footer a:hover {
  color: var(--athena);
}

.nav-footer .nav-footer-left,
.nav-footer .nav-footer-right,
.nav-footer .nav-footer-center {
  font-family: var(--font-ui);
}

/* ---- 9. About / hero (trestles template) ------------------ */
.quarto-about-trestles .about-entity .about-image {
  border-radius: 4px;
  border: 0.5px solid rgba(107, 120, 148, 0.3);
}

.quarto-about-trestles .about-contents h1.title,
.quarto-about-trestles .about-contents .title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 2.6rem;
  line-height: 1.05;
  margin-bottom: 0.3em;
  color: var(--ink);
  border-left: none;
  padding-left: 0;
}

.quarto-about-trestles .about-link,
.about-links .about-link {
  font-family: var(--font-ui);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 0.5px solid var(--athena);
  color: var(--athena) !important;
  padding: 0.55rem 1.1rem;
  border-radius: 3px;
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 500;
}

.quarto-about-trestles .about-link:hover,
.about-links .about-link:hover {
  background: var(--athena);
  color: var(--paper) !important;
  border-color: var(--athena);
}

/* ---- 10. Body content tweaks ------------------------------ */
ul, ol {
  padding-left: 1.4em;
}

li {
  margin-bottom: 0.4em;
}

li strong {
  font-weight: 700;
  color: var(--night);
}

strong, b {
  font-weight: 700;
  color: var(--night);
}

em, i {
  color: var(--ink);
}

/* ---- 11. Blockquote --------------------------------------- */
blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.5em 0 0.5em 1.5em;
  margin: 2em 0;
  font-family: var(--font-display);
  font-style: italic;
  color: var(--night);
  font-size: 1.2em;
  line-height: 1.5;
}

blockquote p:last-child {
  margin-bottom: 0;
}

/* ---- 12. Code -------------------------------------------- */
code:not(pre code) {
  color: var(--terracotta);
  background: var(--cream);
  padding: 0.1em 0.45em;
  border-radius: 3px;
  font-size: 0.92em;
  border: 0.5px solid rgba(201, 169, 97, 0.3);
}

pre {
  background: var(--cream) !important;
  border: 0.5px solid rgba(201, 169, 97, 0.4) !important;
  border-left: 3px solid var(--gold) !important;
  border-radius: 3px;
  padding: 1em 1.25em;
  font-size: 0.88em;
}

/* ---- 13. Tables ------------------------------------------ */
table {
  font-family: var(--font-ui);
  font-size: 0.92rem;
  border-collapse: collapse;
}

table th {
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terracotta);
  border-bottom: 0.5px solid var(--gold) !important;
  padding: 0.7em 0.9em;
}

table td {
  padding: 0.6em 0.9em;
  border-bottom: 0.5px solid rgba(107, 120, 148, 0.18) !important;
}



hr::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 5px;
  height: 5px;
  background: var(--gold);
  border-radius: 50%;
}
/* ---- 14. Horizontal rule (gold + dot) -------------------- */
hr {
  border: none;
  height: 14px;
  margin: 3em 0;
  background-image:
    linear-gradient(to right,
      transparent 0,
      transparent calc(50% - 60px),
      var(--gold) calc(50% - 60px),
      var(--gold) calc(50% - 12px),
      transparent calc(50% - 12px),
      transparent calc(50% + 12px),
      var(--gold) calc(50% + 12px),
      var(--gold) calc(50% + 60px),
      transparent calc(50% + 60px));
  background-repeat: no-repeat;
  background-size: 100% 0.5px;
  background-position: center center;
  position: relative;
  opacity: 0.85;
}

/* ---- 15. TOC --------------------------------------------- */
#TOC, #toc-title, .sidebar nav[role="doc-toc"] {
  font-family: var(--font-ui);
}

#toc-title, .sidebar nav[role="doc-toc"] > h2 {
  font-size: 0.72rem !important;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta) !important;
  font-weight: 600;
  margin-bottom: 1rem;
  border-bottom: 0.5px solid rgba(201, 169, 97, 0.4);
  padding-bottom: 0.5rem;
}

#TOC a,
.sidebar nav[role="doc-toc"] a,
.toc-actions a {
  color: var(--storm);
  font-size: 0.85rem;
  border-bottom: none;
  padding: 0.2em 0;
  display: block;
}

#TOC a:hover,
.sidebar nav[role="doc-toc"] a:hover,
.sidebar nav[role="doc-toc"] a.active {
  color: var(--athena) !important;
  border-left: 2px solid var(--gold);
  padding-left: 0.5rem;
  margin-left: -0.5rem;
}

/* ---- 16. Title block banner (when used) ------------------ */
.quarto-title-banner {
  background: var(--cream);
  border-bottom: 0.5px solid rgba(201, 169, 97, 0.5);
  color: var(--ink);
}

.quarto-title-banner .title {
  color: var(--ink);
}

/* ---- 17. Selection / focus / misc ------------------------ */
::selection {
  background: var(--athena);
  color: var(--paper);
}

::-moz-selection {
  background: var(--athena);
  color: var(--paper);
}

a:focus,
button:focus,
.btn:focus {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- 18. Quarto-specific small tweaks -------------------- */
.quarto-categories .quarto-category {
  background: var(--cream);
  color: var(--terracotta);
  border: 0.5px solid rgba(201, 169, 97, 0.4);
  font-family: var(--font-ui);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}

.quarto-figure figcaption,
figcaption {
  font-family: var(--font-ui);
  font-size: 0.82rem;
  color: var(--storm);
  text-align: center;
  margin-top: 0.6em;
}

/* Reader mode toggle and other navigation tools */
.quarto-reader-toggle .bi {
  color: var(--storm);
}

/* Code copy button */
.code-copy-button {
  color: var(--storm) !important;
}

.code-copy-button:hover {
  color: var(--athena) !important;
}

/* ---- 19. Altmetric badges (carry-over from old custom.css) -- */
span.__dimensions_badge_embed__,
div.altmetric-embed {
  display: inline-flex;
  vertical-align: middle;
}
