/* css styles */
/* League Spartan Google Fonts is used for this theme */
@import url("https://fonts.googleapis.com/css2?family=League+Spartan:wght@100;200;300;400;500;600;700;800;900&display=swap");

body,
#quarto-appendix.default {
  font-family: "League Spartan";
  background-color: #252525;
  color: #FAFAFA;
  font-size: 1rem;
}

/* Typography Hierarchy */
h1, h1.title {
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  margin-top: 2rem;
}

h2, h2.anchored {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
}

h3, h3.anchored,
h3.no-anchor.listing-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  margin-top: 2rem;
  margin-bottom: 1rem;
}

h4, h4.anchored {
  font-size: 1.25rem;
  font-weight: 500;
  line-height: 1.4;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
}

h2#toc-title {
  font-size: 1.75rem;
}

/* Body text sizing */
p, .content p, article p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Math/KaTeX formula sizing - reduced for readability */
.katex, .katex-display, .math, .math-display, mjx-container {
  font-size: 0.95em !important;
  margin: 1em 0;
}

/* Inline math */
.katex, .math, mjx-container:not([display="true"]) {
  font-size: 1em !important;
}

/* Display math equations */
.katex-display, .math-display, mjx-container[display="true"] {
  font-size: 1.1em !important;
  margin: 1.5em 0;
  padding: 0.5em 0;
}

/* MathJax display equations */
.MathJax, .MathJax_Display {
  font-size: 1.1em !important;
}

/* List items in content */
article li, .content li {
  font-size: 1rem;
  line-height: 1.5;
  margin-bottom: 0.5rem;
}

li {
  font-size: 1rem;
}

div.sourceCode {
  background-color: #252525;
  border: 1px solid #FAFAFA;
}

nav.navbar {
  border-bottom: 1px solid #FAFAFA;
}

span.navbar-title {
  font-size: larger;
  color: #FAFAFA;
}

.nav-link {
  font-size: large;
  color: #FAFAFA;
}

.navbar #quarto-search.type-overlay .aa-Autocomplete svg.aa-SubmitIcon,
h1.title,
p.subtitle.lead,
div.quarto-post a,
#title-block-header.quarto-title-block.default .quarto-title-meta-contents a,
pre.sourceCode,
div.quarto-about-jolla .about-link,
.aa-Autocomplete .aa-Form .aa-InputWrapperPrefix .aa-Label svg,
.aa-Autocomplete .aa-Form .aa-InputWrapperPrefix .aa-LoadingIndicator svg,
.aa-DetachedFormContainer .aa-Form .aa-InputWrapperPrefix .aa-Label svg,
.aa-DetachedFormContainer .aa-Form .aa-InputWrapperPrefix .aa-LoadingIndicator,
div.description,
.listing-actions-group .form-select,
.listing-actions-group .form-control {
  color: #FAFAFA;
}

.aa-Autocomplete .aa-Form,
.aa-DetachedFormContainer .aa-Form {
  background-color: #222;
  color: #FAFAFA;
}

.aa-Autocomplete .aa-Form .aa-InputWrapper .aa-Input,
.aa-DetachedFormContainer .aa-Form .aa-InputWrapper .aa-Input {
  border-left: 1px solid #FAFAFA;
  color: #FAFAFA;
  padding-left: 1rem;
}

code,
.code-with-filename .code-with-filename-file {
  color: #FAFAFA;
  background-color: #1a1a1a !important;
  padding: 0.2em 0.4em;
  border-radius: 3px;
}

div.nav-footer {
  border-top: 1px solid #FAFAFA;
  color: #FAFAFA;
  font-size: 1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
}

