/* =========================================================================
   Guide body overrides.

   The guide pages were converted from the original JSP and still carry inline
   light-theme styling (white panels, #e8e8e8 borders, black text, bgcolor
   attributes). Inline styles beat stylesheets, so these rules need !important
   to pull that markup onto the dark theme. Scoped to .legacy so nothing else
   on the site is affected.
   ========================================================================= */

.legacy { color: var(--ink-2); font-size: 14.5px; line-height: 1.68; }

.legacy #main_content { width: auto !important; }

/* Kill the white/grey panel backgrounds and borders. */
.legacy div,
.legacy span,
.legacy td,
.legacy th,
.legacy table,
.legacy p,
.legacy li {
  background-color: transparent !important;
  border-color: var(--line) !important;
  color: inherit !important;
}

.legacy [style*="background-color:#ffffff"],
.legacy [style*="background-color: #ffffff"],
.legacy [style*="background-color:#FFFFFF"],
.legacy [bgcolor="#ffffff"],
.legacy [bgcolor="#FFFFFF"] {
  background: #0d1116 !important;
  border-color: var(--line) !important;
  border-radius: var(--r-sm);
}

/* Header cells the original used grey/red bars for. */
.legacy [bgcolor="#eeeeee"], .legacy [bgcolor="#EEEEEE"],
.legacy [bgcolor="#e8e8e8"], .legacy [bgcolor="#f5f5f5"] {
  background: #161b21 !important;
  color: var(--ink) !important;
}
.legacy [bgcolor="#808080"], .legacy [bgcolor="#999999"] {
  background: var(--line-2) !important;
}
.legacy [bgcolor="#990000"], .legacy [bgcolor="#cc0000"] {
  background: var(--gold) !important;
}

.legacy b, .legacy strong { color: var(--ink) !important; }
.legacy a { color: var(--gold-2) !important; }
.legacy a:hover { color: var(--ember) !important; }

.legacy font { color: inherit !important; }

/* Tables: readable on dark, and scrollable on a phone. */
.legacy table {
  width: 100% !important;
  border-collapse: collapse !important;
  margin: 0 0 16px !important;
}
.legacy td, .legacy th {
  padding: 8px 10px !important;
  border: 1px solid var(--line) !important;
  vertical-align: top;
}
.legacy tr[height="1"] td, .legacy tr[height="3"] td { padding: 0 !important; border: 0 !important; }

/* The converted markup nests fixed-width tables; let them scroll instead of
   pushing the layout wide on mobile. */
.legacy .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 0 16px; }
.legacy .tbl-scroll > table { min-width: 520px; margin: 0 !important; }

.legacy img {
  max-width: 100%; height: auto;
  border-radius: var(--r-sm);
  /* Original art is bright line-art on white; ease it into the dark page. */
  filter: brightness(.94) contrast(1.02);
}
.legacy img.img-responsive { display: block; margin: 0 auto 14px; }

.legacy hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

.legacy ul, .legacy ol { padding-left: 20px; }
.legacy li { margin: 4px 0; }

.legacy h1, .legacy h2, .legacy h3, .legacy h4 { color: var(--ink) !important; }

/* A missing guide image should not leave a broken-icon gap. */
.legacy img[alt=""], .legacy img:not([alt]) { min-height: 0; }
