/*
 * GuestLens documentation: the page layout of the offline guide (fixed sidebar
 * on the left, the page on the right), its text styles and its scrollbars.
 * The sidebar itself is styled in nav.css, the figures and callouts in
 * content.css.
 */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/fraunces-latin.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Fraunces';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/fraunces-latin-italic.woff2') format('woff2-variations');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('fonts/inter-latin.woff2') format('woff2-variations');
}

:root {
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  --brand: #c9573a;
  --brand-dark: #a8432a;
  --brand-tint: #f9e8e1;
  --ink: #241c35;
  --ink-soft: #3d3450;
  --muted: #756e85;
  --bg: #faf7f2;
  --canvas: #ffffff;
  --border: #eae3d9;
  --code-bg: #241c35;
  --code-ink: #eae3d9;
  --scroll-thumb: #d9d1c4;
  --scroll-thumb-hover: #c9573a;
  --radius: 12px;
  --sidebar-w: 292px;
  --topbar-h: 0px;
}

* {
  box-sizing: border-box;
}

/* ── Page scrollbar ──────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--topbar-h) + 20px);
  scrollbar-width: thin;
  scrollbar-color: var(--scroll-thumb) transparent;
}

/* Browsers without scrollbar-color (older Safari) use these instead. */
::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track,
::-webkit-scrollbar-corner {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background-color: var(--scroll-thumb);
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--scroll-thumb-hover);
}

/* Code blocks and wide tables scroll sideways with a slimmer bar. */
pre,
.table-wrap {
  scrollbar-width: thin;
  scrollbar-color: #5a5168 transparent;
}

pre::-webkit-scrollbar-thumb {
  background-color: #5a5168;
}

::selection {
  background: #f3d3c7;
  color: #241c35;
}

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
}

.skip:focus {
  top: 12px;
}

/* ── Layout ──────────────────────────────────────────────── */
.sb {
  position: fixed;
  inset-block: 0;
  inset-inline-start: 0;
  z-index: 40;
  width: var(--sidebar-w);
  border-inline-end: 1px solid var(--border);
}

.content {
  min-width: 0;
  margin-inline-start: var(--sidebar-w);
}

.page {
  max-width: 940px;
  margin: 0 auto;
  padding: 48px 56px 24px;
}

.page-foot {
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 56px 40px;
  font-size: 13.5px;
  color: var(--muted);
}

/* The bar with the menu button only shows on small screens. */
.topbar {
  display: none;
}

/* ── Page title ──────────────────────────────────────────── */
.page-head {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand);
}

.page-head h1 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-size: 40px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* The home page opens with the green banner instead. */
.hero {
  margin-bottom: 36px;
  padding: 40px 40px 36px;
  border-radius: 18px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(201, 87, 58, 0.55), transparent 55%),
    linear-gradient(135deg, #2e2342, #241c35);
  color: #fff;
}

.hero-mark {
  display: block;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
}

.hero-badge {
  display: inline-block;
  padding: 3px 12px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 14px 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 46px;
  line-height: 1.1;
  color: #fff;
}

.hero p {
  max-width: 640px;
  margin: 0;
  font-size: 17.5px;
  opacity: 0.94;
}

/* ── Text ────────────────────────────────────────────────── */
main h2 {
  margin: 48px 0 12px;
  font-family: var(--serif);
  font-size: 27px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

main h3 {
  margin: 30px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  color: var(--ink);
  scroll-margin-top: calc(var(--topbar-h) + 20px);
}

main .page-head + h2,
main .hero + h2 {
  margin-top: 0;
}

main p,
main ul,
main ol {
  margin: 14px 0;
}

main ul,
main ol {
  padding-inline-start: 24px;
}

main li {
  margin: 6px 0;
}

main strong {
  color: var(--ink);
}

main a {
  color: var(--brand-dark);
  text-underline-offset: 2px;
}

main a:hover {
  color: var(--brand);
}

main hr {
  margin: 40px 0;
  border: 0;
  border-top: 1px solid var(--border);
}

code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #f2ede5;
  font-family: ui-monospace, 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--ink);
}

pre {
  position: relative;
  margin: 18px 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: var(--code-bg);
  color: var(--code-ink);
  overflow-x: auto;
  font-size: 13.5px;
  line-height: 1.6;
}

pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

main blockquote {
  margin: 18px 0;
  padding: 12px 18px;
  border-inline-start: 4px solid var(--brand);
  border-radius: 8px;
  background: var(--brand-tint);
}

main blockquote p {
  margin: 0;
}

table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 14.5px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: start;
  vertical-align: top;
}

th {
  font-weight: 600;
  color: var(--muted);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.feature {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--canvas);
  font-size: 15px;
}

.feature strong {
  display: block;
  margin-bottom: 4px;
  color: var(--brand-dark);
}

.callout {
  margin: 18px 0;
  padding: 12px 16px;
  border-inline-start: 4px solid var(--brand);
  border-radius: 8px;
  background: #f9e8e1;
}

/* ── Small screens: the sidebar becomes a drawer ─────────── */
@media (max-width: 960px) {
  :root {
    --topbar-h: 56px;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    height: var(--topbar-h);
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(8px);
  }

  .topbar-menu {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
  }

  .topbar-menu svg {
    width: 20px;
    height: 20px;
  }

  .topbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--ink);
    text-decoration: none;
  }

  .topbar-page {
    min-width: 0;
    margin-inline-start: auto;
    overflow: hidden;
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .sb {
    width: min(320px, 86vw);
    border-inline-end: 0;
    box-shadow: 0 20px 60px -10px rgba(36, 28, 53, 0.35);
    transform: translateX(-105%);
    visibility: hidden;
    transition:
      transform 0.25s ease,
      visibility 0s linear 0.25s;
  }

  .sb .sb-close {
    display: grid;
  }

  .sb.is-open {
    transform: none;
    visibility: visible;
    transition: transform 0.25s ease;
  }

  .content {
    margin-inline-start: 0;
  }

  .page {
    padding: 28px 16px 16px;
  }

  .page-foot {
    padding: 24px 16px 32px;
  }

  .page-head h1 {
    font-size: 30px;
  }

  .hero {
    padding: 28px 22px;
  }

  .hero h1 {
    font-size: 32px;
  }

  main table {
    display: block;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

@media print {
  .sb,
  .topbar,
  .pager,
  .skip {
    display: none !important;
  }

  .content {
    margin: 0;
  }
}
