/* ══════════════════════════════════════════════════════════════════════
 * help.dosido.app — custom stylesheet for the Help Scout Docs site.
 *
 * Served at https://dosido.app/brand/help.css and set as the Docs site's
 * custom stylesheet in Help Scout. It restyles Help Scout's stock "launch"
 * theme; every selector below targets THEIR markup, which we do not control,
 * so a Help Scout theme change can quietly break a rule here.
 *
 * Colors are a point-in-time COPY of src/styles/tokens.css (which is itself a
 * copy from dosido-rails). Re-copy rather than hand-edit if they drift.
 *
 * Specificity: Help Scout prints an inline <style> AFTER this file with the
 * colors from its settings page (`.navbar .nav li a`, `#fullArticle p`, …),
 * and a tie goes to whatever comes last. Rules that fight those are anchored
 * on an id (#mainNav, #contentArea) so they win on specificity instead.
 * ══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "Inter";
  src: url("https://dosido.app/fonts/Inter-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Departure Mono";
  src: url("https://dosido.app/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --amber: #feb754;
  --amber-soft: #fff4e2; /* sun-100 (#ffe2b4) thinned for a callout ground */
  --paper: #e0dabf;
  --roast: #262419;

  --ink-100: #f5f5f5;
  --ink-200: #eeeeee;
  --ink-300: #d9d9d9;
  --ink-600: #777777;
  --ink-700: #555555;
  --ink-900: #212121;

  --radius-button: 6px;
  --radius-card: 8px;
  --shadow-raised: 0px 1px 1px 0px rgba(33, 33, 35, 0.3);
  --shadow-elevated: 0px 10px 24px 0px rgba(33, 33, 35, 0.12);

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "Departure Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

/* ── type ─────────────────────────────────────────────────────────────── */

body,
button,
input,
select,
textarea,
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  color: var(--ink-900);
}

/* ── header: the website's three flush blocks ─────────────────────────── */
/* Amber logo block, beige stretch, roast Contact block — the same bar as
   dosido.app at every width: 56px on a phone, 90px (its resting height) from
   769px, Help Scout's own breakpoint. The phone gets the website's "plain"
   bar (Header.astro with sections={[]}): no menu button, Contact always in
   the roast block — a menu holding one link is just an extra tap. */

/* Phone sizes are the website header's CONDENSED ones (the bar it shrinks to
   on scroll): an 88×18 mark, a 48px bar — its 56px phone bar felt oversized
   here. Desktop restores the resting sizes below. */
#mainNav {
  --bar-h: 48px;
  --logo-w: 88px;
  --logo-h: 18px;
  --brand-pad: 16px;
  --pill-font: 11px;
  --pill-pad: 1px 8px;
}

#mainNav .navbar-inner {
  background: var(--paper);
  box-shadow: none;
  min-height: var(--bar-h);
  padding: 0;
}

/* Full bleed, like the website — the theme caps this at 1080px. */
#mainNav .container-fluid {
  display: flex;
  align-items: stretch;
  max-width: none;
  height: var(--bar-h);
  padding: 0;
}

#mainNav .brand {
  float: none;
  display: flex;
  align-items: center;
  max-width: none;
  margin: 0;
  padding: 0 var(--brand-pad);
  /* background-color, never the `background` shorthand: the shorthand
     also resets background-image and erases the logo drawn below. */
  background-color: var(--amber);
}

/* The logo: the website's wordmark, drawn at the website's 112×23.
   Help Scout's uploaded PNG is 180×75 with the wordmark floating in a lot of
   empty canvas, so any height that fits the bar shrinks the word to a smudge.
   The PNG stays in place, invisible, at the same size — it still carries the
   link's alt text.

   help-logo.svg, NOT logo.svg: logo.svg colors its paths with
   fill="var(--fill-0, …)" under a root fill="none". Written into a page that
   works; as a background image the var() is dropped, the paths inherit
   "none", and the logo draws invisibly. The copy hard-codes the roast fill
   and a real 134×28 size — keep it in step if the wordmark ever changes. */
#mainNav .brand {
  /* Relative, so it resolves beside this stylesheet: the branch preview while
     testing, dosido.app once merged. */
  background-image: url("help-logo.svg");
  background-repeat: no-repeat;
  background-origin: content-box;
  background-position: center;
  background-size: var(--logo-w) var(--logo-h);
}

#mainNav .brand img {
  display: block;
  width: var(--logo-w);
  height: var(--logo-h);
  opacity: 0;
}

