/* FlightLog — documentation pages (loaded after site.css) */

.docs .backdrop .aurora { opacity: .55; }
.docs-tag { margin-left: 6px; padding: 2px 9px; border-radius: 999px; font-family: var(--font-sans); font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--primary-bright); border: 1px solid #5b5bf766; background: #5b5bf714; vertical-align: 3px; }
.nav a[aria-current="page"] { color: var(--foreground); background: var(--muted); }

.docs-layout {
  max-width: calc(1280px + 2 * var(--gutter)); margin: 0 auto; padding: 112px var(--gutter) 80px;
  display: grid; grid-template-columns: 260px minmax(0, 1fr) 220px; gap: 48px; align-items: start;
}

/* ---------- Sidebar ---------- */
.docs-side { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; padding-right: 8px; scrollbar-width: thin; }
.docs-search { position: relative; display: flex; align-items: center; margin-bottom: 20px; }
.docs-search svg { position: absolute; left: 12px; width: 16px; height: 16px; color: var(--muted-foreground); pointer-events: none; }
.docs-search input {
  width: 100%; height: 40px; padding: 0 36px 0 36px; border-radius: 12px; border: 1px solid var(--input);
  background: var(--card); color: var(--foreground); font: inherit; font-size: 14px; outline: none;
}
.docs-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px #5b5bf733; }
.docs-search kbd { position: absolute; right: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--muted-foreground); border: 1px solid var(--input); border-radius: 6px; padding: 1px 6px; }
.docs-nav__title { margin: 22px 0 8px; font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--primary-bright); }
.docs-nav ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-nav li a { display: flex; align-items: center; gap: 8px; padding: 6px 12px; margin-left: -1px; border-left: 2px solid transparent; font-size: 14px; color: var(--muted-foreground); transition: color .15s, border-color .15s; }
.docs-nav li a:hover { color: var(--foreground); }
.docs-nav li a[aria-current="page"] { color: var(--foreground); font-weight: 600; border-left-color: var(--primary); background: linear-gradient(90deg, #5b5bf71a, transparent); }
.docs-nav > ul:first-of-type { border-left: 0; }
.docs-nav > ul:first-of-type a { padding-left: 0; border-left: 0; }
.pro { display: inline-block; padding: 1px 7px; border-radius: 999px; font-family: var(--font-sans); font-size: 10px; font-weight: 700; letter-spacing: .06em; vertical-align: middle; color: var(--primary-bright); border: 1px solid #5b5bf766; background: #5b5bf714; }
h1 .pro { font-size: 13px; padding: 3px 10px; vertical-align: 6px; }

/* Search results */
.docs-results { margin-bottom: 16px; }
.docs-results a { display: block; padding: 10px 12px; border-radius: 12px; margin-bottom: 4px; }
.docs-results a:hover, .docs-results a.is-active { background: var(--muted); }
.docs-results b { display: block; font-size: 14px; }
.docs-results small { display: block; font-size: 12px; color: var(--primary-bright); margin-top: 2px; }
.docs-results span { display: block; font-size: 13px; color: var(--muted-foreground); margin-top: 4px; line-height: 1.5; }
.docs-results mark { background: #00f5d42e; color: var(--foreground); border-radius: 3px; padding: 0 2px; }
.docs-results p { font-size: 14px; color: var(--muted-foreground); padding: 8px 12px; }

/* ---------- Article ---------- */
.docs-main { min-width: 0; max-width: 780px; }
.docs-menu-btn { display: none; }
.docs-crumb { font-size: 13px; color: var(--muted-foreground); margin-bottom: 14px; }
.docs-crumb a { color: var(--primary-bright); }
.docs-crumb span { margin: 0 6px; opacity: .6; }
.docs-article { font-size: 16.5px; line-height: 1.75; color: color-mix(in srgb, var(--foreground) 86%, var(--muted-foreground)); }
.docs-article h1 { font-size: clamp(38px, 5vw, 54px); line-height: 1.02; color: var(--foreground); margin-bottom: 28px; }
.docs-article h2 { font-size: 32px; color: var(--foreground); margin: 56px 0 16px; scroll-margin-top: 96px; }
.docs-article h3 { font-size: 23px; color: var(--foreground); margin: 36px 0 10px; scroll-margin-top: 96px; }
.docs-article h4 { font-size: 18px; color: var(--foreground); margin: 28px 0 8px; }
.docs-article h2:first-of-type { margin-top: 32px; }
.anchor { margin-left: 10px; font-size: .7em; color: var(--muted-foreground); opacity: 0; transition: opacity .15s; }
h2:hover .anchor, h3:hover .anchor, h4:hover .anchor { opacity: 1; }
.docs-article p { margin: 0 0 16px; }
.docs-article strong { color: var(--foreground); font-weight: 600; }
.docs-article a { color: var(--primary-bright); text-decoration: underline; text-decoration-color: #a5a5ff66; text-underline-offset: 3px; }
.docs-article a.anchor { text-decoration: none; }
.docs-article ul, .docs-article ol { margin: 0 0 18px; padding-left: 22px; }
.docs-article li { margin: 6px 0; }
.docs-article li::marker { color: var(--primary-bright); }
.docs-article li > ul, .docs-article li > ol { margin: 6px 0 0; }
.docs-article hr { border: 0; height: 1px; background: var(--border); margin: 40px 0; }
.docs-article code { font-family: var(--font-mono); font-size: .86em; padding: 2px 6px; border-radius: 6px; background: var(--muted); color: var(--foreground); }
.docs-article pre { margin: 0 0 20px; padding: 18px 20px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); overflow-x: auto; }
.docs-article pre code { padding: 0; background: none; font-size: 14px; }
.table-wrap { margin: 0 0 22px; overflow-x: auto; border-radius: 14px; border: 1px solid var(--border); }
.docs-article table { width: 100%; border-collapse: collapse; font-size: 14.5px; line-height: 1.5; }
.docs-article th { text-align: left; font-weight: 600; color: var(--foreground); background: var(--muted); padding: 12px 16px; white-space: nowrap; }
.docs-article td { padding: 11px 16px; border-top: 1px solid var(--border); vertical-align: top; }
.docs-article tbody tr:hover td { background: #5b5bf70a; }
.callout { margin: 0 0 22px; padding: 16px 18px 16px 48px; border-radius: 14px; position: relative; font-size: 15px; line-height: 1.65; border: 1px solid; color: var(--foreground); }
.callout::before { content: ""; position: absolute; left: 16px; top: 18px; width: 18px; height: 18px; background: var(--c); mask: center/contain no-repeat; }
.callout--note { --c: var(--primary-bright); border-color: #5b5bf74d; background: #5b5bf712; }
.callout--note::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.callout--tip { --c: var(--accent); border-color: #00f5d44d; background: #00f5d40f; }
.callout--tip::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18h6M10 22h4M12 2a7 7 0 0 0-4 12.7V17h8v-2.3A7 7 0 0 0 12 2Z'/%3E%3C/svg%3E"); }
.callout--important { --c: var(--warning); border-color: #ffb0204d; background: #ffb0200f; }
.callout--important::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3'/%3E%3Cpath d='M12 9v4M12 17h.01'/%3E%3C/svg%3E"); }
.callout strong:first-child { color: var(--c); }

/* Prev / next + help */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.pager { display: block; padding: 18px 20px; border-radius: 16px; border: 1px solid var(--border); background: var(--card); transition: border-color .2s, transform .2s; }
.pager:hover { border-color: #5b5bf766; transform: translateY(-2px); }
.pager small { display: block; font-size: 12px; color: var(--muted-foreground); }
.pager b { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 700; margin-top: 4px; }
.pager--next { text-align: right; grid-column: 2; }
.docs-help { margin-top: 32px; font-size: 14px; color: var(--muted-foreground); }
.docs-help a { color: var(--primary-bright); }

/* ---------- On this page ---------- */
.docs-toc { position: sticky; top: 96px; max-height: calc(100vh - 112px); overflow-y: auto; font-size: 13px; }
.docs-toc p { font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted-foreground); margin-bottom: 10px; }
.docs-toc ul { list-style: none; margin: 0; padding: 0; border-left: 1px solid var(--border); }
.docs-toc a { display: block; padding: 5px 12px; margin-left: -1px; border-left: 2px solid transparent; color: var(--muted-foreground); line-height: 1.4; transition: color .15s, border-color .15s; }
.docs-toc .lvl3 a { padding-left: 24px; font-size: 12.5px; }
.docs-toc a:hover { color: var(--foreground); }
.docs-toc a.is-active { color: var(--foreground); border-left-color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .docs-layout { grid-template-columns: 240px minmax(0, 1fr); }
  .docs-toc { display: none; }
}
@media (max-width: 900px) {
  .docs-layout { display: block; padding-top: 100px; }
  .docs-side {
    position: fixed; z-index: 60; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); max-height: none;
    padding: 24px 20px; background: var(--popover); border-right: 1px solid var(--border); box-shadow: var(--elevation-2);
    transform: translateX(-105%); transition: transform .25s var(--ease);
  }
  .docs-side.is-open { transform: none; }
  .docs-scrim { position: fixed; inset: 0; z-index: 55; background: #0008; }
  .docs-menu-btn {
    display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; height: 38px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--input); background: var(--card); font-size: 14px;
  }
  .docs-menu-btn svg { width: 16px; height: 16px; }
  .docs-pager { grid-template-columns: 1fr; }
  .pager--next { grid-column: auto; }
}

/* body overflow-x: hidden (site.css) would break the sticky sidebar and TOC */
body.docs { overflow-x: visible; }
/* Search stays reachable when the sidebar is scrolled to the current page */
.docs-search { position: sticky; top: 0; z-index: 1; padding-bottom: 12px; margin-bottom: 8px; background: var(--background); }
@media (max-width: 900px) { .docs-search { background: var(--popover); } }
