/* ==========================================================================
   wpress-x documentation — stylesheet
   --------------------------------------------------------------------------
   Theme: Claude (cream paper, coral/clay accent, serif headings)
   Icons: Iconic — <i-ic class="ic-name">, vendored to assets/vendor/iconic/
   Radius: none, anywhere. See the global rule in section 1.

   Zero external requests: no CDN fonts, no webfonts, no remote images.
   Every glyph is an Iconic mask or a system font character, so the page
   renders identically offline and inside a sandboxed iframe.
   --------------------------------------------------------------------------
   Contents
     1.  Design tokens, themes & the no-radius rule
     2.  Reset & base typography
     3.  Layout shell (navbar / sidebar / content / TOC)
     4.  Navbar
     5.  Sidebar navigation
     6.  On-this-page TOC
     7.  Content typography
     8.  Code blocks, tabs & copy button
     9.  Tables
     10. Callouts, cards, badges, buttons
     11. Search
     12. Utilities & responsive
     13. Print
   ========================================================================== */

/* ==========================================================================
   1. Design tokens, themes & the no-radius rule
   ========================================================================== */

:root {
  /* Claude palette — warm paper, coral clay accent */
  --bg: #faf9f5;
  --bg-subtle: #f5f3ec;
  --bg-code: #f2f0e9;
  --bg-sidebar: #faf9f5;
  --bg-elevated: #ffffff;
  --border: #e6e2d8;
  --border-strong: #d3cec1;

  --text: #1f1e1d;
  --text-muted: #6b6862;
  --text-inverse: #faf9f5;
  --link: #b3512c;

  --accent: #d97757;
  --accent-strong: #c15f3c;
  --accent-soft: #fbeae2;
  --accent-line: #e8b9a2;

  /* syntax */
  --syn-comment: #8a8677;
  --syn-string: #2f6f3e;
  --syn-keyword: #b3512c;
  --syn-number: #8a5a2b;
  --syn-func: #6f5398;
  --syn-punct: #7a766c;

  /* metrics */
  --navbar-h: 57px;
  --sidebar-w: 276px;
  --toc-w: 210px;
  --content-max: 860px;

  /* squared off, everywhere */
  --radius: 0;
  --radius-lg: 0;

  --shadow-sm: 0 1px 2px rgba(31, 30, 29, 0.05);
  --shadow-md: 0 2px 8px rgba(31, 30, 29, 0.07);
  --shadow-lg: 0 8px 24px rgba(31, 30, 29, 0.10);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua",
    Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #1f1e1d;
  --bg-subtle: #262624;
  --bg-code: #232220;
  --bg-sidebar: #1f1e1d;
  --bg-elevated: #262624;
  --border: #3a3835;
  --border-strong: #504d48;

  --text: #f5f3ec;
  --text-muted: #a8a49b;
  --text-inverse: #1f1e1d;
  --link: #e59873;

  --accent: #d97757;
  --accent-strong: #e59873;
  --accent-soft: #33251f;
  --accent-line: #6b4335;

  --syn-comment: #837f72;
  --syn-string: #8bbd7a;
  --syn-keyword: #e08b6a;
  --syn-number: #d3a06a;
  --syn-func: #b39ddb;
  --syn-punct: #9d988e;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   No rounded corners, anywhere. Applied to every element including pseudo
   elements and the vendored Iconic set, so no component can reintroduce one.
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  border-radius: 0 !important;
}

/* ==========================================================================
   2. Reset & base typography
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.68;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  text-underline-offset: 2px;
}

img,
svg {
  max-width: 100%;
  vertical-align: middle;
}

button {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

::selection {
  background: var(--accent-line);
  color: var(--text);
}

/* Iconic sizing: the base sheet defaults to 1em, which is what we want. */
i-ic {
  flex: 0 0 auto;
}

/* ==========================================================================
   3. Layout shell
   ========================================================================== */

.docs-shell {
  min-height: 100vh;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr) var(--toc-w);
  gap: 0;
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 1.75rem;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: var(--navbar-h);
  height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.9rem 1.35rem 3rem 0;
  border-right: 1px solid var(--border);
  background: var(--bg-sidebar);
  scrollbar-width: thin;
}

.docs-main {
  min-width: 0;
  padding: 2.75rem 3.25rem 6rem;
  max-width: var(--content-max);
}

.docs-toc {
  position: sticky;
  top: var(--navbar-h);
  max-height: calc(100vh - var(--navbar-h));
  overflow-y: auto;
  padding: 2.75rem 0 3rem 1.5rem;
  scrollbar-width: thin;
}

