/* SPDX-License-Identifier: Apache-2.0 */
/* GeoPrior-v3 documentation theme overrides for PyData Sphinx Theme */

/* --------------------------------------------------------------------------
 * GeoPrior brand system
 * -------------------------------------------------------------------------- */
html {
  --gp-blue: #0492c2;
  --gp-blue-deep: #0f5c79;
  --gp-blue-soft: #dff3fa;
  --gp-orange: #d05e00;
  --gp-gold: #fbb040;
  --gp-orange-soft: #fff1e5;
  --gp-slate: #17384d;
  --gp-ink: #1f2a33;
  --gp-muted: #5c6c7a;
  --gp-border-light: #d7e4ec;
  --gp-surface-light: #f6fafc;
  --gp-surface-soft: #edf6fb;
  --gp-code-accent: #8b0b6f;
  --gp-success: #198754;
  --gp-danger: #b42318;
  --gp-warning: #d97706;
  --gp-radius-sm: 0.45rem;
  --gp-radius-md: 0.8rem;
  --gp-radius-lg: 1rem;
  --gp-shadow-sm: 0 2px 8px rgba(15, 42, 58, 0.06);
  --gp-shadow-md: 0 10px 24px rgba(15, 42, 58, 0.1);
  --gp-shadow-lg: 0 18px 42px rgba(15, 42, 58, 0.14);
  --gp-content-width: 62rem;
}

html[data-theme="light"] {
  --pst-color-primary: var(--gp-blue);
  --pst-color-secondary: var(--gp-orange);
  --pst-color-accent: var(--gp-gold);
  --pst-color-success: var(--gp-success);
  --pst-color-info: var(--gp-blue);
  --pst-color-warning: var(--gp-warning);
  --pst-color-danger: var(--gp-danger);
  --pst-color-link: var(--gp-blue-deep);
  --pst-color-link-hover: var(--gp-orange);
  --pst-color-inline-code: var(--gp-code-accent);
  --pst-color-text-base: var(--gp-ink);
  --pst-color-text-muted: var(--gp-muted);
  --pst-color-border: var(--gp-border-light);
  --pst-color-background: #ffffff;
  --pst-color-on-background: #12202b;
  --pst-color-surface: var(--gp-surface-light);
  --pst-color-on-surface: #253746;
  --pst-color-target: #fff7ed;
  --pst-color-table-row-hover-bg: rgba(4, 146, 194, 0.08);
  --pst-color-table-inner-border: rgba(23, 56, 77, 0.12);
  --pst-color-shadow: rgba(15, 42, 58, 0.12);
  --pst-color-border-muted: rgba(23, 56, 77, 0.1);
  --pst-color-heading: var(--gp-slate);
  --pst-color-inline-code-links: var(--gp-blue-deep);
  --pst-font-family-base: "Segoe UI", Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
  --pst-font-family-heading: var(--pst-font-family-base);
  --pst-font-family-monospace: "JetBrains Mono",
    "Fira Code", Consolas, Monaco, monospace;
  --pst-font-size-base: 1rem;
  --pst-font-size-h1: 2.55rem;
  --pst-font-size-h2: 2rem;
  --pst-font-size-h3: 1.55rem;
  --pst-font-size-h4: 1.2rem;
  --pst-sidebar-font-size: 0.95rem;
  --pst-sidebar-font-size-mobile: 1rem;
  --pst-sidebar-header-font-weight: 700;
  --pst-header-height: 4.2rem;
  --pst-header-article-height: 2.8rem;
  --pst-admonition-font-weight-heading: 700;
  --pst-color-inline-code-background: rgba(4, 146, 194, 0.08);
}

html[data-theme="dark"] {
  --pst-color-primary: #3eb9df;
  --pst-color-secondary: #ff9742;
  --pst-color-accent: #ffbc6c;
  --pst-color-success: #37b679;
  --pst-color-info: #3eb9df;
  --pst-color-warning: #f7a84b;
  --pst-color-danger: #ff7867;
  --pst-color-link: #89d7f0;
  --pst-color-link-hover: #ffbc6c;
  --pst-color-inline-code: #f2a7e6;
  --pst-color-text-base: #e5edf4;
  --pst-color-text-muted: #a8b7c3;
  --pst-color-border: #274154;
  --pst-color-background: #0e1720;
  --pst-color-on-background: #eaf2f7;
  --pst-color-surface: #15222c;
  --pst-color-on-surface: #d4e1ea;
  --pst-color-target: rgba(255, 151, 66, 0.18);
  --pst-color-table-row-hover-bg: rgba(62, 185, 223, 0.11);
  --pst-color-table-inner-border: rgba(212, 225, 234, 0.1);
  --pst-color-shadow: rgba(0, 0, 0, 0.45);
  --pst-color-border-muted: rgba(212, 225, 234, 0.08);
  --pst-color-heading: #f4f8fb;
  --pst-color-inline-code-links: #96def3;
  --pst-font-family-base: "Segoe UI", Roboto, Ubuntu,
    Cantarell, "Helvetica Neue", Arial, sans-serif;
  --pst-font-family-heading: var(--pst-font-family-base);
  --pst-font-family-monospace: "JetBrains Mono",
    "Fira Code", Consolas, Monaco, monospace;
  --pst-font-size-base: 1rem;
  --pst-font-size-h1: 2.55rem;
  --pst-font-size-h2: 2rem;
  --pst-font-size-h3: 1.55rem;
  --pst-font-size-h4: 1.2rem;
  --pst-sidebar-font-size: 0.95rem;
  --pst-sidebar-font-size-mobile: 1rem;
  --pst-sidebar-header-font-weight: 700;
  --pst-header-height: 4.2rem;
  --pst-header-article-height: 2.8rem;
  --pst-admonition-font-weight-heading: 700;
  --pst-color-inline-code-background: rgba(62, 185, 223, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--pst-font-family-base);
  line-height: 1.72;
  letter-spacing: 0.01em;
}

.bd-page-width {
  max-width: 92rem;
}

.bd-main .bd-content .bd-article-container,
.bd-main .bd-content .bd-article {
  max-width: var(--gp-content-width);
}

.bd-main .bd-content .bd-article-container {
  padding-top: 1.2rem;
}

