/*
 * docs.houfy.com theme: fonts, header, left menu, and the Scalar overrides.
 * One file for every docs page (index.html = API reference, guides.html = Get started, access.html = API access).
 * Light mode only. Everything is self-hosted: no third-party scripts, styles or fonts on these pages,
 * because they can act as the signed-in Houfy user.
 */

/* ── Fonts (self-hosted; Inter is the variable font, JetBrains Mono is subset to Latin) ── */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-v20-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url(../fonts/inter-v20-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-regular.woff2) format("woff2");
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url(../fonts/jetbrains-mono-latin-medium.woff2) format("woff2");
}

:root {
  --hf-navy: #1F4E66;
  --hf-navy-hover: #163A4F;
  --hf-ink: #111827;
  --hf-body: #4B5563;
  --hf-muted: #6B7280;
  --hf-line: #E8EAED;
  --hf-menu-line: #E5E7EB;
  --hf-field-line: #D1D5DB;
  --hf-code-bg: #F7F8FA;
  --hf-grey: #F3F4F6;
  --hf-current-bg: #EFF6FF;
  --hf-current: #1E3A8A;
  --hf-header-h: 64px;
  --hf-menu-w: 280px;
  --hf-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --hf-font-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--hf-header-h) + 16px); }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--hf-font);
  color: var(--hf-ink);
  background: #FFFFFF;
  -webkit-font-smoothing: antialiased;
}

/* ── Header ───────────────────────────────────────────────────────────── */
.hf-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--hf-header-h);
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px;
  background: #FFFFFF; border-bottom: 1px solid var(--hf-line);
}
.hf-brand { display: flex; align-items: center; gap: 14px; text-decoration: none; flex: none; }
.hf-brand img { height: 28px; width: auto; display: block; }
.hf-brand span { font-size: 15px; color: var(--hf-muted); padding-left: 14px; border-left: 1px solid var(--hf-line); line-height: 24px; }
.hf-spacer { flex: 1; }
.hf-nav { display: flex; align-items: center; gap: 24px; font-size: 15px; }
.hf-nav a { color: var(--hf-body); text-decoration: none; white-space: nowrap; }
.hf-nav a:hover { color: var(--hf-ink); }
.hf-nav a[aria-current="page"] { color: var(--hf-ink); font-weight: 600; }
#houfy-account { display: flex; align-items: center; gap: 16px; font-size: 15px; }
#houfy-account:empty { display: none; }
#houfy-account a { color: var(--hf-body); text-decoration: none; white-space: nowrap; }
#houfy-account a:hover { color: var(--hf-ink); }
.hf-apply {
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--hf-navy); color: var(--hf-navy); background: #FFFFFF;
  font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  display: inline-flex; align-items: center;
}
.hf-apply:hover { background: var(--hf-current-bg); }
.hf-menu-toggle {
  display: none; flex: none;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--hf-field-line); background: #FFFFFF; color: var(--hf-ink);
  align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.hf-menu-toggle svg { width: 20px; height: 20px; }