/* Remove excessive margins from footer paragraphs */
.nav-footer p {
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

/* Footer sections */
.nav-footer-left,
.nav-footer-center,
.nav-footer-right {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.nav-footer-left {
  justify-content: flex-start;
}

.nav-footer-center {
  justify-content: center;
}

.nav-footer-right {
  justify-content: flex-end;
}

/* Mobile-friendly stacked footer */
@media (max-width: 768px) {
  div.nav-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .nav-footer-left,
  .nav-footer-center,
  .nav-footer-right {
    width: 100%;
    justify-content: center;
  }
}

/* About page styling - reduce name size */
.quarto-about-jolla .about-entity .about-link,
.quarto-about-jolla h1.title,
.quarto-about-jolla .about-entity h1,
.quarto-about-jolla .about-entity,
#quarto-content .quarto-about-jolla h1 {
  font-size: 2rem !important;
  font-weight: 600;
}

/* Responsive name size */
@media (max-width: 768px) {
  .quarto-about-jolla .about-entity h1,
  .quarto-about-jolla h1.title {
    font-size: 1.75rem !important;
  }
}

/* Retro/vintage style avatar image - muted colors */
.quarto-about-jolla img.about-image,
.quarto-about-trestles img.about-image,
.quarto-about-solana img.about-image,
.quarto-about-marquee img.about-image,
.quarto-about-broadside img.about-image,
img.about-image {
  filter: sepia(25%) saturate(70%) contrast(90%) brightness(95%) !important;
  -webkit-filter: sepia(25%) saturate(70%) contrast(90%) brightness(95%) !important;
}

div.cookie-consent-footer {
  font-size: 0.9rem;
  text-decoration: none;
  color: #FAFAFA;
  margin: 0;
  padding: 0;
  line-height: 1.4;
}

div.cookie-consent-footer a {
  color: #FAFAFA;
  text-decoration: underline;
}

div.listing-actions-group,
div.quarto-post.image-right {
  padding-bottom: 27px;
}

/* Cookies */
div.cc-nb-main-container {
  background-color: #252525;
}

p#cc-nb-title.cc-nb-title,
p#cc-nb-text.cc-nb-text {
  color: #FAFAFA;
}

.termsfeed-com---palette-light .cc-nb-changep {
  background-color: #FAFAFA;
  color: #252525;
}

.termsfeed-com---palette-light .cc-nb-okagree {
  color: #252525;
}

.termsfeed-com---palette-light .cc-pc-head-lang select {
  background-color: #FAFAFA;
}

/* Override pure white text in code blocks and pre elements */
pre, pre code, code.sourceCode {
  color: #FAFAFA !important;
}

/* Override Bootstrap's pure white table text */
.table {
  --bs-table-color: #FAFAFA !important;
  --bs-table-striped-color: #FAFAFA !important;
  --bs-table-active-color: #FAFAFA !important;
  --bs-table-hover-color: #FAFAFA !important;
}

/* Override pure white in body text for dark theme */
[data-bs-theme="dark"] {
  --bs-body-color: #FAFAFA !important;
  --bs-emphasis-color: #FAFAFA !important;
}

/* Override code color */
[data-bs-theme="dark"] {
  --bs-code-color: #FAFAFA !important;
}

/* Listing controls styling - Order By and Filter */
.listing-actions-group {
  gap: 1rem;
}

/* Input group icons - grey color */
.listing-actions-group .input-group-text {
  background-color: #1a1a1a;
  border: 1px solid #00ff9d;
  color: #999 !important;
}

.listing-actions-group .input-group-text i,
.listing-actions-group .input-group-text .bi,
.listing-actions-group .input-group-text .bi-sort-down,
.listing-actions-group .input-group-text .bi-search {
  color: #999 !important;
}

.listing-actions-group .input-group-text i::before,
.listing-actions-group .input-group-text .bi::before,
.listing-actions-group .input-group-text .bi-sort-down::before,
.listing-actions-group .input-group-text .bi-search::before {
  color: #999 !important;
}

.listing-actions-group .form-select,
.listing-actions-group .form-control {
  background-color: #1a1a1a;
  border: 1px solid #00ff9d;
  padding: 0.5rem 1rem;
  font-size: 0.95rem;
  color: #999 !important;
  -webkit-text-fill-color: #999 !important;
}

/* Dropdown arrow for select - grey color */
.listing-actions-group .form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23999' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

.listing-actions-group .form-select:focus,
.listing-actions-group .form-control:focus {
  background-color: #252525;
  border-color: #00ff9d;
  box-shadow: 0 0 0 0.2rem rgba(0, 255, 157, 0.25);
  color: #999 !important;
}

