/* OKTOGEN Git — BBE CI Brand-Layer
 * Token-Quelle: fulfillment.bestbrandseverywhere.com (Live-CI, Stand 2026-08-10)
 * Akzent BBE Rot #ed220d, Ink #0f0f10, Deep #1a0a0b; Kokoro (Headings, lokal
 * gebundelt), System-Sans (UI), JetBrains Mono (Code).
 * Laden via custom/templates/custom/header.tmpl NACH dem Gitea-Theme: gleiche
 * :root-Spezifitaet, spaetere Quelle gewinnt — gilt fuer Hell- und Dunkel-Theme.
 * Kontrast (R5): Fluss-Links/Buttons nutzen die dunkle Stufe #d21e0c (5.4:1 auf
 * Weiss); im Dunkel-Theme hebt eine hellere Stufe (#f15545, 4.8:1) den Akzent.
 */

@font-face { font-family: 'Kokoro'; src: url('/assets/fonts/Kokoro-Regular.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kokoro'; src: url('/assets/fonts/Kokoro-Italic.otf') format('opentype'); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: 'Kokoro'; src: url('/assets/fonts/Kokoro-Bold.otf') format('opentype'); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Kokoro'; src: url('/assets/fonts/Kokoro-Heavy.otf') format('opentype'); font-weight: 800; font-style: normal; font-display: swap; }

:root {
  /* BBE-Zusatz-Tokens */
  --bbe-ink: #0f0f10;
  --bbe-ink-2: #1b1b20;
  --bbe-paper: #f4f4f5;
  --bbe-red: #ed220d;
  --bbe-red-text: #d21e0c;      /* 5.4:1 auf Weiss — Fluss-Text-tauglich */
  --bbe-red-text-dark: #f15545; /* 4.8:1 auf dunklem Grund */
  --bbe-radius-card: 10px;
  --bbe-font-brand: 'Kokoro', Georgia, 'Times New Roman', serif;

  /* Gitea-Primaerfarbe -> BBE Rot (ersetzt Gitea-Gruen auf allen Flaechen) */
  --color-primary: #d21e0c;
  --color-primary-contrast: #ffffff;
  --color-primary-light-1: #ef3b29;
  --color-primary-light-2: #f15545;
  --color-primary-light-3: #f36e60;
  --color-primary-light-4: #f5887c;
  --color-primary-light-5: #f7a198;
  --color-primary-light-6: #f9bab4;
  --color-primary-light-7: #fbd4d0;
  --color-primary-dark-1: #b61a0a;
  --color-primary-dark-2: #9b1609;
  --color-primary-dark-3: #801207;
  --color-primary-dark-4: #650e06;
  --color-primary-dark-5: #490b04;
  --color-primary-dark-6: #2e0703;
  --color-primary-dark-7: #1a0a0b;
  --color-primary-alpha-10: rgba(237,34,13,0.10);
  --color-primary-alpha-20: rgba(237,34,13,0.20);
  --color-primary-alpha-30: rgba(237,34,13,0.30);
  --color-primary-alpha-40: rgba(237,34,13,0.40);
  --color-primary-alpha-50: rgba(237,34,13,0.50);
  --color-primary-alpha-60: rgba(237,34,13,0.60);
  --color-primary-alpha-70: rgba(237,34,13,0.70);
  --color-primary-alpha-80: rgba(237,34,13,0.80);
  --color-primary-alpha-90: rgba(237,34,13,0.90);

  /* Code/Diff in JetBrains Mono (CI --mono), Fallback System-Mono */
  --fonts-monospace: 'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Kopfleiste im BBE-Ink — wie fulfillment-Nav, in beiden Themes */
  --color-nav-bg: var(--bbe-ink);
  --color-nav-hover-bg: var(--bbe-ink-2);
  --color-nav-text: var(--bbe-paper);
  --color-header-wrapper: var(--bbe-ink);
  --color-header-wrapper-transparent: rgba(15,15,16,0);
}

/* Dunkel-Theme: hellere Akzentstufe, damit der Kontrast-Floor auch dort haelt */
html.theme-gitea-dark {
  --color-primary: var(--bbe-red-text-dark);
  --color-primary-contrast: #1a0a0b;
}
@media (prefers-color-scheme: dark) {
  html.theme-gitea-auto {
    --color-primary: var(--bbe-red-text-dark);
    --color-primary-contrast: #1a0a0b;
  }
}

/* Headings tragen die Kokoro-Serif — die BBE-Marken-Schrift */
h1, h2, .ui.header {
  font-family: var(--bbe-font-brand);
  letter-spacing: -0.01em;
  text-wrap: balance;
}

/* White-Label-Netz: Gitea-Eigenwerbung ausblenden. Haengt am Linkziel (href),
 * nie an Klassennamen oder uebersetztem Text — stabil gegen Umbau und i18n. */
footer a[href*="gitea.io"],
footer a[href*="about.gitea.com"],
footer a[href*="docs.gitea.com"],
.page-footer a[href*="gitea.io"],
.page-footer a[href*="about.gitea.com"],
.page-footer a[href*="docs.gitea.com"] { display: none !important; }

/* Karten in der BBE-Flaechenlogik */
.ui.attached.segment,
.ui.segment { border-radius: var(--bbe-radius-card); }

/* Kopfleiste: Gitea-Doku-Links raus (Gurt zum Template-Override, href-basiert) */
#navbar a[href*="docs.gitea.com"],
.navbar a[href*="docs.gitea.com"] { display: none !important; }

/* Marken-Wortzug neben dem Logo — wie der fulfillment-Nav-Brand, in Kokoro */
#navbar-logo::after {
  content: "OKTOGEN Git";
  font-family: var(--bbe-font-brand);
  font-weight: 700;
  font-size: 16px;
  color: var(--bbe-paper);
  margin-left: var(--space-2, 0.5rem);
  white-space: nowrap;
}

/* BBE-Footer-Bauteile */
.page-footer .bbe-foot-links { display: contents; }

/* Auth-Seiten: fokussierter BBE-Header — Marke mittig, keine doppelten Wege.
 * "Sign In" oben rechts und "Explore" sind auf der Login-Seite Dopplung bzw.
 * Sackgasse (Login-Pflicht leitet eh hierher zurueck). */
#navbar { position: relative; }
body:has(.page-content.user.signin) #navbar a[href$="/user/login"],
body:has(.page-content.user.signin) #navbar a[href^="/explore"] { display: none !important; }
body:has(.page-content.user.signin) #navbar-logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

/* Footer liegt auf BBE-Ink: Links brauchen die helle Akzentstufe (4.5:1-Floor),
 * die dunkle Stufe faellt auf dunklem Grund auf 3.2:1 durch */
.page-footer a { color: var(--bbe-red-text-dark); }
.page-footer a:hover { color: var(--color-primary-light-3); }