/* --------------------------------------------------------------------------
 * Header / navbar
 * -------------------------------------------------------------------------- */
.bd-header {
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--pst-color-border);
  box-shadow: 0 3px 14px rgba(15, 42, 58, 0.06);
}

html[data-theme="light"] .bd-header {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.96) 0%,
    rgba(246, 250, 252, 0.96) 100%
  );
}

html[data-theme="dark"] .bd-header {
  background: linear-gradient(
    180deg,
    rgba(14, 23, 32, 0.94) 0%,
    rgba(21, 34, 44, 0.94) 100%
  );
}

.navbar-brand {
  gap: 0.7rem;
}

.navbar-brand img,
.navbar-brand svg {
  max-height: 2.3rem;
  width: auto;
}

.navbar-brand .title {
  font-weight: 800;
  letter-spacing: -0.02em;
}

.bd-header .navbar-nav > .nav-item > .nav-link,
.bd-header .navbar-nav .nav-link {
  border-radius: 999px;
  font-weight: 600;
  margin: 0 0.12rem;
  padding: 0.4rem 0.85rem;
  transition: background-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease;
}

.bd-header .navbar-nav > .nav-item > .nav-link:hover,
.bd-header .navbar-nav .nav-link:hover,
.bd-header .navbar-nav > .nav-item > .nav-link:focus-visible,
.bd-header .navbar-nav .nav-link:focus-visible {
  background: color-mix(
    in srgb,
    var(--pst-color-primary) 12%,
    transparent
  );
  color: var(--pst-color-primary);
  transform: translateY(-1px);
}

.search-button__button {
  border-radius: 999px;
  border: 1px solid var(--pst-color-border);
  box-shadow: none;
}

.search-button__button:hover,
.search-button__button:focus-visible {
  border-color: color-mix(
    in srgb,
    var(--pst-color-primary) 42%,
    var(--pst-color-border)
  );
  box-shadow: 0 0 0 0.18rem color-mix(
    in srgb,
    var(--pst-color-primary) 12%,
    transparent
  );
}

.theme-switch-button {
  border-radius: 999px;
}

.hero-tagline {
  color: var(--pst-color-text-muted);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-top: -0.25rem;
  margin-bottom: 1.35rem;
}

html[data-theme="light"] .hero-tagline {
  background: transparent;
}

html[data-theme="dark"] .hero-tagline {
  background: transparent;
}
/* --------------------------------------------------------------------------
 * Sidebars and TOC
 * -------------------------------------------------------------------------- */
.bd-sidebar-primary {
  border-right: 1px solid var(--pst-color-border);
}

html[data-theme="light"] .bd-sidebar-primary {
  background: linear-gradient(
    180deg,
    rgba(246, 250, 252, 0.88) 0%,
    rgba(255, 255, 255, 0.95) 100%
  );
}

html[data-theme="dark"] .bd-sidebar-primary {
  background: linear-gradient(
    180deg,
    rgba(21, 34, 44, 0.95) 0%,
    rgba(14, 23, 32, 0.98) 100%
  );
}

.bd-sidebar-primary .sidebar-header-items,
.bd-sidebar-primary .sidebar-primary-item {
  padding-top: 0.15rem;
}

.bd-sidebar .nav-link,
.bd-links .reference,
.bd-toc-nav a {
  border-radius: 0.7rem;
  color: var(--pst-color-text-base);
  transition: background-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease;
}

.bd-sidebar .nav-link:hover,
.bd-links .reference:hover,
.bd-toc-nav a:hover {
  background: color-mix(
    in srgb,
    var(--pst-color-primary) 10%,
    transparent
  );
  color: var(--pst-color-primary);
  transform: translateX(2px);
}

.bd-sidebar .nav-link.active,
.bd-sidebar .current > .nav-link,
.bd-links__link.current,
.bd-links .current > .reference,
.bd-toc-nav a.active {
  background: linear-gradient(
    90deg,
    color-mix(
      in srgb,
      var(--pst-color-primary) 18%,
      transparent
    ),
    color-mix(
      in srgb,
      var(--pst-color-secondary) 10%,
      transparent
    )
  );
  border-left: 3px solid var(--pst-color-primary);
  color: var(--pst-color-primary);
  font-weight: 700;
}

.bd-toc-nav {
  font-size: 0.92rem;
}

.bd-toc-item.active > .reference {
  color: var(--pst-color-primary);
}

/* --------------------------------------------------------------------------
 * Headings and body links
 * -------------------------------------------------------------------------- */
article.bd-article h1,
article.bd-article h2,
article.bd-article h3,
article.bd-article h4,
article.bd-article h5,
article.bd-article h6 {
  color: var(--pst-color-heading);
  font-weight: 800;
  letter-spacing: -0.025em;
  scroll-margin-top: calc(var(--pst-header-height) + 1rem);
}

article.bd-article h1 {
  border-bottom: 3px solid var(--pst-color-primary);
  margin-bottom: 1.3rem;
  padding-bottom: 0.65rem;
}

article.bd-article h2 {
  border-bottom: 1px solid color-mix(
    in srgb,
    var(--pst-color-secondary) 28%,
    var(--pst-color-border)
  );
  margin-top: 3rem;
  margin-bottom: 1.15rem;
  padding-bottom: 0.45rem;
}

article.bd-article h3 {
  margin-top: 2.35rem;
}

article.bd-article h4 {
  color: color-mix(
    in srgb,
    var(--pst-color-primary) 72%,
    var(--pst-color-heading)
  );
  margin-top: 1.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.content a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink),
article a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink) {
  color: var(--pst-color-link);
  position: relative;
  text-decoration: none;
  transition: color 0.18s ease;
}

.content a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink)::after,
article a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink)::after {
  background: var(--pst-color-link);
  bottom: -0.08rem;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  transition: width 0.22s ease;
  width: 0;
}

.content a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink):hover,
article a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink):hover {
  color: var(--pst-color-link-hover);
}

.content a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink):hover::after,
article a:not(.sd-stretched-link):not(.sd-card-link):not(.headerlink):hover::after {
  background: var(--pst-color-link-hover);
  width: 100%;
}

/* --------------------------------------------------------------------------
 * Inline code and code blocks
 * -------------------------------------------------------------------------- */
