/* Shared hub-track shell — Infrastructure, Observability, Production, Scrutin
   Pair with section style.css (--ht-* tokens) + html[data-hp-theme] */

body.devops-infra-core,
body.devops-obs-core,
body.production-core,
body.scrutin-core {
  --ht-font-body: "Inter", system-ui, -apple-system, sans-serif;
  --ht-font-mono: "JetBrains Mono", ui-monospace, "Cascadia Code", monospace;
  --ht-radius: 8px;
  --ht-radius-lg: 12px;
  --ht-content-width: min(800px, 92vw);
  --ht-hub-width: min(960px, 94vw);
  --ht-line-height: 1.75;
  --ht-font-size: clamp(1rem, 0.97rem + 0.2vw, 1.125rem);
  --ht-font-h1: clamp(1.75rem, 1.5rem + 1.5vw, 2.5rem);
  --ht-font-h2: clamp(1.375rem, 1.2rem + 0.9vw, 1.875rem);
  --ht-font-h3: clamp(1.125rem, 1rem + 0.55vw, 1.5rem);
  --ht-font-small: 0.875rem;
  --ht-font-code: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);
  --ht-side-pad: clamp(16px, 3vw, 28px);
  margin: 0;
  min-height: 100vh;
  background: var(--ht-bg) !important;
  color: var(--ht-text);
  font-family: var(--ht-font-body);
  font-size: var(--ht-font-size);
  line-height: var(--ht-line-height);
  -webkit-font-smoothing: antialiased;
}

body.devops-infra-core::before,
body.devops-obs-core::before,
body.production-core::before,
body.scrutin-core::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, var(--ht-glow-a), transparent 60%);
  opacity: 0.9;
}

html[data-hp-theme="light"] body.devops-infra-core::before,
html[data-hp-theme="light"] body.devops-obs-core::before,
html[data-hp-theme="light"] body.production-core::before,
html[data-hp-theme="light"] body.scrutin-core::before {
  opacity: 0.45;
}

body.devops-infra-core::after,
body.devops-obs-core::after,
body.production-core::after,
body.scrutin-core::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.42;
  background-image:
    radial-gradient(circle at 14% 16%, var(--ht-glow-a) 0, transparent 42%),
    radial-gradient(circle at 86% 78%, var(--ht-glow-b) 0, transparent 38%),
    linear-gradient(var(--ht-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--ht-grid) 1px, transparent 1px);
  background-size: auto, auto, 52px 52px, 52px 52px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 22%, #000 18%, transparent 74%);
}

html[data-hp-theme="light"] body.devops-infra-core::after,
html[data-hp-theme="light"] body.devops-obs-core::after,
html[data-hp-theme="light"] body.production-core::after,
html[data-hp-theme="light"] body.scrutin-core::after {
  opacity: 0.22;
}

body.devops-infra-core #main-content,
body.devops-obs-core #main-content,
body.production-core #main-content,
body.scrutin-core #main-content {
  position: relative;
  z-index: 1;
}

body[class*="-core"] a {
  color: var(--ht-link);
}

body[class*="-core"] a:hover {
  color: var(--ht-accent);
}

/* ── Main / hub layout ── */

body[class*="-core"] .htc-main,
body[class*="-core"] .sd-hub,
body[class*="-core"] .sd-article {
  max-width: var(--ht-hub-width);
  margin: 0 auto;
  padding: clamp(24px, 5vw, 48px) var(--ht-side-pad) 64px;
}

body[class*="-core"] .htc-content-page .htc-main,
body[class*="-core"] .htc-content-page .sd-article,
body[class*="-core"] .core-reading-page .sd-article {
  max-width: var(--ht-content-width);
}

/* ── Breadcrumb ── */

body[class*="-core"] .htc-breadcrumb ol,
body[class*="-core"] .sd-hub__crumb-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  font-size: var(--ht-font-small);
  color: var(--ht-text-muted);
}

body[class*="-core"] .htc-breadcrumb a,
body[class*="-core"] .sd-hub__crumb a {
  color: var(--ht-text-muted);
  text-decoration: none;
}

body[class*="-core"] .htc-breadcrumb a:hover,
body[class*="-core"] .sd-hub__crumb a:hover {
  color: var(--ht-accent);
}

/* ── Hub hero ── */

