/*
 * StackGen SDK docs — visual parity with https://docs.stackgen.com/
 * Dark-first Infima-style tokens, Geist typography, StackGen navbar/footer chrome.
 */

:root {
  --sg-font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  --sg-font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sg-link: #1976d2;
  --sg-link-hover: #1565c0;
  --sg-bg: #ffffff;
  --sg-surface: #ffffff;
  --sg-text: #1c1e21;
  --sg-text-secondary: #525860;
  --sg-border: #dadde1;
  --sg-navbar-bg: #ffffff;
  --sg-navbar-text: #1c1e21;
  --sg-navbar-link: rgba(0, 0, 0, 0.8);
  --sg-code-bg: #f6f8fa;
  --sg-code-border: #d1d9e0;
  --sg-pre-bg: #f6f8fa;
  --sg-pre-text: #24292f;
  --sg-inline-code-bg: #f3f4f6;
  --sg-inline-code-text: #2563eb;
  --sg-inline-code-border: #d1d9e0;
  --sg-footer-bg: #ffffff;
  --sg-footer-text: #525860;
  --sg-footer-link: #1c1e21;
  --sg-footer-title: #1c1e21;
  --sg-footer-art: url('https://docs.stackgen.com/img/footer-hubspot/footer-background.png');
}

html[data-theme='dark'] {
  --sg-link: #64b5f6;
  --sg-link-hover: #90caf9;
  --sg-bg: #1b1b1d;
  --sg-surface: #242526;
  --sg-text: #e3e3e3;
  --sg-text-secondary: rgba(255, 255, 255, 0.7);
  --sg-border: #303030;
  --sg-navbar-bg: #242526;
  --sg-navbar-text: #ffffff;
  --sg-navbar-link: rgba(255, 255, 255, 0.8);
  --sg-code-bg: #1e1e2e;
  --sg-code-border: #313244;
  --sg-pre-bg: #1e1e2e;
  --sg-pre-text: #cdd6f4;
  --sg-inline-code-bg: #313244;
  --sg-inline-code-text: #fb923c;
  --sg-inline-code-border: #45475a;
  --sg-footer-bg: #242526;
  --sg-footer-text: rgba(255, 255, 255, 0.7);
  --sg-footer-link: rgba(255, 255, 255, 0.9);
  --sg-footer-title: #ffffff;
  --sg-footer-art: url('https://docs.stackgen.com/img/footer-hubspot/footer-diamond-art.png');
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sg-font);
  color: var(--sg-text);
  background: var(--sg-bg);
  line-height: 1.65;
}

.wrapper {
  max-width: 996px;
}

/* ── Navbar (parity with docs.stackgen.com / Infima) ── */

.site-header.sg-navbar {
  border-top: 0;
  border-bottom: 1px solid var(--sg-border);
  background: var(--sg-navbar-bg);
  min-height: 3.75rem;
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0;
}

/* Kill Minima's constrained header wrapper + float nav */
.site-header.sg-navbar > .wrapper,
.site-header.sg-navbar .wrapper {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
}

.sg-navbar__inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  min-height: 3.75rem;
  box-sizing: border-box;
}

.sg-navbar__brand-group {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.sg-navbar__brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.sg-navbar__logo {
  display: block;
  height: 28px;
  width: auto;
}

html[data-theme='light'] .sg-navbar__logo--dark,
html:not([data-theme]) .sg-navbar__logo--dark {
  display: none;
}

html[data-theme='dark'] .sg-navbar__logo--light {
  display: none;
}

.sg-navbar__product {
  font-family: var(--sg-font);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.01em;
  color: var(--sg-link);
  text-decoration: none;
  white-space: nowrap;
  padding-left: 0.65rem;
  border-left: 1px solid var(--sg-border);
  line-height: 1.2;
}

.sg-navbar__product:hover {
  color: var(--sg-link-hover);
  text-decoration: none;
}

.sg-navbar__nav {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  float: none !important;
  position: static;
  line-height: normal;
  padding: 0;
  margin: 0;
}

.sg-navbar__trigger {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sg-navbar__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.sg-navbar__burger-icon,
.sg-navbar__burger-icon::before,
.sg-navbar__burger-icon::after {
  display: block;
  width: 1rem;
  height: 2px;
  background: var(--sg-navbar-link);
  border-radius: 1px;
  position: relative;
}

.sg-navbar__burger-icon::before,
.sg-navbar__burger-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.sg-navbar__burger-icon::before {
  top: -5px;
}

.sg-navbar__burger-icon::after {
  top: 5px;
}

.sg-navbar__links {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.15rem;
  min-width: 0;
}

.sg-navbar__link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--sg-navbar-link);
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.2;
  text-decoration: none;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
}

