/*
 * Custom Forgejo theme for forge.waxwing.studio — "Waxwing gold".
 *
 * Forgejo auto-discovers any public/assets/css/theme-<name>.css file under
 * CUSTOM_PATH and lists it in user Appearance settings as "waxwing" — this
 * is the same mechanism every built-in alternate theme uses, nothing
 * private or forked.
 *
 * Palette: the yellow tail band and fawn breast of a waxwing, mapped onto
 * the amber scale.
 *
 *
 * WHY THE WHOLE RAMP IS OVERRIDDEN, NOT JUST --color-primary
 *
 * Forgejo's auto theme does not derive its accent states from
 * --color-primary; it hardcodes all 27 of them, twice (once for light, once
 * for dark). --color-primary-hover is var(--color-primary-dark-2), which is
 * itself a literal, and every --color-primary-alpha-N is a literal
 * hex+alpha. So setting --color-primary alone recolors buttons and links
 * while leaving every hover, active, focus and alpha state the stock
 * orange. The full set is therefore restated below, per mode.
 *
 * Variable names, values and the light/dark split were read from this
 * instance's own served theme-forgejo-auto.css, not from generic docs:
 *   curl https://forge.waxwing.studio/assets/css/theme-forgejo-auto.css
 *
 *
 * THE LIGHT-N / DARK-N INVERSION
 *
 * These names are positional, not descriptive, and they swap between modes.
 * In light mode --color-primary-light-N walks *lighter* (light-7 is nearly
 * white) and dark-N walks darker. In dark mode both invert: dark-N walks
 * lighter, light-N walks darker. The stock theme relies on this to keep
 * "subtle background" and "strong foreground" meaning the same thing in
 * both modes, so the blocks below preserve the same scale positions rather
 * than assuming the names mean what they say.
 *
 * Scale positions mirror stock exactly (stock uses orange, this uses amber
 * at the identical steps), which is what keeps the contrast relationships
 * Forgejo already tuned. Measured against the backgrounds these actually
 * land on, every pairing clears WCAG AA:
 *
 *   light  primary #b45309 on white ............ 5.02:1  (stock 5.18:1)
 *   light  hover   #92400e on white ............ 7.09:1  (stock 7.31:1)
 *   dark   primary #fbbf24 w/ black text ...... 12.58:1  (stock 9.28:1)
 *   dark   primary #fbbf24 on #1f1f23 .......... 9.84:1  (stock 7.26:1)
 *
 * The import inherits everything that is not the accent — greys, semantic
 * status colors, syntax highlighting — so a Forgejo upgrade that retunes
 * those is picked up for free, and the blast radius of this file stays the
 * accent ramp.
 */
@import "/assets/css/theme-forgejo-auto.css";

/* Light mode. Overrides the imported :root by source order (equal
 * specificity, declared later). */
:root {
  --color-primary: #b45309;           /* amber-700 */
  --color-primary-contrast: #ffffff;

  --color-primary-dark-1: #b45309;    /* amber-700 */
  --color-primary-dark-2: #92400e;    /* amber-800 */
  --color-primary-dark-3: #92400e;
  --color-primary-dark-4: #78350f;    /* amber-900 */
  --color-primary-dark-5: #78350f;
  --color-primary-dark-6: #78350f;
  --color-primary-dark-7: #78350f;

  --color-primary-light-1: #d97706;   /* amber-600 */
  --color-primary-light-2: #f59e0b;   /* amber-500 */
  --color-primary-light-3: #fbbf24;   /* amber-400 */
  --color-primary-light-4: #fcd34d;   /* amber-300 */
  --color-primary-light-5: #fde68a;   /* amber-200 */
  --color-primary-light-6: #fef3c7;   /* amber-100 */
  --color-primary-light-7: #fffbeb;   /* amber-50  */

  --color-primary-alpha-10: #b4530919;
  --color-primary-alpha-20: #b4530933;
  --color-primary-alpha-30: #b453094b;
  --color-primary-alpha-40: #b4530966;
  --color-primary-alpha-50: #b4530980;
  --color-primary-alpha-60: #b4530999;
  --color-primary-alpha-70: #b45309b3;
  --color-primary-alpha-80: #b45309cc;
  --color-primary-alpha-90: #b45309e1;

  --color-primary-hover: var(--color-primary-dark-2);
  --color-primary-active: var(--color-primary-dark-4);
}

