/* Shared night palette for the six existing fixed-paper article owners.
 * One light-mode exception restores the existing readable red for LTV's small
 * Take label. Other light colors, content, geometry, typography and image pixels
 * are untouched.
 * Repeated IDs match the existing article authority, including year-heading rules.
 * The site theme control owns html[data-ag-theme]; no second preference is stored.
 */
html[data-ag-theme="dark"] :is(
  #ag-cod-scroll-v15#ag-cod-scroll-v15#ag-cod-scroll-v15,
  #ag-mw4-american-guns#ag-mw4-american-guns#ag-mw4-american-guns,
  #ag-fc5-patriotic#ag-fc5-patriotic#ag-fc5-patriotic,
  #ag-cod-vehicles#ag-cod-vehicles#ag-cod-vehicles,
  #ag-code-valor#ag-code-valor#ag-code-valor,
  #ag-cod-ltv#ag-cod-ltv#ag-cod-ltv
) {
  --paper: var(--ag-blue, #00249c);
  --ink: var(--ag-cream, #f3e4cd);
  --dim: color-mix(in srgb, var(--ag-cream, #f3e4cd) 80%, var(--ag-blue, #00249c));
  --blue: var(--ag-cream, #f3e4cd);
  --accent: var(--ag-cream, #f3e4cd);
  --ag-gallery-rule: color-mix(in srgb, var(--ag-cream, #f3e4cd) 50%, var(--ag-blue, #00249c));
  --ag-gallery-wash: color-mix(in srgb, var(--ag-cream, #f3e4cd) 6%, var(--ag-blue, #00249c));
}

/* Four catalogue endings declare their own light-only nested palette. */
html[data-ag-theme="dark"] :is(
  #ag-cod-scroll-v15#ag-cod-scroll-v15,
  #ag-fc5-patriotic#ag-fc5-patriotic,
  #ag-cod-vehicles#ag-cod-vehicles,
  #ag-code-valor#ag-code-valor
) .closing {
  --ink: inherit;
  --dim: inherit;
  --accent: inherit;
  color: var(--ink) !important;
}

/* The small LTV Take label needs the shared readable label red on cream.
 * Its existing decorative border and every other light-mode color are retained.
 */
html:not([data-ag-theme="dark"]) #ag-cod-ltv#ag-cod-ltv .ag-editorial-box.ag-editorial-take-box .ag-editorial-rule > b {
  color: #8f211d !important;
}

/* These skip links bypass the article's link token. */
html[data-ag-theme="dark"] :is(
  #ag-cod-scroll-v15#ag-cod-scroll-v15,
  #ag-fc5-patriotic#ag-fc5-patriotic,
  #ag-cod-vehicles#ag-cod-vehicles,
  #ag-code-valor#ag-code-valor,
  #ag-cod-ltv#ag-cod-ltv
) .ag-cod-skip-link {
  color: var(--blue) !important;
}

/* Existing separators retain their widths, styles, spacing and visibility. */
html[data-ag-theme="dark"] :is(
  #ag-cod-scroll-v15#ag-cod-scroll-v15#ag-cod-scroll-v15,
  #ag-fc5-patriotic#ag-fc5-patriotic#ag-fc5-patriotic,
  #ag-cod-vehicles#ag-cod-vehicles#ag-cod-vehicles,
  #ag-code-valor#ag-code-valor#ag-code-valor,
  #ag-cod-ltv#ag-cod-ltv#ag-cod-ltv
) :is(.record dl, .year-record, .release-group, .sources, .identification-note, .year-heading) {
  border-color: var(--ag-gallery-rule) !important;
}

/* MW4's source/variant inset and expandable roster have distinct owners. */
html[data-ag-theme="dark"] #ag-mw4-american-guns#ag-mw4-american-guns .ag-mw4-variant-inset {
  background: var(--ag-gallery-wash) !important;
}
html[data-ag-theme="dark"] #ag-mw4-american-guns#ag-mw4-american-guns :is(
  .ag-mw4-roster-group,
  .ag-mw4-roster-table th,
  .ag-mw4-roster-table td,
  .ag-mw4-roster-table tbody tr
) {
  border-color: var(--ag-gallery-rule) !important;
}

/* LTV table text and focus already consume the palette; only rules are fixed. */
html[data-ag-theme="dark"] #ag-cod-ltv .ltv-table-wrap {
  border-bottom-color: var(--ag-gallery-rule);
}
html[data-ag-theme="dark"] #ag-cod-ltv :is(th, td) {
  border-bottom-color: var(--ag-gallery-rule);
}

/* LTV's bridge bypasses tokens for Take text and its small label.
 * The existing red top accent remains decorative; all readable text is cream.
 */
html[data-ag-theme="dark"] #ag-cod-ltv#ag-cod-ltv .ag-editorial-box.ag-editorial-take-box,
html[data-ag-theme="dark"] #ag-cod-ltv#ag-cod-ltv .ag-editorial-box.ag-editorial-take-box :is(
  .ag-editorial-copy-body,
  .ag-editorial-take-copy > h2:first-child,
  .ag-editorial-rule,
  .ag-editorial-rule b
) {
  color: var(--ink) !important;
}
