/* ============================================================================
   Happily.ai API docs — shared brand styles
   Used by the guide pages and the top bar on every page.
   Brand: Happy Blue #4C32CC · Engage Yellow #FFC200 · Lato
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&family=JetBrains+Mono:wght@400;600&display=swap');

:root {
  --happy-blue: #4C32CC;
  --engage-yellow: #FFC200;
  --purple: #8B41F0;
  --not-so-black: #2A2A2A;
  --not-so-white: #EAEAEA;
  --green: #0DD379;
  --red: #FF4343;
  --orange: #F99002;

  --ink: #2A2A2A;
  --ink-soft: #5b5b66;
  --line: #e7e7ef;
  --bg-soft: #f7f7fb;
  --radius: 12px;
  --maxw: 760px;
  --topbar-h: 56px;
  --gradient-primary: linear-gradient(135deg, #4C32CC 0%, #8B41F0 100%);
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

/* ---- Top bar (shared with the Scalar reference page) --------------------- */
.hp-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.hp-topbar__brand { display: flex; align-items: center; }
.hp-topbar__brand img { height: 30px; display: block; }
.hp-topbar__nav { display: flex; align-items: center; gap: 22px; margin-left: 8px; }
.hp-topbar__nav a {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.hp-topbar__nav a:hover { color: var(--happy-blue); }
.hp-topbar__nav a.is-active { color: var(--happy-blue); border-bottom-color: var(--engage-yellow); }
.hp-topbar__spacer { flex: 1; }
.hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--happy-blue);
  color: #fff !important;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
.hp-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(76, 50, 204, .25); }
.hp-btn--ghost { background: var(--engage-yellow); color: var(--not-so-black) !important; }

/* ---- Guide layout -------------------------------------------------------- */
.hp-shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }

.hp-sidebar {
  width: 270px;
  flex: 0 0 270px;
  border-right: 1px solid var(--line);
  padding: 28px 18px 60px;
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  background: var(--bg-soft);
}
.hp-sidebar__group { margin-bottom: 22px; }
.hp-sidebar__title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 8px 8px;
}
.hp-sidebar a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 14.5px;
  color: var(--ink);
  text-decoration: none;
  line-height: 1.3;
}
.hp-sidebar a:hover { background: #ecebf7; color: var(--happy-blue); }
.hp-sidebar a.is-active { background: var(--happy-blue); color: #fff; font-weight: 700; }

.hp-main { flex: 1; min-width: 0; display: flex; justify-content: center; padding: 48px 40px 120px; }
.hp-content { width: 100%; max-width: var(--maxw); }

/* ---- Guide typography ---------------------------------------------------- */
.hp-content h1 { font-size: 40px; font-weight: 900; line-height: 1.1; margin: 0 0 8px; letter-spacing: -0.02em; }
.hp-content h2 { font-size: 26px; font-weight: 700; margin: 44px 0 14px; padding-top: 8px; letter-spacing: -0.01em; }
.hp-content h3 { font-size: 19px; font-weight: 700; margin: 30px 0 10px; }
.hp-content p, .hp-content li { font-size: 16.5px; line-height: 1.7; color: #34343f; }
.hp-content a { color: var(--happy-blue); font-weight: 700; text-decoration: none; }
.hp-content a:hover { text-decoration: underline; }
.hp-content ul, .hp-content ol { padding-left: 22px; }
.hp-content li { margin: 6px 0; }
.hp-content hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; }
.hp-lede { font-size: 19px; color: var(--ink-soft); line-height: 1.6; margin: 6px 0 8px; }

/* ---- Code --------------------------------------------------------------- */
.hp-content code {
  font-family: var(--mono);
  font-size: 13.5px;
  background: #f0effb;
  color: #4127a3;
  padding: 2px 6px;
  border-radius: 5px;
}
.hp-content pre {
  background: #1b1b2e;
  color: #e8e8f4;
  padding: 18px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  border: 1px solid #2a2a44;
  line-height: 1.55;
}
.hp-content pre code { background: none; color: inherit; padding: 0; font-size: 13.5px; }
.hp-content pre.hp-code { position: relative; padding-top: 38px; }
.hp-content pre.hp-code::before {
  content: attr(data-lang);
  position: absolute; top: 0; left: 0; right: 0;
  padding: 7px 16px;
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase; color: #b9b9d6;
  background: #14141f; border-bottom: 1px solid #2a2a44; border-radius: 12px 12px 0 0;
}

/* ---- Tables ------------------------------------------------------------- */
.hp-content table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.hp-content th, .hp-content td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.hp-content th { font-weight: 700; background: var(--bg-soft); }

/* ---- Callouts (GitHub-style alerts) ------------------------------------- */
.hp-callout {
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  background: var(--bg-soft);
}
.hp-callout p { margin: 6px 0; }
.hp-callout__title { font-weight: 900; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
.hp-callout--note { border-left-color: var(--happy-blue); }
.hp-callout--note .hp-callout__title { color: var(--happy-blue); }
.hp-callout--tip { border-left-color: var(--green); }
.hp-callout--tip .hp-callout__title { color: var(--green); }
.hp-callout--important { border-left-color: var(--purple); }
.hp-callout--important .hp-callout__title { color: var(--purple); }
.hp-callout--warning { border-left-color: var(--orange); }
.hp-callout--warning .hp-callout__title { color: var(--orange); }
.hp-callout--caution { border-left-color: var(--red); }
.hp-callout--caution .hp-callout__title { color: var(--red); }

/* ---- Cards grid (used on the guides index) ------------------------------ */
.hp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 24px 0; }
.hp-card {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink);
  background: #fff;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.hp-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(42,42,42,.08); border-color: #d9d6f4; }
.hp-card h3 { margin: 0 0 6px; font-size: 17px; color: var(--happy-blue); }
.hp-card p { margin: 0; font-size: 14.5px; color: var(--ink-soft); }

/* ---- Footer ------------------------------------------------------------- */
.hp-footer { border-top: 1px solid var(--line); margin-top: 60px; padding-top: 20px; font-size: 14px; color: var(--ink-soft); }
.hp-footer a { color: var(--happy-blue); font-weight: 700; text-decoration: none; }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  .hp-sidebar { display: none; }
  .hp-main { padding: 32px 22px 90px; }
  .hp-topbar__nav { display: none; }
}
