/*
 * Goway internal whitelabel for self-hosted Metabase (OSS).
 * Injected via reverse proxy, not a Metabase build change -- see theme.js
 * for why (Metabase's whitelabel *settings* are Enterprise-gated, but the
 * app's own CSS already runs on custom properties, so overriding those here
 * gets the same visual result without touching Metabase's source).
 * Values pulled directly from the Goway site's own theme
 * (libs/styles/muiTheme.tsx): brand orange #F05B2A, body text #464446,
 * Inter for UI text, Romie for headings.
 */

@font-face {
  font-family: "Goway Inter";
  src: url("/goway-theme/fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Goway Romie";
  src: url("/goway-theme/fonts/Romie-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Goway Romie";
  src: url("/goway-theme/fonts/Romie-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root,
:root[data-mantine-color-scheme="dark"],
:root[data-mantine-color-scheme="light"] {
  --mb-color-core-brand: #F05B2A !important;
  --mb-color-brand: #F05B2A !important;
  --mb-default-font-family: "Goway Inter", "Helvetica Neue", Arial, sans-serif !important;

  --mb-color-text-primary: #464446 !important;
  --mb-color-background-primary: #FFFFFF !important;
  --mb-color-background-secondary: #FDFAF2 !important;
  --mb-color-border-neutral: #ECECEC !important;
}

@media (prefers-color-scheme: dark) {
  :root {
    --mb-color-core-brand: #F05B2A !important;
    --mb-color-brand: #F05B2A !important;
    --mb-default-font-family: "Goway Inter", "Helvetica Neue", Arial, sans-serif !important;

    --mb-color-text-primary: #464446 !important;
    --mb-color-background-primary: #FFFFFF !important;
    --mb-color-background-secondary: #FDFAF2 !important;
    --mb-color-border-neutral: #ECECEC !important;
  }
}

html,
body,
#root {
  font-family: "Goway Inter", "Helvetica Neue", Arial, sans-serif !important;
  /* Fallback in case the dark login-page backdrop isn't actually driven by
     --mb-color-background-primary (it's a separate illustration wrapper). */
  background-color: #FDFAF2 !important;
}

/* Headings use the Goway display face, matching the site's own heading.* typography variants. */
h1, h2, h3, h4, h5, h6,
[class*="Title"] {
  font-family: "Goway Romie", "Georgia", serif !important;
}

.goway-logo-replacement {
  object-fit: contain;
  min-width: 100px;
  /* Safety ceiling -- theme.js sizes this to match the original SVG's
     rendered height (normally ~65px), but if that measurement ever comes
     back empty the <img> falls back to its raw intrinsic size, which is a
     print-resolution asset and renders enormous. This caps that failure
     mode without constraining the normal case. */
  max-height: 120px;
}

/* Admin navbar -- swapped from Metabase's default purple to the Goway navy. */
[data-testid="admin-navbar"] {
  background-color: rgb(35, 53, 88) !important;
}

/* Dashboard title bar -- matches the Goway site's own page-header navy. */
[data-testid="dashboard-header-container"] {
  background-color: #2F3F61 !important;
}
[data-testid="dashboard-header-container"],
[data-testid="dashboard-header-container"] * {
  color: #FEFFFE !important;
}
/* Edit/Share/Bookmark/Info/More each use a different data-testid, so target
   any button in the header rather than enumerating each one individually. */
[data-testid="dashboard-header-container"] button:hover,
[data-testid="dashboard-header-container"] button:hover * {
  color: #000000 !important;
}
