/* Site additions: documentation, download metadata, small polish. */

/* The generic .site-nav a rule would otherwise override the button's color and padding. */
.site-header .site-nav a.btn {
  color: #fff;
  padding: 5px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}
.site-header .site-nav a.btn:hover {
  color: #fff;
}

.page-head { padding: var(--sp-8) 0 var(--sp-6); }
.page-head h1 { font-size: 30px; margin-bottom: 6px; letter-spacing: -.04em; }
.page-head p { color: var(--text-muted); font-size: 14px; }
.section-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); margin-bottom: 6px; }

.download-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 18px;
}

.filter-row button {
  border: 1px solid var(--border-soft);
  background: var(--bg-surface);
  color: var(--text-muted);
  border-radius: var(--r-sm);
  padding: 8px 14px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.filter-row button:hover,
.filter-row button.active {
  border-color: var(--brand-300);
  background: var(--brand-50);
  color: var(--brand-700);
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.resource-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 20px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
}

.resource-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.resource-type {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--brand-700);
}

.resource-card h2 {
  font-size: 18px;
  margin: 0 0 4px;
  line-height: 1.35;
}

.resource-id {
  color: var(--text-faint);
  font-size: 11px;
  margin-bottom: 14px;
  word-break: break-all;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--text-muted);
  font-size: 11.5px;
  margin-top: auto;
}

.resource-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--brand-700);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
}

.resource-link:hover {
  text-decoration: underline;
}

.resource-empty {
  grid-column: 1 / -1;
  padding: 44px 18px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px dashed var(--border-soft);
  border-radius: var(--r-md);
}

@media (max-width: 800px) {
  .resource-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 520px) {
  .resource-grid {
    grid-template-columns: 1fr;
  }
}

.download-meta span::before {
  content: "·";
  margin-right: 8px;
  color: var(--brand-500);
}

.docs-links .system {
  display: block;
  color: inherit;
  text-decoration: none;
}

.docs-links .system:hover {
  border-color: var(--brand-300);
  transform: translateY(-2px);
}

.docs-layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: 46px;
  padding: 38px 0 76px;
}

.docs-side {
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 22px);
}

.docs-side h2 {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-faint);
  margin: 0 0 10px;
}

.docs-side nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-side a {
  display: block;
  padding: 9px 11px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 13.5px;
  text-decoration: none;
}

.docs-side a:hover {
  background: var(--bg-subtle);
  color: var(--brand-700);
}

.docs-side a.active {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

.docs-content {
  min-width: 0;
}

.docs-content .doc-status {
  color: var(--text-faint);
  font-size: 12px;
  margin-bottom: 18px;
}

.doc-body {
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.doc-body h1,
.doc-body h2,
.doc-body h3,
.doc-body h4 {
  line-height: 1.3;
  letter-spacing: -.025em;
  margin: 1.7em 0 .65em;
}

.doc-body h1 {
  font-size: 32px;
  margin-top: 0;
}

.doc-body h2 {
  font-size: 23px;
  padding-top: .55em;
  border-top: 1px solid var(--border-soft);
}

.doc-body h3 {
  font-size: 17px;
}

.doc-body p,
.doc-body ul,
.doc-body ol {
  margin: 0 0 1em;
}

.doc-body ul,
.doc-body ol {
  padding-left: 1.4em;
}

.doc-body li {
  margin: .25em 0;
}

.doc-body a {
  color: var(--brand-700);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.doc-body code {
  font-family: var(--font-mono);
  font-size: .9em;
  background: var(--bg-subtle);
  padding: .12em .35em;
  border-radius: 3px;
}

.doc-body pre {
  background: var(--ink-900);
  color: #ece8f5;
  padding: 16px 18px;
  border-radius: var(--r-md);
  overflow-x: auto;
  line-height: 1.55;
  margin: 1.1em 0 1.4em;
}

.doc-body pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: 12.5px;
}

.doc-body blockquote {
  margin: 1.2em 0;
  padding: 10px 16px;
  border-left: 3px solid var(--brand-300);
  background: var(--brand-50);
  color: var(--text-muted);
}

.doc-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0 1.6em;
  font-size: 13px;
}

.doc-body th,
.doc-body td {
  border: 1px solid var(--border-soft);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.doc-body th {
  background: var(--bg-subtle);
  font-weight: 600;
}

.doc-body hr {
  border: 0;
  border-top: 1px solid var(--border-soft);
  margin: 2em 0;
}

.doc-loading {
  padding: 40px 0;
  color: var(--text-muted);
}

.doc-error {
  padding: 14px 16px;
  border: 1px solid var(--err-200, #f5c2c7);
  background: #fff5f6;
  color: var(--err-700, #842029);
  border-radius: var(--r-md);
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding-top: 22px;
  }
  .docs-side {
    position: static;
  }
  .docs-side nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .docs-side a {
    background: var(--bg-subtle);
  }
}

@media (max-width: 640px) {
  .site-header .brand-text {
    display: none;
  }
  .site-header .wrap {
    padding-left: 12px;
    padding-right: 12px;
    min-width: 0;
  }
  .site-header .site-nav {
    gap: 6px;
    min-width: 0;
  }
  .site-header .site-nav a:not(.btn) {
    font-size: 12px;
    white-space: nowrap;
    padding-left: 0;
    padding-right: 0;
  }
  .site-header .site-nav a[href="#why"],
  .site-header .site-nav a[href="#journey"],
  .site-header .site-nav a[href="/#why"],
  .site-header .site-nav a[href="/#journey"],
  .site-header .site-nav a[href="/resources.html"] {
    display: none;
  }
  .site-header .site-nav .btn {
    padding: 6px 8px;
    font-size: 11px;
    min-width: 0;
    white-space: nowrap;
  }
  .site-header .site-nav a[href="/docs.html"] {
    display: none;
  }
}
