/* =============================================
   Tank Logic — guide.css  v5 (clean consolidation)
   Article layout, typography, callouts, TOC
   ============================================= */

/* ── Reading progress ─────────────────────────── */
.read-progress {
  position: fixed;
  top: var(--nav-h);
  left: 0; right: 0;
  height: 2px;
  background: transparent;
  z-index: 300;
  pointer-events: none;
}
.read-progress__bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--blue));
  transition: width 0.12s linear;
}

/* ── Guide hero ───────────────────────────────── */
.guide-hero {
  padding-top: calc(var(--nav-h) + 52px);
  padding-bottom: 48px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.guide-hero::before {
  content: '';
  position: absolute;
  width: 560px; height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(59,130,246,0.05) 0%, transparent 70%);
  top: -160px; right: -80px;
  pointer-events: none;
}

.guide-hero__inner  { max-width: 780px; position: relative; z-index: 1; }

.guide-hero__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.guide-hero h1 {
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.032em;
  line-height: 1.22;
  color: var(--tx-hi);
  margin-bottom: 16px;
}

.guide-hero__desc {
  font-size: var(--sz-16);
  color: var(--tx);
  line-height: 1.75;
  max-width: 640px;
  margin-bottom: 24px;
  letter-spacing: -0.005em;
}

.guide-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.guide-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: var(--sz-12);
  font-weight: 500;
  color: var(--tx-lo);
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 4px 10px;
}
.guide-meta-item strong { color: var(--tx); font-weight: 600; }

/* ── Guide layout ─────────────────────────────── */
.guide-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 44px;
  padding-block: 56px;
  align-items: start;
}

/* ── Article body ─────────────────────────────── */
.guide-body { max-width: 740px; }