/* Dark mode. A media query adds no specificity, so this must come after the
 * import's own dark block to win — and after the light block above, which
 * would otherwise apply in both modes. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-primary: #fbbf24;         /* amber-400 */
    --color-primary-contrast: #000;

    --color-primary-dark-1: #fcd34d;  /* amber-300 */
    --color-primary-dark-2: #fcd34d;
    --color-primary-dark-3: #fde68a;  /* amber-200 */
    --color-primary-dark-4: #fde68a;
    --color-primary-dark-5: #fef3c7;  /* amber-100 */
    --color-primary-dark-6: #fef3c7;
    --color-primary-dark-7: #fffbeb;  /* amber-50  */

    --color-primary-light-1: #f59e0b; /* amber-500 */
    --color-primary-light-2: #d97706; /* amber-600 */
    --color-primary-light-3: #b45309; /* amber-700 */
    --color-primary-light-4: #92400e; /* amber-800 */
    --color-primary-light-5: #92400e;
    --color-primary-light-6: #78350f; /* amber-900 */
    --color-primary-light-7: #78350f;

    --color-primary-alpha-10: #d9770619;
    --color-primary-alpha-20: #d9770633;
    --color-primary-alpha-30: #d977064b;
    --color-primary-alpha-40: #d9770666;
    --color-primary-alpha-50: #d9770680;
    --color-primary-alpha-60: #d9770699;
    --color-primary-alpha-70: #d97706b3;
    --color-primary-alpha-80: #d97706cc;
    --color-primary-alpha-90: #d97706e1;

    --color-primary-hover: var(--color-primary-light-1);
    --color-primary-active: var(--color-primary-light-2);
  }
}


/* ===========================================================================
 * CHROME - warmed at the base ramp, not variable by variable
 *
 * Stock's neutrals are cool: cool grey in light, and a distinctly blue steel in
 * dark. Against an amber accent that reads as two palettes sharing a page.
 *
 * An earlier version of this file warmed about twenty-five semantic variables
 * one at a time. That was the wrong altitude and it left most of the UI cool -
 * code blocks, cards, inputs, menus, the console, timelines. Stock does not
 * scatter its neutrals: it defines two base ramps and derives everything from
 * them. --zinc-* drives 53 variables in light, --steel-* drives 65 in dark.
 * Overriding the 35 ramp steps therefore reaches ~118 consumers, coherently,
 * and keeps every relationship stock already tuned.
 *
 * Each step holds the stock colour's relative luminance and rotates hue only
 * (36deg light, 32deg dark, 10-12pc saturation, flat rather than tapered).
 * Saturation is deliberately low: an earlier attempt used up to 30pc and turned
 * the mid-tones khaki, because a neutral carries far more visible chroma at mid
 * lightness than at the extremes. These values reproduce the previously
 * reviewed dark surfaces to within one channel step, so the look does not
 * shift; it only extends to everything that was still cool.
 *
 * The ramps live in a plain :root because stock defines them identically in
 * both schemes - there is nothing mode-specific to say about them.
 *
 * THE MIRROR RULE, WHICH THIS FILE PREVIOUSLY BROKE
 *
 * A :root block applies in BOTH schemes, and this file's :root is declared
 * after the import's dark block, so anything set here wins in dark mode too
 * unless the dark block below restates it. The previous version set fourteen
 * variables in :root and only eleven in dark, so five light values leaked into
 * dark: --color-active became #e7e1d9, a near-white, under --color-text
 * #e2ded8. That is 1.03:1 - the active navigation tab rendered as a pale block
 * with invisible text. --color-box-body-highlight (1.05:1) and
 * --color-secondary-hover (1.11:1) leaked the same way.
 *
 * So: every name declared in the light block below is declared again in the
 * dark block. The base ramps are the sole exception, and only because stock
 * gives them identical values in both schemes. check-theme-vars.sh enforces
 * this mechanically - it is not a convention to remember.
 *
 * Semantic colour is untouched: diff add/remove, status, badges, labels, the
 * console and ANSI palettes, and every language dot. Those encode meaning.
 * =========================================================================== */

