@import url("https://fonts.googleapis.com/css2?family=Comfortaa:wght@400;600&display=swap");

/* Top bar site name */
.md-header .md-header__title .md-header__ellipsis, .md-nav__title, .h1 {
  font-family: "Comfortaa", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 600;
  letter-spacing: 0.03em;
}
/* Scale up the header logo */
.md-header .md-header__button.md-logo img {
  height: 1.8rem;
  width: auto;
}

/* Multi-panel figure layout for macros-based figures */
.lt-figure-multi .lt-figure-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
}

.lt-figure-multi .lt-figure-col {
  flex: 1 1 0;
  min-width: 200px;
  text-align: center;
}

.lt-figure-multi img {
  max-width: 100%;
}

.lt-subcaption {
  margin-top: 0.3em;
  font-size: 0.85em;
  color: var(--md-default-fg-color--lighter);
}

/* Theme-aware figures: show only the appropriate variant */
.lt-figure-theme-aware {
  scroll-margin-top: 4rem;
}

/* Figure wrapper with navigation header */
.lt-figure-wrapper {
  margin: 1.5em 0;
  scroll-margin-top: 4rem;
}

.lt-figure-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  margin-bottom: 0.75em;
  padding: 0.75em 1em;
  background: var(--md-code-bg-color, #f5f5f5);
  border-radius: 4px;
}

.lt-figure-title {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--md-default-fg-color, #333);
}

.lt-figure-theme-aware .lt-fig-dark {
  display: none;
}

[data-md-color-scheme="slate"] .lt-figure-theme-aware .lt-fig-light {
  display: none;
}

[data-md-color-scheme="slate"] .lt-figure-theme-aware .lt-fig-dark {
  display: block;
}

/* Make sure images scale nicely */
.lt-figure-theme-aware img {
  max-width: 100%;
}

