/* Reader features — consent banner, accessibility menu, push bell, FAQ, author/pillar blocks.
   Look per theme: each theme's site.css sets the --rd-* tokens (section "Reader features"). */
:where(:root) {
  --rd-bg: #fff;
  --rd-fg: #1b1b1b;
  --rd-muted: #5c5c5c;
  --rd-line: #d9d9d9;
  --rd-soft: #f3f3f1;
  --rd-accent: #1f4fd1;
  --rd-accent-hover: #173c9f;
  --rd-on-accent: #fff;
  --rd-radius: 8px;
  --rd-radius-btn: 6px;
  --rd-font: inherit;
  --rd-head-font: inherit;
  --rd-head-weight: 700;
  --rd-shadow: 0 10px 40px -12px rgb(0 0 0 / .35), 0 2px 6px rgb(0 0 0 / .08);
  --rd-focus: #ffbf47;
  --rd-fab-size: 52px;
}

.rd-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.rd-ui { font-family: var(--rd-font); color: var(--rd-fg); line-height: 1.5; font-size: 1rem; }
.rd-ui [hidden], .rd-ui[hidden] { display: none !important; }
.rd-ui *, .rd-ui *::before, .rd-ui *::after { box-sizing: border-box; }
.rd-ui :focus-visible { outline: 3px solid var(--rd-focus); outline-offset: 2px; box-shadow: 0 0 0 5px var(--rd-fg); }

/* ---------- buttons */
.rd-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--rd-radius-btn);
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
  background: var(--rd-bg); color: var(--rd-fg); border: 1.5px solid var(--rd-fg);
  transition: background-color .15s, color .15s, border-color .15s;
}
.rd-btn:hover { background: var(--rd-soft); }
.rd-btn--primary { background: var(--rd-accent); border-color: var(--rd-accent); color: var(--rd-on-accent); }
.rd-btn--primary:hover { background: var(--rd-accent-hover); border-color: var(--rd-accent-hover); }
.rd-btn--link { border-color: transparent; background: transparent; text-decoration: underline; text-underline-offset: 3px; }
.rd-btn--link:hover { background: var(--rd-soft); }
.rd-icon-btn { display: inline-grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; color: var(--rd-fg); cursor: pointer; }
.rd-icon-btn:hover { background: var(--rd-soft); }

/* ---------- consent banner */
.rd-consent {
  position: fixed; inset-inline: 12px; bottom: 12px; z-index: 2147483000;
  max-width: 980px; margin-inline: auto;
  background: var(--rd-bg); border: 1px solid var(--rd-line); border-radius: var(--rd-radius);
  box-shadow: var(--rd-shadow); padding: 18px 20px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.rd-consent__inner { display: flex; gap: 16px 24px; align-items: center; flex-wrap: wrap; }
.rd-consent__text { flex: 1 1 420px; min-width: 0; }
.rd-consent__title { margin: 0 0 4px; font-family: var(--rd-head-font); font-weight: var(--rd-head-weight); font-size: 1.1rem; color: var(--rd-fg); line-height: 1.3; }
.rd-consent__text p { margin: 0; font-size: .92rem; color: var(--rd-muted); }
.rd-consent__text a, .rd-modal a { color: inherit; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.rd-consent__actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .rd-consent { inset-inline: 0; bottom: 0; border-radius: var(--rd-radius) var(--rd-radius) 0 0; border-inline: 0; border-bottom: 0; padding: 16px; }
  .rd-consent__actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .rd-consent__actions .rd-btn--link { grid-column: 1 / -1; min-height: 40px; }
  .rd-consent__text p { font-size: .88rem; }
}
.rd-footer-link { margin: 12px 0 0; font-size: .9em; }
.rd-footer-link button { font: inherit; color: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; opacity: .9; }
.rd-footer-link button:hover { opacity: 1; }
.rd-footer-link--fixed { position: fixed; bottom: 6px; inset-inline-start: 8px; z-index: 50; background: var(--rd-bg); padding: 2px 8px; border-radius: 4px; margin: 0; }

/* ---------- modal (consent preferences) */
.rd-modal, .rd-a11y { position: fixed; inset: 0; z-index: 2147483001; }
.rd-modal__backdrop { position: absolute; inset: 0; background: rgb(0 0 0 / .45); }
.rd-a11y .rd-modal__backdrop { background: rgb(0 0 0 / .2); }
.rd-modal__panel {
  position: relative; margin: 6vh auto 0; width: min(560px, calc(100vw - 24px)); max-height: 88vh; overflow: auto;
  background: var(--rd-bg); border-radius: var(--rd-radius); box-shadow: var(--rd-shadow); padding: 20px 22px;
}
.rd-modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.rd-modal__title { margin: 0; font-family: var(--rd-head-font); font-weight: var(--rd-head-weight); font-size: 1.25rem; color: var(--rd-fg); line-height: 1.3; }
.rd-modal__intro { margin: 0 0 12px; color: var(--rd-muted); font-size: .95rem; }
.rd-modal__foot { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.rd-cats { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rd-line); }
.rd-cat { padding: 14px 0; border-bottom: 1px solid var(--rd-line); }
.rd-cat__name { font-weight: 700; }
.rd-cat__name small { font-weight: 400; color: var(--rd-muted); }
.rd-cat__desc { margin: 4px 0 0; padding-inline-start: 58px; font-size: .88rem; color: var(--rd-muted); }
.rd-switch { display: flex; align-items: center; gap: 12px; cursor: pointer; min-height: 32px; }
.rd-switch input { position: absolute; opacity: 0; width: 46px; height: 28px; margin: 0; cursor: pointer; }
.rd-switch__ui { position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px; background: var(--rd-line); border: 1.5px solid var(--rd-muted); transition: background-color .15s; }
.rd-switch__ui::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 19px; height: 19px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .15s; }
.rd-switch input:checked + .rd-switch__ui { background: var(--rd-accent); border-color: var(--rd-accent); }
.rd-switch input:checked + .rd-switch__ui::after { transform: translateX(-18px); }
[dir="ltr"] .rd-switch input:checked + .rd-switch__ui::after { transform: translateX(18px); }
.rd-switch input:disabled + .rd-switch__ui { opacity: .6; }
.rd-switch input:focus-visible + .rd-switch__ui { outline: 3px solid var(--rd-focus); outline-offset: 2px; }

