/* ═══════════════════════════════════════════════════════════════════
   NSX — minimal custom styles (everything else is stock material)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Navbar ───────────────────────────────────────────────────────── */
/* Keep the header neutral even if the Material primary palette changes. */
[data-md-color-scheme="default"] {
  --nsx-header-bg: #ffffff;
  --nsx-header-fg: #111827;
  --nsx-header-muted: #4b5563;
  --nsx-header-border: rgba(17, 24, 39, 0.08);
  --nsx-header-search-bg: rgba(17, 24, 39, 0.04);
  --nsx-header-search-bg-hover: rgba(17, 24, 39, 0.08);
}

[data-md-color-scheme="slate"] {
  --nsx-header-bg: #050816;
  --nsx-header-fg: #f8fafc;
  --nsx-header-muted: #cbd5e1;
  --nsx-header-border: rgba(248, 250, 252, 0.08);
  --nsx-header-search-bg: rgba(248, 250, 252, 0.08);
  --nsx-header-search-bg-hover: rgba(248, 250, 252, 0.12);
}

.md-header,
.md-tabs {
  background: var(--nsx-header-bg);
  color: var(--nsx-header-fg);
}

.md-header {
  border-bottom: 1px solid var(--nsx-header-border);
  box-shadow: none;
}

.md-tabs {
  border-bottom: 1px solid var(--nsx-header-border);
}

.md-header__button,
.md-header__title,
.md-header__topic,
.md-tabs__link,
.md-search__icon,
.md-source,
.md-source__icon,
.md-source__repository {
  color: var(--nsx-header-fg);
}

.md-tabs__link {
  opacity: 0.8;
}

.md-tabs__link--active,
.md-tabs__link:is(:hover, :focus),
.md-header__button:is(:hover, :focus),
.md-header__title:is(:hover, :focus),
.md-source:is(:hover, :focus) {
  color: var(--md-accent-fg-color);
  opacity: 1;
}

.md-search__form {
  background: var(--nsx-header-search-bg);
  box-shadow: inset 0 0 0 1px var(--nsx-header-border);
}

.md-search__form:hover,
.md-search__form:focus-within {
  background: var(--nsx-header-search-bg-hover);
}

.md-search__input,
.md-search__input::placeholder {
  color: var(--nsx-header-muted);
}

/* ── Layout ───────────────────────────────────────────────────────── */
.md-grid { max-width: 1840px; }

/* ── Landing page ─────────────────────────────────────────────────── */
.landing {
  max-width: 1120px;
  margin: 0 auto;
}
.landing h2 {
  text-align: center;
  margin-top: 0.5rem;
}
.landing hr {
  border: none;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  margin: 3rem 0;
}

/* Hero */
.landing .hero { text-align: center; margin: 3rem 0 0; }
.hero-logo { max-width: min(460px, 80%); height: auto; }
.landing .hero h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}
.hero-sub {
  font-size: 1.05rem;
  color: var(--md-default-fg-color--light);
  margin-bottom: 1.5rem;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
}
.quick-links .md-button {
  margin: 0;
  padding: 0.35rem 0.65rem;
  font-size: 0.72rem;
  border-radius: 999px;
}

/* Subtitle paragraphs */
.section-sub {
  text-align: center;
  color: var(--md-default-fg-color--light);
  font-size: 0.95rem;
}

/* SVG diagrams */
.diagram { display: block; margin: 1.5rem auto; width: 100%; height: auto; }
.diagram--narrow { max-width: 680px; }

/* Material grid cards on the home page */
.landing .grid.cards > ul > li > p {
  font-size: 0.9rem;
  line-height: 1.55;
}
.landing .grid.cards > ul > li > p:first-child {
  font-size: 0.84rem;
  line-height: 1.4;
}
.landing .grid.cards > ul > li > p:first-child strong {
  font-weight: 600;
}

.landing .feature-cards > ul > li {
  padding: 0.7rem 0.8rem;
}
.landing .feature-cards > ul > li > p {
  font-size: 0.84rem;
  line-height: 1.45;
}
.landing .feature-cards > ul > li > p:first-child {
  font-size: 0.79rem;
  line-height: 1.25;
}

/* ── Card grid for non-landing pages (getting-started, examples) ──── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 0 0 1rem;
}
.card-grid .card {
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 8px;
  padding: 1.3rem 1.4rem;
  transition: border-color 0.2s;
}
.card-grid .card:hover { border-color: var(--md-accent-fg-color); }
.card-grid .card h3 { margin: 0 0 0.35rem; font-size: 0.98rem; font-weight: 600; }
.card-grid .card p  { margin: 0; font-size: 0.88rem; line-height: 1.6; color: var(--md-default-fg-color--light); }
.card-grid--3 { grid-template-columns: repeat(3, 1fr); }
.card-grid--2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 900px) {
  .card-grid--3, .card-grid--2 { grid-template-columns: 1fr; }
}