:not(pre) > code,
code.literal {
  background: var(--pst-color-inline-code-background);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 16%,
    transparent
  );
  border-radius: 0.45rem;
  color: var(--pst-color-inline-code);
  font-family: var(--pst-font-family-monospace);
  font-size: 0.9em;
  padding: 0.16em 0.42em;
}

.highlight,
div.highlight,
pre {
  border-radius: var(--gp-radius-md);
}

div.highlight {
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 12%,
    var(--pst-color-border)
  );
  box-shadow: var(--gp-shadow-sm);
  margin: 1.6rem 0;
  overflow: hidden;
}

.highlight pre {
  border: 0;
  line-height: 1.65;
  margin: 0;
  padding: 1rem 1.15rem;
}

.highlight .nf,
.highlight .nc,
.highlight .nn,
.highlight .ne,
.highlight .nd,
.highlight .nx,
.highlight .na {
  text-decoration-color: var(--pst-color-primary);
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s ease,
    text-decoration-color 0.15s ease,
    text-decoration-thickness 0.15s ease,
    font-weight 0.15s ease;
}

.highlight .nf:hover,
.highlight .nc:hover,
.highlight .nn:hover,
.highlight .ne:hover,
.highlight .nd:hover,
.highlight .nx:hover,
.highlight .na:hover,
a.reference:hover code.xref.py,
code.xref.py.py-func:hover,
code.xref.py.py-class:hover,
code.xref.py.py-mod:hover {
  color: var(--gp-code-accent) !important;
  font-weight: 600;
  text-decoration-color: var(--gp-code-accent);
  text-decoration-thickness: 2px;
}

.highlight a {
  border-bottom: 1px dotted var(--pst-color-primary);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease,
    color 0.18s ease;
}

.highlight a:hover {
  border-bottom-color: var(--gp-code-accent);
  color: var(--gp-code-accent) !important;
}

button.copybtn {
  border: 1px solid var(--pst-color-border) !important;
  border-radius: 999px !important;
  box-shadow: none !important;
  opacity: 0.85 !important;
}

button.copybtn:hover {
  background: color-mix(
    in srgb,
    var(--pst-color-primary) 10%,
    transparent
  ) !important;
  color: var(--pst-color-primary) !important;
}

/* --------------------------------------------------------------------------
 * Tables
 * -------------------------------------------------------------------------- */
table.docutils:not(.field-list),
table.table {
  border: 1px solid var(--pst-color-border);
  border-collapse: separate;
  border-radius: var(--gp-radius-md);
  border-spacing: 0;
  box-shadow: var(--gp-shadow-sm);
  margin: 1.75rem 0;
  overflow: hidden;
  width: 100%;
}

.pst-scrollable-table-container {
  border-radius: var(--gp-radius-md);
}

table.docutils:not(.field-list) thead th,
table.table thead th {
  background: linear-gradient(
    180deg,
    color-mix(
      in srgb,
      var(--pst-color-primary) 6%,
      transparent
    ),
    transparent 76%
  ),
  color-mix(in srgb, var(--pst-color-surface) 95%, white);
  border-bottom: 1px solid var(--pst-color-border);
  font-weight: 800;
  padding: 0.85rem 1rem;
  position: sticky;
  text-align: left;
  top: 0;
  z-index: 2;
}

table.docutils:not(.field-list) th,
table.docutils:not(.field-list) td,
table.table th,
table.table td {
  border-top: 1px solid var(--pst-color-table-inner-border);
  padding: 0.85rem 1rem;
  transition: background-color 0.15s ease,
    box-shadow 0.15s ease;
  vertical-align: top;
}

table.docutils:not(.field-list) tbody tr:nth-child(even),
table.table tbody tr:nth-child(even) {
  background: color-mix(
    in srgb,
    var(--pst-color-surface) 92%,
    transparent
  );
}

table.docutils:not(.field-list) tbody tr:hover > th,
table.docutils:not(.field-list) tbody tr:hover > td,
table.table tbody tr:hover > th,
table.table tbody tr:hover > td {
  background: var(--pst-color-table-row-hover-bg);
  box-shadow: inset 0 2px 0 0 var(--pst-color-primary),
    inset 0 -2px 0 0 var(--pst-color-primary);
}

table.docutils:not(.field-list) caption,
table.table caption {
  caption-side: top;
  color: var(--pst-color-text-muted);
  font-weight: 700;
  padding: 0.5rem 0 0.25rem;
}

/* --------------------------------------------------------------------------
 * Interpretation / operational-risk table
 * -------------------------------------------------------------------------- */

table.docutils.interpretation-table,
table.interpretation-table {
  border: 1px solid var(--pst-color-border);
  border-radius: var(--gp-radius-md);
  box-shadow: var(--gp-shadow-md);
  overflow: hidden;
}

table.docutils.interpretation-table thead th,
table.interpretation-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.84rem;
}

table.docutils.interpretation-table tbody tr:nth-child(1) td,
table.interpretation-table tbody tr:nth-child(1) td {
  background: color-mix(
    in srgb,
    var(--gp-success) 10%,
    var(--gp-card-bg)
  );
}

table.docutils.interpretation-table tbody tr:nth-child(2) td,
table.interpretation-table tbody tr:nth-child(2) td {
  background: color-mix(
    in srgb,
    var(--gp-warning) 12%,
    var(--gp-card-bg)
  );
}

table.docutils.interpretation-table tbody tr:nth-child(3) td,
table.interpretation-table tbody tr:nth-child(3) td {
  background: color-mix(
    in srgb,
    var(--gp-danger) 10%,
    var(--gp-card-bg)
  );
}

/* Strong first-column label */
table.docutils.interpretation-table tbody td:first-child,
table.interpretation-table tbody td:first-child {
  font-weight: 800;
  white-space: nowrap;
  width: 14rem;
}

/* Row accent bar */
table.docutils.interpretation-table tbody tr:nth-child(1) td:first-child,
table.interpretation-table tbody tr:nth-child(1) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-success);
}

table.docutils.interpretation-table tbody tr:nth-child(2) td:first-child,
table.interpretation-table tbody tr:nth-child(2) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-warning);
}

table.docutils.interpretation-table tbody tr:nth-child(3) td:first-child,
table.interpretation-table tbody tr:nth-child(3) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-danger);
}

