/*!
 * forgejo-github-theme — "github" (light)
 * Token layer for Forgejo 16.x. Installed as:
 *   <custom>/public/assets/css/theme-github.css
 *
 * This file ONLY declares custom properties (plus the syntax-highlighting
 * palette, which cannot be expressed as Forgejo tokens). All structural and
 * component styling lives in github-theme.css so that both the light and the
 * dark theme share one stylesheet and one cache entry.
 *
 * SPDX-License-Identifier: MIT
 */

:root,
:root[data-theme="github"],
.theme-github {
  color-scheme: light;
  --is-dark-theme: false;

  /* === Theme-owned tokens =============================================== *
   * Everything the theme's own CSS and JS reads. Override these (and only
   * these) in github-theme.branding.css to re-brand the instance.          */
  --gh-canvas: #ffffff;
  --gh-canvas-subtle: #f6f8fa;
  --gh-canvas-inset: #f6f8fa;
  --gh-canvas-overlay: #ffffff;
  --gh-border: #d0d7de;
  --gh-border-muted: #d8dee4;
  --gh-border-strong: #afb8c1;
  --gh-fg: #1f2328;
  --gh-fg-muted: #59636e;
  --gh-fg-subtle: #6e7781;
  --gh-fg-on-emphasis: #ffffff;

  --gh-accent: #0969da;
  --gh-accent-strong: #0757ba;
  --gh-accent-fg: #0969da;
  --gh-accent-subtle: #ddf4ff;
  --gh-accent-muted: rgb(84 174 255 / 40%);

  --gh-success: #2da44e;
  --gh-success-strong: #1a7f37;
  --gh-success-fg: #1a7f37;
  --gh-success-subtle: #dafbe1;
  --gh-success-muted: rgb(74 194 107 / 40%);

  --gh-danger: #cf222e;
  --gh-danger-strong: #a40e26;
  --gh-danger-fg: #cf222e;
  --gh-danger-subtle: #ffebe9;
  --gh-danger-muted: rgb(255 129 130 / 40%);

  --gh-attention: #bf8700;
  --gh-attention-fg: #9a6700;
  --gh-attention-subtle: #fff8c5;
  --gh-attention-muted: rgb(212 167 44 / 40%);

  --gh-done: #8250df;
  --gh-done-fg: #8250df;
  --gh-done-subtle: #fbefff;

  --gh-sponsor-fg: #bf3989;
  --gh-neutral-emphasis: #6e7781;
  --gh-neutral-subtle: rgb(234 238 242 / 50%);

  --gh-header-bg: #f6f8fa;
  --gh-header-fg: #1f2328;
  --gh-header-border: #d0d7de;
  --gh-header-hover: rgb(31 35 40 / 6%);

  --gh-shadow-small: 0 1px 0 rgb(31 35 40 / 4%);
  --gh-shadow-medium: 0 3px 6px rgb(140 149 159 / 15%);
  --gh-shadow-large: 0 8px 24px rgb(140 149 159 / 20%);
  --gh-shadow-inset: inset 0 1px 0 rgb(255 255 255 / 25%);
  --gh-shadow-focus: 0 0 0 3px rgb(9 105 218 / 30%);

  --gh-diff-add-bg: #e6ffec;
  --gh-diff-add-word: #abf2bc;
  --gh-diff-add-border: #4ac26b;
  --gh-diff-del-bg: #ffebe9;
  --gh-diff-del-word: #ffcecb;
  --gh-diff-del-border: #ff8182;
  --gh-diff-hunk-bg: #f6f8fa;
  --gh-diff-hunk-fg: #59636e;

  /* Language dots — recreated palette, not imported from anywhere. */
  --gh-lang-1: #3572a5;
  --gh-lang-2: #f1e05a;
  --gh-lang-3: #e34c26;
  --gh-lang-4: #563d7c;
  --gh-lang-5: #00add8;
  --gh-lang-6: #dea584;
  --gh-lang-7: #b07219;
  --gh-lang-8: #89e051;

  /* Geometry & branding knobs */
  --gh-radius: 6px;
  --gh-radius-small: 4px;
  --gh-radius-large: 12px;
  --gh-radius-pill: 2em;
  --gh-sidebar-width: 316px;
  --gh-sidebar-min: 240px;
  --gh-sidebar-max: 520px;
  --gh-filetree-width: 268px;
  --gh-header-height: 62px;
  --gh-subnav-height: 48px;
  --gh-content-max: 1280px;
  --gh-logo-url: none;
  --gh-logo-width: 32px;

  /* Density — overwritten by [data-gh-density] in github-theme.css */
  --gh-row-py: 8px;
  --gh-block-gap: 16px;
  --gh-font-size: 14px;
  --gh-line-height: 1.5;

  --gh-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans",
    Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --gh-font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  /* === Forgejo / Fomantic token mapping ================================= *
   * Mapping the theme palette onto the variables Forgejo's own stylesheets
   * consume. This is what makes untouched Forgejo pages look themed without
   * a single template override.                                            */

  --color-primary: #0969da;
  --color-primary-contrast: #ffffff;
  --color-primary-dark-1: #0860c4;
  --color-primary-dark-2: #0757ae;
  --color-primary-dark-3: #064e99;
  --color-primary-dark-4: #054583;
  --color-primary-dark-5: #053c6e;
  --color-primary-dark-6: #043358;
  --color-primary-dark-7: #032a43;
  --color-primary-light-1: #1a76e0;
  --color-primary-light-2: #3384e5;
  --color-primary-light-3: #4d92e9;
  --color-primary-light-4: #66a1ed;
  --color-primary-light-5: #80aff1;
  --color-primary-light-6: #99bef5;
  --color-primary-light-7: #b3ccf8;
  --color-primary-alpha-10: rgb(9 105 218 / 10%);
  --color-primary-alpha-20: rgb(9 105 218 / 20%);
  --color-primary-alpha-30: rgb(9 105 218 / 30%);
  --color-primary-alpha-40: rgb(9 105 218 / 40%);
  --color-primary-alpha-50: rgb(9 105 218 / 50%);
  --color-primary-alpha-60: rgb(9 105 218 / 60%);
  --color-primary-alpha-70: rgb(9 105 218 / 70%);
  --color-primary-alpha-80: rgb(9 105 218 / 80%);
  --color-primary-alpha-90: rgb(9 105 218 / 90%);
  --color-primary-hover: #0757ba;
  --color-primary-active: #044289;

  --color-secondary: #d0d7de;
  --color-secondary-dark-1: #c6cdd5;
  --color-secondary-dark-2: #bcc4cc;
  --color-secondary-dark-3: #afb8c1;
  --color-secondary-dark-4: #a1abb5;
  --color-secondary-dark-5: #939ea9;
  --color-secondary-dark-6: #85919d;
  --color-secondary-dark-7: #778491;
  --color-secondary-dark-8: #6e7781;
  --color-secondary-dark-9: #656d76;
  --color-secondary-dark-10: #5c6570;
  --color-secondary-dark-11: #545d68;
  --color-secondary-dark-12: #4b5560;
  --color-secondary-dark-13: #424d59;
  --color-secondary-light-1: #d8dee4;
  --color-secondary-light-2: #e1e6eb;
  --color-secondary-light-3: #eaeef2;
  --color-secondary-light-4: #f2f4f7;
  --color-secondary-alpha-10: rgb(208 215 222 / 10%);
  --color-secondary-alpha-20: rgb(208 215 222 / 20%);
  --color-secondary-alpha-30: rgb(208 215 222 / 30%);
  --color-secondary-alpha-40: rgb(208 215 222 / 40%);
  --color-secondary-alpha-50: rgb(208 215 222 / 50%);
  --color-secondary-alpha-60: rgb(208 215 222 / 60%);
  --color-secondary-alpha-70: rgb(208 215 222 / 70%);
  --color-secondary-alpha-80: rgb(208 215 222 / 80%);
  --color-secondary-alpha-90: rgb(208 215 222 / 90%);
  --color-secondary-button: #f6f8fa;
  --color-secondary-hover: #eaeef2;
  --color-secondary-active: #e1e6eb;
  --color-secondary-bg: #f6f8fa;

  /* Named colours used across Fomantic components */
  --color-red: #cf222e;
  --color-red-light: #e5534b;
  --color-red-dark-1: #a40e26;
  --color-red-dark-2: #82071e;
  --color-orange: #bc4c00;
  --color-orange-light: #fb8f44;
  --color-orange-dark-1: #953800;
  --color-orange-dark-2: #762c00;
  --color-yellow: #bf8700;
  --color-yellow-light: #d4a72c;
  --color-yellow-dark-1: #9a6700;
  --color-yellow-dark-2: #7d4e00;
  --color-olive: #6f7d1c;
  --color-olive-light: #a5b336;
  --color-green: #2da44e;
  --color-green-light: #4ac26b;
  --color-green-dark-1: #1a7f37;
  --color-green-dark-2: #116329;
  --color-teal: #1b7c83;
  --color-teal-light: #3192aa;
  --color-blue: #0969da;
  --color-blue-light: #218bff;
  --color-blue-dark-1: #0757ba;
  --color-blue-dark-2: #033d8b;
  --color-violet: #8250df;
  --color-violet-light: #a475f9;
  --color-purple: #8250df;
  --color-purple-light: #a475f9;
  --color-pink: #bf3989;
  --color-pink-light: #d8639e;
  --color-brown: #7d4e00;
  --color-brown-light: #a2721a;
  --color-black: #1f2328;
  --color-grey: #6e7781;
  --color-grey-light: #8c959f;
  --color-gold: #bf8700;
  --color-white: #ffffff;

  /* Status / message colours */
  --color-error-border: #ff8182;
  --color-error-bg: #ffebe9;
  --color-error-bg-active: #ffcecb;
  --color-error-bg-hover: #ffcecb;
  --color-error-text: #a40e26;
  --color-success-border: #4ac26b;
  --color-success-bg: #dafbe1;
  --color-success-text: #116329;
  --color-warning-border: #d4a72c;
  --color-warning-bg: #fff8c5;
  --color-warning-text: #7d4e00;
  --color-info-border: #54aeff;
  --color-info-bg: #ddf4ff;
  --color-info-text: #0a3069;

  /* Surfaces */
  --color-body: #ffffff;
  --color-box-header: #f6f8fa;
  --color-box-body: #ffffff;
  --color-box-body-highlight: #f6f8fa;
  --color-text: #1f2328;
  --color-text-light: #59636e;
  --color-text-light-1: #6e7781;
  --color-text-light-2: #8c959f;
  --color-text-light-3: #afb8c1;
  --color-text-dark: #010409;
  --color-footer: #ffffff;
  --color-timeline: #d8dee4;
  --color-input-text: #1f2328;
  --color-input-background: #ffffff;
  --color-input-toggle-background: #eaeef2;
  --color-input-border: #d0d7de;
  --color-input-border-hover: #afb8c1;
  --color-light: rgb(234 238 242 / 55%);
  --color-light-mimic-enabled: rgb(0 0 0 / 0%);
  --color-light-border: #d0d7de;
  --color-hover: rgb(208 215 222 / 32%);
  --color-active: rgb(208 215 222 / 48%);
  --color-menu: #ffffff;
  --color-card: #ffffff;
  --color-markup-table-row: rgb(234 238 242 / 45%);
  --color-markup-code-block: #f6f8fa;
  --color-markup-code-inline: rgb(129 139 152 / 12%);
  --color-button: #f6f8fa;
  --color-code-bg: #ffffff;
  --color-code-sidebar-bg: #f6f8fa;
  --color-shadow: rgb(140 149 159 / 20%);
  --color-shadow-opaque: #e1e6eb;
  --color-secondary-nav-bg: #ffffff;
  --color-expand-button: #eaeef2;
  --color-placeholder-text: #6e7781;
  --color-editor-line-highlight: #fff8c5;
  --color-project-column-bg: #f6f8fa;
  --color-caret: #1f2328;
  --color-reaction-bg: rgb(9 105 218 / 8%);
  --color-reaction-hover-bg: rgb(9 105 218 / 16%);
  --color-reaction-active-bg: rgb(9 105 218 / 22%);
  --color-tooltip-text: #ffffff;
  --color-tooltip-bg: #24292f;
  --color-nav-bg: #f6f8fa;
  --color-nav-hover-bg: rgb(31 35 40 / 6%);
  --color-nav-text: #1f2328;
  --color-label-text: #1f2328;
  --color-label-bg: rgb(234 238 242 / 90%);
  --color-label-hover-bg: #d8dee4;
  --color-label-active-bg: #d0d7de;
  --color-accent: #0969da;
  --color-small-accent: #ddf4ff;
  --color-active-line: #fff8c5;
  --color-console-fg: #e6edf3;
  --color-console-fg-subtle: #8b949e;
  --color-console-bg: #0d1117;
  --color-console-border: #30363d;
  --color-console-hover-bg: #161b22;
  --color-console-active-bg: #21262d;
  --color-console-menu-bg: #161b22;
  --color-console-menu-border: #30363d;
  --color-overlay-backdrop: rgb(31 35 40 / 50%);

  /* Diff */
  --color-diff-removed-word-bg: #ffcecb;
  --color-diff-added-word-bg: #abf2bc;
  --color-diff-removed-row-bg: #ffebe9;
  --color-diff-moved-row-bg: #fff8c5;
  --color-diff-added-row-bg: #e6ffec;
  --color-diff-removed-row-border: #ff8182;
  --color-diff-moved-row-border: #d4a72c;
  --color-diff-added-row-border: #4ac26b;
  --color-diff-inactive: #f6f8fa;

  /* Highlighting */
  --color-highlight-bg: #fff8c5;
  --color-highlight-fg: #1f2328;
  --color-highlight-mark-bg: #fff8c5;

  /* Git graph lanes */
  --color-commit-graph-1: #0969da;
  --color-commit-graph-2: #1a7f37;
  --color-commit-graph-3: #8250df;
  --color-commit-graph-4: #bc4c00;
  --color-commit-graph-5: #bf3989;
  --color-commit-graph-6: #1b7c83;
  --color-commit-graph-7: #9a6700;
}