.docs-sidebar::-webkit-scrollbar,
.docs-toc::-webkit-scrollbar,
pre::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.docs-sidebar::-webkit-scrollbar-thumb,
.docs-toc::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
  background: var(--border-strong);
}
.docs-sidebar::-webkit-scrollbar-track,
.docs-toc::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
  background: transparent;
}

/* ==========================================================================
   4. Navbar
   ========================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 1030;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  height: var(--navbar-h);
  padding: 0 1.75rem;
  background: var(--bg);
  color: var(--text);
  border-bottom: 1px solid var(--border);
}

.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.navbar-brand:hover {
  text-decoration: none;
  color: var(--text);
}

.navbar-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
}

.navbar-brand .brand-sub {
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.version-pill {
  padding: 0.08rem 0.4rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
}

.navbar-spacer {
  flex: 1 1 auto;
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
}

.navbar-link {
  padding: 0.3rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.navbar-link:hover {
  background: var(--bg-subtle);
  color: var(--text);
  text-decoration: none;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
  border-color: var(--border);
}

.icon-btn i-ic {
  --ic-size: 17px;
}

[data-theme="dark"] .theme-icon-light,
.theme-icon-dark {
  display: none;
}
[data-theme="dark"] .theme-icon-dark {
  display: block;
}

.navbar-toggler {
  display: none;
}

/* ==========================================================================
   5. Sidebar navigation
   ========================================================================== */

.sidebar-search {
  margin-bottom: 1.4rem;
}

.search-box {
  position: relative;
}