.sg-navbar__link:hover {
  color: var(--sg-link);
  text-decoration: none;
  background: rgba(124, 58, 237, 0.08);
}

.sg-navbar__link.is-active {
  color: var(--sg-link);
  background: rgba(124, 58, 237, 0.12);
}

.sg-navbar__right {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.65rem;
  flex-shrink: 0;
  margin-left: auto;
}

.sg-navbar__external {
  color: var(--sg-navbar-link);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.sg-navbar__external:hover {
  color: var(--sg-link);
  text-decoration: none;
}

.sg-navbar__external-icon {
  font-size: 0.75em;
  margin-left: 0.15em;
}

/* DocSearch-style search control (docs.stackgen.com) */
.sg-navbar__search {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 11.5rem;
  height: 2.25rem;
  padding: 0 0.65rem 0 0.75rem;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-surface);
  color: var(--sg-text-secondary);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html[data-theme='dark'] .sg-navbar__search {
  background: rgba(255, 255, 255, 0.04);
  box-shadow: none;
}

.sg-navbar__search:hover {
  color: var(--sg-text);
  border-color: rgba(124, 58, 237, 0.45);
}

.sg-navbar__search-icon {
  flex-shrink: 0;
  opacity: 0.75;
}

.sg-navbar__search-label {
  flex: 1 1 auto;
  text-align: left;
}

.sg-navbar__search-kbd {
  font-family: var(--sg-font-mono);
  font-size: 0.7rem;
  line-height: 1;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  border: 1px solid var(--sg-border);
  color: var(--sg-text-secondary);
  background: rgba(124, 58, 237, 0.06);
}

/* Theme toggle — copied from docs.stackgen.com navbar chrome */
.stackgen-theme-toggle {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  box-sizing: border-box;
  height: 32px;
  padding: 1px;
  border-radius: 999px;
  border: 1px solid rgba(40, 22, 56, 0.08);
  background-color: rgba(250, 250, 252, 0.96);
  backdrop-filter: blur(8px) saturate(1.08);
  -webkit-backdrop-filter: blur(8px) saturate(1.08);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.7) inset,
    0 1px 1px rgba(15, 23, 42, 0.04);
}

html[data-theme='dark'] .stackgen-theme-toggle {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background-color: rgba(22, 21, 30, 0.72);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 1px 1px rgba(0, 0, 0, 0.35);
}

.stackgen-theme-toggle__segment {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(40, 22, 56, 0.36);
  cursor: pointer;
}

html[data-theme='dark'] .stackgen-theme-toggle__segment {
  color: rgba(230, 220, 255, 0.38);
}