body[class*="-core"] .htc-hero,
body[class*="-core"] .sd-hub__hero {
  margin-bottom: 2rem;
}

body[class*="-core"] .htc-hero__title,
body[class*="-core"] .sd-hub__title {
  font-family: var(--ht-font-body);
  font-size: var(--ht-font-h1);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 0.75rem;
  color: var(--ht-text);
}

body[class*="-core"] .htc-hero__lede,
body[class*="-core"] .sd-hub__lede {
  margin: 0;
  max-width: 62ch;
  color: var(--ht-text-muted);
  font-size: var(--ht-font-size);
  line-height: var(--ht-line-height);
}

/* ── Hub topic grid ── */

body[class*="-core"] .sd-hub__section-title {
  font-size: var(--ht-font-h2);
  font-weight: 600;
  margin: 0 0 0.35rem;
  color: var(--ht-text);
}

body[class*="-core"] .sd-hub__section-lede {
  margin: 0 0 1.25rem;
  color: var(--ht-text-muted);
  font-size: var(--ht-font-small);
}

body[class*="-core"] .sd-topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}

body[class*="-core"] .sd-topic-card {
  position: relative;
  padding: 1.1rem 1.15rem;
  border-radius: var(--ht-radius-lg);
  border: 1px solid var(--ht-border);
  background: var(--ht-bg-elevated);
  box-shadow: var(--ht-shadow);
  overflow: hidden;
}

body[class*="-core"] .sd-topic-card__watermark {
  position: absolute;
  right: -12px;
  bottom: -12px;
  opacity: 0.07;
  pointer-events: none;
}

body[class*="-core"] .sd-topic-card__badge {
  display: inline-block;
  margin-bottom: 0.5rem;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ht-accent-dim);
  border: 1px solid color-mix(in srgb, var(--ht-accent) 35%, transparent);
  color: var(--ht-accent);
}

body[class*="-core"] .sd-topic-card__title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.45rem;
  line-height: 1.35;
}

body[class*="-core"] .sd-topic-card__desc {
  margin: 0;
  font-size: var(--ht-font-small);
  line-height: 1.55;
  color: var(--ht-text-muted);
}

/* ── Article shell — flat on section bg (like *-core guides, no notebook) ── */

body.devops-infra-core .sd-article__paper,
body.devops-obs-core .sd-article__paper,
body.production-core .sd-article__paper,
body.scrutin-core .sd-article__paper,
body.devops-infra-core .sd-article__hero,
body.devops-obs-core .sd-article__hero,
body.production-core .sd-article__hero,
body.scrutin-core .sd-article__hero {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  border: none;
  border-radius: 0;
  box-shadow: none !important;
}

body.devops-infra-core .sd-article__paper,
body.devops-obs-core .sd-article__paper,
body.production-core .sd-article__paper,
body.scrutin-core .sd-article__paper {
  padding: 0;
}

body.devops-infra-core .sd-article__hero,
body.devops-obs-core .sd-article__hero,
body.production-core .sd-article__hero,
body.scrutin-core .sd-article__hero {
  margin: 0 0 1.75rem;
  padding: 0 0 1.25rem;
  border-bottom: 1px solid var(--ht-border);
}

body[class*="-core"] .sd-article__hero h1 {
  font-family: var(--ht-font-body);
  font-size: var(--ht-font-h1);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0;
  color: var(--ht-text);
}

body[class*="-core"] .sd-article > .sd-hub__crumb {
  padding-left: 0;
  padding-right: 0;
}

/* ── Article typography ── */

body[class*="-core"] .sd-article .lede,
body[class*="-core"] .sd-article p,
body[class*="-core"] .sd-article li {
  color: var(--ht-text);
}

body[class*="-core"] .sd-article .lede {
  margin-bottom: 1rem;
}

body[class*="-core"] .sd-article .takeaways {
  margin: 0 0 1.5rem 1.2em;
  padding: 0;
  color: var(--ht-text-muted);
}

body[class*="-core"] .sd-article h2,
body[class*="-core"] .sd-article h3 {
  font-family: var(--ht-font-body);
  color: var(--ht-text);
  letter-spacing: -0.02em;
}

body[class*="-core"] .sd-article h2,
body[class*="-core"] .sd-step,
body[class*="-core"] .production-step {
  font-size: var(--ht-font-h2);
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--ht-border);
}

body[class*="-core"] .sd-article h3 {
  font-size: var(--ht-font-h3);
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
}