.search-box > i-ic {
  position: absolute;
  top: 50%;
  left: 0.6rem;
  --ic-size: 15px;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 0.45rem 3.1rem 0.45rem 2rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 0.875rem;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.search-kbd {
  position: absolute;
  top: 50%;
  right: 0.45rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.05rem 0.3rem;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  pointer-events: none;
}

.search-kbd i-ic {
  --ic-size: 10px;
}

.search-results {
  position: absolute;
  z-index: 20;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 320px;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
}

.search-results[hidden] {
  display: none;
}

.search-results a {
  display: block;
  padding: 0.4rem 0.55rem;
  color: var(--text);
  font-size: 0.87rem;
}

.search-results a:hover,
.search-results a:focus-visible {
  background: var(--accent-soft);
  color: var(--link);
  text-decoration: none;
}

.search-results mark {
  background: transparent;
  color: var(--link);
  font-weight: 700;
}

.search-empty {
  padding: 0.6rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sidebar-group + .sidebar-group {
  margin-top: 1.35rem;
}

.sidebar-heading {
  margin: 0 0 0.45rem;
  padding: 0 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav a {
  display: block;
  padding: 0.28rem 0.6rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.45;
  border-left: 2px solid transparent;
}

.sidebar-nav a:hover {
  color: var(--text);
  background: var(--bg-subtle);
  text-decoration: none;
}

.sidebar-nav a.active {
  color: var(--link);
  background: var(--accent-soft);
  border-left-color: var(--accent);
  font-weight: 600;
}

.sidebar-nav code {
  font-size: 0.8em;
}

.sidebar-group.filtered-out,
.sidebar-nav li.filtered-out {
  display: none;
}

/* ==========================================================================
   6. On-this-page TOC
   ========================================================================== */

.toc-title {
  margin: 0 0 0.65rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.toc-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--border);
}

.toc-nav a {
  display: block;
  padding: 0.2rem 0 0.2rem 0.85rem;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.toc-nav a:hover {
  color: var(--text);
  text-decoration: none;
}

.toc-nav a.active {
  border-left-color: var(--accent);
  color: var(--link);
  font-weight: 600;
}

.toc-nav .toc-h3 a {
  padding-left: 1.6rem;
  font-size: 0.79rem;
}

/* ==========================================================================
   7. Content typography
   ========================================================================== */

.hero {
  padding: 0.5rem 0 2rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}

.hero h1 {
  margin: 0 0 0.55rem;
  font-family: var(--font-serif);
  font-size: clamp(2.3rem, 5.2vw, 3.1rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.08;
}

.hero .hero-tagline {
  margin: 0 0 1.35rem;
  max-width: 46ch;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--text-muted);
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.docs-section {
  margin-bottom: 3.5rem;
  scroll-margin-top: calc(var(--navbar-h) + 1rem);
}

.docs-section > h2 {
  margin: 0 0 0.5rem;
  padding-bottom: 0.45rem;
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  border-bottom: 1px solid var(--border);
}

.docs-section h3 {
  margin: 2.1rem 0 0.5rem;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.docs-section h4 {
  margin: 1.5rem 0 0.35rem;
  font-size: 1.02rem;
  font-weight: 700;
}

.docs-section p {
  margin: 0 0 1rem;
}

.docs-section ul,
.docs-section ol {
  margin: 0 0 1rem;
  padding-left: 1.4rem;
}

.docs-section li {
  margin-bottom: 0.38rem;
}

.docs-section li > ul,
.docs-section li > ol {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
}

.anchor-link {
  margin-left: 0.4rem;
  color: var(--accent);
  opacity: 0;
  font-weight: 400;
  text-decoration: none;
  transition: opacity 0.12s ease;
}

h2:hover .anchor-link,
h3:hover .anchor-link,
.anchor-link:focus-visible {
  opacity: 1;
}

.docs-section h2,
.docs-section h3 {
  scroll-margin-top: calc(var(--navbar-h) + 1rem);
}

:not(pre) > code {
  padding: 0.12em 0.38em;
  border: 1px solid var(--border);
  background: var(--bg-code);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85em;
  word-break: break-word;
}

kbd {
  padding: 0.12em 0.4em;
  border: 1px solid var(--border-strong);
  border-bottom-width: 2px;
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  font-size: 0.8em;
  color: var(--text);
}

/* ==========================================================================
   8. Code blocks, tabs & copy button
   ========================================================================== */

.code-block {
  position: relative;
  margin: 0 0 1.35rem;
  border: 1px solid var(--border);
  background: var(--bg-code);
  overflow: hidden;
}

.code-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.32rem 0.32rem 0.32rem 0.8rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.code-filename {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
}

.code-spacer {
  flex: 1 1 auto;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.24rem 0.55rem;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.copy-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.copy-btn i-ic {
  --ic-size: 13px;
}

.copy-btn.copied {
  color: #2f6f3e;
  border-color: #2f6f3e;
}

[data-theme="dark"] .copy-btn.copied {
  color: #8bbd7a;
  border-color: #8bbd7a;
}

.code-block pre {
  margin: 0;
  padding: 0.95rem 1.05rem;
  overflow-x: auto;
  background: transparent;
}

.code-block pre code {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-mono);
  font-size: 0.845rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre;
  tab-size: 2;
}

.tok-comment {
  color: var(--syn-comment);
  font-style: italic;
}
.tok-string {
  color: var(--syn-string);
}
.tok-keyword {
  color: var(--syn-keyword);
}
.tok-number {
  color: var(--syn-number);
}
.tok-func {
  color: var(--syn-func);
}
.tok-punct {
  color: var(--syn-punct);
}

/* tabbed code (npm / yarn / pnpm / bun) */
.code-tabs {
  margin-bottom: 1.35rem;
  border: 1px solid var(--border);
  overflow: hidden;
}

.code-tabs-bar {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.3rem 0.35rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-subtle);
}

.code-tab {
  padding: 0.26rem 0.7rem;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.79rem;
  font-weight: 600;
  cursor: pointer;
}

.code-tab:hover {
  color: var(--text);
}

.code-tab[aria-selected="true"] {
  background: var(--bg-elevated);
  border-color: var(--border-strong);
  color: var(--text);
}

.code-panel[hidden] {
  display: none;
}

.code-tabs .code-block {
  margin: 0;
  border: 0;
}

/* ==========================================================================
   9. Tables
   ========================================================================== */

.table-wrap {
  overflow-x: auto;
  margin-bottom: 1.35rem;
  border: 1px solid var(--border);
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-table th,
.docs-table td {
  padding: 0.6rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.docs-table thead th {
  background: var(--bg-subtle);
  font-weight: 700;
  white-space: nowrap;
  border-bottom: 1px solid var(--border-strong);
}

.docs-table tbody tr:last-child td {
  border-bottom: 0;
}

.docs-table tbody tr:hover {
  background: var(--bg-subtle);
}

.docs-table code {
  font-size: 0.82em;
  white-space: nowrap;
}

.docs-table td:first-child {
  font-weight: 600;
}

/* ==========================================================================
   10. Callouts, cards, badges, buttons
   ========================================================================== */

.callout {
  display: flex;
  gap: 0.75rem;
  margin: 0 0 1.35rem;
  padding: 0.9rem 1.05rem;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout > i-ic {
  flex: 0 0 auto;
  --ic-size: 17px;
  margin-top: 0.28rem;
  color: var(--accent);
}

.callout-info {
  border-left-color: #5b8def;
  background: rgba(91, 141, 239, 0.07);
}
.callout-info > i-ic {
  color: #3f6fd0;
}

.callout-warning {
  border-left-color: #d9a441;
  background: rgba(217, 164, 65, 0.09);
}
.callout-warning > i-ic {
  color: #a97b1e;
}

.callout-danger {
  border-left-color: #c0492f;
  background: rgba(192, 73, 47, 0.07);
}
.callout-danger > i-ic {
  color: #c0492f;
}

.callout-success {
  border-left-color: #3f7d4f;
  background: rgba(63, 125, 79, 0.08);
}
.callout-success > i-ic {
  color: #3f7d4f;
}

[data-theme="dark"] .callout-info > i-ic {
  color: #8fb4f7;
}
[data-theme="dark"] .callout-warning > i-ic {
  color: #e5bf6e;
}
[data-theme="dark"] .callout-danger > i-ic {
  color: #e8876e;
}
[data-theme="dark"] .callout-success > i-ic {
  color: #8bbd7a;
}

/* feature cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(235px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card:hover {
  border-color: var(--accent-line);
  box-shadow: var(--shadow-sm);
}

.card h4 {
  margin: 0 0 0.35rem;
  font-size: 0.98rem;
}

.card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.card-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 0.7rem;
  background: var(--accent-soft);
  color: var(--accent);
}

.card-icon i-ic {
  --ic-size: 17px;
}

.badge {
  display: inline-block;
  padding: 0.12em 0.55em;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--link);
  font-size: 0.73rem;
  font-weight: 700;
  white-space: nowrap;
}

.badge-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text-muted);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #fff;
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg-subtle);
  border-color: var(--text-muted);
  color: var(--text);
}

.btn i-ic {
  --ic-size: 15px;
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.site-footer {
  padding: 2rem 1.75rem 3rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.85rem;
  text-align: center;
}

.site-footer p {
  margin: 0.3rem 0;
}

/* ==========================================================================
   11. Search overlay (Ctrl/Cmd + K)
   ========================================================================== */

.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1050;
  display: flex;
  justify-content: center;
  padding: 12vh 1rem 1rem;
  background: rgba(31, 30, 29, 0.5);
}

.search-overlay[hidden] {
  display: none;
}

.search-dialog {
  width: 100%;
  max-width: 560px;
  height: max-content;
  max-height: 60vh;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}

.search-dialog input {
  width: 100%;
  padding: 0.9rem 1rem;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 1rem;
}

.search-dialog input:focus {
  outline: none;
}

.search-dialog .search-results {
  position: static;
  max-height: none;
  border: 0;
  box-shadow: none;
  padding: 0.4rem;
}

.search-hint {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.search-hint i-ic {
  --ic-size: 11px;
}

/* ==========================================================================
   12. Utilities & responsive
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-muted {
  color: var(--text-muted);
}

.mono {
  font-family: var(--font-mono);
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 1025;
  background: rgba(31, 30, 29, 0.45);
  border: 0;
  padding: 0;
  cursor: pointer;
}

.backdrop[hidden] {
  display: none;
}

@media (max-width: 1200px) {
  .docs-layout {
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  }
  .docs-toc {
    display: none;
  }
}

@media (max-width: 992px) {
  .docs-layout {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 1.25rem;
  }

  .navbar-toggler {
    display: grid;
  }

  .navbar-links {
    display: none;
  }

  .docs-sidebar {
    position: fixed;
    z-index: 1035;
    top: 0;
    left: 0;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    padding: 1.25rem;
    border-right: 1px solid var(--border);
    background: var(--bg-elevated);
    box-shadow: var(--shadow-lg);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }

  .docs-sidebar.open {
    transform: translateX(0);
  }

  .docs-main {
    padding: 1.75rem 0 4rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  body {
    font-size: 15px;
  }
  .hero h1 {
    font-size: 1.95rem;
  }
  .docs-section > h2 {
    font-size: 1.5rem;
  }
  .search-kbd {
    display: none;
  }
  .docs-pager {
    flex-direction: column;
  }
}

/* ==========================================================================
   13. Print
   ========================================================================== */

@media print {
  .navbar,
  .docs-sidebar,
  .docs-toc,
  .docs-pager,
  .copy-btn,
  .backdrop {
    display: none !important;
  }
  .docs-layout {
    display: block;
    padding: 0;
  }
  .docs-main {
    padding: 0;
    max-width: none;
  }
  .code-block,
  .card,
  .table-wrap {
    break-inside: avoid;
  }
}
