/* Omnitas theme for Gitea 1.25.5 (2026-11-16).
   Imports Gitea's own dark theme and overrides its CSS variables with the Omnitas brand.
   Brand source: OmniCert omnicert/web/static/tokens.css at commit e50d342 (values copied,
   never altered). Dark only: there is no light theme.

   Contrast floor, enforced by tests/test_contrast.py over the final cascade: every text colour at
   least 4.5:1, every control outline and the focus ring at least 3:1, against every surface it can
   sit on. Changing a colour so that a floor is missed fails that test.

   Where a variable below is not a brand value, the comment says how it is derived. */
@import url("./theme-gitea-dark.css");

gitea-theme-meta-info {
  --theme-display-name: "Omnitas";
}

/* Typeface: Schibsted Grotesk, self-hosted (the files are verbatim copies from OmniCert). */
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: italic;
  font-weight: 400 900;
  font-display: swap;
  src: url("../fonts/schibsted-grotesk-latin-wght-italic.woff2") format("woff2");
}

:root {
  /* Dark only. Gitea's Mermaid picks its dark theme from --is-dark-theme. */
  --is-dark-theme: true;
  color-scheme: dark;

  /* Brand tokens (OmniCert tokens.css, e50d342). */
  --omnitas-ground: #0d1f2e;
  --omnitas-deep: #08141f;
  --omnitas-surface: #192a38;          /* --color-surface-solid */
  --omnitas-surface-raised: #20313f;   /* --color-surface-raised-solid */
  --omnitas-ink: #f7f4ee;
  --omnitas-muted: #b2bcc8;
  --omnitas-champagne: #daad82;
  --omnitas-champagne-light: #e6c29e;  /* link and accent hover */
  --omnitas-border-strong: #8498ac;
  --omnitas-success: #5fd39a;
  --omnitas-warning: #f0b84a;
  --omnitas-danger: #f89bad;
  --omnitas-info: #9cc0e2;             /* make-renewals --color-info */
  --omnitas-focus: #daad82;            /* OmniCert --color-focus */

  --fonts-proportional: "Schibsted Grotesk", -apple-system, "Segoe UI", system-ui, Roboto, "Helvetica Neue", Arial, sans-serif;

  /* Ground and surfaces. */
  --color-body: var(--omnitas-ground);
  --color-nav-bg: var(--omnitas-deep);
  --color-footer: var(--omnitas-deep);
  --color-secondary-nav-bg: #0b1a27;               /* midway between ground and deep */
  --color-box-header: var(--omnitas-surface-raised);
  --color-box-body: var(--omnitas-surface);
  --color-box-body-highlight: var(--omnitas-surface-raised);
  --color-menu: var(--omnitas-surface);
  --color-card: var(--omnitas-surface);
  --color-button: var(--omnitas-surface);
  --color-input-background: var(--omnitas-deep);
  --color-input-toggle-background: var(--omnitas-surface-raised);
  --color-code-bg: var(--omnitas-deep);
  --color-secondary-bg: var(--omnitas-surface-raised);
  --color-expand-button: var(--omnitas-surface-raised);
  --color-nav-hover-bg: var(--omnitas-surface);
  --color-timeline: #284053;                       /* --color-border over the surface, opaque */
  --color-overlay-backdrop: rgba(8, 20, 31, 0.75);

  /* Translucent layers (brand values: --color-surface-raised, --color-well, --color-hover). */
  --color-hover: rgba(255, 255, 255, 0.06);
  --color-hover-opaque: #273744;                   /* the line above over --color-box-body */
  --color-active: rgba(255, 255, 255, 0.1);
  --color-markup-table-row: rgba(255, 255, 255, 0.03);
  --color-markup-code-block: rgba(8, 20, 31, 0.4);
  --color-markup-code-inline: rgba(8, 20, 31, 0.4);
  --color-reaction-bg: rgba(255, 255, 255, 0.06);

  /* Text. Two brand levels only, so the four "light" steps all use the muted colour. */
  --color-text: var(--omnitas-ink);
  --color-text-dark: var(--omnitas-ink);
  --color-text-light: var(--omnitas-muted);
  --color-text-light-1: var(--omnitas-muted);
  --color-text-light-2: var(--omnitas-muted);
  --color-text-light-3: var(--omnitas-muted);
  --color-input-text: var(--omnitas-ink);
  --color-placeholder-text: var(--omnitas-muted);
  --color-nav-text: var(--omnitas-ink);
  --color-label-text: var(--omnitas-ink);
  --color-label-active-bg: #5a6a7a;                /* was #728292: --color-label-text on it was 3.59:1 */

  /* Primary: champagne. The dark-N steps mix toward white and the light-N steps toward black,
     the same direction as Gitea's own dark theme. */
  --color-primary: var(--omnitas-champagne);
  --color-primary-contrast: var(--omnitas-ground);
  --color-primary-dark-1: color-mix(in srgb, var(--omnitas-champagne) 90%, #fff);
  --color-primary-dark-2: color-mix(in srgb, var(--omnitas-champagne) 80%, #fff);
  --color-primary-dark-3: color-mix(in srgb, var(--omnitas-champagne) 70%, #fff);
  --color-primary-dark-4: color-mix(in srgb, var(--omnitas-champagne) 60%, #fff);
  --color-primary-dark-5: color-mix(in srgb, var(--omnitas-champagne) 40%, #fff);
  --color-primary-dark-6: color-mix(in srgb, var(--omnitas-champagne) 20%, #fff);
  --color-primary-dark-7: color-mix(in srgb, var(--omnitas-champagne) 6%, #fff);
  --color-primary-light-1: color-mix(in srgb, var(--omnitas-champagne) 86%, #000);
  --color-primary-light-2: color-mix(in srgb, var(--omnitas-champagne) 75%, #000);
  --color-primary-light-3: color-mix(in srgb, var(--omnitas-champagne) 66%, #000);
  --color-primary-light-4: color-mix(in srgb, var(--omnitas-champagne) 57%, #000);
  --color-primary-light-5: color-mix(in srgb, var(--omnitas-champagne) 38%, #000);
  --color-primary-light-6: color-mix(in srgb, var(--omnitas-champagne) 18%, #000);
  --color-primary-light-7: color-mix(in srgb, var(--omnitas-champagne) 6%, #000);
  --color-primary-alpha-10: color-mix(in srgb, var(--omnitas-champagne) 10%, transparent);
  --color-primary-alpha-20: color-mix(in srgb, var(--omnitas-champagne) 20%, transparent);
  --color-primary-alpha-30: color-mix(in srgb, var(--omnitas-champagne) 30%, transparent);
  --color-primary-alpha-40: color-mix(in srgb, var(--omnitas-champagne) 40%, transparent);
  --color-primary-alpha-50: color-mix(in srgb, var(--omnitas-champagne) 50%, transparent);
  --color-primary-alpha-60: color-mix(in srgb, var(--omnitas-champagne) 60%, transparent);
  --color-primary-alpha-70: color-mix(in srgb, var(--omnitas-champagne) 70%, transparent);
  --color-primary-alpha-80: color-mix(in srgb, var(--omnitas-champagne) 80%, transparent);
  --color-primary-alpha-90: color-mix(in srgb, var(--omnitas-champagne) 90%, transparent);
  --color-primary-hover: var(--omnitas-champagne-light);
  --color-primary-active: var(--color-primary-light-1);
  --color-accent: var(--omnitas-champagne);

  /* Secondary: the brand border (--color-border, rgba(107,159,206,0.18)) over the surface is
     #284053; the scale is mixed from it, with the steps Gitea's own dark theme uses. */
  --color-secondary: #284053;
  --color-secondary-dark-1: color-mix(in srgb, #284053 97%, #fff);
  --color-secondary-dark-2: color-mix(in srgb, #284053 93%, #fff);
  --color-secondary-dark-3: color-mix(in srgb, #284053 86%, #fff);
  --color-secondary-dark-4: color-mix(in srgb, #284053 78%, #fff);
  --color-secondary-dark-5: color-mix(in srgb, #284053 50%, #fff);   /* text (.form .help): 4.5:1 on every surface */
  --color-secondary-dark-6: color-mix(in srgb, #284053 49.5%, #fff);  /* text and icons only in Gitea 1.25.5 */
  --color-secondary-dark-7: color-mix(in srgb, #284053 49%, #fff);    /* file icons */
  --color-secondary-dark-8: color-mix(in srgb, #284053 48%, #fff);
  --color-secondary-dark-9: color-mix(in srgb, #284053 44%, #fff);
  --color-secondary-dark-10: color-mix(in srgb, #284053 37%, #fff);
  --color-secondary-dark-11: color-mix(in srgb, #284053 30%, #fff);
  --color-secondary-dark-12: color-mix(in srgb, #284053 25%, #fff);
  --color-secondary-dark-13: color-mix(in srgb, #284053 23%, #fff);
  --color-secondary-light-1: color-mix(in srgb, #284053 83%, #000);
  --color-secondary-light-2: color-mix(in srgb, #284053 69%, #000);
  --color-secondary-light-3: color-mix(in srgb, #284053 49%, #000);
  --color-secondary-light-4: color-mix(in srgb, #284053 39%, #000);
  --color-secondary-alpha-10: color-mix(in srgb, #284053 10%, transparent);
  --color-secondary-alpha-20: color-mix(in srgb, #284053 20%, transparent);
  --color-secondary-alpha-30: color-mix(in srgb, #284053 30%, transparent);
  --color-secondary-alpha-40: color-mix(in srgb, #284053 40%, transparent);
  --color-secondary-alpha-50: color-mix(in srgb, #284053 50%, transparent);
  --color-secondary-alpha-60: color-mix(in srgb, #284053 60%, transparent);
  --color-secondary-alpha-70: color-mix(in srgb, #284053 70%, transparent);
  --color-secondary-alpha-80: color-mix(in srgb, #284053 80%, transparent);
  --color-secondary-alpha-90: color-mix(in srgb, #284053 90%, transparent);

  /* Outlines of controls: brand --color-border-strong, 3:1 on every surface. */
  --color-input-border: var(--omnitas-border-strong);
  --color-input-border-hover: var(--omnitas-muted);
  --color-light-border: var(--omnitas-border-strong);

  /* State colours: brand success, warning, danger; info from make-renewals. Backgrounds and
     borders are tints of the text colour (8% and 30% as in make-renewals). */
  --color-error-text: var(--omnitas-danger);
  --color-error-bg: color-mix(in srgb, var(--omnitas-danger) 8%, transparent);
  --color-error-bg-hover: color-mix(in srgb, var(--omnitas-danger) 12%, transparent);
  --color-error-bg-active: color-mix(in srgb, var(--omnitas-danger) 16%, transparent);
  --color-error-border: color-mix(in srgb, var(--omnitas-danger) 30%, transparent);
  --color-success-text: var(--omnitas-success);
  --color-success-bg: color-mix(in srgb, var(--omnitas-success) 8%, transparent);
  --color-success-border: color-mix(in srgb, var(--omnitas-success) 30%, transparent);
  --color-warning-text: var(--omnitas-warning);
  --color-warning-bg: color-mix(in srgb, var(--omnitas-warning) 8%, transparent);
  --color-warning-border: color-mix(in srgb, var(--omnitas-warning) 30%, transparent);
  --color-info-text: var(--omnitas-info);
  --color-info-bg: color-mix(in srgb, var(--omnitas-info) 8%, transparent);
  --color-info-border: color-mix(in srgb, var(--omnitas-info) 30%, transparent);

  /* The highlighted line in file views (brand --color-banner-bg tint, at a lower alpha so syntax
     colours keep their contrast on it). */
  --color-highlight-fg: var(--omnitas-champagne);
  --color-highlight-bg: rgba(218, 173, 130, 0.1);

  /* Console (Actions logs). */
  --color-console-fg: var(--omnitas-ink);
  --color-console-fg-subtle: var(--omnitas-muted);
  --color-console-bg: var(--omnitas-deep);
  --color-console-border: var(--omnitas-surface);
  --color-console-hover-bg: var(--omnitas-surface);
  --color-console-active-bg: var(--omnitas-surface-raised);
  --color-console-menu-bg: var(--omnitas-surface);
  --color-console-menu-border: #284053;
  --color-ansi-red: #f2788a;                      /* lightened from #cc4848 until 4.5:1 on the console */
  --color-ansi-magenta: #e268ac;                  /* lightened from #d22e8b */
  --color-ansi-bright-red: #ffa0aa;               /* lightened from #d15a5a: 4.5:1 on --color-ansi-bright-black cells too */

  /* Badges: the text colour is the brand state colour, the background a tint of it. */
  --color-red-badge: var(--omnitas-danger);
  --color-red-badge-bg: color-mix(in srgb, var(--omnitas-danger) 10%, transparent);
  --color-red-badge-hover-bg: color-mix(in srgb, var(--omnitas-danger) 20%, transparent);
  --color-green-badge: var(--omnitas-success);
  --color-green-badge-bg: color-mix(in srgb, var(--omnitas-success) 10%, transparent);
  --color-green-badge-hover-bg: color-mix(in srgb, var(--omnitas-success) 20%, transparent);
  --color-yellow-badge: var(--omnitas-warning);
  --color-yellow-badge-bg: color-mix(in srgb, var(--omnitas-warning) 10%, transparent);
  --color-yellow-badge-hover-bg: color-mix(in srgb, var(--omnitas-warning) 20%, transparent);
  --color-orange-badge: #f6a066;                  /* Gitea's own --color-orange-light, brighter than #f2711c */
  --color-orange-badge-bg: color-mix(in srgb, var(--color-orange-badge) 10%, transparent);
  --color-orange-badge-hover-bg: color-mix(in srgb, var(--color-orange-badge) 20%, transparent);

  /* Gitea's named palette. Gitea paints these both as text on the page (.text.red, delete buttons,
     message headers, alert titles) and as fills with --color-white text on top (.ui.red.button,
     labels, toasts). Both halves cannot be met with a light text colour, so every colour below is
     lightened (hue and saturation kept as far as the floor allows) until it reads 4.5:1 as text on
     every surface, and --color-white becomes the ground colour: dark text on a light fill, the way
     the champagne primary already works. Values were measured by tests/test_contrast.py R11. */
  --color-white: var(--omnitas-ground);            /* text on a coloured fill; the toggle knob has its own rule below */
  --color-red: #f67e7e;                            /* was #cc4848 */
  --color-red-light: #f98a8a;                      /* was #d15a5a */
  --color-red-dark-1: #f47a7a;                     /* was #c23636 */
  --color-red-dark-2: #f37878;                     /* was #ad3030 */
  --color-orange: #f4883a;                         /* was #cc580c */
  --color-blue: #6aaae0;                           /* was #3a8ac6 */
  --color-blue-dark-1: #66a6dc;                    /* was #347cb3 */
  --color-purple: #c98ae0;                         /* was #b259d0 */
  --color-purple-dark-1: #c386dc;                  /* was #a742c9 */
  --color-violet-dark-1: #b392ee;                  /* was #7b4edb */
  --color-green-dark-1: #84a95f;                   /* was #7a9e55 */
  --color-green-dark-2: #83a75e;                   /* was #6c8c4c */
  --color-yellow-dark-1: #c89603;                  /* was #b88a03 */
  --color-git: #f47b64;                            /* was #f05133 */
  --color-logo: #6eaf2b;                           /* was #609926 */
  --color-grey: #959fab;                           /* was #384149 */
  --color-grey-light: #aab5c0;                     /* was #818f9e */

  /* Diff rows: tints of the state colours over the ground, opaque so syntax colours sit on a
     known background. Word-level highlights are stronger than their row. */
  --color-diff-added-row-bg: color-mix(in srgb, var(--omnitas-success) 10%, var(--omnitas-ground));
  --color-diff-added-row-border: color-mix(in srgb, var(--omnitas-success) 24%, var(--omnitas-ground));
  --color-diff-added-linenum-bg: color-mix(in srgb, var(--omnitas-success) 14%, var(--omnitas-ground));
  --color-diff-added-word-bg: color-mix(in srgb, var(--omnitas-success) 20%, var(--omnitas-ground));
  --color-diff-removed-row-bg: color-mix(in srgb, var(--omnitas-danger) 10%, var(--omnitas-ground));
  --color-diff-removed-row-border: color-mix(in srgb, var(--omnitas-danger) 24%, var(--omnitas-ground));
  --color-diff-removed-linenum-bg: color-mix(in srgb, var(--omnitas-danger) 14%, var(--omnitas-ground));
  --color-diff-removed-word-bg: color-mix(in srgb, var(--omnitas-danger) 20%, var(--omnitas-ground));
  --color-diff-moved-row-bg: color-mix(in srgb, var(--omnitas-warning) 10%, var(--omnitas-ground));
  --color-diff-moved-row-border: color-mix(in srgb, var(--omnitas-warning) 40%, var(--omnitas-ground));
  --color-diff-inactive: var(--color-secondary-nav-bg);
}

/* Focus ring (spec item 5): champagne on every focusable element. Gitea's Fomantic rules set
   "outline: none" on .ui.button, .ui.dropdown and the inputs with higher specificity, hence
   !important. */
:focus-visible {
  outline: 2px solid var(--omnitas-focus) !important;
  outline-offset: 2px !important;
}

/* Syntax colours (Chroma). Gitea's dark theme tunes these for its own near-black ground; each
   group below is the original colour lightened just enough to reach 4.5:1 on every surface code
   sits on here: the code well, the Markdown code block, the diff rows and the highlighted line
   (tests/test_contrast.py, rules R6 and R10). */
.chroma .kp, .chroma .ow { color: #99b25c; }                      /* was #5f8700 */
.chroma .cpf, .chroma .dl, .chroma .il, .chroma .kc, .chroma .m, .chroma .mb, .chroma .mf,
.chroma .mh, .chroma .mi, .chroma .mo, .chroma .no { color: #81aecf; } /* was #649bc4 */
.chroma .vc, .chroma .vg, .chroma .vi { color: #7baaf1; }          /* was #649bee */
.chroma .c, .chroma .c1, .chroma .ch, .chroma .cm, .chroma .go, .chroma .w { color: #a4a9b7; } /* was #777e94, #7f8699 */
.chroma .cs, .chroma .sr { color: #b19edc; }                      /* was #9075cd */
.chroma .gr { color: #ff857a; }                                   /* was #f43 */
.chroma .gt, .chroma .k, .chroma .kd, .chroma .kr, .chroma .ne, .chroma .nl, .chroma .nt,
.chroma .o { color: #ff8759; }                                    /* was #ff7540 */
.chroma .kt { color: #ff847c; }                                   /* was #ff7b72 */
.chroma .se, .chroma .ss { color: #ff8744; }                      /* was #ff8540 */

/* ---------------------------------------------------------------------------------------------
   Gitea rules whose colour no variable value can fix (tests/test_contrast.py R11_SUPERSEDED).
   Each has the same selector and the same !important as Gitea's rule and loads after it, so it
   wins; the test checks these rules in place of Gitea's.
   Not here, deliberately: .tw-text-white. Gitea 1.25.5 uses it only on the icon badges of the
   issue timeline (reopen, close, merge, review verdict), always together with a tw-bg-green,
   -red, -purple or -grey fill, and its --color-white is the ground colour here: dark on those
   fills reads 6.25 to 6.55:1. A rule that made it light would read 2.33 to 2.44:1 on them.
   --------------------------------------------------------------------------------------------- */
.archived-icon { color: var(--color-text-light-2) !important; }
a.ui.ui.ui.grey.label:hover { color: var(--color-label-text); }
a.ui.ui.ui.basic.grey.label:hover { color: var(--color-text); }
#review-box .review-comments-counter { color: var(--omnitas-ink); }
.activity-bar-graph-alt { color: var(--omnitas-ink); }
/* --color-white is dark here, and Gitea uses it for the knob of a toggle too. */
.ui.toggle.checkbox label:after { background: var(--omnitas-ink); }

/* ---------------------------------------------------------------------------------------------
   Spec item 2: readable README and Markdown.
   A reading width of about 70 characters, a body line height of 1.6, headings in the brand's
   scale, tables styled for reading. Code blocks, tables and images keep the full width.
   --------------------------------------------------------------------------------------------- */
:root {
  --omnitas-border: rgba(107, 159, 206, 0.18);        /* brand --color-border */
  --omnitas-border-hover: rgba(107, 159, 206, 0.35);  /* brand --color-border-hover */
  --omnitas-ease-out: cubic-bezier(0.16, 1, 0.3, 1);  /* brand --ease-out */
  --omnitas-duration-slow: 240ms;                     /* brand --duration-slow */
}

.markup {
  line-height: 1.6 !important;   /* Gitea sets 1.5 !important on .markup */
}
.markup p,
.markup ul,
.markup ol,
.markup blockquote,
.markup h1,
.markup h2,
.markup h3,
.markup h4,
.markup h5,
.markup h6 {
  max-width: 70ch;
}
.markup h1,
.markup h2,
.markup h3,
.markup h4,
.markup h5,
.markup h6 {
  line-height: 1.2;
}
.markup h1 { font-size: clamp(1.75rem, 1.4rem + 1.4vw, 2.25rem); }  /* brand --text-2xl */
.markup h2 { font-size: 1.5rem; }                                   /* brand --text-xl */
.markup h3 { font-size: 1.125rem; }                                 /* brand --text-lg */
.markup h4 { font-size: 1rem; }                                     /* brand --text-base */
.markup h5,
.markup h6 { font-size: 0.875rem; }                                 /* brand --text-sm */
.markup table {
  border-collapse: collapse;
}
.markup table th,
.markup table td {
  padding: 0.5rem 0.75rem !important;   /* Gitea sets its own padding and borders with !important */
  border: 0 !important;
  border-bottom: 1px solid var(--omnitas-border) !important;
}
.markup table th {
  background: var(--color-box-header);
  text-align: left;
}
.markup table tr {
  border-top: 0;
}

/* ---------------------------------------------------------------------------------------------
   Spec item 3: topics coloured by prefix.
   The selectors match the prefix, never a full topic name, so a new topic is coloured without a
   change here. "&topic=1" is part of every match so a search-box query never gets a colour.
   Backgrounds are opaque tints of the text colour so the pair reads the same on every surface;
   tests/test_contrast.py rule R8 checks every --omnitas-*-text against its -bg (and -hover-bg).
   --------------------------------------------------------------------------------------------- */
:root {
  --omnitas-topic-type-text: #e6c29e;
  --omnitas-topic-area-text: #9cc0e2;
  --omnitas-topic-status-text: #b2bcc8;      /* the neutral family colour for any status-* value */
  --omnitas-topic-customer-text: #c3b1ec;
  --omnitas-topic-affair-text: #7fd6cf;
  --omnitas-topic-partner-text: #eba2c4;
  --omnitas-status-draft-text: var(--omnitas-warning);
  --omnitas-status-active-text: var(--omnitas-success);

  --omnitas-topic-type-bg: color-mix(in srgb, var(--omnitas-topic-type-text) 14%, var(--omnitas-surface));
  --omnitas-topic-area-bg: color-mix(in srgb, var(--omnitas-topic-area-text) 14%, var(--omnitas-surface));
  --omnitas-topic-status-bg: color-mix(in srgb, var(--omnitas-topic-status-text) 14%, var(--omnitas-surface));
  --omnitas-topic-customer-bg: color-mix(in srgb, var(--omnitas-topic-customer-text) 14%, var(--omnitas-surface));
  --omnitas-topic-affair-bg: color-mix(in srgb, var(--omnitas-topic-affair-text) 14%, var(--omnitas-surface));
  --omnitas-topic-partner-bg: color-mix(in srgb, var(--omnitas-topic-partner-text) 14%, var(--omnitas-surface));
  --omnitas-status-draft-bg: color-mix(in srgb, var(--omnitas-status-draft-text) 14%, var(--omnitas-surface));
  --omnitas-status-active-bg: color-mix(in srgb, var(--omnitas-status-active-text) 14%, var(--omnitas-surface));

  --omnitas-topic-type-hover-bg: color-mix(in srgb, var(--omnitas-topic-type-text) 20%, var(--omnitas-surface));
  --omnitas-topic-area-hover-bg: color-mix(in srgb, var(--omnitas-topic-area-text) 20%, var(--omnitas-surface));
  --omnitas-topic-status-hover-bg: color-mix(in srgb, var(--omnitas-topic-status-text) 20%, var(--omnitas-surface));
  --omnitas-topic-customer-hover-bg: color-mix(in srgb, var(--omnitas-topic-customer-text) 20%, var(--omnitas-surface));
  --omnitas-topic-affair-hover-bg: color-mix(in srgb, var(--omnitas-topic-affair-text) 20%, var(--omnitas-surface));
  --omnitas-topic-partner-hover-bg: color-mix(in srgb, var(--omnitas-topic-partner-text) 20%, var(--omnitas-surface));
  --omnitas-status-draft-hover-bg: color-mix(in srgb, var(--omnitas-status-draft-text) 20%, var(--omnitas-surface));
  --omnitas-status-active-hover-bg: color-mix(in srgb, var(--omnitas-status-active-text) 20%, var(--omnitas-surface));
}

a.ui.label[href*="/explore/repos?q=type-"][href*="&topic=1"] {
  color: var(--omnitas-topic-type-text);
  background: var(--omnitas-topic-type-bg);
  border-color: var(--omnitas-topic-type-text);
}
a.ui.label[href*="/explore/repos?q=area-"][href*="&topic=1"] {
  color: var(--omnitas-topic-area-text);
  background: var(--omnitas-topic-area-bg);
  border-color: var(--omnitas-topic-area-text);
}
a.ui.label[href*="/explore/repos?q=status-"][href*="&topic=1"]:not([href*="/explore/repos?q=status-draft&topic=1"], [href*="/explore/repos?q=status-active&topic=1"]) {
  color: var(--omnitas-topic-status-text);
  background: var(--omnitas-topic-status-bg);
  border-color: var(--omnitas-topic-status-text);
}
a.ui.label[href*="/explore/repos?q=customer-"][href*="&topic=1"] {
  color: var(--omnitas-topic-customer-text);
  background: var(--omnitas-topic-customer-bg);
  border-color: var(--omnitas-topic-customer-text);
}
a.ui.label[href*="/explore/repos?q=affair-"][href*="&topic=1"] {
  color: var(--omnitas-topic-affair-text);
  background: var(--omnitas-topic-affair-bg);
  border-color: var(--omnitas-topic-affair-text);
}
a.ui.label[href*="/explore/repos?q=partner-"][href*="&topic=1"] {
  color: var(--omnitas-topic-partner-text);
  background: var(--omnitas-topic-partner-bg);
  border-color: var(--omnitas-topic-partner-text);
}
/* status- carries meaning for the two values the convention defines; the exact match ends at
   "&topic=1", so a longer topic that starts with the same letters is not coloured by it.
   The neutral status- rule above excludes these two values with :not(), so the two sets of rules
   never compete: a more specific selector there would have outranked these (measured in a
   browser, 2026-11-16: status-draft and status-active rendered the neutral colour). */
a.ui.label[href*="/explore/repos?q=status-draft&topic=1"] {
  color: var(--omnitas-status-draft-text);
  background: var(--omnitas-status-draft-bg);
  border-color: var(--omnitas-status-draft-text);
}
a.ui.label[href*="/explore/repos?q=status-active&topic=1"] {
  color: var(--omnitas-status-active-text);
  background: var(--omnitas-status-active-bg);
  border-color: var(--omnitas-status-active-text);
}
/* Hover: Gitea's a.ui.label:hover would swap in its grey label colours. */
a.ui.label[href*="/explore/repos?q=type-"][href*="&topic=1"]:hover { background: var(--omnitas-topic-type-hover-bg); color: var(--omnitas-topic-type-text); }
a.ui.label[href*="/explore/repos?q=area-"][href*="&topic=1"]:hover { background: var(--omnitas-topic-area-hover-bg); color: var(--omnitas-topic-area-text); }
a.ui.label[href*="/explore/repos?q=status-"][href*="&topic=1"]:not([href*="/explore/repos?q=status-draft&topic=1"], [href*="/explore/repos?q=status-active&topic=1"]):hover { background: var(--omnitas-topic-status-hover-bg); color: var(--omnitas-topic-status-text); }
a.ui.label[href*="/explore/repos?q=customer-"][href*="&topic=1"]:hover { background: var(--omnitas-topic-customer-hover-bg); color: var(--omnitas-topic-customer-text); }
a.ui.label[href*="/explore/repos?q=affair-"][href*="&topic=1"]:hover { background: var(--omnitas-topic-affair-hover-bg); color: var(--omnitas-topic-affair-text); }
a.ui.label[href*="/explore/repos?q=partner-"][href*="&topic=1"]:hover { background: var(--omnitas-topic-partner-hover-bg); color: var(--omnitas-topic-partner-text); }
a.ui.label[href*="/explore/repos?q=status-draft&topic=1"]:hover { background: var(--omnitas-status-draft-hover-bg); color: var(--omnitas-status-draft-text); }
a.ui.label[href*="/explore/repos?q=status-active&topic=1"]:hover { background: var(--omnitas-status-active-hover-bg); color: var(--omnitas-status-active-text); }

/* ---------------------------------------------------------------------------------------------
   Spec item 4: a calmer repository list (explore, organisation, user profile).
   Repository list items are the .flex-item rows that carry a "forks" link
   (templates/shared/repo/list.tmpl in 1.25.5); issue and other lists are left alone.
   The description reads in text colour; the metadata row (language, stars, forks) and the
   "updated" line are muted and smaller.
   --------------------------------------------------------------------------------------------- */
.flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]) .flex-item-body {
  color: var(--color-text);
  font-size: 1rem;
}
.flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]) .flex-item-body:last-child,
.flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]) .flex-item-trailing {
  color: var(--color-text-light-2);
  font-size: 0.8125rem;
}

/* ---------------------------------------------------------------------------------------------
   Spec item 5: the small touches. Repository list items and cards lift 2 px on hover.
   The heatmap needs no CSS (it follows --color-primary) and Mermaid is drawn inside an iframe
   that no stylesheet reaches; it takes its dark theme from --is-dark-theme above.
   --------------------------------------------------------------------------------------------- */
.flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]),
.ui.card,
.ui.cards > .card {
  transition: transform var(--omnitas-duration-slow) var(--omnitas-ease-out),
    border-color var(--omnitas-duration-slow) var(--omnitas-ease-out),
    box-shadow var(--omnitas-duration-slow) var(--omnitas-ease-out);
}
.flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]):hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--omnitas-border-hover);
}
.ui.card:hover,
.ui.cards > .card:hover {
  transform: translateY(-2px);
  border-color: var(--omnitas-border-hover);
}
@media (prefers-reduced-motion: reduce) {
  .flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]),
  .ui.card,
  .ui.cards > .card {
    transition: none;
  }
  .flex-list .flex-item:has(.flex-item-trailing a[href$="/forks"]):hover,
  .ui.card:hover,
  .ui.cards > .card:hover {
    transform: none;
  }
}

/* ---------------------------------------------------------------------------------------------
   Spec item 6: "Repositories" in the top menu.
   templates/custom/extra_links.tmpl adds a "Repositories" link after Gitea's "Explore" link; this
   hides "Explore" (it points to /explore/repos, or to /explore/organizations in one landing-page
   configuration). The new link ends in "?sort=recentupdate", so these selectors do not match it.
   Organisations and users stay reachable as tabs on the same page.
   --------------------------------------------------------------------------------------------- */
#navbar a.item[href$="/explore/repos"],
#navbar a.item[href$="/explore/organizations"] {
  display: none !important;   /* Gitea's open-menu rule (#navbar.navbar-menu-open .navbar-left>.item) outranks this selector */
}