/* ---------- floating dock */
.rd-dock { position: fixed; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 2147482000; display: flex; flex-direction: column; gap: 10px; }
.rd-dock--left { left: 16px; }
.rd-dock--right { right: 16px; }
.rd-fab {
  display: grid; place-items: center; width: var(--rd-fab-size); height: var(--rd-fab-size); border-radius: 50%;
  background: var(--rd-accent); color: var(--rd-on-accent); border: 2px solid var(--rd-on-accent);
  box-shadow: 0 4px 14px rgb(0 0 0 / .25); cursor: pointer; padding: 0;
}
.rd-fab:hover { background: var(--rd-accent-hover); }
.rd-fab--push { background: var(--rd-bg); color: var(--rd-fg); border-color: var(--rd-line); width: 44px; height: 44px; margin-inline: auto; }
.rd-fab--push:hover { background: var(--rd-soft); }
.rd-fab--push[aria-pressed="true"] { color: var(--rd-accent); border-color: var(--rd-accent); }
.rd-fab--push[aria-pressed="true"] svg path:first-child { fill: currentColor; }
body.has-sticky-cta .rd-dock { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 640px) { :root { --rd-fab-size: 48px; } .rd-dock { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); } .rd-dock--left { left: 12px; } .rd-dock--right { right: 12px; } }
html.rd-consent-open .rd-dock, html.rd-consent-open body .rd-dock { bottom: calc(var(--rd-banner-h, 120px) + 12px); }