.guide-body h2 {
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.32;
  color: var(--tx-hi);
  margin-top: 56px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.guide-body h2:first-child { margin-top: 0; }

.guide-body h3 {
  font-size: var(--sz-16);
  font-weight: 600;
  letter-spacing: -0.018em;
  line-height: 1.38;
  color: var(--tx-hi);
  margin-top: 36px;
  margin-bottom: 12px;
}

/* Primary prose — strong contrast for reading comfort */
.guide-body p {
  font-size: var(--sz-16);
  color: var(--tx);
  line-height: 1.82;
  margin-bottom: 20px;
  letter-spacing: -0.003em;
}

.guide-body ul,
.guide-body ol {
  padding-left: 22px;
  margin-bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.guide-body ul { list-style: disc; }
.guide-body ol { list-style: decimal; }

.guide-body li {
  font-size: var(--sz-16);
  color: var(--tx);
  line-height: 1.76;
  padding-left: 4px;
}

.guide-body strong { color: var(--tx-hi); font-weight: 600; }
.guide-body em     { color: var(--accent); font-style: normal; font-weight: 600; }

.guide-body a {
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(77,148,255,0.35);
  transition: color var(--t), text-decoration-color var(--t);
}
.guide-body a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ── Callout boxes ────────────────────────────── */
.callout {
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-block: 26px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.callout-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1.5; margin-top: 1px; }

.callout-body { flex: 1; }
.callout-body strong {
  display: block;
  font-size: var(--sz-13);
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: -0.01em;
}
.callout-body p {
  font-size: var(--sz-13);
  margin-bottom: 0 !important;
  line-height: 1.68;
}

/* Tip — green */
.callout-tip {
  background: rgba(0,200,150,0.05);
  border: 1px solid rgba(0,200,150,0.18);
  border-left: 3px solid var(--accent);
}
.callout-tip .callout-body strong { color: var(--accent); }
.callout-tip .callout-body p      { color: #c8f0e2; }

/* Warning — gold */
.callout-warning {
  background: rgba(240,168,48,0.05);
  border: 1px solid rgba(240,168,48,0.18);
  border-left: 3px solid var(--gold);
}
.callout-warning .callout-body strong { color: var(--gold); }
.callout-warning .callout-body p      { color: #f0e8b0; }

/* Info — blue */
.callout-info {
  background: rgba(77,148,255,0.05);
  border: 1px solid rgba(77,148,255,0.18);
  border-left: 3px solid var(--blue);
}
.callout-info .callout-body strong { color: var(--blue); }
.callout-info .callout-body p      { color: #c8dcf4; }

/* ── Data tables ──────────────────────────────── */
.guide-table-wrap {
  overflow-x: auto;
  margin-block: 26px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--sz-13);
  min-width: 420px;
}

.guide-table th {
  background: var(--bg-2);
  padding: 11px 15px;
  text-align: left;
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--tx);
  border-bottom: 1px solid var(--border);
}

.guide-table td {
  padding: 11px 15px;
  color: var(--tx);
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}
.guide-table tr:last-child td { border-bottom: none; }
.guide-table tr:nth-child(even) td { background: rgba(255,255,255,0.012); }
.guide-table tr:hover td { background: rgba(255,255,255,0.02); }

.td-good    { color: var(--accent)  !important; font-weight: 600; }
.td-bad     { color: #ff7070        !important; font-weight: 600; }
.td-neutral { color: var(--gold)    !important; font-weight: 600; }

/* ── Step boxes ───────────────────────────────── */
.steps-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-block: 26px;
}

.step-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  transition: border-color 160ms, background 160ms;
}
.step-item:hover {
  border-color: rgba(0,200,150,0.25);
  background: rgba(0,200,150,0.03);
}

.step-num {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--accent);
  color: #021a12;
  font-weight: 800;
  font-size: var(--sz-12);
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow 160ms var(--ease), transform 160ms var(--ease);
}
.step-item:hover .step-num {
  box-shadow: 0 0 14px rgba(0,200,150,0.4);
  transform: scale(1.06);
}

.step-body strong {
  display: block;
  font-size: var(--sz-14);
  font-weight: 600;
  color: var(--tx-hi);
  margin-bottom: 5px;
  letter-spacing: -0.012em;
}
.step-body p {
  font-size: var(--sz-14);
  color: var(--tx);
  margin-bottom: 0 !important;
  line-height: 1.68;
}

/* ── TOC ──────────────────────────────────────── */
.toc-panel {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
  position: sticky;
  top: calc(var(--nav-h) + 14px);
}

.toc-title {
  font-size: var(--sz-10);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--tx-lo);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc-list a {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: var(--sz-12);
  color: var(--tx-lo);
  padding: 6px 8px;
  border-radius: var(--r-md);
  transition: background 120ms, color 120ms, border-left-color 120ms;
  line-height: 1.4;
  letter-spacing: -0.006em;
  border-left: 2px solid transparent;
}
.toc-list a::before {
  content: '';
  width: 3px; height: 3px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.3;
  flex-shrink: 0;
  transition: opacity 120ms;
}
.toc-list a:hover        { background: var(--bg-2); color: var(--tx); }
.toc-list a:hover::before { opacity: 0.6; }
.toc-list a.active {
  color: var(--accent);
  background: rgba(0,200,150,0.07);
  border-left-color: var(--accent);
  padding-left: 6px;
  font-weight: 500;
}
.toc-list a.active::before { background: var(--accent); opacity: 1; }

/* ── Guide sidebar ────────────────────────────── */
.guide-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Related guides ───────────────────────────── */
.related-guides {
  margin-top: 56px;
  padding-top: 40px;
  border-top: 1px solid var(--border);
}

.related-guides h2 {
  font-size: var(--sz-18);
  margin-bottom: 18px;
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.related-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  transition: border-color 160ms, transform 160ms, background 160ms;
}
.related-card:hover {
  border-color: rgba(77,148,255,0.3);
  transform: translateY(-2px);
  background: rgba(255,255,255,0.012);
}

.related-card__icon {
  font-size: 1.2rem;
  flex-shrink: 0;
  width: 38px; height: 38px;
  background: var(--bg-3);
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  transition: background 160ms;
}
.related-card:hover .related-card__icon { background: var(--accent-lo); }

.related-card h4 {
  font-size: var(--sz-13);
  font-weight: 600;
  color: var(--tx-hi);
  margin-bottom: 3px;
  letter-spacing: -0.01em;
}
.related-card p {
  font-size: var(--sz-12);
  color: var(--tx-lo);
  margin: 0;
  line-height: 1.5;
}

/* ── SEO content section ──────────────────────── */
.seo-content {
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}
.seo-content__inner     { max-width: 720px; }
.seo-content__inner h2  { font-size: var(--sz-18); margin-bottom: 14px; }
.seo-content__inner h3  { font-size: var(--sz-15); margin-top: 28px; margin-bottom: 9px; }
.seo-content__inner p   { font-size: var(--sz-15); color: var(--tx); line-height: 1.78; margin-bottom: 10px; }
.seo-list {
  list-style: decimal;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.seo-list li { font-size: var(--sz-15); color: var(--tx); line-height: 1.7; padding-left: 4px; }

/* Table text (override for seo tables) */
.guide-table td    { font-size: var(--sz-13); }

/* ── Reduced motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .step-item, .related-card, .toc-list a { transition: none !important; }
  .step-item:hover .step-num             { transform: none !important; box-shadow: none !important; }
}

/* ── Responsive ───────────────────────────────── */
@media (min-width: 960px) {
  .guide-layout   { grid-template-columns: 1fr 272px; }
  .related-grid   { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .guide-hero h1  { font-size: 1.7rem; }
  .guide-body p,
  .guide-body li  { font-size: var(--sz-15); }
  .step-item      { padding: 14px 15px; }
  .guide-layout   { padding-block: 36px; }
}
