/* Whispy docs layout. Tokens come from ../styles.css. */
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--green); color: var(--bg); padding: 8px 14px; border-radius: 8px; z-index: 10; }
.skip-link:focus { left: 8px; }

a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, pre:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

img { max-width: 100%; height: auto; }

.docs-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  max-width: var(--maxw); margin: 0 auto; padding: 16px;
}
.brand-docs { color: var(--muted); font-weight: 500; }

.os-switch { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; background: var(--bg-soft); }
.os-switch button {
  font: inherit; font-size: 0.9rem; color: var(--muted); background: transparent; border: 0; padding: 6px 16px; cursor: pointer;
}
.os-switch button[aria-pressed="true"] { background: var(--green); color: var(--bg); font-weight: 600; }

.docs-shell {
  max-width: var(--maxw); margin: 0 auto; padding: 8px 16px 48px;
  display: grid; grid-template-columns: 1fr; gap: 20px;
}
.docs-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.docs-nav a {
  color: var(--muted); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: 0.92rem;
}
.docs-nav a:hover { color: var(--text); }
.docs-nav a[aria-current="page"] { color: var(--green); border-color: rgba(36, 191, 158, 0.5); background: rgba(36, 191, 158, 0.08); }

.docs-main { min-width: 0; }
.docs-main h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); letter-spacing: -0.03em; line-height: 1.15; margin: 0 0 12px; }
.docs-main h2 { font-size: 1.35rem; margin: 2.2em 0 0.5em; letter-spacing: -0.02em; }
.docs-main h3 { font-size: 1.05rem; margin: 1.6em 0 0.4em; }
.docs-main p, .docs-main li { color: var(--text); overflow-wrap: anywhere; }
.docs-main .lede { color: var(--muted); max-width: 60ch; }
.docs-main a { color: var(--green); }
.docs-main a:hover { text-decoration: underline; }

pre {
  margin: 12px 0; padding: 14px 16px; background: var(--bg-soft); border: 1px solid var(--border);
  border-radius: 12px; overflow-x: auto; max-width: 100%; font-family: var(--mono); font-size: 0.86rem; line-height: 1.5;
}
pre code { color: var(--text); }
.copy-wrap { position: relative; }
.copy-wrap pre { margin: 12px 0; }
.copy-wrap pre { padding-top: 38px; }
.copy-btn, button[data-copy-target] {
  font: inherit; font-size: 0.8rem; color: var(--green); background: var(--bg-card);
  border: 1px solid rgba(36, 191, 158, 0.4); border-radius: 8px; padding: 4px 10px; cursor: pointer;
}
.copy-wrap .copy-btn { position: absolute; top: 14px; right: 10px; }
.copy-btn:hover, button[data-copy-target]:hover { background: rgba(36, 191, 158, 0.12); }
button[data-copy-target][hidden] { display: none; }

/* OS-specific content */
html[data-os="linux"] [data-os="macos"],
html[data-os="macos"] [data-os="linux"] { display: none; }
html:not([data-os]) [data-os]::before {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase; background: rgba(36, 191, 158, 0.12); color: var(--green);
  border: 1px solid rgba(36, 191, 158, 0.35); vertical-align: middle;
}
html:not([data-os]) [data-os="macos"]::before { content: "macOS"; }
html:not([data-os]) [data-os="linux"]::before { content: "Linux"; }

/* Cards (landing page) */
.cards { display: grid; grid-template-columns: 1fr; gap: 14px; margin: 24px 0; }
.card {
  display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px;
  transition: border-color 0.15s;
}
.card:hover { border-color: rgba(36, 191, 158, 0.5); text-decoration: none !important; }
.card h2 { margin: 0 0 6px; font-size: 1.1rem; color: var(--text); }
.card p { margin: 0; color: var(--muted); }

/* Checklist */
.checklist { list-style: none; padding: 0; margin: 12px 0; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); }
.checklist input { margin-top: 5px; width: 18px; height: 18px; accent-color: var(--green); flex: none; }
.checklist .step-body { min-width: 0; flex: 1; }

/* Notes */
.note { border-left: 3px solid var(--green); background: var(--bg-soft); padding: 10px 14px; border-radius: 0 10px 10px 0; margin: 14px 0; }
.note p { margin: 0; }

/* Troubleshooting + FAQ */
details {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 0 16px; margin: 10px 0;
}
details > summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
details[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
details details { background: var(--bg-soft); }
details details > summary { font-weight: 500; }
details > :last-child { margin-bottom: 14px; }
.confirm { color: var(--muted); font-size: 0.92rem; }

/* Shown only when JavaScript is off (the head script always sets data-os otherwise) */
html[data-os] .no-js-only { display: none; }

/* Tables */
.table-scroll { overflow-x: auto; max-width: 100%; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
thead th { color: var(--muted); font-weight: 600; }
.group-row th { color: var(--green); background: var(--bg-soft); text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
#config-reference { min-width: 640px; }
#config-reference td:nth-child(1) code, #config-reference td:nth-child(2) code { white-space: nowrap; }
#config-reference td:nth-child(1), #config-reference td:nth-child(2) { overflow-wrap: normal; }
#config-reference thead th { white-space: nowrap; }
#config-reference td:nth-child(3) { min-width: 7rem; }
#config-reference td:nth-child(4) { min-width: 14rem; }
#config-reference tr:target td { background: rgba(36, 191, 158, 0.1); }

.docs-footer {
  max-width: var(--maxw); margin: 0 auto; padding: 24px 16px 40px; border-top: 1px solid var(--border);
  display: flex; flex-wrap: wrap; gap: 8px 24px; color: var(--muted); font-size: 0.9rem;
}
.docs-footer a { color: var(--green); }

@media (min-width: 860px) {
  .docs-shell { grid-template-columns: 200px minmax(0, 1fr); gap: 40px; }
  .docs-nav { flex-direction: column; flex-wrap: nowrap; position: sticky; top: 16px; align-self: start; }
  .docs-nav a { border-radius: 10px; }
  .cards { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