/* Figure captions - consistent styling for all figures */
.lt-figure-theme-aware figcaption {
  margin-top: 0.75em;
  font-style: italic;
  color: var(--md-default-fg-color--light, #666);
  font-size: 0.9em;
  text-align: center;
}

.lt-figure-theme-aware figcaption strong {
  font-style: normal;
}

.lt-figure-theme-aware figcaption .fig-link {
  color: inherit;
  text-decoration: none;
}

.lt-figure-theme-aware figcaption .fig-link:hover {
  text-decoration: underline;
  color: var(--md-accent-fg-color, #448aff);
}

/* =============================================================================
   Table Captions
   Styled captions for tables with automatic numbering
   ============================================================================= */

.lt-table-wrapper {
  margin: 1.5em 0;
  text-align: center;
  scroll-margin-top: 4rem;
}

.lt-table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
  margin-bottom: 0.75em;
  padding: 0.75em 1em;
  background: var(--md-code-bg-color, #f5f5f5);
  border-radius: 4px;
}

.lt-table-title {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--md-default-fg-color, #333);
}

/* Narrow only the experimental datasets table headers (override theme min-width: 5rem).
   Otherwise it has an annoying unnecessary horizontal scrollbar... */
#tab-exp-datasets table:not([class]) th {
  min-width: 0;
}

.lt-table-caption {
  margin-top: 0.5em;
  font-style: italic;
  color: var(--md-default-fg-color--light, #666);
  font-size: 0.9em;
  text-align: center;
}

.lt-table-caption strong {
  font-style: normal;
}

.lt-table-caption .table-link {
  color: inherit;
  text-decoration: none;
}

.lt-table-caption .table-link:hover {
  text-decoration: underline;
  color: var(--md-accent-fg-color, #448aff);
}

/* =============================================================================
   Reader's Guide Index Links
   Links in the figure/table index - styled to match other internal links
   ============================================================================= */

.index-link {
  text-decoration: none !important;
  border-bottom: 1px solid transparent !important;
}

.index-link:hover {
  text-decoration: none !important;
  border-bottom: 1px solid currentColor !important;
}

/* Right-aligned fixed-width number display for figure/table index.
   Uses inline-block for alignment; border-bottom on parent handles underline. */
.index-num {
  display: inline-block;
  min-width: 1em;
  text-align: right;
}

/* Wider variant for pages with 10+ figures/tables (double-digit numbers) */
.index-num-wide {
  min-width: 1.2em;
}


/* Custom admonition colors: swap note and info */
.md-typeset .admonition.note,
.md-typeset details.note {
  border-color: #00b8d4;
}
.md-typeset .note > .admonition-title,
.md-typeset .note > summary {
  background-color: rgba(0, 184, 212, 0.1);
}
.md-typeset .note > .admonition-title::before,
.md-typeset .note > summary::before {
  background-color: #00b8d4;
}

.md-typeset .admonition.info,
.md-typeset details.info {
  border-color: #448aff;
}
.md-typeset .info > .admonition-title,
.md-typeset .info > summary {
  background-color: rgba(68, 138, 255, 0.1);
}
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before {
  background-color: #448aff;
}

/* Disable MkDocs Material instant preview popup on these links */
.index-link::after {
  display: none !important;
}

/* Globally disable MkDocs Material preview popups/tooltips */
.md-tooltip,
.md-preview,
[data-md-component="tooltip"],
.md-annotation__index::after {
  display: none !important;
}

/* Disable preview hover effects on all internal anchor links */
a[href^="#"]::before,
a[href^="#"]::after {
  display: none !important;
}

/* =============================================================================
   Figure Picker Component
   Interactive dropdowns for selecting figure variants (sample, gamma, quantity, etc.)
   ============================================================================= */

.fig-picker {
  margin: 1.5em 0;
  /* Account for sticky header when scrolling to anchor (JS scrollIntoView) */
  scroll-margin-top: 4rem;
}

/* Anchor spans for hash-based navigation also need scroll margin */
span[id^="fig-"] {
  scroll-margin-top: 4rem;
}

/* Reader's Guide admonition needs scroll margin for Jump to Index button */
.admonition.info {
  scroll-margin-top: 4rem;
}

.fig-picker-controls {
  display: flex;
  flex-direction: column;
  gap: 0.75em;
  margin-bottom: 1em;
  padding: 0.75em 1em;
  background: var(--md-code-bg-color, #f5f5f5);
  border-radius: 4px;
}

.fig-picker-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1em;
}

.fig-picker-title {
  font-weight: 600;
  font-size: 0.95em;
  color: var(--md-default-fg-color, #333);
}

.fig-picker-dropdowns {
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
  align-items: center;
}

.fig-picker-control {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.fig-picker-control label {
  font-weight: 500;
  white-space: nowrap;
  font-size: 0.9em;
}

.fig-picker-control select {
  padding: 0.4em 0.8em;
  border: 1px solid var(--md-default-fg-color--lighter, #ccc);
  border-radius: 4px;
  background: var(--md-default-bg-color, #fff);
  color: var(--md-default-fg-color, #333);
  font-size: 0.9em;
  cursor: pointer;
  min-width: 120px;
}

.fig-picker-control select:hover {
  border-color: var(--md-accent-fg-color, #448aff);
}

.fig-picker-control select:focus {
  outline: none;
  border-color: var(--md-accent-fg-color, #448aff);
  box-shadow: 0 0 0 2px rgba(68, 138, 255, 0.2);
}

.fig-picker .fig-picker-image {
  display: flex;
  justify-content: center;
}

.fig-picker .fig-picker-image figure {
  margin: 0;
  text-align: center;
}

.fig-picker .fig-picker-image img {
  max-width: 100%;
  height: auto;
}

.fig-picker figcaption {
  margin-top: 0.75em;
  font-style: italic;
  color: var(--md-default-fg-color--light, #666);
  font-size: 0.9em;
}

/* Let figure captions use the full content width instead of shrinking to image width */
.fig-picker .fig-picker-image figure {
  width: 100%;
}

.fig-picker figcaption .fig-picker-highlight {
  color: var(--md-default-fg-color, #333);
  font-weight: 500;
}

.fig-picker figcaption .fig-link {
  color: inherit;
  text-decoration: none;
}

.fig-picker figcaption .fig-link:hover {
  text-decoration: underline;
  color: var(--md-accent-fg-color, #448aff);
}

/* =============================================================================
   Side-by-Side Tables
   Flex layout for placing two tables next to each other
   ============================================================================= */

.lt-side-by-side {
  display: flex;
  gap: 2em;
  flex-wrap: wrap;
}

.lt-side-by-side > div {
  flex: 1;
  min-width: 250px;
}

/* Prevent Material theme table wrappers from forcing full width */
.lt-side-by-side .md-typeset__scrollwrap,
.lt-side-by-side .md-typeset__table {
  width: auto;
  display: inline-block;
}

.lt-side-by-side table {
  width: auto;
}

/* Tighten gap between bold headers and tables */
.lt-side-by-side p {
  margin-bottom: 0.25em;
}

/* Reduce gap between side-by-side tables and the caption below */
.lt-side-by-side + .lt-table-caption {
  margin-top: 0.25em;
}

/* Dark theme adjustments for select elements */
[data-md-color-scheme="slate"] .fig-picker-control select {
  background: var(--md-code-bg-color, #2d2d2d);
  border-color: var(--md-default-fg-color--lighter, #555);
}

/* =============================================================================
   Figure Picker Navigation Buttons
   Prev/Next navigation between fig_pickers on the same page
   ============================================================================= */

.fig-picker-nav {
  display: flex;
  gap: 0.5em;
}

.fig-picker-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  padding: 0.3em 0.6em;
  border: 1px solid var(--md-default-fg-color--lighter, #ccc);
  border-radius: 4px;
  background: var(--md-default-bg-color, #fff);
  color: var(--md-default-fg-color--light, #666);
  font-size: 0.8em;
  cursor: pointer;
  transition: all 0.15s ease;
}

.fig-picker-nav-btn:hover {
  border-color: var(--md-accent-fg-color, #448aff);
  color: var(--md-accent-fg-color, #448aff);
  background: var(--md-accent-fg-color--transparent, rgba(68, 138, 255, 0.1));
}

.fig-picker-nav-btn:active {
  transform: translateY(1px);
}

.fig-picker-nav-btn span {
  font-size: 1em;
}

/* Dark theme adjustments for navigation buttons */
[data-md-color-scheme="slate"] .fig-picker-nav-btn {
  background: var(--md-code-bg-color, #2d2d2d);
  border-color: var(--md-default-fg-color--lighter, #555);
}

/* =============================================================================
   Figure Picker Slider
   Range input for dimensions with many ordered options (seeds, sindec values)
   ============================================================================= */

.fig-picker-slider-control {
  flex: 1 1 200px;
  max-width: 400px;
}

.fig-picker-slider-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75em;
  flex: 1;
}

.fig-picker-slider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--md-default-fg-color--lighter, #ccc);
  outline: none;
  cursor: pointer;
}

.fig-picker-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--md-accent-fg-color, #448aff);
  cursor: pointer;
  border: 2px solid var(--md-default-bg-color, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fig-picker-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--md-accent-fg-color, #448aff);
  cursor: pointer;
  border: 2px solid var(--md-default-bg-color, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.fig-picker-slider::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: var(--md-default-fg-color--lighter, #ccc);
}

.fig-picker-slider:hover::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(68, 138, 255, 0.2);
}

.fig-picker-slider:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px rgba(68, 138, 255, 0.3);
}

.fig-picker-slider-value {
  font-size: 0.85em;
  font-weight: 500;
  white-space: nowrap;
  min-width: 4em;
  text-align: center;
  padding: 0.2em 0.6em;
  border-radius: 4px;
  background: var(--md-accent-fg-color--transparent, rgba(68, 138, 255, 0.1));
  color: var(--md-accent-fg-color, #448aff);
  border: 1px solid var(--md-accent-fg-color, #448aff);
}

/* Dark theme adjustments for slider */
[data-md-color-scheme="slate"] .fig-picker-slider {
  background: var(--md-default-fg-color--lightest, #444);
}

[data-md-color-scheme="slate"] .fig-picker-slider::-webkit-slider-thumb {
  border-color: var(--md-code-bg-color, #2d2d2d);
}

[data-md-color-scheme="slate"] .fig-picker-slider::-moz-range-thumb {
  border-color: var(--md-code-bg-color, #2d2d2d);
}

/* =============================================================================
   Figure Picker Checkbox Toggle
   Styled toggle switch for boolean dimensions (e.g., NGC 1068 on/off)
   ============================================================================= */

.fig-picker-checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.fig-picker-checkbox {
  /* Hide native checkbox, replaced by the toggle track */
  -webkit-appearance: none;
  appearance: none;
  position: relative;
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--md-default-fg-color--lighter, #ccc);
  cursor: pointer;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.fig-picker-checkbox::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--md-default-bg-color, #fff);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.fig-picker-checkbox:checked {
  background: var(--md-accent-fg-color, #448aff);
}

.fig-picker-checkbox:checked::after {
  transform: translateX(16px);
}

.fig-picker-checkbox:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(68, 138, 255, 0.2);
}

.fig-picker-checkbox:hover {
  background: var(--md-default-fg-color--light, #999);
}

.fig-picker-checkbox:checked:hover {
  background: var(--md-accent-fg-color, #448aff);
  filter: brightness(1.1);
}

/* Dark theme adjustments for checkbox toggle */
[data-md-color-scheme="slate"] .fig-picker-checkbox {
  background: var(--md-default-fg-color--lightest, #444);
}

[data-md-color-scheme="slate"] .fig-picker-checkbox::after {
  background: var(--md-code-bg-color, #2d2d2d);
}

[data-md-color-scheme="slate"] .fig-picker-checkbox:checked {
  background: var(--md-accent-fg-color, #448aff);
}

[data-md-color-scheme="slate"] .fig-picker-checkbox:hover {
  background: var(--md-default-fg-color--lighter, #555);
}

[data-md-color-scheme="slate"] .fig-picker-checkbox:checked:hover {
  background: var(--md-accent-fg-color, #448aff);
  filter: brightness(1.1);
}

/* =============================================================================
   Figure Picker No-Image Placeholder
   Shown when a computed dimension resolves to null (invalid combination)
   ============================================================================= */

.fig-picker-no-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  padding: 2em;
  color: var(--md-default-fg-color--light, #999);
  font-style: italic;
  font-size: 0.95em;
  border: 2px dashed var(--md-default-fg-color--lightest, #ddd);
  border-radius: 8px;
  background: var(--md-code-bg-color, #f8f8f8);
}