body[class*="-core"] .sd-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.25rem;
  font-size: var(--ht-font-small);
}

body[class*="-core"] .sd-article th,
body[class*="-core"] .sd-article td {
  border: 1px solid var(--ht-border);
  padding: 8px 10px;
  text-align: left;
}

body[class*="-core"] .sd-article th {
  background: var(--ht-bg-panel);
  color: var(--ht-text);
  font-weight: 600;
}

body[class*="-core"] .sd-article td {
  color: var(--ht-text-muted);
}

body[class*="-core"] .note-box,
body[class*="-core"] .exp-box {
  margin: 1.25rem 0;
  padding: 1rem 1.1rem;
  border-radius: var(--ht-radius);
  border: 1px solid var(--ht-border);
  background: var(--ht-bg-panel);
  font-size: var(--ht-font-small);
  color: var(--ht-text-muted);
}

body[class*="-core"] .note-box strong,
body[class*="-core"] .exp-box strong {
  color: var(--ht-accent);
}

body[class*="-core"] pre.tech,
body[class*="-core"] .sd-article pre {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: var(--ht-radius);
  border: 1px solid var(--ht-border);
  background: var(--ht-code-bg);
  overflow-x: auto;
  font-family: var(--ht-font-mono);
  font-size: var(--ht-font-code);
  line-height: 1.55;
}

body[class*="-core"] .sd-article code {
  font-family: var(--ht-font-mono);
  font-size: 0.92em;
  background: var(--ht-code-inline-bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

body[class*="-core"] pre code {
  background: transparent;
  padding: 0;
}

body[class*="-core"] .do-figure {
  margin: 1.25rem 0;
}

body[class*="-core"] .do-figure figcaption {
  margin-top: 0.5rem;
  font-size: var(--ht-font-small);
  color: var(--ht-text-dim);
}

/* ── Production-specific ── */

body.production-core .production-scenario-box {
  margin: 0 0 1.5rem;
  padding: 1rem 1.15rem;
  border-radius: var(--ht-radius-lg);
  border: 1px solid color-mix(in srgb, var(--ht-accent) 30%, var(--ht-border));
  background: var(--ht-accent-dim);
}

body.production-core .production-scenario-box__label {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ht-accent);
}

body.production-core .production-framework__title {
  font-family: var(--ht-font-body);
  font-size: var(--ht-font-h2);
  color: var(--ht-text);
}

body.production-core .production-framework__card {
  border-color: color-mix(in srgb, var(--ht-accent) 28%, var(--ht-border));
  background: var(--ht-bg-elevated);
}

body.production-core .production-framework__label {
  font-family: var(--ht-font-body);
  color: var(--ht-accent);
}

body.production-core .production-framework__card p,
body.production-core .production-framework__note {
  color: var(--ht-text-muted);
}

body.production-core .production-q-list__item {
  border: 1px solid var(--ht-border);
  background: var(--ht-bg-elevated);
  border-radius: var(--ht-radius);
}

body.production-core .production-q-list__text,
body.production-core .production-q-list__text a {
  color: var(--ht-text);
}

body.production-core .production-checklist li {
  margin-bottom: 0.65rem;
}

body.production-core .production-step--why { border-top-color: color-mix(in srgb, var(--ht-accent) 40%, var(--ht-border)); }
body.production-core .production-step--what { border-top-color: color-mix(in srgb, #38bdf8 40%, var(--ht-border)); }
body.production-core .production-step--how { border-top-color: color-mix(in srgb, #34d399 40%, var(--ht-border)); }

/* ── Core pager tokens ── */

body.devops-infra-core { --core-pager-accent: var(--ht-accent); --core-pager-border: var(--ht-border); --core-pager-bg: var(--ht-bg-panel); }
body.devops-obs-core { --core-pager-accent: var(--ht-accent); --core-pager-border: var(--ht-border); --core-pager-bg: var(--ht-bg-panel); }
body.production-core { --core-pager-accent: var(--ht-accent); --core-pager-border: var(--ht-border); --core-pager-bg: var(--ht-bg-panel); }
body.scrutin-core { --core-pager-accent: var(--ht-accent); --core-pager-border: var(--ht-border); --core-pager-bg: var(--ht-bg-panel); }

body[class*="-core"] .sd-article__nav-footer {
  display: none;
}
