/* ==========================================================================
   Theme tokens — the only place colors and metrics are defined.
   Components consume variables only, which is what makes theme packs
   (extra palettes, density, accents) drop-in data later.

   Values marked [APK] are taken from RIF's own decoded resources
   (res/values/colors.xml, redditisfun 4.13.2) — see docs/SPEC.md.
   Values marked [REF] are sampled from the RIF 5.x reference screenshots.
   ========================================================================== */

:root {
  --rif-font: 'Roboto', system-ui, -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --rif-font-size: 14px;
  --rif-line-height: 1.32;

  /* Metrics — [APK] dimens + [REF] screenshots, scaled to a ~412px viewport */
  --rif-topbar-h: 48px;
  --rif-tabs-h: 32px;
  --rif-tab-min: 72px;          /* [APK] design_tab_scrollable_min_width */
  --rif-gutter-w: 32px;
  --rif-thumb-size: 48px;
  --rif-pad: 7px;
  --rif-indent: 18px;
  --rif-drawer-w: min(58vw, 240px);
}

/* ------------------------------- Light ---------------------------------- */
[data-theme='light'] {
  --rif-bg: #efefef;            /* [APK] light_light_gray */
  --rif-panel: #dfdfdf;         /* [APK] light_gray */
  --rif-tabs-bg: #c9c9c9;       /* [REF] */
  --rif-tab-text: #444444;
  --rif-tab-text-active: #111111;
  --rif-tab-divider: #bdbdbd;
  --rif-border: #d0d0d0;
  --rif-text: #212121;          /* [APK] primary_text_default_material_light */
  --rif-meta: #3f3f3f;          /* [REF] comments · subreddit line */
  --rif-dim: #6d6d6d;           /* [REF] byline */
  --rif-domain: #9a9a9a;        /* [REF] light gray domain suffix */
  --rif-score: #9e9e9e;         /* [REF] score under the arrow */
  --rif-link: #35338f;          /* [REF] muted indigo (4.13 was #0000ff) */
  --rif-link-visited: #5a4778;  /* [REF] (4.13 was #551a8b) */
  --rif-link-inline: #268bd2;   /* [APK] markdown_link_color */
  --rif-accent: #33b5e5;        /* [REF] Holo blue tab underline (4.13 was #336699) */
  --rif-on-accent: #111111;     /* [LAB] dark text on the light Holo blue fill */
  --rif-selected-bg: #dfeafe;   /* [APK] list_item_checked_light over bg */
  --rif-vote: #c0c0c0;          /* [APK] arrow_gray */
  --rif-up: #ff8b60;            /* [APK] arrow_red */
  --rif-down: #9494ff;          /* [APK] arrow_blue */
  --rif-action: #333333;        /* [REF] action bar text */
  --rif-icon: #555555;
  --rif-thumb-bg: #d8d8d8;
  --rif-nsfw: #ff0000;          /* [APK] nsfw_text */
  --rif-scrim: rgba(0, 0, 0, 0.18);
  --rif-backdrop: #e3e3e3;      /* area around the shell on wide screens */
}

/* ------------------------------- Dark ----------------------------------- */
[data-theme='dark'] {
  --rif-bg: #303030;            /* [APK] background_material_dark */
  --rif-panel: #212121;         /* [APK] colorPrimary */
  --rif-tabs-bg: #2e2e2e;
  --rif-tab-text: #cfcfcf;
  --rif-tab-text-active: #ffffff;
  --rif-tab-divider: #3c3c3c;
  --rif-border: #424242;
  --rif-text: #ffffff;          /* [APK] primary_text_default_material_dark */
  --rif-meta: #cccccc;
  --rif-dim: #8f8f8f;
  --rif-domain: #8f8f8f;
  --rif-score: #a0a0a0;
  --rif-link: #ffffff;          /* [APK] threads_list_title_unclicked_darktheme */
  --rif-link-visited: #aaaaff;  /* [APK] light_purple */
  --rif-link-inline: #6fb6e8;
  --rif-accent: #aadff1;        /* [APK] accent_darktheme */
  --rif-on-accent: #111111;     /* [LAB] dark text on the pale accent fill */
  --rif-selected-bg: #253344;   /* [APK] list_item_checked_dark (#3F3068AE) over bg */
  --rif-vote: #c0c0c0;
  --rif-up: #ff8b60;
  --rif-down: #9494ff;
  --rif-action: #dddddd;        /* [APK] list_item_actions_text_darktheme */
  --rif-icon: #cfcfcf;
  --rif-thumb-bg: #424242;
  --rif-nsfw: #ff5555;
  --rif-scrim: rgba(0, 0, 0, 0.5);
  --rif-backdrop: #191919;
}

/* ------------------------------- Night ---------------------------------- */
/* True-black variant of the dark theme (RIF's "black background" option) */
[data-theme='night'] {
  --rif-bg: #000000;
  --rif-panel: #0f0f0f;
  --rif-tabs-bg: #161616;
  --rif-tab-text: #c9c9c9;
  --rif-tab-text-active: #ffffff;
  --rif-tab-divider: #262626;
  --rif-border: #222222;
  --rif-text: #e6e6e6;
  --rif-meta: #c9c9c9;
  --rif-dim: #8a8a8a;
  --rif-domain: #8a8a8a;
  --rif-score: #9a9a9a;
  --rif-link: #ffffff;
  --rif-link-visited: #aaaaff;
  --rif-link-inline: #6fb6e8;
  --rif-accent: #aadff1;
  --rif-on-accent: #111111;    /* [LAB] dark text on the pale accent fill */
  --rif-selected-bg: #1b2838;
  --rif-vote: #b5b5b5;
  --rif-up: #ff8b60;
  --rif-down: #9494ff;
  --rif-action: #d0d0d0;
  --rif-icon: #c9c9c9;
  --rif-thumb-bg: #1a1a1a;
  --rif-nsfw: #ff5555;
  --rif-scrim: rgba(0, 0, 0, 0.6);
  --rif-backdrop: #000000;
}