/* ── Left menu (built like the logged-in Houfy menu) ─────────────────── */
.hf-menu {
  position: fixed; top: var(--hf-header-h); bottom: 0; left: 0; z-index: 50;
  width: var(--hf-menu-w);
  background: #FFFFFF; border-right: 1px solid var(--hf-menu-line);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 12px 32px;
  display: flex; flex-direction: column; gap: 2px;
  font-family: var(--hf-font);
}
.hf-menu a { text-decoration: none; }
.hf-menu-links { display: none; }
.hf-search {
  height: 40px; border: 1px solid var(--hf-field-line); border-radius: 10px;
  display: flex; align-items: center; gap: 8px; padding: 0 12px; margin-bottom: 8px;
  color: var(--hf-muted); flex: none;
}
.hf-search:focus-within { border-color: var(--hf-navy); }
.hf-search svg { width: 16px; height: 16px; flex: none; }
.hf-search input {
  all: unset; flex: 1; min-width: 0; font-size: 15px; color: var(--hf-ink); font-family: var(--hf-font);
}
.hf-search input::placeholder { color: var(--hf-muted); }
.hf-search kbd { font-family: var(--hf-font); font-size: 12px; white-space: nowrap; color: var(--hf-muted); }
.hf-label {
  padding: 12px 12px 4px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.35px; text-transform: uppercase;
  color: var(--hf-body);
}
.hf-row {
  height: 40px; padding: 0 12px; border-radius: 8px; flex: none;
  display: flex; align-items: center; gap: 12px;
  font-size: 16px; font-weight: 500; color: var(--hf-ink);
  font-family: var(--hf-font); line-height: 20px;
}
button.hf-row { all: unset; box-sizing: border-box; width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; display: flex; align-items: center; gap: 12px; font-size: 16px; font-weight: 500; color: var(--hf-ink); font-family: var(--hf-font); cursor: pointer; }
.hf-row:hover { background: var(--hf-grey); }
.hf-row:focus-visible, .hf-sub a:focus-visible { outline: 2px solid var(--hf-navy); outline-offset: -2px; }
.hf-row > svg:first-child { width: 20px; height: 20px; flex: none; color: var(--hf-body); }
.hf-row[aria-current="page"] { background: var(--hf-current-bg); color: var(--hf-current); }
.hf-row[aria-current="page"] > svg:first-child { color: var(--hf-current); }
.hf-row .hf-grow { flex: 1; min-width: 0; }
.hf-chevron { width: 16px; height: 16px; flex: none; color: var(--hf-muted); transition: transform .15s; }
.hf-group-toggle[aria-expanded="true"] .hf-chevron { transform: rotate(180deg); }
.hf-sub { display: flex; flex-direction: column; padding: 2px 0 6px 44px; }
.hf-sub[hidden] { display: none; }
.hf-sub a {
  min-height: 34px; padding: 6px 10px; border-radius: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 15px; line-height: 20px; color: var(--hf-body);
}
.hf-sub a:hover { background: var(--hf-grey); color: var(--hf-ink); }
.hf-sub a[aria-current="page"] { background: var(--hf-current-bg); color: var(--hf-current); font-weight: 500; }
.hf-method { font-family: var(--hf-font-code); font-size: 11px; color: var(--hf-muted); flex: none; }
.hf-hide { display: none !important; }
.hf-backdrop { display: none; }

/* ── Page frame ───────────────────────────────────────────────────────── */
.hf-main { margin-left: var(--hf-menu-w); padding-top: var(--hf-header-h); min-width: 0; }
.hf-footer {
  border-top: 1px solid var(--hf-line);
  padding: 24px 44px; font-size: 14px; line-height: 22px; color: var(--hf-muted);
  display: flex; flex-wrap: wrap; gap: 6px 18px;
}
.hf-footer a { color: var(--hf-body); text-decoration: none; }
.hf-footer a:hover { color: var(--hf-ink); text-decoration: underline; }

/* ── Phone and tablet: the menu becomes a drawer ─────────────────────── */
@media (max-width: 900px) {
  .hf-header { gap: 12px; padding: 0 16px; }
  .hf-nav, .hf-header .hf-apply { display: none; }
  .hf-menu-toggle { display: inline-flex; }
  .hf-brand { gap: 10px; }
  .hf-brand img { height: 24px; }
  .hf-brand span { padding-left: 10px; }
  .hf-menu {
    width: min(320px, 88vw); transform: translateX(-100%); visibility: hidden;
    transition: transform .2s ease, visibility .2s; box-shadow: none; z-index: 70;
  }
  body.hf-menu-open .hf-menu { transform: none; visibility: visible; box-shadow: 0 10px 30px -12px rgba(15, 29, 43, .35); }
  body.hf-menu-open .hf-backdrop { display: block; position: fixed; inset: var(--hf-header-h) 0 0 0; z-index: 65; background: rgba(17, 24, 39, .25); }
  .hf-menu-links { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--hf-line); }
  .hf-menu-links .hf-apply { justify-content: center; margin: 8px 0 0; }
  .hf-main { margin-left: 0; }
  .hf-footer { padding: 24px 16px; }
}