/* ---------- accessibility panel */
.rd-a11y__panel {
  position: absolute; bottom: 84px; width: min(390px, calc(100vw - 24px)); max-height: calc(100vh - 110px); overflow: auto;
  background: var(--rd-bg); border-radius: var(--rd-radius); box-shadow: var(--rd-shadow); padding: 16px 18px 18px;
  border: 1px solid var(--rd-line);
}
.rd-a11y--left .rd-a11y__panel { left: 16px; }
.rd-a11y--right .rd-a11y__panel { right: 16px; }
@media (max-width: 640px) {
  .rd-a11y__panel { left: 0 !important; right: 0 !important; bottom: 0; width: 100%; max-height: 86vh; border-radius: var(--rd-radius) var(--rd-radius) 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
}
.rd-a11y__label { margin: 4px 0 6px; font-weight: 700; font-size: .95rem; }
.rd-seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1.5px solid var(--rd-fg); border-radius: var(--rd-radius-btn); overflow: hidden; }
.rd-seg__btn { min-height: 44px; border: 0; border-inline-start: 1px solid var(--rd-line); background: var(--rd-bg); color: var(--rd-fg); font: inherit; font-weight: 700; cursor: pointer; }
.rd-seg__btn:first-child { border-inline-start: 0; font-weight: 500; }
.rd-seg__btn[aria-pressed="true"] { background: var(--rd-fg); color: var(--rd-bg); }
.rd-a11y__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.rd-tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 84px; padding: 10px 6px;
  border: 1.5px solid var(--rd-line); border-radius: var(--rd-radius-btn); background: var(--rd-soft); color: var(--rd-fg);
  font: inherit; font-size: .82rem; font-weight: 600; line-height: 1.25; text-align: center; cursor: pointer;
}
.rd-tile:hover { border-color: var(--rd-fg); }
.rd-tile[aria-pressed="true"] { background: var(--rd-accent); border-color: var(--rd-accent); color: var(--rd-on-accent); }
.rd-a11y__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.rd-a11y__statement { color: var(--rd-fg); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.rd-a11y__note { margin: 12px 0 0; font-size: .78rem; color: var(--rd-muted); }
@media (max-width: 360px) { .rd-a11y__grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- accessibility modes (classes on <html>) */
html.a11y-text-1 { font-size: 112.5% !important; }
html.a11y-text-2 { font-size: 125% !important; }
html.a11y-text-3 { font-size: 140% !important; }
html.a11y-contrast :where(*:not(svg, svg *, img, video, picture, iframe)) {
  background-color: #fff !important; background-image: none !important; color: #000 !important; border-color: #000 !important; text-shadow: none !important; box-shadow: none !important;
}
html.a11y-contrast a, html.a11y-contrast a * { color: #0000c8 !important; text-decoration: underline !important; }
html.a11y-contrast .rd-tile[aria-pressed="true"], html.a11y-contrast .rd-seg__btn[aria-pressed="true"], html.a11y-contrast .rd-btn--primary, html.a11y-contrast .rd-fab { background-color: #000 !important; color: #fff !important; }
html.a11y-dark :where(*:not(svg, svg *, img, video, picture, iframe)) {
  background-color: #000 !important; background-image: none !important; color: #fff !important; border-color: #fff !important; text-shadow: none !important; box-shadow: none !important;
}
html.a11y-dark a, html.a11y-dark a * { color: #ffeb3b !important; }
html.a11y-dark .rd-tile[aria-pressed="true"], html.a11y-dark .rd-seg__btn[aria-pressed="true"], html.a11y-dark .rd-btn--primary, html.a11y-dark .rd-fab { background-color: #ffeb3b !important; color: #000 !important; }
html.a11y-contrast .rd-modal__backdrop, html.a11y-dark .rd-modal__backdrop { background-color: transparent !important; }
html.a11y-gray body > *:not(.rd-ui) { filter: grayscale(1); }
html.a11y-links a { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 3px !important; outline: 2px solid currentColor; outline-offset: 1px; }
html.a11y-links:not(.a11y-contrast):not(.a11y-dark) a:not(.rd-ui a) { background-color: #fff59d !important; color: #000 !important; }
html.a11y-font body, html.a11y-font body *:not(svg):not(svg *) { font-family: Arial, "Arial Hebrew", "Segoe UI", Helvetica, sans-serif !important; }
html.a11y-spacing body *:not(svg):not(svg *):not(.rd-ui):not(.rd-ui *) { line-height: 1.9 !important; letter-spacing: .06em !important; word-spacing: .16em !important; }
html.a11y-spacing p, html.a11y-spacing li { margin-bottom: 1em; }
html.a11y-still *, html.a11y-still *::before, html.a11y-still *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
html.a11y-cursor, html.a11y-cursor * { cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 24 24'%3E%3Cpath d='M5 2l14 10.5-6.4 1.2 3.6 7.6-3 1.4-3.5-7.6L5 20z' fill='%23000' stroke='%23fff' stroke-width='1.3' stroke-linejoin='round'/%3E%3C/svg%3E") 6 2, auto !important; }
.rd-guide { position: fixed; inset-inline: 0; height: 2.6em; pointer-events: none; z-index: 2147481000; border-block: 3px solid #000; background: rgb(255 235 59 / .18); box-shadow: 0 0 0 100vmax rgb(0 0 0 / .32); transform: translateY(-50%); }
@media (prefers-reduced-motion: reduce) { .rd-ui * { transition: none !important; } }

/* ---------- FAQ accordion (content: .faq-block > .faq-item > h3.faq-q + .faq-a) — themes restyle via tokens */
.faq-block { margin: 2em 0; border-top: 1px solid var(--rd-line); }
.faq-item { border-bottom: 1px solid var(--rd-line); }
.faq-item > .faq-q { margin: 0; font-size: 1.1em; line-height: 1.4; }
.faq-item > .faq-a { padding: 0 0 1em; }
.faq-item > .faq-a > :first-child { margin-top: 0; }
.faq-item > .faq-a > :last-child { margin-bottom: 0; }
.faq-block:not(.is-accordion) .faq-q { padding: .9em 0 .4em; }
.faq-q__btn {
  all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 16px;
  padding: .9em 0; cursor: pointer; font: inherit; color: inherit; text-align: start;
}
.faq-q__btn:focus-visible { outline: 3px solid var(--rd-focus); outline-offset: 2px; }
.faq-q__icon { flex: none; width: 1.6em; height: 1.6em; display: grid; place-items: center; border-radius: 50%; border: 1.5px solid currentColor; transition: transform .2s; }
.faq-q__icon::before { content: ""; width: .45em; height: .45em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-20%) rotate(45deg); }
.faq-q__btn[aria-expanded="true"] .faq-q__icon { transform: rotate(180deg); }
.faq-block.is-accordion .faq-a[hidden] { display: none; }

/* ---------- author E-E-A-T, topic clusters (structure; theme colors via tokens) */
.rd-author-meta { margin-top: 6px; }
.rd-author-meta__job { margin: 0; font-weight: 600; color: var(--rd-muted); font-size: .95em; }
.rd-author-meta__bio { margin: 8px 0 0; color: inherit; font-size: .98em; line-height: 1.6; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.rd-chips li { font-size: .82em; padding: 3px 10px; border-radius: 999px; background: var(--rd-soft); border: 1px solid var(--rd-line); color: var(--rd-fg); }
.rd-social { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0 0; padding: 0; list-style: none; font-size: .9em; }
.rd-social a { color: inherit; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }

.rd-guide-link { display: flex; gap: 14px; align-items: center; margin: 1.6em 0; padding: 14px 18px; border: 1px solid var(--rd-line); border-inline-start: 4px solid var(--rd-accent); background: var(--rd-soft); border-radius: var(--rd-radius); }
.rd-guide-link__kicker { margin: 0; font-size: .8em; font-weight: 700; letter-spacing: .02em; color: var(--rd-accent); }
.rd-guide-link__title { margin: 2px 0 0; font-weight: 700; font-size: 1.05em; line-height: 1.35; }
.rd-guide-link__title a { color: var(--rd-fg); text-decoration: none; }
.rd-guide-link__title a:hover { text-decoration: underline; }
.rd-guide-link__icon { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--rd-accent); color: var(--rd-on-accent); }

.rd-pillar { margin: 8px 0 32px; }
.rd-pillar__badge { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; background: var(--rd-accent); color: var(--rd-on-accent); font-size: .8rem; font-weight: 700; }
.rd-pillar__intro { max-width: 72ch; font-size: 1.08em; line-height: 1.7; }
.rd-pillar__intro p { margin: 0 0 .8em; }
.rd-pillar__subs { margin-top: 20px; }
.rd-pillar__subs-title { margin: 0 0 10px; font-family: var(--rd-head-font); font-weight: var(--rd-head-weight); font-size: 1.1rem; }
.rd-subtopics { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.rd-subtopics a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 48px; padding: 10px 14px; border: 1px solid var(--rd-line); border-radius: var(--rd-radius); background: var(--rd-bg); color: var(--rd-fg); text-decoration: none; font-weight: 600; }
.rd-subtopics a:hover { border-color: var(--rd-accent); color: var(--rd-accent); }
.rd-subtopics small { color: var(--rd-muted); font-weight: 400; }
.rd-pillar__start { margin-top: 22px; }
.rd-steps { counter-reset: rdstep; margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.rd-steps li { counter-increment: rdstep; display: flex; gap: 12px; align-items: baseline; }
.rd-steps li::before { content: counter(rdstep); flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--rd-fg); color: var(--rd-bg); font-weight: 700; font-size: .85rem; }
.rd-steps a { color: var(--rd-fg); font-weight: 600; }

/* ---------- newsletter band status (themes without their own) */
.rd-nl-status { margin: 8px 0 0; font-weight: 600; }

@media print { .rd-ui, .rd-guide, .rd-footer-link { display: none !important; } }
