/* Layout and components specific to the API reference.
   Loaded after blog-assets/blog.css, which supplies the design tokens, the
   header/footer and the button styles — this file only adds what the
   reference itself needs. */

/* ── shared bits blog.css does not define ───────────────────────── */

.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;
}

.hm-kicker {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 8px;
}

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

.hm-footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  justify-content: center;
  margin: 4px 0 2px;
}
.hm-footer-links a {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--mute);
  text-decoration: none;
}
.hm-footer-links a:hover { color: var(--rust); }

/* ── page frame ─────────────────────────────────────────────────── */

.hm-docs-main { flex: 1; padding: 40px 0 72px; }

.hm-docs-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 28px;
}

.hm-docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}

.hm-docs-body { min-width: 0; }

.hm-docs-header { margin-bottom: 44px; }
.hm-docs-header h1 {
  font-size: clamp(32px, 5vw, 44px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.08;
  margin: 0 0 14px;
}
.hm-docs-header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.hm-docs-lede {
  color: var(--mute);
  font-size: 15px;
  line-height: 1.65;
  max-width: 68ch;
  margin: 0 0 14px;
}
.hm-docs-fineprint { font-size: 13px; }

/* ── sticky table of contents ───────────────────────────────────── */

.hm-docs-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  padding-right: 8px;
}
.hm-docs-toc ul { list-style: none; margin: 0 0 22px; padding: 0; }
.hm-docs-toc li { margin: 0; }
.hm-docs-toc a {
  display: block;
  padding: 4px 8px;
  color: var(--mute);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  overflow-wrap: anywhere;
}
.hm-docs-toc a:hover { color: var(--ink); background: var(--paper2); }
.hm-docs-toc a.is-current {
  color: var(--rust);
  border-left-color: var(--rust);
  background: var(--paper2);
}
.hm-docs-toc-sections a { font-weight: 600; }
.hm-docs-toc-group {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-top: 14px;
}
.hm-docs-toc-group ul { margin: 4px 0 0; }
.hm-docs-toc-endpoints a {
  font-family: var(--f-mono);
  font-size: 11.5px;
  letter-spacing: 0;
  text-transform: none;
}
.hm-docs-toc-method {
  display: inline-block;
  min-width: 38px;
  font-size: 9.5px;
  font-weight: 600;
  color: var(--rust);
}

/* ── sections ───────────────────────────────────────────────────── */

.hm-docs-section {
  margin-bottom: 56px;
  scroll-margin-top: 24px;
}
.hm-docs-section-head { margin-bottom: 20px; }
.hm-docs-section-head h2 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.hm-docs-block {
  margin: 22px 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}

/* ── code ───────────────────────────────────────────────────────── */

.hm-docs-code {
  position: relative;
  margin: 12px 0;
  background: var(--ink);
  border-radius: 10px;
  overflow: hidden;
}
.hm-docs-code-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 239, 230, 0.55);
  padding: 10px 14px 0;
}
.hm-docs-code pre {
  margin: 0;
  padding: 12px 14px 14px;
  overflow-x: auto;
  color: #f4efe6;
  font-family: var(--f-mono);
  font-size: 12.5px;
  line-height: 1.65;
}
.hm-docs-code code { font-family: inherit; }