.stackgen-theme-toggle__segment--active {
  color: #ffffff !important;
  background: linear-gradient(180deg, #b4a0fc 0%, #7c3aed 42%, #5b21b6 100%);
  box-shadow:
    0 1px 2px rgba(91, 33, 182, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.14) inset;
}

.stackgen-theme-toggle__icon,
.stackgen-theme-toggle__icon svg {
  display: block;
  width: 14px;
  height: 14px;
}

/* Collapse to burger before labels wrap (docs.stackgen.com pattern) */
@media screen and (max-width: 1100px) {
  .sg-navbar__burger {
    display: inline-flex;
    margin-left: 0.25rem;
  }

  .sg-navbar__links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    padding: 0.75rem 1.25rem 1rem;
    background: var(--sg-navbar-bg);
    border-bottom: 1px solid var(--sg-border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    z-index: 101;
  }

  .sg-navbar__trigger:checked ~ .sg-navbar__links {
    display: flex;
  }

  .sg-navbar__link {
    padding: 0.65rem 0.75rem;
  }

  .sg-navbar__search {
    min-width: 0;
    width: 2.25rem;
    padding: 0;
    justify-content: center;
  }

  .sg-navbar__search-label,
  .sg-navbar__search-kbd {
    display: none;
  }

  .sg-navbar__external {
    display: none;
  }
}

@media screen and (max-width: 640px) {
  .sg-navbar__inner {
    padding: 0 0.85rem;
  }
}

/* Hide Minima leftovers if theme CSS still injects them */
.site-header .site-title,
.site-nav .nav-trigger,
.site-nav label[for='nav-trigger'],
.site-nav .menu-icon {
  display: none !important;
}

/* ── Main content ── */

.page-content {
  padding-top: 2rem;
  padding-bottom: 3rem;
}

.page-heading {
  font-weight: 700;
  letter-spacing: -0.02em;
}

a {
  color: var(--sg-link);
  text-decoration: none;
}

a:hover {
  color: var(--sg-link-hover);
  text-decoration: underline;
}

h1, h2, h3, h4 {
  letter-spacing: -0.02em;
  color: var(--sg-text);
}

h2 {
  margin-top: 2rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--sg-border);
}

p, li {
  color: var(--sg-text);
}

/* ── Tables ── */

.page-content table {
  display: table;
  width: 100%;
  max-width: 100%;
  margin: 1.25rem 0;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  border-collapse: collapse;
  background: var(--sg-surface);
  color: var(--sg-text-secondary);
  font-size: 0.9375rem;
}

/* Minima sets `table tr:nth-child(even) { background: light gray }` — breaks dark mode */
.page-content table tr:nth-child(even) {
  background-color: transparent !important;
}

.page-content thead {
  display: table-header-group;
}

.page-content tbody {
  display: table-row-group;
}

.page-content tr {
  display: table-row;
}

.page-content th,
.page-content td {
  display: table-cell;
  border-bottom: 1px solid var(--sg-border);
  padding: 0.65rem 0.85rem;
  vertical-align: top;
  text-align: left;
}

.page-content th {
  background: rgba(124, 58, 237, 0.08);
  color: var(--sg-text);
  font-weight: 600;
}

html[data-theme='dark'] .page-content th {
  background: rgba(255, 255, 255, 0.06);
}

.page-content td {
  color: var(--sg-text-secondary);
}

.page-content td p,
.page-content th p {
  margin: 0;
  color: inherit;
}

html[data-theme='dark'] .page-content td {
  color: rgba(255, 255, 255, 0.82);
}

.page-content tr:last-child th,
.page-content tr:last-child td {
  border-bottom: 0;
}

.page-content tr:nth-child(even) td {
  background-color: rgba(124, 58, 237, 0.05);
}

html[data-theme='dark'] .page-content tr:nth-child(even) td {
  background-color: #2c2d30;
}

html[data-theme='dark'] .page-content tr:nth-child(odd) td {
  background-color: var(--sg-surface);
}

@media (max-width: 640px) {
  .page-content .wrapper {
    overflow-x: auto;
  }
}

/* ── Blockquotes ── */

blockquote {
  border-left: 4px solid #7c3aed;
  background: rgba(124, 58, 237, 0.08);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  color: var(--sg-text);
}

html[data-theme='light'] blockquote {
  background: #f5e8ff;
  border-left-color: #8247e7;
}

/* ── Code ── */

/* Inline code only — block code lives inside pre/highlighter-rouge */
:not(pre) > code {
  font-family: var(--sg-font-mono);
  font-size: 0.85em;
  font-weight: 500;
  background: var(--sg-inline-code-bg);
  color: var(--sg-inline-code-text);
  border: 1px solid var(--sg-inline-code-border);
  border-radius: 4px;
  padding: 0.15em 0.4em;
  white-space: break-spaces;
}