.listing-actions-group .form-select option {
  background-color: #1a1a1a;
  color: #FAFAFA;
}

/* Filter input - text color when typing and placeholder */
.listing-actions-group input.form-control,
.listing-actions-group input.search,
.listing-actions-group .quarto-listing-filter input {
  color: #999 !important;
  -webkit-text-fill-color: #999 !important;
}

.listing-actions-group .form-control::placeholder {
  color: #999 !important;
  opacity: 0.7;
}

/* Search overlay backdrop - reduce white opacity */
.aa-DetachedOverlay {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Alternative targeting for search modal backdrop */
body[data-md-state="search"] .aa-Backdrop,
.aa-Backdrop {
  background-color: rgba(0, 0, 0, 0.7) !important;
}

/* Search modal container */
.aa-DetachedContainer {
  background-color: #1a1a1a;
  border: 1px solid #00ff9d;
}

/* Navbar search button - all variations */
#quarto-search,
#quarto-search *,
#quarto-search button,
#quarto-search .aa-DetachedSearchButton {
  color: #FAFAFA !important;
}

/* Navbar search SVG icons */
#quarto-search svg,
#quarto-search svg *,
#quarto-search path,
#quarto-search circle,
#quarto-search button svg,
#quarto-search button svg *,
#quarto-search .aa-DetachedSearchButton svg,
#quarto-search .aa-DetachedSearchButton svg *,
#quarto-search .aa-DetachedSearchButtonIcon,
#quarto-search .aa-DetachedSearchButtonIcon * {
  color: #FAFAFA !important;
  fill: #FAFAFA !important;
  stroke: #FAFAFA !important;
}

/* Search modal icon colors */
.aa-DetachedSearchButton svg,
.aa-DetachedSearchButton svg *,
.aa-DetachedSearchButtonIcon,
.aa-DetachedSearchButtonIcon *,
.aa-SubmitButton svg,
.aa-SubmitButton svg *,
.aa-Form svg,
.aa-Form svg *,
.aa-InputWrapperPrefix svg,
.aa-InputWrapperPrefix svg * {
  fill: #FAFAFA !important;
  stroke: #FAFAFA !important;
  color: #FAFAFA !important;
}

/* Search results styling */
.aa-Panel {
  background-color: #1a1a1a;
  color: #FAFAFA;
}

.aa-Item {
  color: #FAFAFA;
}

.aa-Item[aria-selected="true"] {
  background-color: #252525;
}

.aa-ItemContent mark {
  background-color: #00ff9d;
  color: #1a1a1a;
}

/* PDF-specific styles for handling long lines */
@media print {
  /* Allow code blocks to break and wrap */
  pre, pre code, code.sourceCode, .sourceCode {
    white-space: pre-wrap !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-all !important;
    max-width: 100% !important;
    overflow: hidden !important;
    font-size: 0.75em !important;
  }
  
  /* Code spans within code blocks */
  pre code span, code.sourceCode span {
    white-space: pre-wrap !important;
    word-break: break-all !important;
  }
  
  /* Handle long math equations */
  .katex-display, .math-display, mjx-container[display="true"] {
    overflow: hidden !important;
    max-width: 100% !important;
    font-size: 0.8em !important;
    transform: scale(0.95);
    transform-origin: left center;
  }
  
  /* Scale down equations if needed */
  .katex, .math, mjx-container {
    font-size: 0.8em !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
  }
  
  /* Ensure tables don't overflow */
  table {
    max-width: 100% !important;
    table-layout: fixed !important;
    word-wrap: break-word !important;
    font-size: 0.85em !important;
  }
  
  /* Handle source code divs */
  div.sourceCode {
    overflow: hidden !important;
    max-width: 100% !important;
    page-break-inside: auto !important;
  }
  
  /* Prevent URLs and long strings from overflowing */
  a, .url {
    word-break: break-all !important;
    overflow-wrap: break-word !important;
  }
  
  /* Force all content to fit page width */
  body, #quarto-content, main, article {
    max-width: 100% !important;
    overflow: hidden !important;
  }
  
  /* Code blocks specific wrapping */
  .cell-code pre, .cell-output pre {
    white-space: pre-wrap !important;
    word-break: break-all !important;
  }
}