/* spec.css — additional styles for the rendered ISA specification.
 *
 * Extends /css/style.css with typography, layout, and component styles
 * specific to the long-form Markdown-rendered spec.
 *
 * Loaded after style.css so its rules win on conflict.
 */

/* ---------- Layout ------------------------------------------------------ */

.spec-header {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border, #2a2a2a);
}

.spec-header .tagline {
  margin-top: 0.75rem;
  opacity: 0.75;
}

.spec-toc {
  margin: 2rem 0 3rem 0;
  padding: 1.5rem 1.75rem;
  background: var(--panel, #161616);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 4px;
}

.spec-toc .section-label {
  margin-bottom: 0.75rem;
}

.spec-toc ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.spec-toc ul ul {
  padding-left: 1.25rem;
  margin-top: 0.25rem;
  border-left: 1px solid var(--border, #2a2a2a);
  padding-left: 1rem;
}

.spec-toc li {
  margin: 0.35rem 0;
  font-size: 0.92rem;
  line-height: 1.4;
}

.spec-toc a {
  color: var(--text, #e6e6e6);
  text-decoration: none;
  opacity: 0.8;
}

.spec-toc a:hover {
  opacity: 1;
  color: var(--accent, #7ac6ff);
}

/* ---------- Article body ------------------------------------------------ */

.spec-body {
  max-width: 100%;
  line-height: 1.65;
}

.spec-body h1,
.spec-body h2,
.spec-body h3,
.spec-body h4,
.spec-body h5,
.spec-body h6 {
  scroll-margin-top: 1.5rem;     /* anchored jumps don't hide under top */
  position: relative;
}

.spec-body h1 {
  font-size: 2.1rem;
  margin: 0 0 1.5rem 0;
  line-height: 1.2;
}

.spec-body h2 {
  font-size: 1.55rem;
  margin: 3rem 0 1rem 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #2a2a2a);
}

.spec-body h3 {
  font-size: 1.2rem;
  margin: 2rem 0 0.75rem 0;
}

.spec-body h4 {
  font-size: 1.05rem;
  margin: 1.5rem 0 0.5rem 0;
  opacity: 0.9;
}

.spec-body p {
  margin: 0.75rem 0 1rem 0;
}

.spec-body ul,
.spec-body ol {
  margin: 0.75rem 0 1rem 0;
  padding-left: 1.5rem;
}

.spec-body li {
  margin: 0.35rem 0;
}

/* ---------- Permalink anchors -------------------------------------------- */

.spec-body .headerlink {
  margin-left: 0.5rem;
  opacity: 0;
  text-decoration: none;
  color: var(--accent, #7ac6ff);
  font-weight: normal;
  transition: opacity 0.15s;
}

.spec-body h1:hover .headerlink,
.spec-body h2:hover .headerlink,
.spec-body h3:hover .headerlink,
.spec-body h4:hover .headerlink,
.spec-body h5:hover .headerlink,
.spec-body h6:hover .headerlink {
  opacity: 0.6;
}

.spec-body .headerlink:hover {
  opacity: 1 !important;
}

/* ---------- Tables ------------------------------------------------------- */

.spec-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: 0.9rem;
}

.spec-body th,
.spec-body td {
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, #2a2a2a);
  vertical-align: top;
}

.spec-body th {
  font-weight: 600;
  border-bottom: 2px solid var(--border, #2a2a2a);
}

.spec-body tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* ---------- Code -------------------------------------------------------- */

.spec-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  background: var(--panel, #161616);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 3px;
  color: var(--code-fg, #e8e2d8);
}

.spec-body pre {
  background: var(--panel, #161616);
  border: 1px solid var(--border, #2a2a2a);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-size: 0.85rem;
  line-height: 1.5;
}

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

/* ---------- Blockquotes ------------------------------------------------- */

.spec-body blockquote {
  margin: 1.25rem 0;
  padding: 0.75rem 1.25rem;
  border-left: 3px solid var(--accent, #7ac6ff);
  background: rgba(255, 255, 255, 0.02);
  opacity: 0.92;
}

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

.spec-body blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------- Horizontal rules -------------------------------------------- */

.spec-body hr {
  border: none;
  border-top: 1px solid var(--border, #2a2a2a);
  margin: 2.5rem 0;
}

/* ---------- Footnotes --------------------------------------------------- */

.spec-body .footnote {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border, #2a2a2a);
}

/* ---------- Sticky TOC on wide screens ---------------------------------- */
/* Optional: uncomment if you want the TOC to follow the reader on desktop.
 * Requires no other layout change. Disabled by default for simplicity.
 *
 * @media (min-width: 1400px) {
 *   .spec-toc {
 *     position: sticky;
 *     top: 1.5rem;
 *     max-height: calc(100vh - 3rem);
 *     overflow-y: auto;
 *   }
 * }
 */
