/* Nebula brand palette for the portal: the indigo ramp from the default skin (indigo.json). */

:root,
[data-md-color-primary="custom"] {
  --md-primary-fg-color: #4f46e5;          /* nebula-600 */
  --md-primary-fg-color--light: #6366f1;   /* nebula-500 */
  --md-primary-fg-color--dark: #3730a3;    /* nebula-800 */
  --md-primary-bg-color: #ffffff;
  --md-primary-bg-color--light: rgba(255, 255, 255, 0.7);
}

[data-md-color-accent="custom"] {
  --md-accent-fg-color: #6366f1;           /* nebula-500 */
  --md-accent-fg-color--transparent: rgba(99, 102, 241, 0.1);
  --md-accent-bg-color: #ffffff;
  --md-accent-bg-color--light: rgba(255, 255, 255, 0.7);
}

[data-md-color-scheme="default"] {
  --md-typeset-a-color: #4338ca;           /* nebula-700 */
  --md-code-bg-color: #f5f6ff;
  --md-typeset-kbd-color: #eef2ff;
  --md-footer-bg-color: #1e1b4b;           /* nebula-950 */
  --md-footer-bg-color--dark: #14122f;
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: #111827;
  --md-default-fg-color: #f3f4f6;
  --md-default-fg-color--light: #d1d5db;
  --md-default-fg-color--lighter: #9ca3af;
  --md-default-fg-color--lightest: #374151;
  --md-code-bg-color: #1f2937;
  --md-typeset-a-color: #a5b4fc;           /* nebula-300 */
  --md-accent-fg-color: #c7d2fe;           /* nebula-200 */
  --md-accent-fg-color--transparent: rgba(199, 210, 254, 0.12);
  --md-primary-fg-color: #312e81;          /* nebula-900 */
  --md-primary-fg-color--light: #4338ca;
  --md-primary-fg-color--dark: #1e1b4b;
  --md-footer-bg-color: #0b0a1f;
  --md-footer-bg-color--dark: #060515;
  --md-typeset-table-color: rgba(255, 255, 255, 0.08);
}