/* No menu button: the nav it would toggle is always open (below). */
#mainNav .btn-navbar {
  display: none;
}

/* Every wrapper between the bar and the link has to stretch, or the roast
   block shrinks to the height of its text: .nav-collapse > nav > ul > li.
   On a phone Help Scout collapses .nav-collapse to height 0 (and its script
   writes inline heights when toggled), hence the !important pair. */
#mainNav .nav-collapse {
  display: flex;
  align-items: stretch;
  clear: none;
  margin-left: auto;
  height: auto !important;
  overflow: visible !important;
}

#mainNav .nav-collapse > nav {
  display: flex;
  align-items: stretch;
}

#mainNav .nav {
  position: static;
  display: flex;
  margin: 0;
}

/* The roast block, as the website's `.cta`. Help Scout prints two Contact
   items — #contact for desktop, #contactMobile for phones — and hides the
   other one. Each is shown only at its own width here, because a display
   rule for both outranks Help Scout's hiding and shows two. */
@media (max-width: 768px) {
  #mainNav .nav #contactMobile {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 12px;
    background: var(--roast);
  }
}

/* The website's Log In pill (`.login` in Header.astro) inside the block:
   1px border, 6px radius, Departure Mono 12px uppercase, inverting on hover.
   The resets matter — Help Scout gives these links a 32px line-height, and on
   phones bold gray text, padding, and a margin. */
#mainNav .nav .contactUs {
  display: flex;
  align-items: center;
  margin: 0;
  padding: var(--pill-pad);
  border: 1px solid var(--paper);
  border-radius: var(--radius-button);
  background: none;
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--pill-font);
  font-weight: 400;
  line-height: 1.45;
  letter-spacing: 0.003em;
  text-transform: uppercase;
  text-shadow: none;
  white-space: nowrap;
  transition:
    background-color 150ms ease,
    color 150ms ease;
}

#mainNav .nav .contactUs:hover,
#mainNav .nav .contactUs:focus {
  background: var(--paper);
  color: var(--roast);
}

@media (min-width: 769px) {
  #mainNav {
    --bar-h: 90px;
    --logo-w: 112px;
    --logo-h: 23px;
    --brand-pad: 52px;
    --pill-font: 12px;
    --pill-pad: 2px 10px;
  }

  #mainNav .nav #contact {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0 48px;
    background: var(--roast);
  }
}

/* ── search ───────────────────────────────────────────────────────────── */

#docsSearch {
  background: var(--ink-100);
  border-bottom: 1px solid var(--ink-200);
}

#docsSearch h1 {
  color: var(--ink-900);
  font-weight: 600;
  letter-spacing: -0.01em;
}

#searchBar .search-query {
  border: 1px solid var(--ink-300);
  border-radius: var(--radius-button);
  box-shadow: none;
  color: var(--ink-900);
}

#searchBar .search-query:focus {
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(254, 183, 84, 0.35);
  outline: 0;
}

/* The big home-page button: amber, dark text, like the website's buttons. */
#searchBar button,
#searchBar button:hover {
  background: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 0 var(--radius-button) var(--radius-button) 0;
  color: var(--ink-900);
  font-weight: 600;
  text-shadow: none;
}

#searchBar button:hover {
  background: #f5a93f;
  border-color: #f5a93f;
}

/* The small sidebar search keeps its magnifier icon on a clear ground. */
#searchBar.sm button,
#searchBar.sm button:hover {
  background: none;
  border-color: transparent;
  color: var(--ink-600);
}

#serp-dd {
  border-color: var(--ink-300);
  border-radius: 0 0 var(--radius-card) var(--radius-card);
  box-shadow: var(--shadow-elevated);
}

#serp-dd .result a:hover,
#serp-dd .result > li.active {
  background: var(--ink-100);
}

/* On a phone the big button swaps its "Search" label for a magnifier, which
   Help Scout draws light gray — nearly invisible on amber. */
#searchBar:not(.sm) button .icon-search {
  color: var(--ink-900);
}

/* ── links ────────────────────────────────────────────────────────────── */
/* Near-black, with an amber underline on hover — replaces the slate blue. */

#contentArea a,
#contentArea .most-pop-articles .popArticles a,
#contentArea .contentWrapper a,
#contentArea .related a,
#contentArea .articleList a {
  color: var(--ink-900);
}

#contentArea .most-pop-articles .popArticles a:hover span,
#contentArea .related ul > li a:hover span,
#contentArea .articleList a:hover span,
#contentArea #fullArticle a:hover {
  color: var(--ink-900);
  text-decoration: underline;
  text-decoration-color: var(--amber);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* In-article links read as links: a quiet underline that warms on hover. */
