/* GTA HUB Forgejo theme (plan 02). Source of truth: THEME.md. Dark only.
 * Built on Forgejo's dark theme; only variables plus a few component rules are overridden,
 * so Forgejo upgrades keep working. Pass 1: colours + buttons. Fonts come in a later pass. */
@import url("./theme-forgejo-dark.css");

gitea-theme-meta-info {
  --theme-display-name: "GTA HUB";
  --theme-color-scheme: dark;
}

:root {
  /* THEME §1 tokens */
  --gh-bg: #0c0d1b;
  --gh-bg-gradient: linear-gradient(189deg, #1f1f38 0%, #18182d 30%, #111222 65%, #0c0d1b 100%);
  --gh-surface: #1f1f38;
  --gh-surface-2: #2a2947;
  --gh-border: #3d3b63;
  --gh-text: #ffffff;
  --gh-heading: #fff9cb;
  --gh-text-body: #e5ddff;
  --gh-lavender: #ccc2f5;
  --gh-muted: #9d97c4;
  --gh-accent: #e9639b;
  --gh-accent-hover: #f285b5;
  --gh-primary: #ffb2c6;
  --gh-primary-hover: #ffc7d6;
  --gh-on-accent: #0c0d1b;
  --gh-danger: #ff6b81;
  --gh-success: #7ee0c3;
  --gh-warning: #ffad36;

  /* Forgejo dark builds greys from a blue-grey "steel" ramp (#10161d…#d2e0f0) that is not in THEME §1.
   * Remap it to a navy→lavender ramp through THEME tokens (bg, surface, surface-2, border, muted, lavender,
   * text-body; in-between steps interpolated), so chips, counters, heatmap cells, etc. stay on-palette. */
  --steel-900: #0c0d1b;  /* --bg */
  --steel-850: #111222;
  --steel-800: #18182d;
  --steel-750: #1f1f38;  /* --surface */
  --steel-700: #2a2947;  /* --surface-2 */
  --steel-650: #333157;
  --steel-600: #3d3b63;  /* --border */
  --steel-550: #4b4875;
  --steel-500: #5a5787;
  --steel-450: #6b6799;
  --steel-400: #7c78ab;
  --steel-350: #8d88b8;
  --steel-300: #9d97c4;  /* --muted */
  --steel-250: #b0a9d3;
  --steel-200: #bfb7e3;
  --steel-150: #ccc2f5;  /* --lavender */
  --steel-100: #e5ddff;  /* --text-body */
  --color-secondary-alpha-10: #3331571a;
  --color-secondary-alpha-20: #33315733;
  --color-secondary-alpha-30: #3331574d;
  --color-secondary-alpha-40: #33315766;
  --color-secondary-alpha-50: #33315780;
  --color-secondary-alpha-60: #33315799;
  --color-secondary-alpha-70: #333157b3;
  --color-secondary-alpha-80: #333157cc;
  --color-secondary-alpha-90: #333157e6;
  /* Counter chips (Members 1, Repositories 1): surface-2 fill, lavender text. */
  --color-label-bg: var(--gh-surface-2);
  --color-label-text: var(--gh-lavender);
  --color-label-hover-bg: #333157;
  --color-label-active-bg: var(--gh-border);
  --color-label-bg-alt: var(--gh-surface-2);
  /* Repo-header counters next to disabled (signed-out) Watch/Star/Fork use this, with !important. */
  --color-light-mimic-enabled: var(--gh-surface);

  /* Forgejo mapping */
  --color-body: var(--gh-bg);
  --color-nav-bg: var(--gh-bg);
  --color-nav-hover-bg: var(--gh-surface-2);
  --color-secondary-nav-bg: var(--gh-bg);
  --color-header-wrapper: var(--gh-bg);
  --color-footer: var(--gh-bg);
  --color-box-body: var(--gh-surface);
  --color-box-body-highlight: var(--gh-surface-2);
  --color-box-header: var(--gh-surface-2);
  --color-card: var(--gh-surface);
  --color-menu: var(--gh-surface);
  --color-button: var(--gh-surface);
  --color-input-background: var(--gh-surface);
  --color-input-border: var(--gh-border);
  --color-input-border-hover: var(--gh-muted);
  --color-input-text: var(--gh-text);
  --color-placeholder-text: var(--gh-muted);
  --color-hover: var(--gh-surface-2);
  --color-active: var(--gh-surface-2);
  --color-tooltip-bg: var(--gh-surface-2);
  --color-tooltip-text: var(--gh-text);
  --color-code-bg: #111222;
  --color-markup-code-block: #111222;
  --color-markup-code-inline: var(--gh-surface-2);
  --color-secondary: var(--gh-border);
  --color-light-border: var(--gh-border);
  --color-timeline: var(--gh-border);

  --color-text: var(--gh-text-body);
  --color-text-dark: var(--gh-text);
  --color-text-light: var(--gh-lavender);
  --color-text-light-1: var(--gh-muted);
  --color-text-light-2: var(--gh-muted);
  --color-text-light-3: var(--gh-muted);
  --color-caret: var(--gh-text);

  --color-primary: var(--gh-accent);
  --color-primary-contrast: var(--gh-on-accent);
  --color-primary-hover: var(--gh-accent-hover);
  --color-primary-active: var(--gh-accent-hover);
  --color-primary-dark-1: #ec74a6;
  --color-primary-dark-2: #ef85b1;
  --color-primary-dark-3: #f297bd;
  --color-primary-dark-4: #f5a9c8;
  --color-primary-light-1: #d45a8d;
  --color-primary-light-2: #bf5180;
  --color-primary-light-3: #a94872;
  --color-primary-light-4: #943f64;
  --color-primary-light-5: #7f3656;
  --color-primary-light-6: #6a2d48;
  --color-primary-light-7: #55243a;
  --color-primary-alpha-10: #e9639b1a;
  --color-primary-alpha-20: #e9639b33;
  --color-primary-alpha-30: #e9639b4d;
  --color-primary-alpha-40: #e9639b66;
  --color-primary-alpha-50: #e9639b80;
  --color-primary-alpha-60: #e9639b99;
  --color-primary-alpha-70: #e9639bb3;
  --color-primary-alpha-80: #e9639bcc;
  --color-primary-alpha-90: #e9639be6;
  --color-accent: var(--gh-accent);
  --color-small-accent: var(--gh-accent-hover);
  --color-selection-bg: #e9639b59;
  --color-selection-fg: var(--gh-text);

  --color-red: var(--gh-danger);
  --color-green: var(--gh-success);
  --color-yellow: var(--gh-warning);
  --color-orange: var(--gh-warning);
  --color-error-text: var(--gh-danger);
  --color-success-text: var(--gh-success);
  --color-warning-text: var(--gh-warning);
  --color-error-border: var(--gh-danger);
  --color-success-border: var(--gh-success);
  --color-warning-border: var(--gh-warning);
}

/* THEME §1: page gradient background */
body { background: var(--gh-bg-gradient) fixed var(--gh-bg); }

/* THEME §3 Links: accent, underline + accent-hover on hover */
a:hover { color: var(--gh-accent-hover); }

/* THEME §3 Buttons. Shape: pill, except where Forgejo joins a button to a neighbour
 * (button groups, labeled buttons, action inputs, dropdown buttons) - those keep square inner corners. */
.ui.button:not(.ui.buttons .button):not(.ui.labeled.button .button):not(.ui.labeled.button):not(.ui.action.input .button):not(.ui.dropdown .button) { border-radius: 999px; }

/* Fomantic (Forgejo's UI kit) hard-codes colours and inset box-shadow "borders" per state
 * (e.g. #d01919 on red hover). Every state below is set explicitly so none of those leak through. */
/* !important: Fomantic's colour-variant shadow rules out-specify anything reasonable. Borders carry the outline instead. */
.ui.button, .ui.button:hover, .ui.button:focus, .ui.button:active, .ui.button.active { box-shadow: none !important; text-shadow: none; background-image: none; }

/* Secondary (Forgejo default, basic, secondary): --surface fill (D20), 1px lavender border, white text; hover surface-2. */
.ui.button, .ui.basic.button, .ui.secondary.button, .ui.basic.buttons .button {
  background: var(--gh-surface);
  color: var(--gh-text);
  border: 1px solid var(--gh-lavender);
}
.ui.button:hover,
.ui.button:focus,
.ui.button:active,
.ui.button.active,
.ui.basic.button:hover,
.ui.basic.button:focus,
.ui.basic.button:active,
.ui.basic.button.active,
.ui.secondary.button:hover,
.ui.secondary.button:focus,
.ui.secondary.button:active,
.ui.secondary.button.active,
.ui.basic.buttons .button:hover,
.ui.basic.buttons .button:focus,
.ui.basic.buttons .button:active,
.ui.basic.buttons .button.active {
  background: var(--gh-surface-2);
  color: var(--gh-text);
  border-color: var(--gh-lavender);
}

/* Primary: pastel pink fill, navy text (D11). Active: brightness .95. */
.ui.primary.button, .ui.primary.buttons .button {
  background: var(--gh-primary);
  color: var(--gh-on-accent);
  border: 1px solid var(--gh-primary);
}
.ui.primary.button:hover,
.ui.primary.button:focus,
.ui.primary.buttons .button:hover,
.ui.primary.buttons .button:focus {
  background: var(--gh-primary-hover);
  color: var(--gh-on-accent);
  border-color: var(--gh-primary-hover);
}
.ui.primary.button:active,
.ui.primary.button.active,
.ui.primary.buttons .button:active,
.ui.primary.buttons .button.active {
  background: var(--gh-primary);
  color: var(--gh-on-accent);
  border-color: var(--gh-primary);
  filter: brightness(.95);
}
.ui.primary.buttons .button + .button { border-left-color: rgba(12, 13, 27, .25); }

/* Basic primary (outline accent). On surface-2 hover the text switches to accent-hover (THEME §1 rule). */
.ui.basic.primary.button, .ui.basic.primary.buttons .button { background: transparent; color: var(--gh-accent); border: 1px solid var(--gh-accent); }
.ui.basic.primary.button:hover,
.ui.basic.primary.button:focus,
.ui.basic.primary.button:active,
.ui.basic.primary.button.active,
.ui.basic.primary.buttons .button:hover,
.ui.basic.primary.buttons .button:focus,
.ui.basic.primary.buttons .button:active,
.ui.basic.primary.buttons .button.active { background: var(--gh-surface-2); color: var(--gh-accent-hover); border-color: var(--gh-accent-hover); }

/* Danger: secondary style with danger border + text (THEME §3). */
.ui.red.button, .ui.basic.red.button, .ui.negative.button, .ui.basic.negative.button, .ui.red.buttons .button, .ui.basic.red.buttons .button {
  background: transparent;
  color: var(--gh-danger);
  border: 1px solid var(--gh-danger);
}
.ui.red.button:hover,
.ui.red.button:focus,
.ui.red.button:active,
.ui.red.button.active,
.ui.basic.red.button:hover,
.ui.basic.red.button:focus,
.ui.basic.red.button:active,
.ui.basic.red.button.active,
.ui.negative.button:hover,
.ui.negative.button:focus,
.ui.negative.button:active,
.ui.negative.button.active,
.ui.basic.negative.button:hover,
.ui.basic.negative.button:focus,
.ui.basic.negative.button:active,
.ui.basic.negative.button.active,
.ui.red.buttons .button:hover,
.ui.red.buttons .button:focus,
.ui.red.buttons .button:active,
.ui.red.buttons .button.active,
.ui.basic.red.buttons .button:hover,
.ui.basic.red.buttons .button:focus,
.ui.basic.red.buttons .button:active,
.ui.basic.red.buttons .button.active {
  background: var(--gh-surface-2);
  color: var(--gh-danger);
  border-color: var(--gh-danger);
}

/* Success (merge etc.): not covered by THEME §3; success fill with navy text for contrast. */
.ui.green.button, .ui.basic.green.button, .ui.positive.button, .ui.basic.positive.button, .ui.green.buttons .button {
  background: var(--gh-success);
  color: var(--gh-on-accent);
  border: 1px solid var(--gh-success);
}
.ui.green.button:hover,
.ui.green.button:focus,
.ui.green.button:active,
.ui.green.button.active,
.ui.basic.green.button:hover,
.ui.basic.green.button:focus,
.ui.basic.green.button:active,
.ui.basic.green.button.active,
.ui.positive.button:hover,
.ui.positive.button:focus,
.ui.positive.button:active,
.ui.positive.button.active,
.ui.basic.positive.button:hover,
.ui.basic.positive.button:focus,
.ui.basic.positive.button:active,
.ui.basic.positive.button.active,
.ui.green.buttons .button:hover,
.ui.green.buttons .button:focus,
.ui.green.buttons .button:active,
.ui.green.buttons .button.active {
  background: #9be8d1;
  color: var(--gh-on-accent);
  border-color: #9be8d1;
}

/* Disabled: THEME §3 opacity .45 (Forgejo applies var(--opacity-disabled) with !important). */
:root { --opacity-disabled: .45; }
.ui.button.disabled, .ui.button:disabled { cursor: not-allowed; }

/* THEME §3 Focus */
:focus-visible { outline: 2px solid var(--gh-accent); outline-offset: 3px; }

/* THEME §2: headings cream, h1 white */
.markup h1, .ui.header.h1 { color: var(--gh-text); }
.markup h2, .markup h3, h2.ui.header, h3.ui.header { color: var(--gh-heading); }

/* THEME §5 Logo: minimum 32px rendered width (Forgejo default is 30px). */
#navbar-logo img { width: 32px; height: 32px; }

/* Labeled buttons (Watch | 1, Star | 0): button and counter read as one control, same lavender outline. */
/* Doubled class: Forgejo's repo header sets these counters to rgba(0,0,0,.3). */
.ui.ui.labeled.button > .label {
  background: var(--gh-surface);
  color: var(--gh-text);
  border-color: var(--gh-lavender);
}
.ui.ui.labeled.button:hover > .label { background: var(--gh-surface-2); }

/* Action inputs (search field + attached button): one outline, changing together on hover/focus. */
/* Doubled classes out-rank Fomantic's .ui.action.input:not([class*="left action"]) > .button rules. */
.ui.ui.ui.action.input > .button:not(.primary),
.ui.ui.ui.action.input > .button:not(.primary):hover { border-color: var(--color-input-border); background: var(--gh-surface); }
/* Selected toggle inside an action input (clone panel HTTPS/SSH): primary fill. */
.ui.ui.ui.action.input > .primary.button { background: var(--gh-primary); color: var(--gh-on-accent); border-color: var(--gh-primary); }
.ui.ui.ui.action.input:hover > input,
.ui.ui.ui.action.input:hover > .button { border-color: var(--color-input-border-hover); }
.ui.ui.ui.action.input > input:focus,
.ui.ui.ui.action.input > input:focus ~ .button { border-color: var(--gh-accent); }
/* The labeled pair is one pill: rounded outer ends, square seam. */
.ui.labeled.button > .button { border-radius: 999px 0 0 999px; }
.ui.labeled.button > .label { border-radius: 0 999px 999px 0; }
.repo-buttons .ui.ui.labeled.button > .label:hover { color: var(--gh-text); background: var(--gh-surface-2); }

/* Filled status labels (issue/PR state "Open", "Closed", warnings): THEME status colours are light,
 * so text is navy (--on-accent) for contrast (white on #7ee0c3 was ~1.7:1). */
.ui.ui.ui.ui.green.label, .ui.ui.ui.ui.red.label, .ui.ui.ui.ui.yellow.label, .ui.ui.ui.ui.orange.label,
.ui.green.labels .label, .ui.red.labels .label, .ui.yellow.labels .label, .ui.orange.labels .label {
  color: var(--gh-on-accent);
}
.ui.ui.ui.ui.green.label svg, .ui.ui.ui.ui.red.label svg { color: var(--gh-on-accent); }
