/*
 * Sword admin theme — which realm am I changing?
 *
 * js/realm-indicator.js works out the realm shown in the console and writes two things
 * on the page: the attribute data-sword-env (prod / staging / master / other) and the
 * label text (--sword-env-label). This file turns them into:
 *   1. a label next to the logo            PROD      STAGING     MASTER
 *   2. the colour of the line under the top bar
 *
 * The logo itself is the same everywhere: the brand kit does not allow changing it.
 *
 * Colours: PROD = coral (take care), STAGING = blue (safe to try), MASTER = purple (server administration).
 */

/* ---------- 1. Colour per environment ---------- */
html[data-sword-env="prod"] {
  --sword-env-colour: #FF7E7E;      /* brand coral */
}

html[data-sword-env="staging"] {
  --sword-env-colour: #5F97F0;      /* brand light blue */
}

html[data-sword-env="master"] {
  --sword-env-colour: #BE95E5;      /* brand purple */
}

html[data-sword-env="other"] {
  --sword-env-colour: #ABABAB;      /* brand grey 500 */
}

/* ---------- 2. Label next to the logo ---------- */
html[data-sword-env] .pf-v5-c-masthead__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

html[data-sword-env] .pf-v5-c-masthead__brand::after {
  content: var(--sword-env-label, "");
  padding: 2px 10px;
  border-radius: 999px;
  background-color: var(--sword-env-colour);
  color: #0D0D0D;                   /* dark text on the light label: contrast above 7:1 on all four colours */
  font-family: "Figtree", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.6;
  white-space: nowrap;
}

/* ---------- 3. Line under the top bar: one flat colour instead of the brand gradient ---------- */
html[data-sword-env] .pf-v5-c-masthead {
  border-image: none;
  border-bottom: 4px solid var(--sword-env-colour);
}
