/* The News overlays are outside .nw-app. Rebind inherited chrome tokens here:
   root-level color-mix tokens otherwise retain the main site's dark violet value. */
body[data-chrome="news"] {
  --chrome-header: var(--bg-raised);
  --chrome-surface: var(--bg-raised);
  --scrim: rgb(41 38 34 / 52%);
  --shadow-3: 0 16px 48px rgb(61 39 22 / 22%);
  --accent: var(--primary);
  --accent-ink: var(--primary-ink);
  --neon: var(--primary);
  --news-menu-font: 'News Sans', 'News Sans Fallback', var(--font-body);
}
body[data-chrome="news"]:lang(ar) {
  --news-menu-font: 'CPS Arabic Body', var(--font-body);
}

body[data-chrome="news"] :is(.side-drawer, #lang-modal .modal-box) {
  background: var(--chrome-surface);
  color: var(--text);
  font-family: var(--news-menu-font);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body[data-chrome="news"] .side-drawer {
  border-inline-start: 0;
  box-shadow: var(--shadow-3);
}
body[data-chrome="news"] :is(#menu-overlay, #lang-modal) {
  background: var(--scrim);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
body[data-chrome="news"] :is(.side-drawer, #lang-modal) ::selection {
  background: #e6b9b5;
  color: #3f1822;
}
body[data-chrome="news"] :is(.side-drawer, #lang-modal) :is(a, button, summary, input):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
body[data-chrome="news"] :is(.drawer-header h2, #lang-modal .modal-header h2) {
  margin: 0;
  padding: 0;
  color: var(--text);
  font: 700 1.25rem/1.3 var(--news-menu-font);
  letter-spacing: 0;
  text-transform: none;
}
body[data-chrome="news"] .drawer-header {
  min-block-size: 64px;
  border-block-end-color: var(--border);
}
body[data-chrome="news"] :is(#close-menu, #close-lang) {
  flex: none;
  color: var(--text-muted);
}
body[data-chrome="news"] :is(#close-menu, #close-lang):hover {
  background: var(--surface-1);
  color: var(--text);
}
body[data-chrome="news"] .drawer-nav-compact {
  padding-block-start: 16px;
  scrollbar-color: var(--border-control) transparent;
}

/* Category tokens must be declared on each group; changing body --accent cannot
   override the main site's [data-accent] declarations on these descendants. */
body[data-chrome="news"] .drawer-group[data-accent] {
  --accent: #982e43;
  --accent-ink: #fff8ed;
  --neon: var(--accent);
}
body[data-chrome="news"] .drawer-group[data-accent="cyan"] { --accent: #285e4c; }
body[data-chrome="news"] .drawer-group[data-accent="amber"] { --accent: #82501e; }
body[data-chrome="news"] .drawer-group[data-accent="pink"] { --accent: #982e43; }
body[data-chrome="news"] .drawer-group[data-accent="coral"] { --accent: #a54d30; }
body[data-chrome="news"] .drawer-group[data-accent="lime"] { --accent: #566433; }
body[data-chrome="news"] .drawer-group[data-accent="violet"] { --accent: #72515e; }
body[data-chrome="news"] .drawer-group > h2 {
  margin-block-end: 6px;
  font: 700 .8125rem/1.5 var(--news-menu-font);
  letter-spacing: .04em;
  color: var(--accent);
}
body[data-chrome="news"] .drawer-group :is(.drawer-link, .drawer-sub > summary) {
  min-block-size: 44px;
  padding-block: 8px;
  color: var(--text);
  font-family: var(--news-menu-font);
}
body[data-chrome="news"] .drawer-group :is(.drawer-link, .drawer-sub > summary):hover {
  background: var(--surface-1);
  color: var(--text);
}
body[data-chrome="news"] .drawer-group :is(.drawer-link[aria-current], .drawer-sub[open] > summary) {
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-raised));
  color: var(--accent);
  font-weight: 600;
}
body[data-chrome="news"] .drawer-sub > ul .drawer-link > i { color: var(--accent); }
body[data-chrome="news"] .drawer-sub > summary::after { color: var(--text-muted); }

body[data-chrome="news"] .drawer-nav-compact > .drawer-tile:not(.drawer-tile--community) {
  background: var(--surface-1);
  border-color: var(--border);
  color: var(--text);
}
body[data-chrome="news"] .drawer-nav-compact > .drawer-tile:not(.drawer-tile--community):hover { background: var(--surface-2); }
body[data-chrome="news"] .drawer-nav-compact > .drawer-tile--news[aria-current] {
  background: #f1ddd6;
  border-color: #b86770;
  color: #722035;
}

/* Partner artwork and original orange/green fills stay intact. Pocket's text
   needs its original light ink instead of inheriting News's charcoal --text. */
body[data-chrome="news"] .partner-row--pg {
  --partner-ink: #f2f0ff;
  --focus: #fff8ed;
}
body[data-chrome="news"] .partner-row--my { --focus: #1f0c00; }

body[data-chrome="news"] .drawer-search {
  background-color: var(--bg-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23706355' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 3.5 3.5'/%3E%3C/svg%3E");
  border-color: var(--border-control);
  color: var(--text);
  caret-color: var(--primary);
  font: 400 1rem/1.4 var(--news-menu-font);
}
body[data-chrome="news"] .drawer-search::placeholder { color: var(--text-faint); opacity: 1; }
body[data-chrome="news"] .drawer-search:is(:hover, :focus-visible) { border-color: var(--primary); }
body[data-chrome="news"] .drawer-empty { color: var(--text-muted); }

body[data-chrome="news"] #lang-modal .modal-box {
  border: 0;
  box-shadow: var(--shadow-3);
  scrollbar-color: var(--border-control) transparent;
}
body[data-chrome="news"] #lang-modal .modal-header { padding-block-end: 12px; border-block-end: 1px solid var(--border); }
body[data-chrome="news"] #lang-modal .lang-option {
  background: var(--surface-1);
  border-color: transparent;
  color: var(--text);
  font: 500 1rem/1.4 var(--news-menu-font);
}
body[data-chrome="news"] #lang-modal .lang-option:hover { background: var(--surface-2); }
body[data-chrome="news"] #lang-modal .lang-option.active {
  background: var(--primary);
  border-color: transparent;
  color: var(--primary-ink);
}
body[data-chrome="news"] #lang-modal .lang-option.active::after { color: currentColor; }