/* --------------------------------------------------------------------------
 * Syntax highlighting (chroma) — GitHub light
 * These are plain class rules rather than tokens because Forgejo emits chroma
 * classes directly into the markup.
 * ------------------------------------------------------------------------ */
:root {
  --color-syntax-comment: #6e7781;
  --color-syntax-keyword: #cf222e;
  --color-syntax-entity: #8250df;
  --color-syntax-constant: #0550ae;
  --color-syntax-string: #0a3069;
  --color-syntax-variable: #953800;
  --color-syntax-tag: #116329;
  --color-syntax-heading: #0550ae;
  --color-syntax-error: #82071e;
  --color-syntax-error-bg: #ffebe9;
  --color-syntax-line-number: #8c959f;
}

.chroma { background: transparent; color: var(--gh-fg); }
.chroma .lnt,
.chroma .ln { color: var(--color-syntax-line-number); }
.chroma .hl { background-color: var(--color-highlight-bg); }
.chroma .c, .chroma .ch, .chroma .cm, .chroma .c1, .chroma .cs,
.chroma .cp, .chroma .cpf { color: var(--color-syntax-comment); font-style: italic; }
.chroma .k, .chroma .kc, .chroma .kd, .chroma .kn, .chroma .kp,
.chroma .kr, .chroma .kt, .chroma .ow { color: var(--color-syntax-keyword); }
.chroma .o { color: var(--color-syntax-keyword); }
.chroma .n { color: var(--gh-fg); }
.chroma .nf, .chroma .fm, .chroma .nc { color: var(--color-syntax-entity); }
.chroma .nb, .chroma .bp { color: var(--color-syntax-constant); }
.chroma .nn, .chroma .nx { color: var(--gh-fg); }
.chroma .nt { color: var(--color-syntax-tag); }
.chroma .na { color: var(--color-syntax-variable); }
.chroma .nv, .chroma .vc, .chroma .vg, .chroma .vi { color: var(--color-syntax-variable); }
.chroma .no, .chroma .nd, .chroma .ni, .chroma .ne,
.chroma .nl, .chroma .py { color: var(--color-syntax-constant); }
.chroma .s, .chroma .sa, .chroma .sb, .chroma .sc, .chroma .dl, .chroma .sd,
.chroma .s2, .chroma .se, .chroma .sh, .chroma .si, .chroma .sx,
.chroma .sr, .chroma .s1, .chroma .ss { color: var(--color-syntax-string); }
.chroma .m, .chroma .mb, .chroma .mf, .chroma .mh, .chroma .mi,
.chroma .il, .chroma .mo { color: var(--color-syntax-constant); }
.chroma .err { color: var(--color-syntax-error); background-color: var(--color-syntax-error-bg); }
.chroma .gd { color: #82071e; background-color: var(--gh-diff-del-bg); }
.chroma .gi { color: #116329; background-color: var(--gh-diff-add-bg); }
.chroma .gh { color: var(--color-syntax-heading); font-weight: 600; }
.chroma .gu { color: var(--color-syntax-entity); }
.chroma .ge { font-style: italic; }
.chroma .gs { font-weight: 600; }
.chroma .gl { text-decoration: underline; }
.chroma .gp { color: var(--gh-fg-muted); }