.page-content table :not(pre) > code {
  font-size: 0.8125em;
}

/* Rouge / Minima: .highlighter-rouge > .highlight > pre.highlight > code */
div.highlighter-rouge {
  margin: 1.25rem 0;
  border: 1px solid var(--sg-code-border);
  border-radius: 8px;
  background: var(--sg-pre-bg);
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
}

html[data-theme='dark'] div.highlighter-rouge {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

div.highlighter-rouge > .highlight {
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

div.highlighter-rouge pre,
div.highlighter-rouge pre.highlight {
  margin: 0;
  padding: 1rem 1.25rem;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  color: var(--sg-pre-text);
  overflow-x: auto;
  font-family: var(--sg-font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  box-shadow: none !important;
}

div.highlighter-rouge pre > code,
div.highlighter-rouge pre.highlight > code {
  display: block;
  background: transparent !important;
  color: inherit;
  border: 0 !important;
  padding: 0 !important;
  font-weight: 400;
  font-size: inherit;
  white-space: pre;
}

/* Plain pre blocks (e.g. home page cards) */
.card pre,
.page-content pre:not(.highlight) {
  margin: 0.75rem 0 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--sg-code-border);
  border-radius: 8px;
  background: var(--sg-pre-bg);
  color: var(--sg-pre-text);
  overflow-x: auto;
  font-family: var(--sg-font-mono);
  font-size: 0.8125rem;
  line-height: 1.55;
  box-shadow: none;
}

.card pre > code,
.page-content pre:not(.highlight) > code {
  display: block;
  background: transparent !important;
  color: inherit;
  border: 0 !important;
  padding: 0 !important;
  font-weight: 400;
  white-space: pre;
}

.code-sample-group div.highlighter-rouge {
  margin-top: 0;
}

.code-sample-group div.highlighter-rouge + div.highlighter-rouge {
  margin-top: 1rem;
}

/* Rouge token colors — light theme */
.highlight .c,
.highlight .c1,
.highlight .cm { color: #6a737d; font-style: italic; }
.highlight .k,
.highlight .kd,
.highlight .kn,
.highlight .kp,
.highlight .kr,
.highlight .kt { color: #d73a49; font-weight: 600; }
.highlight .s,
.highlight .s1,
.highlight .s2,
.highlight .sb,
.highlight .sc,
.highlight .sd { color: #032f62; }
.highlight .nf { color: #6f42c1; font-weight: 600; }
.highlight .nn,
.highlight .nc { color: #005cc5; }
.highlight .na { color: #008080; }
.highlight .nb { color: #005cc5; }
.highlight .no,
.highlight .nv,
.highlight .nx,
.highlight .bp { color: #24292f; }
.highlight .o { color: #d73a49; }
.highlight .p { color: #24292f; }
.highlight .mi,
.highlight .mf,
.highlight .mh { color: #005cc5; }

/* Rouge token colors — dark theme */
html[data-theme='dark'] .highlight .c,
html[data-theme='dark'] .highlight .c1,
html[data-theme='dark'] .highlight .cm { color: #6c7086; font-style: italic; }
html[data-theme='dark'] .highlight .k,
html[data-theme='dark'] .highlight .kd,
html[data-theme='dark'] .highlight .kn,
html[data-theme='dark'] .highlight .kp,
html[data-theme='dark'] .highlight .kr,
html[data-theme='dark'] .highlight .kt { color: #cba6f7; font-weight: 600; }
html[data-theme='dark'] .highlight .s,
html[data-theme='dark'] .highlight .s1,
html[data-theme='dark'] .highlight .s2,
html[data-theme='dark'] .highlight .sb,
html[data-theme='dark'] .highlight .sc,
html[data-theme='dark'] .highlight .sd { color: #a6e3a1; }
html[data-theme='dark'] .highlight .nf { color: #89b4fa; font-weight: 600; }
html[data-theme='dark'] .highlight .nn,
html[data-theme='dark'] .highlight .nc { color: #89b4fa; }
html[data-theme='dark'] .highlight .na { color: #89dceb; }
html[data-theme='dark'] .highlight .nb { color: #89b4fa; }
html[data-theme='dark'] .highlight .no,
html[data-theme='dark'] .highlight .nv,
html[data-theme='dark'] .highlight .nx,
html[data-theme='dark'] .highlight .bp { color: #cdd6f4; }
html[data-theme='dark'] .highlight .o { color: #cba6f7; }
html[data-theme='dark'] .highlight .p { color: #cdd6f4; }
html[data-theme='dark'] .highlight .mi,
html[data-theme='dark'] .highlight .mf,
html[data-theme='dark'] .highlight .mh { color: #fab387; }

/* ── Mermaid ── */

.mermaid {
  margin: 1.25rem 0;
  overflow-x: auto;
  border: 1px solid var(--sg-border);
  border-radius: 8px;
  background: var(--sg-surface);
  padding: 1rem;
  text-align: center;
}

html[data-theme='dark'] .mermaid svg {
  filter: none;
}

/* ── Sample pages ── */

.sample-nav {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
}

.sample-nav a {
  color: var(--sg-link);
}

.hero {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1) 0%, rgba(100, 181, 246, 0.08) 100%);
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem 0 2rem;
}

.hero h1 {
  margin-top: 0;
  border: 0;
  font-size: 1.75rem;
}

.hero p {
  color: var(--sg-text-secondary);
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.card {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: 12px;
  padding: 1rem 1.1rem;
}

.card h3 {
  margin-top: 0;
  font-size: 1.05rem;
}

.card p {
  color: var(--sg-text-secondary);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.btn {
  display: inline-block;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-weight: 600;
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(180deg, #b4a0fc 0%, #7c3aed 42%, #5b21b6 100%);
  color: #fff !important;
}

.btn-primary:hover {
  color: #fff !important;
  text-decoration: none;
}

.btn-secondary {
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  color: var(--sg-text) !important;
}

.lang-tabs {
  display: none;
}

.page-lang-switcher {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0.25rem;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  background: var(--sg-surface);
}

.lang-switch {
  appearance: none;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem 0.95rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sg-text-secondary);
  cursor: pointer;
}

.lang-switch.is-active {
  color: #ffffff;
  background: linear-gradient(180deg, #b4a0fc 0%, #7c3aed 42%, #5b21b6 100%);
}

.lang-switch:focus-visible {
  outline: 2px solid rgba(124, 58, 237, 0.5);
  outline-offset: 2px;
}

.code-sample-group {
  margin: 1rem 0 2rem;
}

.lang-panel[hidden] {
  display: none !important;
}

.sample-block {
  margin-bottom: 2rem;
}

.sample-jump {
  margin: 0 0 1.25rem;
  font-size: 0.95rem;
  color: var(--sg-text-secondary);
}

.sample-catalog__toolbar {
  display: grid;
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.sample-catalog__search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.sample-catalog__search {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--sg-border);
  border-radius: 10px;
  background: var(--sg-surface);
  color: var(--sg-text);
  font: inherit;
  padding: 0.7rem 0.9rem;
}

.sample-catalog__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.sample-catalog__chip {
  appearance: none;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  background: var(--sg-surface);
  color: var(--sg-text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.sample-catalog__chip.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #b4a0fc 0%, #7c3aed 42%, #5b21b6 100%);
}

a.sample-card {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

a.sample-card:hover {
  text-decoration: none;
  border-color: rgba(124, 58, 237, 0.45);
  transform: translateY(-1px);
}

.sample-card__tags {
  display: block;
  margin-top: 0.65rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--sg-text-secondary);
}

.sample-catalog__empty {
  color: var(--sg-text-secondary);
}

body.sg-docs-search-open {
  overflow: hidden;
}

.sg-docs-search {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.sg-docs-search__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
}

.sg-docs-search__dialog {
  position: relative;
  width: min(640px, calc(100% - 2rem));
  margin: 12vh auto 0;
  background: var(--sg-surface);
  border: 1px solid var(--sg-border);
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.sg-docs-search__bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--sg-border);
}

.sg-docs-search__input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--sg-text);
  font: inherit;
  font-size: 1.05rem;
  outline: none;
}

.sg-docs-search__kbd {
  font-family: var(--sg-font-mono);
  font-size: 0.75rem;
  color: var(--sg-text-secondary);
}

.sg-docs-search__filters {
  display: flex;
  gap: 0.35rem;
  padding: 0.65rem 1rem 0;
}

.sg-docs-search__filter {
  appearance: none;
  border: 1px solid var(--sg-border);
  border-radius: 999px;
  background: transparent;
  color: var(--sg-text-secondary);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  cursor: pointer;
}

.sg-docs-search__filter.is-active {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #b4a0fc 0%, #7c3aed 42%, #5b21b6 100%);
}

.sg-docs-search__results {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0.35rem;
  max-height: min(52vh, 420px);
  overflow: auto;
}

.sg-docs-search__item {
  border-radius: 10px;
}

.sg-docs-search__item.is-active {
  background: rgba(124, 58, 237, 0.12);
}

.sg-docs-search__link {
  display: grid;
  gap: 0.2rem;
  padding: 0.7rem 0.8rem;
  color: inherit;
  text-decoration: none;
}

.sg-docs-search__link:hover {
  text-decoration: none;
}

.sg-docs-search__title {
  font-weight: 600;
  color: var(--sg-text);
}

.sg-docs-search__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.75rem;
  color: var(--sg-text-secondary);
}

.sg-docs-search__kind {
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.sg-docs-search__desc {
  font-size: 0.85rem;
  color: var(--sg-text-secondary);
}

.sg-docs-search__empty {
  padding: 1rem;
  color: var(--sg-text-secondary);
}

.sg-docs-search__hint {
  margin: 0;
  padding: 0.55rem 1rem 0.85rem;
  font-size: 0.75rem;
  color: var(--sg-text-secondary);
  border-top: 1px solid var(--sg-border);
}

/* ── Footer (docs.stackgen.com) ── */

.site-footer.stackgen-footer {
  border-top: 1px solid var(--sg-border);
  background-color: var(--sg-footer-bg);
  background-image: var(--sg-footer-art);
  background-repeat: no-repeat;
  background-position: right bottom;
  background-size: auto 100%;
  color: var(--sg-footer-text);
  padding: 3rem 0 2rem;
}

.stackgen-footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 3rem;
}

.stackgen-footer-logo-img {
  display: block;
  height: auto;
  max-width: 141px;
}

.stackgen-footer-tagline {
  margin: 0.75rem 0 1rem;
  font-size: 0.95rem;
  color: var(--sg-footer-text);
}

.stackgen-footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.stackgen-footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(124, 58, 237, 0.08);
  transition: background 0.2s ease;
}

html[data-theme='dark'] .stackgen-footer-social__link {
  background: rgba(255, 255, 255, 0.06);
}

.stackgen-footer-social__link:hover {
  background: rgba(124, 58, 237, 0.16);
  text-decoration: none;
}

.stackgen-footer-col__title {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--sg-footer-title);
}

.stackgen-footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
}

.stackgen-footer-links li + li {
  margin-top: 0.5rem;
}

.stackgen-footer-links a {
  color: var(--sg-footer-link);
  font-size: 0.9rem;
}

.stackgen-footer-links a:hover {
  color: var(--sg-link);
}

.stackgen-footer-copyright {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--sg-border);
}

.stackgen-footer-copyright__text {
  margin: 0;
  font-size: 0.85rem;
  color: var(--sg-footer-text);
}

@media (max-width: 800px) {
  .stackgen-footer__grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }

  .site-footer.stackgen-footer {
    background-size: 280px auto;
  }
}

/* Minima overrides */
.site-title {
  display: none;
}

.footer-heading,
.contact-list,
.social-media-list {
  display: none;
}

/* Minima ships `pre, code { background:#eef; border:... }` — keep rouge inner pre clean */
body div.highlighter-rouge pre,
body div.highlighter-rouge pre > code {
  background-color: transparent !important;
  border: 0 !important;
}