/* Slightly tighter prose for this table */
table.docutils.interpretation-table td,
table.interpretation-table td {
  line-height: 1.5;
  font-size: 0.97rem;
}

/* --------------------------------------------------------------------------
 * External-validation interpretation table
 * -------------------------------------------------------------------------- */

table.docutils.external-validation-table,
table.external-validation-table {
  border: 1px solid var(--pst-color-border);
  border-radius: var(--gp-radius-md);
  box-shadow: var(--gp-shadow-md);
  overflow: hidden;
}

table.docutils.external-validation-table thead th,
table.external-validation-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.84rem;
}

table.docutils.external-validation-table tbody tr:nth-child(1) td,
table.external-validation-table tbody tr:nth-child(1) td {
  background: color-mix(
    in srgb,
    var(--gp-success) 10%,
    var(--gp-card-bg)
  );
}

table.docutils.external-validation-table tbody tr:nth-child(2) td,
table.external-validation-table tbody tr:nth-child(2) td {
  background: color-mix(
    in srgb,
    var(--gp-warning) 12%,
    var(--gp-card-bg)
  );
}

table.docutils.external-validation-table tbody tr:nth-child(3) td,
table.external-validation-table tbody tr:nth-child(3) td {
  background: color-mix(
    in srgb,
    var(--gp-danger) 10%,
    var(--gp-card-bg)
  );
}

table.docutils.external-validation-table tbody td:first-child,
table.external-validation-table tbody td:first-child {
  font-weight: 800;
  white-space: nowrap;
  width: 14rem;
}

table.docutils.external-validation-table tbody tr:nth-child(1) td:first-child,
table.external-validation-table tbody tr:nth-child(1) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-success);
}

table.docutils.external-validation-table tbody tr:nth-child(2) td:first-child,
table.external-validation-table tbody tr:nth-child(2) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-warning);
}

table.docutils.external-validation-table tbody tr:nth-child(3) td:first-child,
table.external-validation-table tbody tr:nth-child(3) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-danger);
}

table.docutils.external-validation-table td,
table.external-validation-table td {
  font-size: 0.97rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
 * Hotspot interpretation guide table
 * -------------------------------------------------------------------------- */

table.docutils.hotspot-guide-table,
table.hotspot-guide-table {
  border: 1px solid var(--pst-color-border);
  border-radius: var(--gp-radius-md);
  box-shadow: var(--gp-shadow-md);
  overflow: hidden;
}

table.docutils.hotspot-guide-table thead th,
table.hotspot-guide-table thead th {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.84rem;
}

table.docutils.hotspot-guide-table tbody tr:nth-child(1) td,
table.hotspot-guide-table tbody tr:nth-child(1) td {
  background: color-mix(
    in srgb,
    var(--gp-danger) 10%,
    var(--gp-card-bg)
  );
}

table.docutils.hotspot-guide-table tbody tr:nth-child(2) td,
table.hotspot-guide-table tbody tr:nth-child(2) td {
  background: color-mix(
    in srgb,
    var(--gp-warning) 12%,
    var(--gp-card-bg)
  );
}

table.docutils.hotspot-guide-table tbody tr:nth-child(3) td,
table.hotspot-guide-table tbody tr:nth-child(3) td {
  background: color-mix(
    in srgb,
    var(--pst-color-primary) 10%,
    var(--gp-card-bg)
  );
}

table.docutils.hotspot-guide-table tbody td:first-child,
table.hotspot-guide-table tbody td:first-child {
  font-weight: 800;
  white-space: nowrap;
  width: 14rem;
}

table.docutils.hotspot-guide-table tbody tr:nth-child(1) td:first-child,
table.hotspot-guide-table tbody tr:nth-child(1) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-danger);
}

table.docutils.hotspot-guide-table tbody tr:nth-child(2) td:first-child,
table.hotspot-guide-table tbody tr:nth-child(2) td:first-child {
  box-shadow: inset 6px 0 0 var(--gp-warning);
}

table.docutils.hotspot-guide-table tbody tr:nth-child(3) td:first-child,
table.hotspot-guide-table tbody tr:nth-child(3) td:first-child {
  box-shadow: inset 6px 0 0 var(--pst-color-primary);
}

table.docutils.hotspot-guide-table td,
table.hotspot-guide-table td {
  font-size: 0.97rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
 * Generic admonitions
 * -------------------------------------------------------------------------- */
.admonition,
div.admonition,
.alert {
  border: 1px solid var(--pst-color-border);
  border-radius: var(--gp-radius-md);
  box-shadow: var(--gp-shadow-sm);
  margin: 1.8rem 0;
  overflow: hidden;
}

.admonition .admonition-title,
div.admonition > .admonition-title {
  align-items: center;
  color: #fff;
  display: flex;
  font-weight: 800;
  gap: 0.55rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  margin: 0;
  min-height: 3.1rem;
  padding: 0.9rem 1.15rem;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

html[data-theme="light"] .admonition.tip,
html[data-theme="light"] .admonition.hint {
  background: linear-gradient(
    180deg,
    rgba(25, 135, 84, 0.06) 0%,
    #ffffff 38%
  );
}

html[data-theme="light"] .admonition.warning,
html[data-theme="light"] .admonition.caution {
  background: linear-gradient(
    180deg,
    rgba(217, 119, 6, 0.07) 0%,
    #ffffff 38%
  );
}

html[data-theme="light"] .admonition.error,
html[data-theme="light"] .admonition.danger,
html[data-theme="light"] .admonition.important {
  background: linear-gradient(
    180deg,
    rgba(180, 35, 24, 0.06) 0%,
    #ffffff 38%
  );
}

html[data-theme="dark"] .admonition.tip,
html[data-theme="dark"] .admonition.hint {
  background: linear-gradient(
    180deg,
    rgba(55, 182, 121, 0.10) 0%,
    var(--pst-color-surface) 42%
  );
}

html[data-theme="dark"] .admonition.warning,
html[data-theme="dark"] .admonition.caution {
  background: linear-gradient(
    180deg,
    rgba(247, 168, 75, 0.11) 0%,
    var(--pst-color-surface) 42%
  );
}

html[data-theme="dark"] .admonition.error,
html[data-theme="dark"] .admonition.danger,
html[data-theme="dark"] .admonition.important {
  background: linear-gradient(
    180deg,
    rgba(255, 120, 103, 0.10) 0%,
    var(--pst-color-surface) 42%
  );
}


/* Clean admonition icon reset for PyData theme */
.admonition .admonition-title::before,
div.admonition > .admonition-title::before {
  color: #ffffff !important;
  background: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 0.55rem 0 0 !important;
  padding: 0 !important;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.18));
  position: static !important;
  transform: none !important;
  flex: 0 0 auto;
  display: inline-block;
  line-height: 1;
}

