/* Hallman.Digital Docs — complete custom stylesheet
   Quark 2 Docs child theme
   Typography, layout, navigation, footer, tables, and code presentation.
   Scoped to the documentation theme.
   Working revision: 1.2
*/

:root {
  --hallman-orange: #FA4E2A;
  --hallman-ink: #080A0C;
  --hallman-muted: #59616A;
  --hallman-rule: #D9DEE1;
  --hallman-surface: #F4F5F6;
  --hallman-surface-alt: #F8F9FA;
  --hallman-surface-hover: #F0F2F3;
  --hallman-code-ink: #20262D;
  --hallman-code-border: #D9DEE1;
  --hallman-inline-code-ink: #30363B;
  --hallman-inline-code-surface: #F2F3F4;
  --hallman-table-head: #F0F2F3;
  --hallman-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --hallman-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
}

/* Dark appearance.
   The theme's appearance control sets data-theme on the html element.
*/

html[data-theme='light'] {
  color-scheme: light;
}

html[data-theme='dark'] {
  color-scheme: dark;
  --hallman-orange: #FF795B;
  --hallman-ink: #F1F3F4;
  --hallman-muted: #A7B0B8;
  --hallman-rule: #343D45;
  --hallman-surface: #171D22;
  --hallman-surface-alt: #1D252B;
  --hallman-surface-hover: #273139;
  --hallman-code-ink: #E5EAF0;
  --hallman-code-border: #3A454E;
  --hallman-inline-code-ink: #E5EAF0;
  --hallman-inline-code-surface: #252E35;
  --hallman-table-head: #252E35;
}

/* Self-hosted IBM Plex fonts.
   Expected location:
   user/themes/quark2-docs/fonts/ibm-plex/
*/

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex/IBMPlexSans-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex/IBMPlexSans-Light.woff2') format('woff2');
  font-style: normal;
  font-weight: 300;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/ibm-plex/IBMPlexSans-Medium.woff2') format('woff2');
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/ibm-plex/IBMPlexMono-Regular.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

/* Base typography */

body,
button,
input,
select,
textarea {
  font-family: var(--hallman-sans);
}

body {
  line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--hallman-sans);
  letter-spacing: -0.025em;
}

code,
pre,
kbd,
samp {
  font-family: var(--hallman-mono);
}

/* Documentation layout */

body .docs-layout {
  gap: clamp(1.25rem, 2.5vw, 2.5rem);
}

body .docs-layout > .docs-sidebar {
  border-right: 1px solid var(--hallman-rule);
  padding-right: 1.25rem;
}

body .docs-layout .docs-content {
  line-height: 1.7;
}

body .docs-layout .docs-content > :is(p, ul, ol, blockquote) {
  max-width: 76ch;
}

body .docs-layout .docs-content > h1,
body .docs-layout .docs-content h1 {
  font-family: var(--hallman-sans);
  font-size: clamp(2rem, 3.1vw, 2.85rem);
  font-weight: 300;
  line-height: 1.14;
  letter-spacing: -0.035em;
}

body .docs-layout .docs-content h2 {
  margin-top: 2.2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hallman-rule);
  font-size: clamp(1.35rem, 1.8vw, 1.75rem);
  font-weight: 500;
  letter-spacing: -0.025em;
}

body .docs-layout .docs-content h3 {
  font-weight: 500;
}

/* Strong text */

body .docs-layout .docs-content :is(strong, b) {
  font-family: var(--hallman-sans);
  font-weight: 500;
  letter-spacing: normal;
}

/* Tables */

body .docs-layout .docs-content table {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

body .docs-layout .docs-content th,
body .docs-layout .docs-content td {
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--hallman-rule);
}

body .docs-layout .docs-content th {
  background: var(--hallman-table-head);
  color: var(--hallman-ink);
  font-weight: 500;
}

body .docs-layout .docs-content tbody tr:nth-child(even) {
  background: var(--hallman-surface-alt);
}

body .docs-layout .docs-content tbody tr:hover {
  background: var(--hallman-surface-hover);
}

body .docs-layout .docs-content td code {
  white-space: nowrap;
}

/* Inline code */

