/* ============================================================
   docs.css — shared stylesheet for the UI Framework docs site
   ============================================================ */

/* ---- Layout ---- */
html, body { height: 100%; }
body { display: flex; flex-direction: column; }
.docs-layout { display: flex; flex: 1; min-height: 0; }

/* ---- Sidebar ---- */
.docs-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--ui-color-surface);
  border-right: 1px solid var(--ui-color-border);
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh;
  overflow-y: auto; z-index: 100;
}
.docs-sidebar-header {
  padding: .875rem 1.25rem;
  border-bottom: 1px solid var(--ui-color-border);
  flex-shrink: 0;
}
.docs-sidebar-header a {
  display: flex; align-items: center; gap: .5rem;
  text-decoration: none; font-weight: 700; font-size: .95rem;
  color: var(--ui-color-text);
}
.docs-sidebar-header a:hover { color: var(--color-primary); }
.docs-sidebar-nav { padding: .75rem 0; flex: 1; }
.docs-nav-group { margin-bottom: .25rem; }
.docs-nav-label {
  display: block; padding: .6rem 1.25rem .2rem;
  font-size: .625rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--ui-color-text-muted);
}
.docs-sidebar-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-sidebar-nav li {
  display: flex;
  align-items: center;
}
.docs-sidebar-nav li a:first-child { flex: 1; }
.docs-sidebar-nav li a {
  display: block; padding: .3rem 1.25rem;
  font-size: .8375rem; color: var(--ui-color-text);
  text-decoration: none;
  transition: background .12s, color .12s;
}
.docs-sidebar-nav li a:hover {
  background: var(--ui-color-surface-alt);
  color: var(--color-primary);
}
.docs-sidebar-nav li a.docs-active {
  color: var(--color-primary); font-weight: 600;
  border-left: none;
  background: color-mix(in srgb, var(--color-primary) 7%, transparent);
  position: relative;
  padding-left: calc(1.25rem + 10px);
}
.docs-sidebar-nav li a.docs-active::before {
  content: '';
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.1em;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-brand) 100%);
}
.docs-content { margin-left: 220px; flex: 1; min-width: 0; }

/* Reference icon in sidebar nav */
.docs-nav-ref-icon {
  flex-shrink: 0;
  padding: 0 .65rem;
  font-size: .65rem;
  color: var(--ui-color-text-muted);
  opacity: 0;
  text-decoration: none;
  transition: opacity .15s, color .15s;
}
.docs-sidebar-nav li:hover .docs-nav-ref-icon {
  opacity: 1;
}
.docs-nav-ref-icon:hover {
  color: var(--color-primary) !important;
  opacity: 1;
}

/* ---- Reference link inside h2 ---- */
.docs-ref-link {
  margin-left: auto;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-primary);
  text-decoration: none;
  opacity: .65;
  transition: opacity .15s;
  flex-shrink: 0;
}
.docs-ref-link:hover { opacity: 1; }


/* ---- Section / reference h2 heading — shared by section <h2> and .docs-ref-heading ---- */
.docs-ref-heading {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin: var(--ui-space-8) 0 var(--ui-space-8);
  padding: 0;
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.2;
  color: var(--ui-color-text);
}

.docs-ref-heading::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 5px;
  height: 1.4em;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-brand) 100%);
}

/* ---- Sub-heading — shared by .docs-ref-subheading (reference h3) and .docs-section-header (content h4) ---- */
.docs-ref-subheading,
.docs-section-header {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin: var(--ui-space-12) 0 var(--ui-space-6);
  padding: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--ui-color-text-muted);
}

.docs-ref-subheading::before,
.docs-section-header::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 3px;
  height: 1.2em;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-brand) 100%);
  opacity: .5;
}

/* ---- Section header row (label + toggle controls) ---- */
.docs-section-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.docs-section-row .docs-section-header {
  flex: 1;
  margin: 0;
}

/* Toggle button group */
.docs-toggle-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

/* Panes */
.docs-section-content { margin-top: 0 !important; }
.docs-code-pane-inner {
  position: relative;
}

/* Copy button — framework ui-button handles colors; only positioning needed */
.docs-copy-btn {
  position: absolute;
  top: .6rem;
  right: .6rem;
  z-index: 2;
}
.docs-code-pane .ui-codeblock {
  margin-top: .5rem;
}


/* ================================================================
   Homepage — Hero & Index
   ================================================================ */

/* Override .ui-main padding for homepage to allow full-bleed hero */
.docs-home.ui-main { padding: 0; }

/* ---- Hero ---- */
.docs-hero {
  position: relative;
  overflow: hidden;
  padding: 6rem 3.5rem 5rem;
  border-bottom: 1px solid var(--ui-color-border);
  background: var(--ui-color-surface);
}

/* Dot-grid pattern */
.docs-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, var(--ui-color-border) 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  opacity: .55;
  pointer-events: none;
}

/* Two-tone glow: top-right brand + bottom-left primary */
.docs-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 55% 55% at 105% -10%,
      color-mix(in srgb, var(--color-brand) 22%, transparent) 0%,
      transparent 70%),
    radial-gradient(ellipse 45% 45% at -5% 115%,
      color-mix(in srgb, var(--color-primary) 16%, transparent) 0%,
      transparent 70%);
  pointer-events: none;
}

/* Top-edge gradient fade for depth */
.docs-hero-fade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--color-brand) 6%, transparent) 0%,
    transparent 55%);
  pointer-events: none;
}

.docs-hero > * { position: relative; z-index: 1; }

/* Animated pulse dot inside badge */
@keyframes docs-pulse {
  0%, 100% { opacity: .9; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.6); }
}

