/* ==========================================================================
   Docs shell — chrome for the style guide itself (not part of the system)
   ========================================================================== */

.docs-layout {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  max-width: 90rem;
  margin-inline: auto;
}

.docs-sidebar {
  border-right: 1px solid var(--icl-color-border);
  padding: var(--icl-space-6) var(--icl-space-5);
  position: sticky;
  top: calc(3.5rem + var(--icl-keyline-width));
  height: calc(100vh - 3.5rem - var(--icl-keyline-width));
  overflow-y: auto;
  background: var(--icl-color-surface);
}
.docs-sidebar h2 {
  font-family: var(--icl-font-display);
  font-size: var(--icl-text-sm);
  text-transform: uppercase;
  letter-spacing: var(--icl-tracking-caps);
  color: var(--icl-color-text-muted);
  margin: var(--icl-space-5) 0 var(--icl-space-2);
}
.docs-sidebar h2:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; padding: 0; margin: 0; }
.docs-sidebar a {
  display: block;
  padding: 0.3rem 0.6rem;
  font-size: var(--icl-text-sm);
  color: var(--icl-color-text-muted);
  border-left: 2px solid transparent;
  border-radius: 0 var(--icl-radius-sm) var(--icl-radius-sm) 0;
}
.docs-sidebar a:hover {
  color: var(--icl-color-accent-strong);
  border-left-color: var(--icl-color-accent);
  text-decoration: none;
  background: var(--icl-color-surface);
}

.docs-main { padding: 0 0 var(--icl-space-9); min-width: 0; }
.docs-main > .icl-section { scroll-margin-top: 5rem; }

@media (max-width: 64rem) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
}

/* Demo canvas — shows components on a neutral stage */
.docs-demo {
  border: 1px solid var(--icl-color-border);
  border-radius: var(--icl-radius-md);
  padding: var(--icl-space-5);
  margin-bottom: var(--icl-space-4);
  background-color: var(--icl-color-surface);
}
.docs-demo--dark {
  background-color: var(--icl-color-inverse-bg);
  color: var(--icl-color-inverse-text);
}
.docs-demo--sunken {
  background-color: var(--icl-color-surface-sunken);
  box-shadow: var(--icl-shadow-inset);
}
.docs-demo + .docs-code { margin-top: calc(-1 * var(--icl-space-4)); border-top-left-radius: 0; border-top-right-radius: 0; }

.docs-code {
  font-family: var(--icl-font-mono);
  font-size: var(--icl-text-xs);
  line-height: 1.7;
  white-space: pre;
  background: var(--icl-limestone-950);
  color: var(--icl-limestone-200);
  border-radius: var(--icl-radius-md);
  padding: var(--icl-space-4);
  overflow-x: auto;
  margin-bottom: var(--icl-space-5);
}

/* Color swatches */
.docs-swatch-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(4.5rem, 1fr));
  gap: 0;
  border-radius: var(--icl-radius-md);
  overflow: hidden;
  border: 1px solid var(--icl-color-border);
  margin-bottom: var(--icl-space-2);
}
.docs-swatch {
  padding: var(--icl-space-4) var(--icl-space-2) var(--icl-space-2);
  min-height: 5.25rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  font-family: var(--icl-font-mono);
  font-size: 0.65rem;
  line-height: 1.5;
}
.docs-swatch b { font-family: var(--icl-font-sans); font-size: 0.7rem; }
.docs-swatch--light { color: rgba(255,255,255,0.92); }
.docs-swatch--dark { color: rgba(16,22,28,0.85); }

/* Single semantic swatch chips */
.docs-chip {
  display: flex;
  align-items: center;
  gap: var(--icl-space-3);
  border: 1px solid var(--icl-color-border);
  border-radius: var(--icl-radius-md);
  padding: var(--icl-space-2) var(--icl-space-3);
  font-size: var(--icl-text-sm);
}
.docs-chip__color {
  width: 2.25rem; height: 2.25rem;
  border-radius: var(--icl-radius-sm);
  border: 1px solid rgba(16,22,28,0.12);
  flex: none;
}
.docs-chip code { border: 0; background: none; padding: 0; color: var(--icl-color-text-subtle); }

/* Type specimens */
.docs-specimen {
  border-bottom: 1px solid var(--icl-color-border);
  padding-block: var(--icl-space-4);
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: var(--icl-space-4);
  align-items: baseline;
}
.docs-specimen__meta {
  font-family: var(--icl-font-mono);
  font-size: var(--icl-text-xs);
  color: var(--icl-color-text-muted);
}
@media (max-width: 40rem) { .docs-specimen { grid-template-columns: 1fr; gap: var(--icl-space-1); } }

/* White content card for limestone bands — keeps body/muted text off the
   limestone (where small grays fail AA). The band frames; content sits here. */