.admonition > *:not(.admonition-title) {
  padding-left: 1.15rem;
  padding-right: 1.15rem;
}

.admonition > :last-child {
  padding-bottom: 1rem;
}

.admonition.note,
.admonition.seealso,
.admonition.info {
  border-top: 4px solid var(--pst-color-primary);
}

.admonition.note > .admonition-title,
.admonition.seealso > .admonition-title,
.admonition.info > .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-primary),
    color-mix(in srgb, var(--pst-color-primary) 58%, white)
  );
}

.admonition.tip,
.admonition.hint {
  border-top: 4px solid var(--pst-color-success);
}

.admonition.tip > .admonition-title,
.admonition.hint > .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-success),
    color-mix(in srgb, var(--pst-color-success) 60%, white)
  );
}

.admonition.warning,
.admonition.caution {
  border-top: 4px solid var(--pst-color-warning);
}

.admonition.warning > .admonition-title,
.admonition.caution > .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-warning),
    color-mix(in srgb, var(--pst-color-warning) 62%, white)
  );
}

.admonition.error,
.admonition.danger,
.admonition.important {
  border-top: 4px solid var(--pst-color-danger);
}

.admonition.error > .admonition-title,
.admonition.danger > .admonition-title,
.admonition.important > .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-danger),
    color-mix(in srgb, var(--pst-color-danger) 60%, white)
  );
}

/* --------------------------------------------------------------------------
 * Custom hero admonitions used in the docs
 * -------------------------------------------------------------------------- */
.admonition.practical-examples,
.admonition.practical-example {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pst-color-primary) 6%, transparent) 0%,
    color-mix(in srgb, var(--pst-color-secondary) 6%, transparent) 100%
  ),
  var(--pst-color-background);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 18%,
    var(--pst-color-border)
  );
  border-radius: 1rem;
  box-shadow: var(--gp-shadow-md);
  position: relative;
}

.admonition.practical-examples:hover,
.admonition.practical-example:hover {
  box-shadow: var(--gp-shadow-lg);
}

.admonition.practical-examples .admonition-title,
.admonition.practical-example .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-primary),
    var(--pst-color-secondary)
  );
}

.admonition.practical-examples .admonition-title::before,
.admonition.practical-example .admonition-title::before {
  display: none !important;
}

.admonition.best-practice {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pst-color-success) 8%, transparent) 0%,
    transparent 70%
  ),
  var(--pst-color-background);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-success) 30%,
    var(--pst-color-border)
  );
  border-radius: 1rem;
  box-shadow: var(--gp-shadow-md);
  overflow: hidden;
  position: relative;
}

.admonition.best-practice::before {
  background: var(--pst-color-success);
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 8px;
}

.admonition.best-practice::after {
  background: var(--pst-color-success);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  color: #fff;
  content: attr(data-badge);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.25rem 1.75rem;
  position: absolute;
  right: -34px;
  top: 0.95rem;
  transform: rotate(45deg);
}

.admonition.best-practice .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-success),
    color-mix(in srgb, var(--pst-color-success) 68%, var(--pst-color-primary))
  );
  gap: 0;
}

.admonition.best-practice .admonition-title::before {
  display: none !important;
}

.admonition.plot-anatomy {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pst-color-primary) 7%, transparent) 0%,
    transparent 70%
  ),
  var(--pst-color-background);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 28%,
    var(--pst-color-border)
  );
  border-radius: 1rem;
  box-shadow: var(--gp-shadow-md);
  overflow: hidden;
  position: relative;
}

.admonition.plot-anatomy .admonition-title {
  background: linear-gradient(
    90deg,
    var(--pst-color-primary),
    color-mix(in srgb, var(--pst-color-primary) 58%, var(--gp-slate))
  );
}

.admonition.plot-anatomy .admonition-title::before {
  display: none !important;
}