:root {
  /* Base neutral ramps. Mode-independent - see the mirror rule above. */
  --zinc-50: #fafaf9;
  --zinc-100: #f5f4f2;
  --zinc-150: #eeecea;
  --zinc-200: #e6e4e1;
  --zinc-250: #dfdcd8;
  --zinc-300: #d8d4cf;
  --zinc-350: #bfbab1;
  --zinc-400: #a8a095;
  --zinc-450: #92887a;
  --zinc-500: #797063;
  --zinc-550: #686155;
  --zinc-600: #595248;
  --zinc-650: #4e483f;
  --zinc-700: #443f37;
  --zinc-750: #36332d;
  --zinc-800: #2a2722;
  --zinc-850: #221f1b;
  --zinc-900: #1a1815;

  --steel-100: #e1ded9;
  --steel-150: #d2cdc6;
  --steel-200: #c3bbb3;
  --steel-250: #b4aa9f;
  --steel-300: #a4988b;
  --steel-350: #968879;
  --steel-400: #87796a;
  --steel-450: #766b5d;
  --steel-500: #675c51;
  --steel-550: #574f45;
  --steel-600: #484038;
  --steel-650: #3a342d;
  --steel-700: #302c26;
  --steel-750: #292520;
  --steel-800: #201d19;
  --steel-850: #1c1916;
  --steel-900: #171512;
}

:root {
  /* Light-mode literals: stock hardcodes these rather than deriving them from
   * --zinc-*, so the ramp cannot reach them. Every name here is mirrored in the
   * dark block below. */
  --color-grey: #5a544a;
  --color-grey-light: #797063;
  --color-header-wrapper-transparent: #e1deda00;
  --color-secondary-alpha-10: #d8d4cf19;
  --color-secondary-alpha-20: #d8d4cf33;
  --color-secondary-alpha-30: #d8d4cf4b;
  --color-secondary-alpha-40: #d8d4cf66;
  --color-secondary-alpha-50: #d8d4cf80;
  --color-secondary-alpha-60: #d8d4cf99;
  --color-secondary-alpha-70: #d8d4cfb3;
  --color-secondary-alpha-80: #d8d4cfcc;
  --color-secondary-alpha-90: #d8d4cfe1;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Mirrors of every name declared in the light block above. Restated as the
     * stock var() references where stock had them, so the ramp keeps driving
     * them rather than freezing a literal here. */
    --color-grey: var(--steel-500);
    --color-grey-light: var(--steel-300);
    --color-header-wrapper-transparent: #302c2600;
    --color-secondary-alpha-10: #3a342d19;
    --color-secondary-alpha-20: #3a342d33;
    --color-secondary-alpha-30: #3a342d4b;
    --color-secondary-alpha-40: #3a342d66;
    --color-secondary-alpha-50: #3a342d80;
    --color-secondary-alpha-60: #3a342d99;
    --color-secondary-alpha-70: #3a342db3;
    --color-secondary-alpha-80: #3a342dcc;
    --color-secondary-alpha-90: #3a342de1;

    /* Dark-only: cool literals with no ramp behind them. */
    --color-black: #1a1815;
    --color-black-dark-1: #181513;
    --color-black-dark-2: #1a1815;
    --color-black-light: #2c2822;
    --color-expand-button: #463f37;
  }
}

/*
 * The footer language switcher.
 *
 * SHOW_FOOTER_VERSION, SHOW_FOOTER_POWERED_BY and SHOW_FOOTER_TEMPLATE_LOAD_TIME
 * remove the rest of the footer's clutter from config. There is no equivalent
 * setting for the language dropdown, and the alternative is taking ownership of
 * base/footer_content.tmpl — a 35-line upstream file carrying the
 * custom/extra_links_footer hook this repo already uses — to delete one element.
 * A rule here is the cheaper trade: it fails visible (the dropdown comes back)
 * rather than fails broken (a stale template override).
 *
 * The licenses link beside it deliberately stays. Forgejo is GPL and that link
 * is how third-party licence texts are served.
 *
 * Signed-in users keep a language selector in Settings -> Appearance, so this
 * removes an affordance from the footer, not from the instance.
 */
.page-footer .right-links .language {
  display: none;
}
