/* KYE Protocol™ Whitepaper — typographic styles atop the main site theme. */

.wp-body { background: var(--bg); }

.wp-main {
  max-width: 1200px; margin: 0 auto; padding: 64px 24px 96px;
  display: grid; grid-template-columns: 240px 1fr; gap: 56px; align-items: start;
}
@media (max-width: 980px) { .wp-main { grid-template-columns: 1fr; gap: 32px; padding: 48px 20px 72px; } }
@media (max-width: 600px) { .wp-main { padding: 32px 16px 56px; } }

.wp-toc {
  position: sticky; top: 88px;
  background: rgba(255,255,255,0.78); border: 1px solid var(--line);
  border-radius: var(--radius-2); padding: 18px 20px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  font-size: var(--type-13);
}
.wp-toc-title {
  font-size: var(--type-11); letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 600; margin-bottom: 10px;
}
.wp-toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.wp-toc a { color: var(--text-muted); text-decoration: none; transition: color .12s; }
.wp-toc a:hover { color: var(--accent); }

.wp-article {
  background: rgba(255,255,255,0.78); border: 1px solid var(--line);
  border-radius: var(--radius-3); padding: 56px 56px 72px;
  box-shadow: var(--shadow-2);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
@media (max-width: 700px) { .wp-article { padding: 36px 24px 48px; } }
@media (max-width: 480px) { .wp-article { padding: 28px 18px 40px; } .wp-article h1 { font-size: var(--type-28); } .wp-article h2 { font-size: var(--type-22); margin-top: 40px; } .wp-article p, .wp-records li, .wp-principles li, .wp-refs li { font-size: var(--type-14); } .wp-table { font-size: var(--type-13); display: block; overflow-x: auto; } .wp-toc { position: static; padding: 14px 16px; } }

.wp-meta {
  font-size: var(--type-12); color: var(--text-dim); letter-spacing: 0.04em; margin: 0 0 14px;
}
.wp-meta a { color: var(--accent); text-decoration: none; }
.wp-meta a:hover { text-decoration: underline; }

.wp-article h1 {
  font-size: clamp(40px, 6vw, 64px); font-weight: 800;
  letter-spacing: -0.03em; line-height: 1.05; margin: 0 0 22px;
}
.wp-article h2 {
  font-size: clamp(24px, 2.8vw, 38px); font-weight: 700;
  letter-spacing: -0.02em;
  margin: 64px 0 16px; color: var(--text);
  padding-top: 28px; border-top: 1px solid var(--line);
}
.wp-article h3 {
  font-size: var(--type-16); font-weight: 600; letter-spacing: -0.01em;
  margin: 28px 0 8px; color: var(--text);
}
.wp-lede {
  font-size: var(--type-18); line-height: 1.6; color: var(--text-muted);
  margin: 0 0 12px;
  border-left: 4px solid var(--accent);
  padding: 4px 0 4px 20px;
}
.wp-article p { font-size: var(--type-16); line-height: 1.78; color: var(--text-muted); margin: 0 0 14px; }
.wp-article p strong { color: var(--text); }
.wp-article p em { color: var(--text); font-style: italic; }
.wp-article code {
  font-family: var(--font-mono); font-size: var(--type-13);
  background: var(--accent-soft); color: var(--accent);
  padding: 2px 6px; border-radius: 4px;
}
.wp-article a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.wp-records, .wp-principles, .wp-refs {
  margin: 0 0 14px; padding-left: 22px; line-height: 1.78; color: var(--text-muted);
}
.wp-records li, .wp-principles li, .wp-refs li { margin: 6px 0; font-size: var(--type-14); }
.wp-records li strong, .wp-principles li strong { color: var(--text); }
.wp-principles { padding-left: 22px; }

.wp-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: 18px 0 22px; font-size: var(--type-14);
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: var(--radius-2); overflow: hidden;
}
.wp-table th, .wp-table td { padding: 12px 14px; text-align: left; vertical-align: top; }
.wp-table thead th {
  background: rgba(99, 102, 241, 0.08); color: var(--text-dim);
  font-weight: 600; font-size: var(--type-11); text-transform: uppercase; letter-spacing: 0.10em;
  border-bottom: 1px solid var(--line-strong);
}
.wp-table tbody tr { border-top: 1px solid var(--line-soft); }
.wp-table tbody tr:first-child { border-top: none; }
.wp-table tbody td { color: var(--text-muted); }
.wp-table tbody td:first-child { color: var(--text); font-weight: 500; }