/* The sidebar gradient from the indigo skin, on the header and the tab bar. */
.md-header,
.md-tabs {
  background: linear-gradient(90deg, #1e1b4b 0%, #312e81 45%, #3730a3 100%);
}
.md-header[data-md-state="shadow"],
.md-header--shadow {
  box-shadow: 0 0 0.2rem rgba(30, 27, 75, 0.35), 0 0.2rem 0.4rem rgba(30, 27, 75, 0.3);
}
.md-header__button.md-logo img {
  height: 1.6rem;
}

/* Keep all desktop documentation tabs within Material's content width. */
.md-tabs__item {
  padding-inline: 0.4rem;
}

/* Homepage branding uses the supplied logo at its original resolution. */
.nebula-home { max-width: 64rem; margin-inline: auto; }
.nebula-home-hero {
  text-align: center; margin-block: .5rem 2.5rem; padding: 2rem 1rem;
  border: 1px solid rgba(99, 102, 241, .25); border-radius: .8rem;
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, .15), transparent 70%);
}
.nebula-home-hero img {
  display: block; width: 275px; max-width: 75%; height: auto;
  margin: 0 auto 1rem; border-radius: .6rem;
}
.md-typeset .nebula-home-hero h1 {
  margin: .5rem 0 1rem; font-size: clamp(1.7rem, 3.5vw, 2.7rem);
  line-height: 1.15; font-weight: 750; letter-spacing: -.04em;
  color: var(--md-default-fg-color);
}
.nebula-home-hero > p { max-width: 38rem; margin-inline: auto; }
.nebula-home-eyebrow { font-size: .65rem; font-weight: 700; letter-spacing: .14em; color: var(--md-typeset-a-color); }
.nebula-home-license { font-size: .7rem; color: var(--md-default-fg-color--light); }
.nebula-home .md-button { margin: .2rem; border-radius: .4rem; }
.nebula-home > h2 { margin-top: 2.5rem; font-weight: 700; letter-spacing: -.02em; }
.md-typeset .nebula-home .grid.cards > ul > li { border-radius: .6rem; padding: 1.1rem; }
.nebula-card-icon { color: var(--md-typeset-a-color); margin-right: .35rem; font-size: 1.2rem; }
.md-typeset .nebula-home .nebula-feature-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.md-typeset .nebula-home .nebula-start-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.md-typeset .nebula-home .nebula-build-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.md-typeset .nebula-home .nebula-quick-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nebula-home .nebula-card-art { width: 100%; height: auto; border-radius: .35rem; }
.md-typeset .nebula-home .nebula-feature-cards h3 { font-weight: 700; font-size: 1rem; }
.nebula-home .md-typeset__table { min-width: 100%; }
.md-typeset .nebula-home .md-typeset__table table { display: table; width: 100%; }
.nebula-home-callout {
  margin-top: 2rem; padding: 1.5rem; border-radius: .6rem;
  border: 1px solid rgba(99, 102, 241, .3); background: rgba(99, 102, 241, .07);
}
.md-typeset .nebula-home-callout h3 { margin-top: 0; font-weight: 700; }
/* Readable calls to action in both palettes, including outlined buttons. */
.md-typeset .md-button { color: var(--md-typeset-a-color); border-color: currentColor; }
.md-typeset .md-button--primary { color: #fff; background: #4f46e5; border-color: #4f46e5; }
.md-typeset .md-button:hover,
.md-typeset .md-button:focus-visible { color: #fff; background: #4338ca; border-color: #4338ca; }
@media (max-width: 1000px) {
  .md-typeset .nebula-home .nebula-start-cards,
  .md-typeset .nebula-home .nebula-feature-cards,
  .md-typeset .nebula-home .nebula-quick-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .nebula-home-hero { padding: 1.25rem .75rem; }
  .md-typeset .nebula-home .grid.cards { grid-template-columns: minmax(0, 1fr); }
  .nebula-home .md-button { font-size: .75rem; padding: .55em .8em; }
}

/* Search box on the gradient */
.md-search__form {
  background-color: rgba(255, 255, 255, 0.12);
}
.md-search__form:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

/* Cards on the home page */
.md-typeset .grid.cards > ul > li {
  border-color: rgba(99, 102, 241, 0.25);
}
.md-typeset .grid.cards > ul > li:hover {
  border-color: #6366f1;
  box-shadow: 0 0.2rem 0.6rem rgba(79, 70, 229, 0.15);
}

/* Admonition accents that Material does not tie to the palette */
.md-typeset .admonition.info,
.md-typeset details.info {
  border-color: #6366f1;
}
.md-typeset .info > .admonition-title,
.md-typeset .info > summary {
  background-color: rgba(99, 102, 241, 0.1);
}
.md-typeset .info > .admonition-title::before,
.md-typeset .info > summary::before {
  background-color: #6366f1;
}

/* Table header tint */
.md-typeset table:not([class]) th {
  background-color: rgba(99, 102, 241, 0.08);
}
[data-md-color-scheme="slate"] .md-typeset table:not([class]) th {
  background-color: rgba(165, 180, 252, 0.1);
}

/* Screenshot placeholders read as figures */
.md-typeset img[src*="/images/"] {
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: 0.4rem;
}

/* Skin gallery swatches (theming/gallery.md) */
.skin-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1rem; margin: 0 0 1.5rem; }
.skin-card { display: grid; grid-template-columns: 5.5rem 1fr; border: 1px solid; border-radius: 0.5rem; overflow: hidden; min-height: 9rem; font-size: 0.7rem; }
.skin-card__sidebar { display: flex; flex-direction: column; gap: 0.5rem; padding: 0.8rem 0.7rem; }
.skin-card__main { display: flex; flex-direction: column; }
.skin-card__header { padding: 0.5rem 0.75rem; border-bottom: 1px solid; font-weight: 600; }
.skin-card__panel { margin: 0.6rem; padding: 0.6rem; border: 1px solid; border-radius: 0.4rem; flex: 1; }
.skin-card__row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.5rem; }
.skin-card__btn { display: inline-block; padding: 0.25rem 0.6rem; border-radius: 0.3rem; font-weight: 600; border: 1px solid transparent; }
.skin-card__btn--ghost { background: transparent; }
.skin-card__chip { display: inline-block; padding: 0.15rem 0.5rem; border-radius: 999px; font-weight: 600; }

/* The documentation consent controls inherit the active Material palette. */
.nebula-cookie-settings { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: .8rem; font-size: .7rem; }
.nebula-cookie-settings button { cursor: pointer; text-decoration: underline; }
.nebula-cookie-settings a { text-decoration: underline; }
.nebula-cookie-banner[hidden], .nebula-cookie-settings [hidden] { display: none; }
.nebula-cookie-banner {
  position: fixed; inset: auto 1rem 1rem; z-index: 5; margin-inline: auto;
  max-width: 54rem; display: flex; align-items: center; gap: 1.5rem;
  padding: 1rem 1.25rem; border: 1px solid var(--md-typeset-a-color); border-radius: .5rem;
  background: var(--md-default-bg-color); color: var(--md-default-fg-color);
  box-shadow: 0 .25rem 1.5rem rgba(0, 0, 0, .2);
}
.nebula-cookie-banner h2 { font-size: .95rem; font-weight: 700; margin: 0 0 .35rem; }
.nebula-cookie-banner p { font-size: .7rem; line-height: 1.5; margin: 0; }
.nebula-cookie-actions { display: flex; gap: .5rem; flex-shrink: 0; }
.nebula-cookie-actions button {
  min-height: 2.2rem; padding: .45rem .7rem; border: 1px solid var(--md-typeset-a-color);
  border-radius: .25rem; font-size: .7rem; cursor: pointer;
}
#nebula-cookie-accept { background: var(--md-primary-fg-color); color: var(--md-primary-bg-color); }
.nebula-cookie-actions button:disabled { opacity: .5; cursor: default; }
.nebula-cookie-actions button:focus-visible, .nebula-cookie-settings button:focus-visible {
  outline: 2px solid var(--md-typeset-a-color); outline-offset: 3px;
}
@media (max-width: 700px) {
  .nebula-cookie-banner { flex-direction: column; align-items: stretch; gap: .8rem; inset-inline: .5rem; }
  .nebula-cookie-actions button { flex: 1; }
}
