/* Antheos Spec — styles for protocol specification pages.
   Used alongside the base style.css (dark mode) */

/* Spec page header */

.spec-header {
  padding: 8rem 0 2rem;
  border-bottom: 0.5px solid var(--border);
}

.spec-header h1 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 600;
  line-height: 1.25;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.spec-subtitle {
  font-size: 1.1rem;
  color: var(--lead);
  margin: 0 0 0.4rem;
}

.spec-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* Table of Contents */

.spec-toc {
  background: var(--bg-surface);
  border: 0.5px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
}

.spec-toc h2 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.spec-toc ol {
  margin: 0;
  padding-left: 1.5rem;
  columns: 2;
  column-gap: 2rem;
}

.spec-toc li {
  margin: 0.25rem 0;
  font-size: 0.9rem;
  break-inside: avoid;
}

.spec-toc a {
  color: var(--text);
  text-decoration: none;
}

.spec-toc a:hover {
  color: var(--lead);
}

/* Spec body */

.spec-body {
  padding-bottom: 2rem;
}

.spec-body section {
  padding: 2.5rem 0 1.5rem;
  border-bottom: 0.5px solid var(--border);
}

.spec-body section:last-child {
  border-bottom: none;
}

/* Headings */

.spec-body h2 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid rgba(74, 122, 154, 0.3);
}

.spec-body h3 {
  font-family: 'Instrument Sans', sans-serif;
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--text);
  margin: 2rem 0 0.8rem;
}

.spec-body h3:first-child {
  margin-top: 0;
}

.spec-body h4 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  margin: 1.5rem 0 0.6rem;
}

/* Text */

.spec-body p {
  color: var(--text-soft);
  margin: 0 0 0.8rem;
  line-height: 1.7;
}

.spec-body strong {
  color: var(--text);
  font-weight: 600;
}

/* Tables */

.spec-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 1.5rem;
  font-size: 0.88rem;
}

.spec-body thead {
  border-bottom: 2px solid rgba(74, 122, 154, 0.3);
}

.spec-body th {
  text-align: left;
  padding: 0.5rem 0.8rem;
  color: var(--text);
  font-weight: 600;
}

.spec-body td {
  padding: 0.45rem 0.8rem;
  color: var(--text-soft);
  border-bottom: 0.5px solid var(--border);
  vertical-align: top;
}

.spec-body td code {
  font-size: 0.84rem;
}

.spec-body tbody tr:hover {
  background: var(--bg-hover);
}

/* Code blocks */

.spec-body pre {
  background: var(--bg-raised);
  border: 0.5px solid var(--border-hover);
  border-radius: 8px;
  padding: 1rem 1.2rem;
  overflow-x: auto;
  margin: 0.8rem 0;
  font-size: 0.84rem;
  line-height: 1.65;
}

.spec-body pre code {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

/* Wire example notes */

.wire-note {
  font-size: 0.84rem;
  color: var(--text-muted);
  font-style: italic;
  margin: -0.3rem 0 1.2rem;
}

/* Lists */

.spec-body ul,
.spec-body ol {
  color: var(--text-soft);
  padding-left: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.spec-body li {
  margin: 0.3rem 0;
  line-height: 1.65;
}

.spec-body li strong {
  color: var(--text);
}

/* Horizontal rule */

.spec-body hr {
  border: none;
  border-top: 0.5px solid var(--border);
  margin: 2rem 0;
}

/* Back-to-top link */

.spec-top {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}

.spec-top:hover {
  color: var(--lead);
}

/* Download button */

.btn-ghost {
  display: inline-flex;
  align-items: center;
  padding: 0.65rem 1.5rem;
  background: transparent;
  border: 0.5px solid var(--border-hover);
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 400;
  font-family: 'IBM Plex Sans', sans-serif;
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease;
}

.btn-ghost:hover {
  background: var(--bg-hover);
}

/* Responsive */

@media (max-width: 720px) {
  .spec-header {
    padding: 6rem 0 1.5rem;
  }

  .spec-toc ol {
    columns: 1;
  }

  .spec-toc {
    padding: 1rem 1.2rem;
  }

  .spec-body table {
    display: block;
    overflow-x: auto;
    font-size: 0.8rem;
  }

  .spec-body th,
  .spec-body td {
    padding: 0.3rem 0.5rem;
  }

  .spec-body pre {
    font-size: 0.78rem;
    padding: 0.8rem;
    border-radius: 6px;
  }
}
