/* ===== BimaNiti Guide — side-rail docs layout ===== */

.guide-hero {
  background: var(--bg-primary);
  text-align: center;
  padding: calc(48px + 58px) 24px 32px;
}
.guide-hero-inner { max-width: 760px; margin: 0 auto; }
.guide-hero-tag {
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .13em; color: var(--accent-hover); margin-bottom: 14px; display: block;
}
.guide-hero h1 {
  font-family: var(--font-display); font-size: 34px; font-weight: 500;
  color: var(--text-primary); line-height: 1.2; margin: 0 auto 14px;
}
@media (min-width: 768px) { .guide-hero h1 { font-size: 40px; } }
.guide-hero-sub { font-size: 14px; font-weight: 300; color: var(--text-muted); }
.guide-updated {
  display: inline-block; margin-top: 14px; font-size: 12px; color: var(--text-muted);
  background: var(--bg-secondary); border: 1px solid var(--border);
  padding: 4px 12px; border-radius: 999px;
}

.guide-shell { background: var(--card-bg); padding: 0 24px 64px; }
.guide-wrap { max-width: var(--max-w); margin: 0 auto; }

/* Side-rail layout */
.guide-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 2.5rem;
  align-items: start;
  padding-top: 2rem;
}
.guide-rail {
  position: sticky;
  top: 78px;
  align-self: start;
  height: max-content;
  border-right: 1px solid var(--border);
  padding-right: 1.25rem;
}
.guide-rail-link {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  padding: 7px 0 7px 12px;
  border-left: 2px solid transparent;
  transition: color 150ms ease, border-color 150ms ease;
}
.guide-rail-link:hover { color: var(--text-primary); }
.guide-rail-link.active {
  color: var(--accent); font-weight: 500; border-left-color: var(--accent);
}

.guide-content { min-width: 0; }
.guide-content .guide-section { scroll-margin-top: 78px; margin-bottom: 3.5rem; }
.guide-content .guide-section:first-child { margin-top: 0; }
.guide-content h2 {
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 400;
  color: var(--text-primary); margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 2px solid var(--accent);
}
.guide-content h3 {
  font-family: var(--font-display); font-size: 1.18rem; font-weight: 400;
  color: var(--text-primary); margin: 1.75rem 0 .5rem;
}
.guide-content p { font-weight: 300; line-height: 1.8; margin-bottom: 1rem; }
.guide-content strong { color: var(--text-primary); font-weight: 500; }
.guide-content ul, .guide-content ol { padding-left: 1.4rem; margin-bottom: 1.25rem; }
.guide-content li { font-weight: 300; margin-bottom: .5rem; }

/* Superscript references */
.guide-ref {
  font-size: .68em; vertical-align: super; font-weight: 600; line-height: 0;
}
.guide-ref a {
  color: var(--accent); text-decoration: none;
  border-bottom: 1px dotted var(--accent); padding: 0 1px;
}
.guide-ref a:hover { color: var(--accent-hover); }

/* Footnotes per section */
.guide-footnotes {
  margin-top: 1.5rem; padding-top: 1rem; border-top: 1px dashed var(--border);
}
.guide-footnotes h4 {
  font-family: var(--font-body); font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--text-muted); margin-bottom: .5rem;
}
.guide-footnotes ol { padding-left: 1.2rem; margin: 0; }
.guide-footnotes li { font-size: 13px; font-weight: 300; color: var(--text-muted); margin-bottom: .35rem; }

/* Callouts */
.guide-callout {
  background: var(--bg-secondary); border-left: 3px solid var(--accent);
  padding: 12px 16px; border-radius: 0 6px 6px 0; margin: 1rem 0;
  font-size: 14px; font-weight: 300;
}
.guide-callout.myth { border-left-color: var(--alert); background: color-mix(in srgb, var(--alert) 6%, transparent); }
.guide-callout .tag {
  display: inline-block; font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: 4px; color: var(--accent-hover);
}
.guide-callout.myth .tag { color: var(--alert); }
.guide-callout p { margin: 0; }

/* Definition lists (building blocks, channels, glossary) */
.guide-deflist { margin: 0 0 1.25rem; }
.guide-deflist dt {
  font-family: var(--font-display); font-size: 1.02rem; color: var(--text-primary);
  font-weight: 400; margin-top: 1rem;
}
.guide-deflist dd { font-weight: 300; font-size: 14px; margin: 0; color: var(--text-secondary); }

/* Timelines */
.guide-timeline { border-left: 2px solid var(--border); margin-left: 6px; }
.guide-tl-item { position: relative; padding: 0 0 1.5rem 1.5rem; }
.guide-tl-item::before {
  content: ''; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px;
  background: var(--accent); border-radius: 50%; border: 2px solid var(--card-bg);
}
.guide-tl-year { font-weight: 600; color: var(--accent-hover); font-size: 13px; }
.guide-tl-event { font-family: var(--font-display); color: var(--text-primary); font-size: 1.05rem; }
.guide-tl-detail { font-size: 14px; font-weight: 300; color: var(--text-secondary); }

/* Insurer filters + table */
.guide-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 1rem; }
.guide-filter {
  font-size: 12px; padding: 6px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--bg-secondary);
  color: var(--text-secondary); font-family: var(--font-body); transition: all 150ms ease;
}
.guide-filter:hover { border-color: var(--accent); color: var(--text-primary); }
.guide-filter.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.guide-table { width: 100%; border-collapse: collapse; font-size: 14px; }
@media (max-width: 560px) {
  .guide-table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
}
.guide-table th, .guide-table td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.guide-table thead th {
  position: sticky; top: 0; background: var(--card-bg);
  font-family: var(--font-body); font-weight: 500; color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}
.guide-table tbody tr:hover { background: var(--bg-secondary); }
.guide-table a { color: var(--accent); text-decoration: none; }
.guide-table a:hover { text-decoration: underline; }
.guide-table .sector-tag {
  font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--bg-secondary);
  border: 1px solid var(--border); color: var(--text-muted); white-space: nowrap;
}
.guide-muted { font-size: 12px; color: var(--text-muted); font-weight: 300; }

.guide-error {
  max-width: 600px; margin: 4rem auto; padding: 1.5rem; border: 1px solid var(--alert);
  border-radius: var(--radius); color: var(--alert); text-align: center;
}

/* Mobile: collapse rail into horizontal scroll strip */
@media (max-width: 820px) {
  .guide-layout { grid-template-columns: 1fr; gap: 1rem; }
  .guide-rail {
    position: sticky; top: 58px; z-index: 80;
    border-right: 0; border-bottom: 1px solid var(--border);
    padding-right: 0; padding-bottom: .5rem; margin-bottom: 1rem;
    display: flex; gap: 6px; overflow-x: auto; white-space: nowrap;
  }
  .guide-rail-link { border-left: 0; border-bottom: 2px solid transparent; padding: 6px 10px; }
  .guide-rail-link.active { border-left: 0; border-bottom-color: var(--accent); }
}
