/* Ansible managed
 * Brand stylesheet for belgahost (Belgahost).
 * Rendered per-brand from roles/cachet_server/templates/brand.css.j2 and
 * served by the front nginx at /brand/belgahost.css. The front nginx
 * injects a <link> to this file into every HTML response for the hostnames
 * mapped to this brand (see nginx.conf.j2 `map $host $cachet_brand`).
 *
 * Palette source: the LIVE site's own stylesheet, read 2026-10-21 —
 * https://www.belgahost.be. Not invented. See defaults/main.yml for which file
 * each value came out of.
 *
 * SCOPE / HONEST LIMITS
 * ---------------------
 * Cachet 3.x's public page is Tailwind-compiled: its colours are baked into
 * utility classes, NOT exposed as CSS custom properties. So there is no
 * theme variable to swap, and a stylesheet cannot fully re-skin it without
 * targeting Tailwind's generated class names.
 *
 * This file therefore does two different jobs, with different reliability:
 *
 *   1. ADDITIVE AND RELIABLE — the brand header band, footer, page
 *      background, and typography. These are our own DOM (injected by
 *      brand.js) plus element-level rules, so they do not depend on any
 *      Cachet internal. This is the part that makes the page read as
 *      Belgahost, and it is what the role's verification asserts.
 *
 *   2. BEST-EFFORT — the accent overrides at the bottom, which nudge
 *      Cachet's own links/buttons onto the brand colour. These DO depend on
 *      Cachet's markup and should be re-checked against the live page after
 *      the first deploy (and after any cachet_server_image_ref bump).
 *      If a selector stops matching, the page degrades to Cachet's stock
 *      accent inside our branded chrome — it does not break.
 */

/* Belgahost ships no webfont — its live site uses the system stack. */

:root {
  --brand-primary: #007bff;
  --brand-secondary: #2e3338;
  --brand-header-bg: #2e3338;
  --brand-header-fg: #f2f2f2;
  --brand-page-bg: #f7f9fb;
  --brand-surface-bg: #ffffff;
  --brand-text: #232629;
  --brand-muted: #6c757d;
  --brand-border: #e3e5e8;
  --brand-link: #0074b2;
  --brand-body-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --brand-heading-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --brand-ok: #28a745;
  --brand-warning: #ffc107;
  --brand-danger: #dc3545;
  --brand-info: #17a2b8;
}

/* ── Typography + page ground ─────────────────────────────────────────── */
body {
  font-family: var(--brand-body-font);
  background-color: var(--brand-page-bg);
  color: var(--brand-text);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--brand-heading-font);
  color: var(--brand-secondary);
}

/* ── Brand header band (our own DOM, built by brand.js) ───────────────── */
/* Height is reserved up front so the injected header does not shift the
 * page once brand.js runs (the header is prepended on DOMContentLoaded). */
.dcin-brandbar {
  background: var(--brand-header-bg);
  color: var(--brand-header-fg);
  border-bottom: 3px solid var(--brand-primary);
  width: 100%;
}

.dcin-brandbar__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.dcin-brandbar__home {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.dcin-brandbar__logo {
  height: 46px;
  width: auto;
  display: block;
}

/* The Blesta client_logo.svg hard-codes fill:#020202 on its text nodes, so it
 * is invisible against the #2e3338 navbar. Invert to white rather than
 * shipping a recoloured copy of someone else's asset. */
.dcin-brandbar__logo {
  filter: brightness(0) invert(1);
}

.dcin-brandbar__title {
  font-family: var(--brand-heading-font);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0.92;
  white-space: nowrap;
}

.dcin-brandbar__nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  font-size: 14px;
}

.dcin-brandbar__nav a {
  color: var(--brand-header-fg);
  text-decoration: none;
  opacity: 0.88;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}

.dcin-brandbar__nav a:hover {
  opacity: 1;
  border-bottom-color: var(--brand-primary);
}

/* ── Brand footer (our own DOM) ───────────────────────────────────────── */
.dcin-brandfoot {
  border-top: 1px solid var(--brand-border);
  background: var(--brand-surface-bg);
  margin-top: 48px;
}

.dcin-brandfoot__inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--brand-muted);
}

.dcin-brandfoot a {
  color: var(--brand-link);
  text-decoration: none;
}

.dcin-brandfoot a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .dcin-brandbar__inner,
  .dcin-brandfoot__inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .dcin-brandbar__title {
    white-space: normal;
  }
}

/* ── Best-effort accent overrides on Cachet's own markup ──────────────── */
/* Everything below targets Cachet/Tailwind-generated markup and is the
 * fragile half of this file (see the header comment). Re-verify against the
 * live page after a cachet_server_image_ref bump. */

a:not(.dcin-brandbar__home):not(.dcin-brandbar__nav a) {
  color: var(--brand-link);
}

/* Form controls + focus rings pick up the brand without needing to know
 * Cachet's class names. */
:root {
  accent-color: var(--brand-primary);
}

*:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

/* Primary action buttons. Tailwind's compiled indigo/blue is Cachet's stock
 * accent; these two selectors cover the shapes Cachet 3.x uses for its
 * subscribe / submit buttons. */
button[type="submit"],
.cachet-btn-primary,
a[role="button"]:not(.dcin-brandbar__nav a) {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

/* Keep the operational-status semantics readable regardless of brand. */
.text-green-500, .text-green-600, .text-emerald-500 { color: var(--brand-ok) !important; }
.text-yellow-500, .text-amber-500 { color: var(--brand-warning) !important; }
.text-red-500, .text-red-600 { color: var(--brand-danger) !important; }
.bg-green-500, .bg-emerald-500 { background-color: var(--brand-ok) !important; }
.bg-yellow-500, .bg-amber-500 { background-color: var(--brand-warning) !important; }
.bg-red-500, .bg-red-600 { background-color: var(--brand-danger) !important; }
