/* ============================================================
   DATA — Forgejo theme  (theme-data.css)
   Target: Forgejo v15.0.3 · selector data-theme, auto light/dark.
   Install: /var/lib/forgejo/custom/public/assets/css/theme-data.css
   Activate (app.ini): [ui] THEMES = data   DEFAULT_THEME = data

   WHAT THIS IS: a variable-override theme. We remap Forgejo's brand
   ramp (--color-primary*) to DATA green + set the UI font; Forgejo's
   neutral steel/zinc greys are LEFT ALONE on purpose (they're
   contrast-tuned, and --color-accent/-highlight/-reaction/-selection
   all DERIVE from --color-primary, so remapping primary cascades the
   brand through links, buttons, active states, badges and accents).

   Values are mapped from design/tokens.css (--data-*) and
   design/theme.css (--ui-* dark choices). No hardcoded colours that
   aren't already DATA tokens; Forgejo var NAMES are kept verbatim so
   this drops onto the shipped theme-forgejo-auto.css structure 1:1.

   Scoped to [data-theme="data"] so it's correct as a named theme;
   the dark half mirrors forgejo-auto's @media(prefers-color-scheme:dark).
   ============================================================ */

/* ---- Self-hosted fonts (no Google; mirrors the main site) ----
   Builder drops the woff2 in custom/public/assets/fonts/ (same files
   as web/static/fonts/, per web/static/fonts/README.md). The forge is
   an app UI, so it uses the DATA UI font (Source Sans 3) only — the
   display serif and Roboto/data face are not needed here. */
@font-face{font-family:"Source Sans 3";font-style:normal;font-weight:400;font-display:swap;
  src:url("/assets/fonts/SourceSans3-Regular.woff2") format("woff2")}
@font-face{font-family:"Source Sans 3";font-style:normal;font-weight:600;font-display:swap;
  src:url("/assets/fonts/SourceSans3-SemiBold.woff2") format("woff2")}

/* ============================================================
   LIGHT  (default)
   ============================================================ */
[data-theme="data"]{
  /* UI font — Forgejo exposes a proportional-font CSS var */
  --fonts-proportional: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* ---- Brand ramp: Forgejo orange #c2410c → DATA green #396250 ----
     Light ramp convention (from forgejo-auto): dark-N progressively
     DARKER (hover/active/borders), light-N progressively LIGHTER. */
  --color-primary:           #396250; /* --data-green */
  --color-primary-contrast:  #ffffff; /* white text on green (AA) */
  --color-primary-dark-1:    #396250;
  --color-primary-dark-2:    #325643; /* → hover (see -hover below) */
  --color-primary-dark-3:    #325643;
  --color-primary-dark-4:    #2a4838; /* → active */
  --color-primary-dark-5:    #2a4838;
  --color-primary-dark-6:    #213a2d;
  --color-primary-dark-7:    #213a2d;
  --color-primary-light-1:   #4a7c63; /* --color-accent derives from this */
  --color-primary-light-2:   #5b9075;
  --color-primary-light-3:   #6fa888;
  --color-primary-light-4:   #93c2aa; /* → highlight-fg */
  --color-primary-light-5:   #bdddcd; /* → small-accent */
  --color-primary-light-6:   #dcefe5; /* → highlight-bg */
  --color-primary-light-7:   #eef6f1;
  --color-primary-alpha-10:  #39625019;
  --color-primary-alpha-20:  #39625033;
  --color-primary-alpha-30:  #3962504b;
  --color-primary-alpha-40:  #39625066;
  --color-primary-alpha-50:  #39625080;
  --color-primary-alpha-60:  #39625099;
  --color-primary-alpha-70:  #396250b3;
  --color-primary-alpha-80:  #396250cc;
  --color-primary-alpha-90:  #396250e1;
  --color-primary-hover:     var(--color-primary-dark-2);
  --color-primary-active:    var(--color-primary-dark-4);

  /* ---- Brand status green → align Forgejo's generic green to DATA ----
     (success states stay their own readable green; we only nudge the
     plain --color-green family used for "open"/positive accents.) */
  --color-green:        #396250;
  --color-green-dark-1: #325643;
  --color-green-dark-2: #2a4838;
  --color-green-light:  #4a7c63;

  /* ---- Optional brand chrome (commented; needs a visual check on the
     instance before enabling — Forgejo's header/footer text + icons are
     tuned for the neutral greys). Uncomment to tint chrome DATA-green:
  --color-nav-bg:           #213a2d;
  --color-header-wrapper:   #213a2d;
  --color-footer:           #1b3025;
  */
}

/* ============================================================
   DARK   (auto, via OS preference — mirrors forgejo-auto)
   Uses design/theme.css dark choices: brand #6fbe92 on near-black.
   Dark ramp convention inverts: dark-N get LIGHTER, light-N DARKER.
   ============================================================ */
@media (prefers-color-scheme: dark){
  [data-theme="data"]{
    --is-dark-theme: true;

    --color-primary:           #6fbe92; /* --ui-brand (dark): AA on dark */
    --color-primary-contrast:  #0c1612; /* --ui-on-brand */
    --color-primary-dark-1:    #88caa4;
    --color-primary-dark-2:    #88caa4;
    --color-primary-dark-3:    #a3d6ba;
    --color-primary-dark-4:    #a3d6ba;
    --color-primary-dark-5:    #c0e3d0;
    --color-primary-dark-6:    #c0e3d0;
    --color-primary-dark-7:    #dcefe5;
    --color-primary-light-1:   #5aa87d;
    --color-primary-light-2:   #4a9069;
    --color-primary-light-3:   #3d7857;
    --color-primary-light-4:   #316045;
    --color-primary-light-5:   #316045;
    --color-primary-light-6:   #244833;
    --color-primary-light-7:   #244833;
    --color-primary-alpha-10:  #6fbe9219;
    --color-primary-alpha-20:  #6fbe9233;
    --color-primary-alpha-30:  #6fbe924b;
    --color-primary-alpha-40:  #6fbe9266;
    --color-primary-alpha-50:  #6fbe9280;
    --color-primary-alpha-60:  #6fbe9299;
    --color-primary-alpha-70:  #6fbe92b3;
    --color-primary-alpha-80:  #6fbe92cc;
    --color-primary-alpha-90:  #6fbe92e1;
    --color-primary-hover:     var(--color-primary-light-1);
    --color-primary-active:    var(--color-primary-light-2);

    --color-green:        #6fbe92;
    --color-green-dark-1: #5aa87d;
    --color-green-dark-2: #4a9069;
    --color-green-light:  #88caa4;

    /* Optional brand chrome (dark) — uncomment with the light block:
    --color-nav-bg:         #0c1612;
    --color-header-wrapper: #0c1612;
    --color-footer:         #0a120e;
    */
  }
}