.hm-docs-copy {
  position: absolute;
  top: 8px; right: 8px;
  padding: 4px 9px;
  font-size: 13px;
  color: rgba(244, 239, 230, 0.7);
  background: rgba(244, 239, 230, 0.09);
  border: 1px solid rgba(244, 239, 230, 0.16);
  border-radius: 6px;
  cursor: pointer;
}
.hm-docs-copy:hover { color: #f4efe6; background: rgba(244, 239, 230, 0.18); }
.hm-docs-copy.is-done { color: #9ec78a; border-color: #9ec78a; }

/* ── endpoints ──────────────────────────────────────────────────── */

.hm-docs-search { margin-bottom: 22px; }
.hm-docs-search input {
  width: 100%;
  max-width: 420px;
  padding: 9px 13px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--border2);
  border-radius: 8px;
}
.hm-docs-search input:focus {
  outline: none;
  border-color: var(--rust);
}
.hm-docs-search-empty { color: var(--mute); font-size: 13px; margin: 12px 0 0; }

.hm-docs-group { margin-bottom: 40px; }
.hm-group-head { margin: 34px 0 16px; }
.hm-group-title {
  font-family: var(--f-serif);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hm-group-desc { color: var(--mute); font-size: 14px; margin: 4px 0 0; }

.hm-docs-endpoint {
  margin: 14px 0;
  padding: 20px 22px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  scroll-margin-top: 24px;
}
.hm-docs-endpoint:target {
  border-color: var(--rust);
  box-shadow: 0 0 0 3px rgba(181, 66, 31, 0.13);
}
.hm-docs-endpoint-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.hm-docs-sig {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}
.hm-docs-path {
  font-family: var(--f-mono);
  font-size: 13.5px;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.hm-docs-anchor {
  color: var(--border2);
  text-decoration: none;
  font-family: var(--f-mono);
  font-size: 15px;
  flex-shrink: 0;
}
.hm-docs-anchor:hover { color: var(--rust); }

.hm-docs-endpoint-name {
  font-family: var(--f-serif);
  font-size: 16px;
  font-weight: 800;
  margin: 12px 0 4px;
}
.hm-docs-endpoint-desc { color: var(--mute); font-size: 14px; margin: 0 0 12px; }
.hm-docs-returns { color: var(--mute); font-size: 13px; margin: 10px 0 0; }

.hm-badge {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--f-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 5px;
  color: #fff;
  flex-shrink: 0;
}
.hm-badge-get { background: var(--sky); }
.hm-badge-post { background: var(--moss); }
.hm-badge-put { background: var(--gold); }
.hm-badge-delete { background: var(--rust); }

.hm-docs-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.hm-docs-chip {
  padding: 3px 9px;
  font-size: 11.5px;
  color: var(--mute);
  background: var(--paper2);
  border: 1px solid var(--border);
  border-radius: 20px;
}
.hm-docs-chip code { font-family: var(--f-mono); font-size: 11px; }
.hm-docs-chip-status { color: var(--moss); font-family: var(--f-mono); }

.hm-docs-note {
  margin-top: 14px;
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--mute);
  background: rgba(192, 138, 45, 0.09);
  border-left: 3px solid var(--gold);
  border-radius: 0 8px 8px 0;
}
.hm-docs-note strong { color: var(--ink); }
.hm-docs-note-wide { margin: 28px 0 0; }

.hm-docs-related {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.hm-docs-related .hm-kicker { margin: 0; }
.hm-docs-related a { color: var(--rust); font-size: 13px; }

/* ── tables ─────────────────────────────────────────────────────── */

.hm-docs-table-wrap { overflow-x: auto; margin: 10px 0; }
.hm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.hm-table th {
  text-align: left;
  padding: 8px 12px 8px 0;
  font-family: var(--f-mono);
  font-size: 10.5px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--mute);
  border-bottom: 1px solid var(--border2);
  white-space: nowrap;
}
.hm-table td {
  padding: 9px 12px 9px 0;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  color: var(--mute);
}
.hm-table code {
  font-family: var(--f-mono);
  font-size: 12.5px;
  color: var(--ink);
}
.hm-docs-type { font-size: 12px; white-space: nowrap; }
.hm-docs-req { color: var(--rust); font-weight: 700; }
.hm-docs-opt { color: var(--border2); }

/* ── concepts / steps / pills ───────────────────────────────────── */

.hm-concepts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.hm-concept {
  padding: 16px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.hm-concept-term {
  font-family: var(--f-serif);
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 5px;
}
.hm-concept-desc { color: var(--mute); font-size: 13.5px; line-height: 1.6; margin: 0; }

.hm-steps { display: flex; flex-direction: column; }
.hm-step { display: flex; gap: 16px; }
.hm-step-rail { display: flex; flex-direction: column; align-items: center; }
.hm-step-num {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--f-mono);
  font-size: 12px;
  color: #fff;
  background: var(--rust);
  border-radius: 50%;
}
.hm-step-line { flex: 1; width: 1px; background: var(--border2); margin: 4px 0; }
.hm-step:last-child .hm-step-line { display: none; }
.hm-step-body { padding-bottom: 22px; min-width: 0; }
.hm-step-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.hm-step-title { font-weight: 700; font-size: 14.5px; }
.hm-step-ep {
  font-family: var(--f-mono);
  font-size: 11.5px;
  color: var(--mute);
  background: var(--paper2);
  padding: 2px 7px;
  border-radius: 5px;
}
.hm-step-desc { color: var(--mute); font-size: 13.5px; margin: 5px 0 0; }

.hm-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.hm-pill {
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--mute);
  background: var(--paper2);
  border: 1px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-family: inherit;
}
.hm-pill:hover { color: var(--ink); }
.hm-pill.is-active {
  color: #fff;
  background: var(--rust);
  border-color: var(--rust);
}

.hm-docs-conv-list { display: flex; flex-direction: column; gap: 6px; }
.hm-docs-conv { padding: 14px 0; border-bottom: 1px solid var(--border); }
.hm-docs-conv:last-child { border-bottom: none; }
.hm-docs-conv h3 {
  font-family: var(--f-mono);
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}
.hm-docs-conv p { color: var(--mute); font-size: 14px; line-height: 1.65; margin: 0; max-width: 72ch; }

.hm-docs-callout {
  margin-top: 22px;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(181, 66, 31, 0.08), rgba(192, 138, 45, 0.07));
  border: 1px solid rgba(181, 66, 31, 0.22);
  border-radius: 10px;
}
.hm-docs-callout p { color: var(--mute); font-size: 13.5px; margin: 0 0 8px; }
.hm-docs-quote { color: var(--ink); font-style: italic; font-size: 13.5px; margin: 0; }