body .docs-layout .docs-content :not(pre) > code {
  padding: 0.12em 0.35em;
  border: 1px solid var(--hallman-code-border);
  border-radius: 3px;
  background: var(--hallman-inline-code-surface);
  color: var(--hallman-inline-code-ink);
  font-family: var(--hallman-mono);
  font-size: 0.88em;
  font-weight: 400;
}

/* Fenced code blocks.
   Preserve syntax-token colors supplied by the active highlighting theme.
*/

body .docs-layout .docs-content pre {
  display: block;
  max-width: 100%;
  margin: 1.4rem 0;
  padding: 1.15rem 1.3rem;
  overflow-x: auto;
  border: 1px solid var(--hallman-code-border);
  border-radius: 5px;
  background: var(--hallman-surface);
  color: var(--hallman-code-ink);
  font-family: var(--hallman-mono);
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.75;
  tab-size: 2;
  white-space: pre;
}

body .docs-layout .docs-content pre code {
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  white-space: inherit;
}

body .docs-layout .docs-content pre code * {
  background: transparent;
  text-shadow: none;
}

/* Sidebar navigation */

body .docs-sidebar .docs-nav-row > a {
  padding: 0.34rem 0.55rem;
  color: var(--hallman-ink);
  font-family: var(--hallman-sans);
  font-size: 0.94rem;
  line-height: 1.4;
  text-decoration: none;
}

body .docs-sidebar .docs-nav-row > a:hover {
  color: var(--hallman-orange);
}

body .docs-sidebar .docs-nav-item.active > .docs-nav-row > a {
  color: var(--hallman-orange);
  font-weight: 500;
}

body .docs-sidebar .docs-nav-item.activeChild > .docs-nav-row > a {
  font-weight: 500;
}

/* Table of contents */

body .docs-toc {
  font-family: var(--hallman-sans);
}

body .docs-toc h4 {
  font-family: var(--hallman-mono);
  font-size: 0.7rem;
  letter-spacing: 0.11em;
}

/* Header logo */

#header .navbar-section.logo img,
#header .logo img {
  width: auto;
  max-height: 2.25rem;
}

/* Footer */

#footer {
  border-top: 1px solid var(--hallman-rule);
}

#footer .hallman-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  margin: 0;
  color: var(--hallman-muted);
  font-size: 0.82rem;
}

#footer .hallman-footer a {
  color: var(--hallman-ink);
  text-decoration: none;
}

#footer .hallman-footer a:hover {
  color: var(--hallman-orange);
}

/* Keyboard focus */

body a:focus-visible,
body button:focus-visible {
  outline: 2px solid var(--hallman-orange);
  outline-offset: 2px;
}

/* Tablet and mobile layout */

@media (max-width: 900px) {
  body .docs-layout {
    gap: 1.25rem;
  }

  body .docs-layout > .docs-sidebar {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 0 0 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--hallman-rule);
  }

  body .docs-sidebar .docs-nav-row > a {
    padding: 0.34rem 0.55rem;
    line-height: 1.4;
  }

  body .docs-sidebar .docs-nav-row > .docs-toggle {
    width: 2rem;
    min-width: 2rem;
  }

  body .docs-layout .docs-content h1 {
    font-size: clamp(1.85rem, 6vw, 2.35rem);
    line-height: 1.18;
  }

  body .docs-layout .docs-content h2 {
    margin-top: 1.6rem;
  }

  body .docs-layout .docs-content {
    line-height: 1.6;
  }

  body .docs-layout .docs-content table {
    font-size: 0.88rem;
  }

  body .docs-layout .docs-content th,
  body .docs-layout .docs-content td {
    padding: 0.55rem 0.7rem;
  }

  body .docs-layout .docs-content pre {
    padding: 0.9rem;
    font-size: 0.82rem;
  }
}

@media (max-width: 560px) {
  body .docs-layout {
    gap: 1rem;
  }

  body .docs-layout > .docs-sidebar {
    padding-bottom: 0.75rem;
  }

  body .docs-sidebar .docs-nav-row > a {
    font-size: 0.91rem;
  }

  body .docs-layout .docs-content h1 {
    font-size: 1.9rem;
  }
}