.admonition.plot-anatomy::after {
  background: var(--pst-color-primary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  color: #fff;
  content: "KEY";
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 0.25rem 1.55rem;
  position: absolute;
  right: -22px;
  top: 0.95rem;
  transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
 * Sphinx Design components
 * -------------------------------------------------------------------------- */
.sd-button-link,
.sd-btn,
.sd-btn.sd-btn-primary,
.sd-btn.sd-btn-secondary {
  border-radius: 999px;
  box-shadow: var(--gp-shadow-sm);
  font-weight: 700;
  transition: transform 0.18s ease,
    box-shadow 0.18s ease, background-color 0.18s ease;
}

.sd-button-link:hover,
.sd-btn:hover,
.sd-btn.sd-btn-primary:hover,
.sd-btn.sd-btn-secondary:hover {
  box-shadow: var(--gp-shadow-md);
  transform: translateY(-2px);
}

.sd-button-link.sd-color-primary,
.sd-btn.sd-btn-primary {
  background: var(--pst-color-primary) !important;
  border-color: var(--pst-color-primary) !important;
  color: #fff !important;
}

.sd-button-link.sd-color-secondary,
.sd-btn.sd-btn-secondary {
  background: var(--pst-color-secondary) !important;
  border-color: var(--pst-color-secondary) !important;
  color: #fff !important;
}

.sd-card {
  border: 1px solid var(--pst-color-border);
  border-radius: 1rem;
  box-shadow: var(--gp-shadow-sm);
  overflow: hidden;
  position: relative;
  transition: border-color 0.18s ease,
    box-shadow 0.18s ease, transform 0.18s ease;
}

.sd-card:hover {
  border-color: color-mix(
    in srgb,
    var(--pst-color-primary) 34%,
    var(--pst-color-border)
  );
  box-shadow: var(--gp-shadow-md);
  transform: translateY(-2px);
}

.sd-card .sd-card-header {
  background: color-mix(
    in srgb,
    var(--pst-color-surface) 92%,
    transparent
  );
  border-bottom: 1px solid var(--pst-color-border);
  font-weight: 700;
  padding: 0.8rem 1.1rem;
}

.sd-card .sd-card-body {
  padding: 1.1rem;
}

.new-badge-card {
  animation: sparkle 1.5s infinite ease-in-out;
  background: var(--pst-color-secondary);
  border: 2px solid #fff;
  border-radius: 999px;
  color: #fff;
  display: none;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.55rem;
  position: absolute;
  right: 0.7rem;
  top: 0.7rem;
  z-index: 3;
}

@keyframes sparkle {
  0% {
    box-shadow: 0 0 0 0 rgba(208, 94, 0, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(208, 94, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(208, 94, 0, 0);
  }
}

/* --------------------------------------------------------------------------
 * CTA cards / see-also cards / preview popups
 * -------------------------------------------------------------------------- */

/* Keep stretched links clickable across the full card */
a.sd-stretched-link {
  position: static !important;
}

a.sd-stretched-link::after {
  background: transparent !important;
  content: "";
  inset: 0;
  position: absolute;
  z-index: 3;
}

/* CTA tiles */
.cta-tiles .sd-card {
  background: var(--pst-color-background);
}

/* See-also / featured application cards */
.see-also-tiles .sd-card {
  background: var(--pst-color-surface) !important;
  overflow: hidden;
  position: relative;
}

.see-also-tiles .sd-card::before,
.see-also-tiles .sd-card::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.see-also-tiles .sd-card::before {
  background-image: var(--card-preview);
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0;
  transform: scale(1.04);
  transition:
    opacity 0.25s ease,
    transform 0.25s ease;
  z-index: 0;
}

.see-also-tiles .sd-card::after {
  background: linear-gradient(
    to bottom,
    rgba(4, 146, 194, 0.16),
    rgba(4, 146, 194, 0.48)
  );
  opacity: 0;
  transition: opacity 0.25s ease;
  z-index: 1;
}

.see-also-tiles .sd-card:hover::before,
.see-also-tiles .sd-card:hover::after {
  opacity: 1;
}

.see-also-tiles .sd-card:hover::before {
  transform: scale(1);
}

.see-also-tiles .sd-card .sd-card-header,
.see-also-tiles .sd-card .sd-card-body {
  position: relative;
  z-index: 2;
}

/* Accent variant */
.see-also-tiles .see-also-accent {
  background: color-mix(
    in srgb,
    var(--pst-color-primary) 8%,
    var(--pst-color-surface)
  ) !important;
}

.see-also-tiles .see-also-accent::before {
  display: none !important;
}

.see-also-tiles .see-also-accent::after {
  background: linear-gradient(
    135deg,
    rgba(4, 146, 194, 0.12),
    rgba(4, 146, 194, 0) 60%
  );
  opacity: 1;
}

.see-also-tiles .see-also-accent:hover,
.see-also-tiles .see-also-accent:hover * {
  color: var(--pst-color-text-base) !important;
}

/* Preview image mappings */
.see-also-tiles .card--uncertainty       { --card-preview: url("../previews/uncertainty.png"); }
.see-also-tiles .card--errors            { --card-preview: url("../previews/errors.png"); }
.see-also-tiles .card--evaluation        { --card-preview: url("../previews/evaluation.png"); }
.see-also-tiles .card--importance        { --card-preview: url("../previews/importance.png"); }
.see-also-tiles .card--relationship      { --card-preview: url("../previews/relationship.png"); }
.see-also-tiles .card--core-ablation     { --card-preview: url("../previews/core_ablation.png"); }
.see-also-tiles .card--ridge-bounds      { --card-preview: url("../previews/ridge_bounds.png"); }
.see-also-tiles .card--hotspot-analytics { --card-preview: url("../previews/where-to-act.png"); }

/* Popup anchor */
/*.seealso-card {
  overflow: visible;
  position: relative;
}*/

.see-also-tiles .sd-card.seealso-card {
  overflow: visible !important;
  position: relative;
}

/* Preview popup */
.card-preview-popup {
  background: var(--pst-color-background);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 24%,
    var(--pst-color-border)
  );
  border-radius: 0.9rem;
  bottom: calc(100% + 0.55rem);
  box-shadow: var(--gp-shadow-lg);
  left: 50%;
  max-width: min(34rem, calc(100vw - 2rem));
  opacity: 0;
  padding: 0.6rem;
  pointer-events: none;
  position: absolute;
  transform: translateX(-50%) translateY(0.35rem);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
  width: 30rem;
  z-index: 40;
}

.card-preview-popup.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.card-preview-popup__figure {
  margin: 0;
}

.card-preview-popup__image,
.card-preview-popup img {
  border: 2px solid var(--pst-color-background);
  border-radius: 0.75rem;
  display: block;
  width: 100%;
}

.card-preview-popup__caption {
  color: var(--pst-color-text-base);
  font-size: 0.92rem;
  line-height: 1.45;
  margin-top: 0.55rem;
}

html[data-theme="dark"] .card-preview-popup__caption {
  color: var(--pst-color-on-background);
}

/* --------------------------------------------------------------------------
 * Topic cards
 * -------------------------------------------------------------------------- */
.topic {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pst-color-primary) 6%, transparent) 0%,
    transparent 65%
  ),
  var(--pst-color-surface);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 18%,
    var(--pst-color-border)
  );
  border-radius: 0.95rem;
  box-shadow: var(--gp-shadow-sm);
  overflow: hidden;
  padding: 1rem 1.2rem;
  position: relative;
  transition: box-shadow 0.18s ease,
    border-color 0.18s ease, transform 0.18s ease;
}

.topic::before {
  background: linear-gradient(
    180deg,
    var(--pst-color-primary),
    color-mix(in srgb, var(--pst-color-primary) 72%, var(--gp-slate))
  );
  border-radius: 0.95rem 0 0 0.95rem;
  content: "";
  inset: 0 auto 0 0;
  position: absolute;
  width: 6px;
}

.topic:hover {
  border-color: color-mix(
    in srgb,
    var(--pst-color-primary) 28%,
    var(--pst-color-border)
  );
  box-shadow: var(--gp-shadow-md);
  transform: translateY(-1px);
}

