/* standards.css — IETF Internet-Draft presentation layer */

.std-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
  display: grid;
  grid-template-columns: 220px 1fr 240px;
  gap: 2rem;
}
@media (max-width: 1100px) { .std-page { grid-template-columns: 200px 1fr; } .std-side { display: none; } }
@media (max-width: 800px) { .std-page { grid-template-columns: 1fr; } .std-toc { display: none; } }

/* ── Top header banner (status, version, etc.) ─────────────────────────── */
.std-marquee {
  grid-column: 1 / -1;
  padding: 1.85rem 1.85rem 1.5rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15,118,110,0.08), transparent 60%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  margin-bottom: 0.5rem;
}
body.dark-mode .std-marquee { background: linear-gradient(135deg, rgba(15,118,110,0.18), transparent 60%); border-color: rgba(255,255,255,0.08); }
.std-marquee h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 0.4rem; }
.std-marquee .std-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0F766E;
  margin-bottom: 0.85rem;
}
body.dark-mode .std-marquee .std-tag { background: rgba(15,118,110,0.25); color: #5FD7D2; }
.std-marquee .std-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
  font-size: 0.85rem;
  margin-top: 0.85rem;
  opacity: 0.85;
}
.std-marquee .std-meta strong { color: #0F766E; margin-right: 0.3rem; }
body.dark-mode .std-marquee .std-meta strong { color: #5FD7D2; }

/* ── TOC sidebar ───────────────────────────────────────────────────────── */
.std-toc {
  position: sticky;
  top: 80px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 0.85rem;
}
.std-toc h4 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.6;
  margin: 0 0 0.5rem;
}
.std-toc ul { list-style: none; padding: 0; margin: 0; }
.std-toc li { padding: 0; }
.std-toc a {
  display: block;
  padding: 0.3rem 0.65rem;
  border-left: 2px solid transparent;
  text-decoration: none;
  color: inherit;
  opacity: 0.75;
  transition: all 0.15s;
}
.std-toc a:hover { opacity: 1; border-left-color: rgba(15,118,110,0.4); }
.std-toc a.active { opacity: 1; color: #0F766E; border-left-color: #0F766E; font-weight: 600; background: rgba(15,118,110,0.06); }
body.dark-mode .std-toc a.active { color: #5FD7D2; border-left-color: #5FD7D2; background: rgba(95,215,210,0.08); }
.std-toc .lvl-3 { padding-left: 1.25rem; font-size: 0.78rem; }

/* ── Article column ───────────────────────────────────────────────────── */
.std-article {
  min-width: 0;
}
.std-article .std-banner {
  display: block;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
  border: 1px solid rgba(217, 119, 6, 0.25);
  font-size: 0.85rem;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}
body.dark-mode .std-article .std-banner { background: rgba(217, 119, 6, 0.18); border-color: rgba(217, 119, 6, 0.4); color: #fbd38d; }

.std-draft { font-size: 1rem; line-height: 1.75; }
.std-draft .lede { font-family: ui-monospace, "SF Mono", monospace; font-size: 1rem; opacity: 0.7; margin-bottom: 0.5rem; }
.std-draft h1 { display: none; } /* h1 rendered in marquee */
.std-draft h2 {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 2.25rem 0 0.85rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  scroll-margin-top: 80px;
}
body.dark-mode .std-draft h2 { border-top-color: rgba(255,255,255,0.08); }
.std-draft h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  scroll-margin-top: 80px;
}
.std-draft p { margin: 0 0 0.85rem; }
.std-draft code {
  font-family: ui-monospace, "SF Mono", monospace;
  background: rgba(15, 118, 110, 0.08);
  color: #0F766E;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  font-size: 0.92em;
}
body.dark-mode .std-draft code { background: rgba(95,215,210,0.12); color: #5FD7D2; }
.std-draft dl {
  margin: 0.85rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.03);
}
body.dark-mode .std-draft dl { background: rgba(255,255,255,0.03); }
.std-draft dt { font-weight: 700; margin-top: 0.55rem; }
.std-draft dt:first-child { margin-top: 0; }
.std-draft dd { margin: 0.15rem 0 0 1rem; opacity: 0.85; }
.std-draft ul { padding-left: 1.5rem; margin: 0 0 0.85rem; }
.std-draft ul li { margin: 0.25rem 0; }
.std-draft article { margin-top: 0; }

.std-draft h2#refs-normative,
.std-draft h2#refs-informative,
.std-draft h2#authors {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.75;
}

.std-authors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-top: 0.85rem;
}
.std-authors p {
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
  font-size: 0.85rem;
  line-height: 1.5;
  margin: 0;
}
body.dark-mode .std-authors p { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
.std-authors p strong { display: block; font-size: 0.95rem; margin-bottom: 0.25rem; }

/* ── Right-side panel (downloads + related) ───────────────────────────── */
.std-side {
  position: sticky;
  top: 80px;
  align-self: flex-start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.std-side .panel {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: rgba(15, 23, 42, 0.02);
}
body.dark-mode .std-side .panel { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); }
.std-side .panel h4 {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  opacity: 0.6;
  margin: 0 0 0.55rem;
}
.std-side .panel a {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 0.85rem;
  opacity: 0.85;
  transition: all 0.15s;
}
.std-side .panel a:hover { background: rgba(15, 118, 110, 0.08); opacity: 1; color: #0F766E; }
body.dark-mode .std-side .panel a:hover { color: #5FD7D2; background: rgba(95,215,210,0.1); }
.std-side .panel a.active { background: rgba(15, 118, 110, 0.1); color: #0F766E; font-weight: 700; opacity: 1; }
body.dark-mode .std-side .panel a.active { background: rgba(95,215,210,0.12); color: #5FD7D2; }

/* Hide the legacy std-downloads block (replaced by side panel) and old std-meta */
.std-draft > .std-downloads,
.std-draft > .std-meta,
.std-draft > .std-banner { display: none; }