.hm-docs-cta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 15px 18px;
  text-decoration: none;
  background: linear-gradient(135deg, rgba(181, 66, 31, 0.08), rgba(192, 138, 45, 0.07));
  border: 1px solid rgba(181, 66, 31, 0.22);
  border-radius: 10px;
}
.hm-docs-cta strong { display: block; font-family: var(--f-serif); font-size: 15px; color: var(--ink); }
.hm-docs-cta span span { display: block; font-size: 12.5px; color: var(--mute); margin-top: 2px; }
.hm-docs-cta > span:last-child { color: var(--rust); font-size: 18px; }

.hm-docs-readmore {
  display: inline-block;
  margin-top: 10px;
  color: var(--rust);
  font-size: 13.5px;
  text-decoration: none;
}
.hm-docs-readmore:hover { text-decoration: underline; }

.hm-docs-linklist { list-style: none; margin: 0 0 14px; padding: 0; }
.hm-docs-linklist li { padding: 7px 0; border-bottom: 1px solid var(--border); color: var(--mute); font-size: 14px; }
.hm-docs-linklist li:last-child { border-bottom: none; }
.hm-docs-linklist a { color: var(--rust); text-decoration: none; }
.hm-docs-linklist a:hover { text-decoration: underline; }
.hm-docs-linklist code { font-family: var(--f-mono); font-size: 13px; }

.hm-docs-readnext {
  padding: 26px 28px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.hm-docs-readnext h2 { font-size: 20px; font-weight: 800; margin: 0 0 12px; }

/* ── filtering ──────────────────────────────────────────────────── */

.is-hidden { display: none !important; }
.hm-docs-endpoint.is-filtered { display: none; }
.hm-docs-group.is-filtered { display: none; }

/* ── narrow screens ─────────────────────────────────────────────── */

@media (max-width: 980px) {
  .hm-docs-layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hm-docs-toc {
    position: static;
    max-height: none;
    overflow: visible;
    margin-bottom: 34px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
  }
  /* The full endpoint list is long enough to bury the page on a phone; the
     section links are the useful half at this width. */
  .hm-docs-toc-endpoints { display: none; }
}

@media (max-width: 620px) {
  .hm-docs-inner { padding: 0 18px; }
  .hm-docs-endpoint, .hm-docs-block { padding: 16px; }
}

/* ── print ──────────────────────────────────────────────────────── */

@media print {
  .hm-docs-toc, .hm-docs-search, .hm-docs-copy, .hm-header, .hm-grid-bg { display: none !important; }
  .hm-docs-layout { display: block; }
  .hm-docs-code { background: none; border: 1px solid #ccc; }
  .hm-docs-code pre { color: #000; }
}