.topic p.topic-title {
  background: var(--pst-color-primary);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  color: #fff;
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.15;
  margin: 0 0 0.65rem 0;
  padding: 0.35rem 0.75rem;
}

.topic p.topic-title .headerlink,
.topic p.topic-title .headerlink::before,
.topic p.topic-title .headerlink::after {
  content: none !important;
  display: none !important;
}

/* --------------------------------------------------------------------------
 * Citations and footnotes
 * -------------------------------------------------------------------------- */
.citation,
.footnote,
dl.footnote {
  border-left: 3px solid var(--pst-color-primary);
  box-shadow: var(--gp-shadow-sm);
  margin: 1.3rem 0;
  padding: 0.85rem 0 0.85rem 1.2rem;
  transition: box-shadow 0.18s ease,
    transform 0.18s ease;
}

.citation:hover,
.footnote:hover,
dl.footnote:hover {
  box-shadow: var(--gp-shadow-md);
  transform: translateY(-1px);
}

.citation .label,
.footnote .label,
dl.footnote > dt,
.footnote dt .label {
  font-weight: 800;
}

.footnotes {
  border-top: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 32%,
    var(--pst-color-border)
  );
  margin-top: 2rem;
  padding-top: 1rem;
}

a.footnote-reference,
a[role="doc-noteref"] {
  border-bottom: 1px dotted var(--pst-color-primary);
  font-weight: 700;
  padding: 0 0.15em;
  text-decoration: none;
}

a.footnote-reference:hover,
a[role="doc-noteref"]:hover {
  border-bottom-style: solid;
  color: var(--pst-color-primary);
}

a.footnote-backref,
a[role="doc-backlink"] {
  margin-left: 0.45rem;
  opacity: 0.78;
}

/* --------------------------------------------------------------------------
 * Hero image animation and utility spacer
 * -------------------------------------------------------------------------- */
@keyframes fadeIn-floatUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-image-card {
  animation: fadeIn-floatUp 0.8s ease-out forwards;
}

hr.hr-spacer {
  background: transparent !important;
  border: 0 !important;
  height: 0 !important;
  margin: 1.5rem 0 2rem !important;
}

/* --------------------------------------------------------------------------
 * Responsive adjustments
 * -------------------------------------------------------------------------- */
@media (max-width: 991.98px) {
  article.bd-article h1 {
    font-size: 2.15rem;
  }

  article.bd-article h2 {
    font-size: 1.75rem;
  }

  .navbar-brand img,
  .navbar-brand svg {
    max-height: 2rem;
  }
}

@media (max-width: 767.98px) {
  .bd-main .bd-content .bd-article-container,
  .bd-main .bd-content .bd-article {
    max-width: 100%;
  }

  .admonition.best-practice::after,
  .admonition.plot-anatomy::after {
    display: none;
  }
}

/* --------------------------------------------------------------------------
 * Readability fixes for admonitions and cards
 * -------------------------------------------------------------------------- */

/* Generic admonition body readability */
.admonition,
div.admonition {
  color: var(--pst-color-text-base);
}

.admonition > *:not(.admonition-title),
div.admonition > *:not(.admonition-title) {
  color: var(--pst-color-text-base);
}

.admonition p,
.admonition li,
.admonition dd,
.admonition dt,
.admonition .admonition-title + * {
  color: var(--pst-color-text-base);
}

.admonition a:not(.headerlink),
div.admonition a:not(.headerlink) {
  color: var(--pst-color-link);
}

html[data-theme="light"] .admonition,
html[data-theme="light"] div.admonition {
  background: #ffffff;
}

html[data-theme="dark"] .admonition,
html[data-theme="dark"] div.admonition {
  background: var(--pst-color-surface);
}

/* Make note/info bodies readable in both themes */
html[data-theme="light"] .admonition.note,
html[data-theme="light"] .admonition.seealso,
html[data-theme="light"] .admonition.info {
  background: linear-gradient(
    180deg,
    rgba(4, 146, 194, 0.06) 0%,
    #ffffff 38%
  );
}

html[data-theme="dark"] .admonition.note,
html[data-theme="dark"] .admonition.seealso,
html[data-theme="dark"] .admonition.info {
  background: linear-gradient(
    180deg,
    rgba(62, 185, 223, 0.10) 0%,
    var(--pst-color-surface) 42%
  );
}

/* Generic card readability */
.sd-card,
.sd-card .sd-card-header,
.sd-card .sd-card-body {
  color: var(--pst-color-text-base);
}

.sd-card p,
.sd-card li,
.sd-card .sd-card-text,
.sd-card .sd-card-title,
.sd-card .sd-card-header {
  color: var(--pst-color-text-base);
}

.sd-card a:not(.sd-stretched-link):not(.sd-btn):not(.sd-button-link) {
  color: var(--pst-color-link);
}

html[data-theme="light"] .sd-card {
  background: #ffffff;
}

html[data-theme="dark"] .sd-card {
  background: var(--pst-color-surface);
}

/* Homepage / tile cards must not be transparent in resting state */
.cta-tiles .sd-card,
.see-also-tiles .sd-card {
  background: var(--pst-color-surface) !important;
}

.cta-tiles .sd-card .sd-card-header,
.cta-tiles .sd-card .sd-card-body,
.see-also-tiles .sd-card .sd-card-header,
.see-also-tiles .sd-card .sd-card-body {
  color: var(--pst-color-text-base) !important;
}

html[data-theme="light"] .cta-tiles .sd-card,
html[data-theme="light"] .see-also-tiles .sd-card {
  background: #ffffff !important;
}

html[data-theme="dark"] .cta-tiles .sd-card,
html[data-theme="dark"] .see-also-tiles .sd-card {
  background: var(--pst-color-surface) !important;
}


/* --------------------------------------------------------------------------
 * Final homepage/grid card theme fix
 * -------------------------------------------------------------------------- */

html[data-theme="light"] {
  --gp-card-bg: #ffffff;
  --gp-card-header-bg: #f2f8fc;
  --gp-card-text: #17384d;
  --gp-card-muted: #4f6474;
  --gp-card-border: #d7e4ec;
}