.docs-panel {
  background: var(--icl-color-surface-raised);
  border: 1px solid var(--icl-color-border);
  border-radius: var(--icl-radius-md);
  box-shadow: var(--icl-shadow-sm);
  padding: var(--icl-space-4) var(--icl-space-5);
}
.docs-panel > .docs-specimen:first-child { padding-top: 0; }
.docs-panel > .docs-specimen:last-child { padding-bottom: 0; border-bottom: 0; }
.docs-panel > :last-child { margin-bottom: 0; }

/* Spacing ruler */
.docs-space-row { display: flex; align-items: center; gap: var(--icl-space-4); padding-block: var(--icl-space-1); }
.docs-space-row code { min-width: 9rem; border: 0; background: none; }
.docs-space-bar { height: 1rem; background: var(--icl-color-accent); border-radius: 1px; }

/* Do / Don't */
.docs-dodont { border-radius: var(--icl-radius-md); border: 1px solid var(--icl-color-border); overflow: hidden; }
.docs-dodont__label {
  font-family: var(--icl-font-display);
  text-transform: uppercase;
  letter-spacing: var(--icl-tracking-wide);
  font-size: var(--icl-text-sm);
  font-weight: 700;
  padding: var(--icl-space-1) var(--icl-space-3);
}
.docs-dodont--do .docs-dodont__label { background: var(--icl-color-success-bg); color: var(--icl-color-success); }
.docs-dodont--dont .docs-dodont__label { background: var(--icl-color-danger-bg); color: var(--icl-color-danger); }
.docs-dodont__body { padding: var(--icl-space-3); font-size: var(--icl-text-sm); }

/* Theme switcher bar */
.docs-themebar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--icl-space-2);
  align-items: center;
  padding: var(--icl-space-3);
  border: 1px solid var(--icl-color-border);
  border-radius: var(--icl-radius-md);
  background: var(--icl-color-surface-sunken);
  margin-bottom: var(--icl-space-5);
}
.docs-themebar__btn {
  font: 600 var(--icl-text-sm) var(--icl-font-sans);
  padding: 0.45em 1em;
  border-radius: var(--icl-radius-full);
  border: 1px solid var(--icl-color-border-strong);
  background: var(--icl-color-surface);
  color: var(--icl-color-text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.docs-themebar__btn[aria-pressed="true"] {
  border-color: var(--icl-color-accent-strong);
  background: var(--icl-color-accent-soft);
  color: var(--icl-color-accent-strong);
}
.docs-themebar__dot { width: 0.7em; height: 0.7em; border-radius: 50%; flex: none; }


/* Hero-background demo photo — set directly on the pseudo, not through
   --icl-hero-image: Chromium resolves a relative url() carried in a custom
   property against the sheet where the var() is SUBSTITUTED (css/icl.css),
   not where the value is declared, so a relative path 404s under /css/.
   A plain declaration here resolves against THIS stylesheet. Real pages
   should give --icl-hero-image a site-root-relative or absolute URL. */
.docs-demo-hero-photo.icl-hero-bg::before { background-image: url("img/hero-demo.jpg"); }

/* Demo stage for the hero-background suite — deliberately NOT .docs-demo:
   that class sets a white background-color which (docs.css loads after
   icl.css) would override the band-surface classes these demos wear. */
.docs-demo-hero {
  border: 1px solid var(--icl-color-border);
  border-radius: var(--icl-radius-md);
  padding: var(--icl-space-5);
  min-height: 17rem;
  /* No mask override needed: the component is width-adaptive, and these
     cards sit below its 48rem container threshold. */
  cursor: zoom-in;
}

/* Hero-background demo modal (opened by docs.js) */
.docs-hero-modal {
  width: min(78rem, 94vw);
  border: 0;
  padding: 0;
  background: transparent;
  overflow: visible;
}
.docs-hero-modal::backdrop {
  background: rgba(24, 21, 16, 0.55);  /* limestone-950 ink, never pure black */
}
.docs-hero-modal__stage {
  border-radius: var(--icl-radius-md);
  padding: var(--icl-space-8) var(--icl-space-7);
  min-height: min(30rem, 72vh);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
/* Panel type comes from the component's own hero formula (icl.css); the
   stage only constrains the measure. */
.docs-hero-modal__stage p {
  max-width: 24em;
  margin: 0;
}
.docs-hero-modal__close {
  position: absolute;
  top: var(--icl-space-3);
  right: var(--icl-space-3);
  width: 2.25rem;
  height: 2.25rem;
  border: 0;
  border-radius: var(--icl-radius-full);
  background: rgba(24, 21, 16, 0.45);
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}
.docs-hero-modal__close:hover { background: rgba(24, 21, 16, 0.7); }