/* Version badge — visual base comes from ui-badge-soft:primary ui-badge@s */
.docs-hero-badge {
  text-transform: uppercase;
  letter-spacing: .09em;
  margin-bottom: 2rem;
  display: inline-flex;
  align-items: center;
  gap: .45em;
}

.docs-hero-badge svg {
  animation: docs-pulse 2s ease-in-out infinite;
}

/* Main headline */
.docs-hero-headline {
  margin: 0 0 1.35rem;
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
  font-weight: 900;
  line-height: 1.03;
  letter-spacing: -.045em;
  color: var(--ui-color-text);
}

.docs-hero-headline em {
  font-style: normal;
  background: linear-gradient(120deg,
    var(--color-primary) 0%,
    var(--color-accent)  45%,
    var(--color-brand)   100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Subtitle */
.docs-hero-sub {
  margin: 0 0 2.25rem;
  max-width: 540px;
  font-size: 1.075rem;
  line-height: 1.7;
  color: var(--ui-color-text-muted);
}

/* CTA button row */
.docs-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .875rem;
  margin-bottom: 2.75rem;
}

/* Feature chips */
.docs-chip {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .3em .75em;
  border-radius: 9999px;
  border: 1px solid var(--ui-color-border);
  background: color-mix(in srgb, var(--ui-color-surface) 80%, transparent);
  backdrop-filter: blur(6px);
  transition: border-color .2s, background .2s;
}
.docs-chip:hover {
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 6%, var(--ui-color-surface));
}
.docs-chip i { color: var(--color-primary); }

/* ---- Index sections ---- */
.docs-index-body { padding: 3rem 0; }

.docs-index-section { margin-bottom: 3.5rem; }

.docs-index-section-header {
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1.25rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--ui-color-border);
}

.docs-index-section-pill {
  display: block;
  width: 5px;
  height: 1.3em;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-brand) 100%);
}

.docs-index-section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ui-color-text);
}

/* ---- Component cards ---- */
.docs-comp-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--ui-color-surface);
  border: 1px solid var(--ui-color-border);
  padding: 1.25rem;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  position: relative;
  overflow: hidden;
}

.docs-comp-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary) 0%, var(--color-brand) 100%);
  opacity: 0;
  transition: opacity .15s;
}

.docs-comp-card:hover {
  border-color: color-mix(in srgb, var(--color-primary) 35%, transparent);
  box-shadow: 0 4px 20px color-mix(in srgb, var(--color-primary) 12%, transparent);
  transform: translateY(-2px);
}

.docs-comp-card:hover::before { opacity: 1; }

.docs-comp-card-icon {
  font-size: 1.35rem;
  margin-bottom: .75rem;
  color: var(--color-primary);
  line-height: 1;
}

.docs-comp-card-name {
  margin: 0 0 .3rem;
  font-size: .875rem;
  font-weight: 700;
  color: var(--ui-color-text);
}

.docs-comp-card-desc {
  margin: 0;
  font-size: .75rem;
  line-height: 1.5;
  color: var(--ui-color-text-muted);
  flex: 1;
}

.docs-comp-card-arrow {
  margin-top: .85rem;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--color-primary);
  opacity: 0;
  transition: opacity .15s;
}

.docs-comp-card:hover .docs-comp-card-arrow { opacity: 1; }

/* ================================================================
   Docs demo utility helpers
   ================================================================ */

/* Color-swatch column layout */
.docs-swatch-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
}

/* Standard demo box (border / outline / shadow / rounded demos) */
.docs-demo-box {
  width: 5.5rem;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 600;
}

/* Smaller demo box (for responsive / compact demo rows) */
.docs-demo-box-sm {
  min-width: 6rem;
  min-height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Solid colour swatch box (colors page) */
.docs-color-box {
  width: 5rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .65rem;
  font-weight: 700;
  color: #fff;
}

/* Horizontal bar for width-scale demos (sizing page) */
.docs-demo-bar {
  height: 1.5rem;
  min-width: .25rem;
  max-width: 100%;
}

/* Capped bar for fluid-height demos — prevents full-viewport bars */
.docs-demo-height-bar-fluid {
  width: 2rem;
  min-height: .25rem;
  max-height: 10rem;
}

/* Vertical bar for height-scale demos (sizing page) */
.docs-demo-height-bar {
  width: 2rem;
  min-height: .25rem;
}

/* Code column with fixed min-width for the sizing reference table */
.docs-code-col {
  min-width: 11rem;
  font-size: .7rem;
}

/* Small muted label under swatches */
.docs-swatch-label {
  font-size: .65rem;
  color: var(--ui-color-text-muted);
}

/* Numeric demo value badge */
.docs-demo-value {
  font-size: .75rem;
  font-weight: 600;
  opacity: .9;
}

/* Slightly dimmed body copy in demo blocks */
.docs-text-body {
  opacity: .8;
  font-size: .875rem;
}

/* Spacing page: margin visualisation zone (warm amber tint) */
.docs-margin-zone {
  background: color-mix(in srgb, var(--color-warning) 25%, transparent);
  display: inline-flex;
}

/* Spacing page: padding visualisation zone (cool blue tint) */
.docs-padding-zone {
  background: color-mix(in srgb, var(--color-info) 15%, transparent);
  border: 1px dashed color-mix(in srgb, var(--color-info) 40%, transparent);
}

/* Spacing page: value pill label */
.docs-space-label {
  font-size: .65rem;
  font-weight: 600;
  border: 1px solid var(--ui-color-border);
}

/* Spacing page: padded value chip */
.docs-space-value-pad {
  padding: .4rem .6rem;
  font-size: .65rem;
  font-weight: 600;
}

/* Navbar demo iframe-like wrapper */
.docs-demo-navbar-wrap {
  border: 1px solid var(--ui-color-border);
  margin-top: var(--ui-space-s);
  overflow: hidden;
}