html[data-theme="dark"] {
  --gp-card-bg: #12202b;
  --gp-card-header-bg: #1a2c38;
  --gp-card-text: #e8f1f7;
  --gp-card-muted: #bfd0db;
  --gp-card-border: #274154;
}

/* Force a single readable palette for all grid cards */
.sd-card,
.cta-tiles .sd-card,
.see-also-tiles .sd-card {
  background: var(--gp-card-bg) !important;
  border-color: var(--gp-card-border) !important;
  color: var(--gp-card-text) !important;
}

/* Header/body must also follow the same palette */
.sd-card .sd-card-header,
.cta-tiles .sd-card .sd-card-header,
.see-also-tiles .sd-card .sd-card-header {
  background: var(--gp-card-header-bg) !important;
  color: var(--gp-card-text) !important;
  border-bottom: 1px solid var(--gp-card-border) !important;
}

.sd-card .sd-card-body,
.cta-tiles .sd-card .sd-card-body,
.see-also-tiles .sd-card .sd-card-body {
  background: var(--gp-card-bg) !important;
  color: var(--gp-card-text) !important;
}

/* Text inside cards */
.sd-card .sd-card-title,
.sd-card .sd-card-text,
.sd-card p,
.sd-card li,
.sd-card strong,
.sd-card em,
.sd-card .sd-stretched-link,
.sd-card a:not(.sd-btn):not(.sd-button-link) {
  color: var(--gp-card-text) !important;
}

/* Slightly softer paragraph tone if needed */
.sd-card p + p,
.sd-card li,
.sd-card .sd-card-text {
  color: var(--gp-card-muted) !important;
}

/* Neutralize common Sphinx Design utility clashes */
.sd-card.sd-bg-light,
.sd-card.sd-bg-dark,
.sd-card.sd-bg-muted,
.sd-card[class*="sd-bg-"] {
  background: var(--gp-card-bg) !important;
  color: var(--gp-card-text) !important;
}

.sd-card .sd-text-light,
.sd-card .sd-text-dark,
.sd-card .sd-text-muted,
.sd-card [class*="sd-text-"] {
  color: inherit !important;
}


/* --------------------------------------------------------------------------
 * Canonical hover styling for homepage/grid cards
 * -------------------------------------------------------------------------- */

/* Light mode: use a darker GeoPrior hover surface so white text stays readable */
html[data-theme="light"] .cta-tiles .sd-card:hover,
html[data-theme="light"] .see-also-tiles .sd-card:hover {
  background: linear-gradient(
    135deg,
    var(--gp-blue-deep),
    var(--gp-slate)
  ) !important;
  border-color: var(--gp-blue-deep) !important;
}

/* Dark mode: keep the brighter accent hover */
html[data-theme="dark"] .cta-tiles .sd-card:hover,
html[data-theme="dark"] .see-also-tiles .sd-card:hover {
  background: linear-gradient(
    135deg,
    var(--pst-color-primary),
    color-mix(
      in srgb,
      var(--pst-color-primary) 72%,
      var(--gp-slate)
    )
  ) !important;
  border-color: var(--pst-color-primary) !important;
}

/* Let the hover gradient show through the inner card regions */
.cta-tiles .sd-card:hover .sd-card-header,
.cta-tiles .sd-card:hover .sd-card-body,
.see-also-tiles .sd-card:hover .sd-card-header,
.see-also-tiles .sd-card:hover .sd-card-body {
  background: transparent !important;
  color: #ffffff !important;
}

/* Keep all hover text readable */
.cta-tiles .sd-card:hover .sd-card-title,
.cta-tiles .sd-card:hover .sd-card-text,
.cta-tiles .sd-card:hover p,
.cta-tiles .sd-card:hover li,
.cta-tiles .sd-card:hover strong,
.cta-tiles .sd-card:hover em,
.cta-tiles .sd-card:hover a,
.see-also-tiles .sd-card:hover .sd-card-title,
.see-also-tiles .sd-card:hover .sd-card-text,
.see-also-tiles .sd-card:hover p,
.see-also-tiles .sd-card:hover li,
.see-also-tiles .sd-card:hover strong,
.see-also-tiles .sd-card:hover em,
.see-also-tiles .sd-card:hover a {
  color: #ffffff !important;
}

/* Slightly softer divider on hover */
.cta-tiles .sd-card:hover .sd-card-header,
.see-also-tiles .sd-card:hover .sd-card-header {
  border-bottom-color: rgba(255, 255, 255, 0.18) !important;
}

/* --------------------------------------------------------------------------
 * CLI page cards
 * -------------------------------------------------------------------------- */

.cli-tiles {
  margin-top: 1.4rem;
}

.cli-tiles .sd-card {
  min-height: 100%;
  position: relative;
}

.cli-tiles .sd-card .sd-card-header {
  font-weight: 800;
}

.cli-tiles .sd-card .sd-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cli-tiles .sd-card pre,
.cli-tiles .sd-card div.highlight {
  margin: 0.4rem 0 0;
  box-shadow: none;
}

.cli-tiles .sd-card code {
  font-size: 0.88em;
}

.cli-tiles .sd-card:hover {
  transform: translateY(-2px);
}

.cli-tiles .sd-card .sd-card-text strong {
  color: var(--pst-color-heading) !important;
}

/* --------------------------------------------------------------------------
 * CLI intro card
 * -------------------------------------------------------------------------- */

.gp-intro-card {
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--pst-color-primary) 7%, transparent) 0%,
    transparent 70%
  ),
  var(--pst-color-surface);
  border: 1px solid color-mix(
    in srgb,
    var(--pst-color-primary) 18%,
    var(--pst-color-border)
  );
  border-radius: 1rem;
  box-shadow: var(--gp-shadow-sm);
  margin: 1.4rem 0 1.8rem;
  padding: 1rem 1.15rem;
}

/* Featured applications: reduce oversized top SVG icons */
.featured-app-tiles .sd-card-img-top {
  display: block;
  width: 100%;
  height: 75px;          /* try 110px to 140px */
  object-fit: contain;
  object-position: center;
  padding: 0.85rem 0.85rem 0.25rem;
  margin: 0 auto;
}

/* Optional: keep card content balanced */
.featured-app-tiles .sd-card-body {
  padding-top: 0.75rem;
}