.wp-cite {
  margin-top: 48px; padding: 16px 20px;
  background: var(--accent-soft); border-radius: var(--radius-2);
  font-size: var(--type-13); color: var(--text-muted); border-left: 3px solid var(--accent);
}
.wp-cite code { background: transparent; padding: 0; color: var(--accent); }

/* Canonical inventory tables — denser, locked-grid feel. */
.wp-inv-table { font-size: var(--type-13); }
.wp-inv-table th, .wp-inv-table td { padding: 10px 12px; vertical-align: top; }
.wp-inv-table tbody td:first-child { color: var(--text-dim); font-weight: 600; text-align: center; width: 3em; }
.wp-inv-ns code { background: transparent; color: var(--text); padding: 0; }

/* Scroll-spy: active TOC item. */
.wp-toc a.active {
  color: var(--accent);
  font-weight: 600;
  position: relative;
}
.wp-toc a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.wp-toc li { transition: padding-left .15s ease; }

/* Hover-anchor permalinks on headings. */
.wp-article h2, .wp-article h3 { position: relative; scroll-margin-top: 100px; }
.wp-article h2 a.hash-anchor,
.wp-article h3 a.hash-anchor {
  position: absolute;
  left: -28px;
  top: 50%;
  transform: translateY(-50%);
  font-size: var(--type-16);
  font-weight: 400;
  color: var(--text-dim);
  text-decoration: none;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
  padding: 0 6px;
  border-radius: 4px;
  line-height: 1;
}
.wp-article h2:hover a.hash-anchor,
.wp-article h3:hover a.hash-anchor,
.wp-article h2 a.hash-anchor:focus,
.wp-article h3 a.hash-anchor:focus {
  opacity: 1;
  color: var(--accent);
}
.wp-article h2 a.hash-anchor.copied,
.wp-article h3 a.hash-anchor.copied {
  opacity: 1;
  color: var(--accent);
  background: var(--accent-soft);
}
@media (max-width: 700px) {
  .wp-article h2 a.hash-anchor,
  .wp-article h3 a.hash-anchor { display: none; }
}

/* Cross-reference links to schemas/specs. */
.wp-xref {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed var(--accent);
  padding-bottom: 1px;
}
.wp-xref:hover { border-bottom-style: solid; }

/* Print stylesheet — strip chrome, optimise typography for paper. */
@media print {
  .top-bar, .footer, .kye-breadcrumbs-host, .skip-link,
  .wp-toc, .wp-actions, .wp-related,
  [data-kye-header], [data-kye-footer], [data-kye-breadcrumbs], [data-kye-related],
  #scroll-top, [data-kye-scroll-top],
  .wp-article h2 a.hash-anchor, .wp-article h3 a.hash-anchor {
    display: none !important;
  }
  body, .wp-body { background: var(--color-paper) !important; }
  .wp-main { display: block; max-width: none; padding: 0; }
  .wp-article {
    background: var(--color-paper) !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    backdrop-filter: none !important;
  }
  body { font-size: 11pt; color: #000; }
  .wp-article p, .wp-records li, .wp-principles li, .wp-refs li { font-size: 10.5pt; line-height: 1.55; color: #111; }
  .wp-article h1 { font-size: 22pt; page-break-after: avoid; }
  .wp-article h2 { font-size: 14pt; page-break-after: avoid; border-top: 1px solid #999; padding-top: 12pt; margin-top: 18pt; }
  .wp-article h3 { font-size: 12pt; page-break-after: avoid; }
  .wp-table { font-size: 9.5pt; page-break-inside: avoid; }
  a { color: #000; text-decoration: underline; }
  code { background: var(--color-brand-50) !important; color: #000 !important; }
}