/* ── Scalar (API reference): Houfy theme, light mode only ─────────────── */
:root {
  --scalar-font: "Inter", sans-serif;
  --scalar-font-code: "JetBrains Mono", monospace;
  --scalar-radius: 8px;
}
/* Scalar forces .dark-mode on its request cards (the near-black code panels): give them the light theme too.
   html body raises the specificity above Scalar's own .light-mode / .dark-mode rules, which load after this file. */
html body.light-mode, html body .light-mode, html body .dark-mode {
  color-scheme: light;
  --scalar-color-1: #111827;
  --scalar-color-2: #4B5563;
  --scalar-color-3: #6B7280;
  --scalar-color-accent: #1F4E66;
  --scalar-background-1: #FFFFFF;
  --scalar-background-2: #F7F8FA;
  --scalar-background-3: #F3F4F6;
  --scalar-background-accent: #1F4E6614;
  --scalar-border-color: #E8EAED;
  --scalar-color-green: #1F4E66;
  --scalar-color-blue: #1F4E66;
  --scalar-color-orange: #9A4A12;
  --scalar-color-yellow: #8A6A00;
  --scalar-color-red: #B42318;
  --scalar-color-purple: #5B3E99;
  --scalar-link-color: #1F4E66;
  --scalar-link-color-hover: #163A4F;
  --scalar-button-1: #1F4E66;
  --scalar-button-1-hover: #163A4F;
  --scalar-button-1-color: #FFFFFF;
  --scalar-scrollbar-color: #0000002e;
  --scalar-scrollbar-color-active: #0000005c;
  --scalar-shadow-1: 0 1px 3px 0 #0000001c;
  --scalar-lifted-brightness: 1;
  --scalar-backdrop-brightness: 1;
}
.hf-reference #app { min-height: calc(100vh - var(--hf-header-h)); }
/* Code panels: light grey with a thin line instead of near-black. */
.hf-reference .request-card, .hf-reference .scalar-card { border: 1px solid var(--hf-line); background: var(--hf-code-bg); }
.hf-reference .request-card .scalar-card-content, .hf-reference .request-card .scalar-card-header, .hf-reference .request-card .scalar-card-footer { background: var(--hf-code-bg); color: #1F2937; }
/* Test Request: an outlined navy button. */
.hf-reference .show-api-client-button {
  --scalar-button-1-color: #1F4E66;
  background: #FFFFFF !important; color: var(--hf-navy) !important;
  border: 1px solid var(--hf-navy) !important; border-radius: 10px !important;
  height: 40px; padding: 0 16px !important;
  font-family: var(--hf-font); font-size: 15px !important; font-weight: 600 !important;
  box-shadow: none !important;
}
.hf-reference .show-api-client-button:hover { background: var(--hf-current-bg) !important; }
.hf-reference .show-api-client-button *, .hf-reference .show-api-client-button svg { color: var(--hf-navy) !important; }
/* The example placeholders (HOST_TOKEN, YOUR_AUTHKEY) show as text; Scalar hides every credential behind dots,
   and a real token the reader types into Authentication stays hidden (index.html marks only the placeholders). */
.hf-reference .scalar-app .credential.hf-placeholder .credential-value { color: inherit; font-size: inherit; }
.hf-reference .scalar-app .credential.hf-placeholder:after { content: none; }
/* Scalar's own phone header holds only its search, which the Houfy menu replaces. */
.hf-reference .t-doc__header { display: none; }
/* Introduction facts (rate limit, 401, 403): thin lines instead of a boxed table. */
html body.hf-reference .markdown table { border: 0; border-collapse: collapse; table-layout: fixed; width: 100%; }
.hf-reference .markdown table th, .hf-reference .markdown table td {
  border: 0; border-top: 1px solid var(--hf-line); background: transparent;
  padding: 14px 24px 14px 0; vertical-align: top; text-align: left;
  font-size: 15px; line-height: 22px;
}
.hf-reference .markdown table th { color: var(--hf-ink); font-weight: 600; padding-bottom: 0; }
.hf-reference .markdown table td { color: var(--hf-body); border-top: 0; padding-top: 2px; }