#contentArea #fullArticle a {
  text-decoration: underline;
  text-decoration-color: var(--ink-300);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

/* ── home: popular articles + category cards ─────────────────────────── */

.most-pop-articles h2 {
  color: var(--ink-900);
  font-weight: 600;
  letter-spacing: -0.01em;
}

#contentArea .category-list .category {
  background: #fff;
  border: 1px solid var(--ink-200);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-raised);
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}

#contentArea .category-list .category:hover {
  background: #fff;
  border-color: var(--ink-300);
  box-shadow: var(--shadow-elevated);
}

#contentArea .category-list h3 {
  color: var(--ink-900);
  font-weight: 600;
}

#contentArea .category-list .category .article-count,
#contentArea .category-list .category:hover .article-count {
  color: var(--ink-600);
}

.sep {
  border-color: var(--ink-200);
}

/* ── article + category pages ─────────────────────────────────────────── */

#contentArea .contentWrapper,
#contentArea .related {
  border-color: var(--ink-200);
}

#contentArea .contentWrapper {
  border-radius: var(--radius-card) var(--radius-card) 0 0;
}

#contentArea .contentWrapper:not(.withRelated) {
  border-radius: var(--radius-card);
}

#contentArea .related {
  border-radius: 0 0 var(--radius-card) var(--radius-card);
}

#contentArea .contentWrapper h1,
#contentArea #fullArticle h1,
#contentArea #fullArticle h2,
#contentArea #fullArticle h3,
#contentArea #fullArticle h4 {
  color: var(--ink-900);
  font-weight: 600;
  letter-spacing: -0.01em;
}

#contentArea #fullArticle,
#contentArea #fullArticle p,
#contentArea #fullArticle ul,
#contentArea #fullArticle ol,
#contentArea #fullArticle li,
#contentArea #fullArticle div,
#contentArea #fullArticle dd,
#contentArea #fullArticle table {
  color: var(--ink-700);
  font-size: 15px;
  line-height: 1.6;
}

#contentArea #fullArticle strong {
  color: var(--ink-900);
  font-weight: 600;
}

/* Tips: an amber callout instead of a gray rule. */
#contentArea #fullArticle blockquote {
  background: var(--amber-soft);
  border-left: 4px solid var(--amber);
  border-radius: 0 var(--radius-button) var(--radius-button) 0;
  color: var(--ink-900);
  font-style: normal;
  padding: 12px 20px;
}

#contentArea #fullArticle blockquote p {
  color: var(--ink-900);
}

/* Code chips: neutral, in the logo's pixel mono — not Bootstrap's pink. */
#contentArea #fullArticle code {
  background: var(--ink-100);
  border: 1px solid var(--ink-200);
  border-radius: 4px;
  color: var(--ink-900);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 2px 5px;
}

#contentArea #fullArticle table th,
#contentArea #fullArticle table td {
  border-top-color: var(--ink-200);
}

#contentArea #fullArticle table thead {
  color: var(--ink-900);
  font-weight: 600;
}

#contentArea .related h3 {
  color: var(--ink-600);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* ── phones ───────────────────────────────────────────────────────────── */
/* 600px is Help Scout's own step for stacking the category cards. */

@media (max-width: 600px) {
  /* One column: two squeeze nearly every title onto two or three lines. */
  .most-pop-articles.two-col .popArticles {
    columns: 1;
  }

  /* Help Scout stacks the cards flush with a -1px overlap, which reads as
     one broken box once they have rounded corners and shadows. */
  #contentArea .category-list .category {
    margin: 0 0 12px;
  }
}

/* ── sidebar ──────────────────────────────────────────────────────────── */

#sidebar h3 {
  color: var(--ink-600);
  font-weight: 600;
  letter-spacing: 0.04em;
}

#sidebar .nav-list a {
  color: var(--ink-700);
}

#sidebar .nav-list a:hover,
#sidebar .nav-list a:focus {
  color: var(--ink-900);
}

/* The current category: bold, with an amber mark in place of the arrow. */
#sidebar .nav-list .active a,
#sidebar .nav-list .active a:hover,
#sidebar .nav-list .active a:focus {
  color: var(--ink-900);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--amber);
  padding-left: 12px;
}

#sidebar .nav-list .active a .icon-arrow {
  display: none;
}

/* ── article rating ───────────────────────────────────────────────────── */

.rateAction {
  border-radius: var(--radius-button);
}
