/* Styling for the static docs site (dist/docs/**). Loaded by both the static
   pages (rendered by scripts/buildDocsSite.mjs, which copies this file
   verbatim to dist/docs-site.css) and nothing else — the in-app Ionic docs
   pages use src/pages/docs/docs.css instead, since Ionic ships its own
   component styling.

   Built on the CSS custom properties from variables.css and tokens.css
   (copied alongside this file at build time), so light/dark follows the same
   `ion-palette-dark` class the theme-init script applies to <html> — no
   separate dark-mode logic needed here. Visual language matches
   src/pages/brochure/brochure.css without importing it, since the static
   site has no build-time access to the app's component tree. */

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--ion-background-color);
  color: var(--ion-text-color);
  font-family: var(--aqua-font-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--aqua-flow);
}

.docs-site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.docs-site__main {
  flex: 1;
  width: 100%;
}

/* ─── Header ──────────────────────────────────────────────────────────────── */

.docs-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--aqua-glass-border);
}

.docs-site-header__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ion-text-color);
}

.docs-site-header__drop {
  font-size: 22px;
  line-height: 1;
}

.docs-site-header__wordmark {
  font-family: var(--aqua-font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.docs-site-header__nav {
  display: flex;
  gap: 20px;
}

.docs-site-header__link {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--aqua-text-muted);
}

.docs-site-header__link:hover {
  color: var(--ion-text-color);
}

/* ─── Landing page ────────────────────────────────────────────────────────── */

.docs-landing {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.docs-landing__intro {
  margin-bottom: 48px;
}

.docs-landing__heading {
  font-family: var(--aqua-font-display);
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

.docs-landing__subheading {
  font-size: 16px;
  line-height: 1.6;
  color: var(--aqua-text-muted);
  max-width: 620px;
  margin: 0;
}

.docs-landing__section-heading {
  font-family: var(--aqua-font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 20px;
}

.docs-landing__popular {
  margin-bottom: 56px;
}

.docs-landing__tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-tile {
  margin: 0;
}

.docs-tile__link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  padding: 20px;
  border-radius: var(--aqua-radius-sm);
  background: var(--aqua-glass-bg);
  border: 1px solid var(--aqua-glass-border);
  text-decoration: none;
  color: var(--ion-text-color);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.docs-tile__link:hover {
  border-color: var(--aqua-flow);
  transform: translateY(-2px);
}

.docs-tile__icon {
  font-size: 26px;
  line-height: 1;
}

.docs-tile__title {
  font-family: var(--aqua-font-display);
  font-size: 16px;
  font-weight: 700;
}

.docs-tile__summary {
  font-size: 13px;
  line-height: 1.55;
  color: var(--aqua-text-muted);
}

/* ─── Full index ──────────────────────────────────────────────────────────── */

.docs-index__category {
  margin-bottom: 40px;
}

.docs-index__category-heading {
  font-family: var(--aqua-font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--aqua-flow);
  margin: 0 0 16px;
}

.docs-index__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.docs-index__entry {
  border-bottom: 1px solid var(--aqua-glass-border);
  padding-bottom: 18px;
}

.docs-index__link {
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ion-text-color);
}

.docs-index__link:hover {
  color: var(--aqua-flow);
}

.docs-index__summary {
  font-size: 14px;
  color: var(--aqua-text-muted);
  margin: 6px 0 0;
}

/* ─── Article page ────────────────────────────────────────────────────────── */

.docs-article {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

.docs-article__back {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--aqua-text-muted);
  margin-bottom: 20px;
}

.docs-article__back:hover {
  color: var(--aqua-flow);
}

.docs-article__icon {
  display: block;
  font-size: 34px;
  margin-bottom: 12px;
}

.docs-article__title {
  font-family: var(--aqua-font-display);
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}

.docs-article__summary {
  font-size: 16px;
  color: var(--aqua-text-muted);
  line-height: 1.6;
  margin: 0 0 36px;
}

/* Constrains body text to a comfortable reading measure while the outer
   .docs-article can stay wider for the header. */
.docs-article__body {
  max-width: 66ch;
  font-size: 16px;
  line-height: 1.75;
}

.docs-article__body h2 {
  font-family: var(--aqua-font-display);
  font-size: 22px;
  font-weight: 700;
  margin: 36px 0 12px;
}

.docs-article__body h3 {
  font-family: var(--aqua-font-display);
  font-size: 18px;
  font-weight: 700;
  margin: 28px 0 10px;
}

.docs-article__body p {
  margin: 0 0 16px;
}

.docs-article__body ul,
.docs-article__body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.docs-article__body li {
  margin-bottom: 6px;
}

.docs-article__body a {
  color: var(--aqua-flow);
}

.docs-article__body strong {
  color: var(--ion-text-color);
}

.docs-article__body hr {
  border: none;
  border-top: 1px solid var(--aqua-glass-border);
  margin: 32px 0;
}

.docs-article__body blockquote {
  margin: 0 0 16px;
  padding: 4px 20px;
  border-left: 3px solid var(--aqua-flow);
  color: var(--aqua-text-muted);
}

/* Code and tables scroll horizontally inside their own container rather than
   widening the page — long shell commands and wide tables are common in
   docs prose. */
.docs-article__body pre {
  overflow-x: auto;
  background: var(--aqua-glass-bg-strong);
  border: 1px solid var(--aqua-glass-border);
  border-radius: var(--aqua-radius-sm);
  padding: 16px;
  margin: 0 0 16px;
}

.docs-article__body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.docs-article__body p code {
  background: var(--aqua-glass-bg-strong);
  padding: 2px 6px;
  border-radius: 6px;
}

.docs-article__body table {
  display: block;
  overflow-x: auto;
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 16px;
}

.docs-article__body th,
.docs-article__body td {
  border: 1px solid var(--aqua-glass-border);
  padding: 8px 12px;
  text-align: left;
  font-size: 14px;
}

/* ─── Footer ──────────────────────────────────────────────────────────────── */

.docs-site-footer {
  border-top: 1px solid var(--aqua-glass-border);
  padding: 28px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.docs-site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.docs-site-footer__link {
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  color: var(--aqua-text-muted);
}

.docs-site-footer__link:hover {
  color: var(--ion-text-color);
}

.docs-site-footer__copy {
  font-size: 12px;
  color: var(--aqua-text-faint);
  margin: 0;
}

/* ─── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .docs-landing,
  .docs-article {
    padding-left: 18px;
    padding-right: 18px;
  }

  .docs-site-header {
    padding: 14px 18px;
  }
}
