/*
 * Sword look for the Keycloak consoles (Account Console and Administration Console).
 * Source of every value: Sword Brand Guidelines 2026.
 *
 * This file only re-colours. It does not move, hide or resize any part of the consoles,
 * so a Keycloak upgrade cannot leave a button unreachable because of it.
 *
 * The same file is shipped in the account theme and in the admin theme.
 * Edit it in account/resources/css/ — build.sh copies it to the admin theme.
 */

/* ---------- 1. Brand fonts ---------- */
/* The font files live in the login theme of this same package; they are not duplicated here.
   Path: from <type>/sword/css/ up to the package root, then into login/sword/fonts/. */
@font-face {
  font-family: "Figtree";
  src: url("../../../login/sword/fonts/figtree-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Figtree";
  src: url("../../../login/sword/fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Lora";
  src: url("../../../login/sword/fonts/lora-latin-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Lora";
  src: url("../../../login/sword/fonts/lora-latin-ext-wght-normal.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- 2. Brand values, light mode ---------- */
:root {
  /* Greyscale (brand kit page 5) */
  --sword-grey-900: #0D0D0D;
  --sword-grey-800: #2E2E2E;
  --sword-grey-700: #5E5E5E;
  --sword-grey-500: #ABABAB;
  --sword-grey-200: #E8E8E8;
  --sword-grey-100: #F3F3F3;

  /* Gradient colours (brand kit page 6) */
  --sword-coral: #FF7E7E;
  --sword-purple: #BE95E5;
  --sword-blue: #4A89E8;
  --sword-light-blue: #5F97F0;

  /* Roles. Only these change between light and dark. */
  --sword-button: var(--sword-grey-800);        /* main buttons */
  --sword-button-hover: var(--sword-grey-900);
  --sword-button-text: #FFFFFF;
  /* Links: the brand blue is too light for small text on white (contrast 3.5:1).
     This is the same blue, darkened until it passes WCAG AA (5.6:1). */
  --sword-link: #2B62C4;
  --sword-link-hover: #1F4B99;
  --sword-accent: var(--sword-blue);            /* selected tab, switches, focus */
  --sword-header: var(--sword-grey-900);        /* top bar */
}

/* ---------- 3. Brand values, dark mode ---------- */
.pf-v5-theme-dark {
  --sword-button: var(--sword-grey-100);
  --sword-button-hover: #FFFFFF;
  --sword-button-text: var(--sword-grey-900);
  --sword-link: #8DB6F7;                        /* light blue, readable on dark surfaces */
  --sword-link-hover: #B5D0FA;
  --sword-accent: var(--sword-light-blue);
  --sword-header: var(--sword-grey-900);
}

/* ---------- 4. Hand the roles to the console components ---------- */
:root,
.pf-v5-theme-dark {
  --pf-v5-global--FontFamily--text: "Figtree", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --pf-v5-global--FontFamily--heading: "Figtree", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --pf-v5-global--primary-color--100: var(--sword-button);
  --pf-v5-global--primary-color--200: var(--sword-button-hover);
  --pf-v5-global--link--Color: var(--sword-link);
  --pf-v5-global--link--Color--hover: var(--sword-link-hover);
  --pf-v5-global--active-color--100: var(--sword-accent);
}

/* ---------- 5. Top bar ---------- */
.pf-v5-c-masthead {
  --pf-v5-c-masthead--BackgroundColor: var(--sword-header);
  /* brand gradient line under the top bar */
  border-bottom: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--sword-coral), var(--sword-purple), var(--sword-blue)) 1;
}

/* Logo: 28px high (brand minimum is 16px), width follows. */
.pf-v5-c-masthead__brand img {
  height: 28px;
  width: auto;
  max-height: none;
}

/* ---------- 6. Text ---------- */
/* Page titles: Lora Regular, as the brand kit asks for headlines. Everything else: Figtree. */
.pf-v5-c-page__main-section h1,
.pf-v5-c-page__main-section .pf-v5-c-title.pf-m-2xl,
.pf-v5-c-page__main-section .pf-v5-c-title.pf-m-3xl {
  font-family: "Lora", Georgia, "Times New Roman", serif;
  font-weight: 400;
}

/* ---------- 7. Buttons ---------- */
.pf-v5-c-button.pf-m-primary {
  --pf-v5-c-button--m-primary--BackgroundColor: var(--sword-button);
  --pf-v5-c-button--m-primary--hover--BackgroundColor: var(--sword-button-hover);
  --pf-v5-c-button--m-primary--focus--BackgroundColor: var(--sword-button-hover);
  --pf-v5-c-button--m-primary--active--BackgroundColor: var(--sword-button-hover);
  --pf-v5-c-button--m-primary--Color: var(--sword-button-text);
  --pf-v5-c-button--m-primary--hover--Color: var(--sword-button-text);
  --pf-v5-c-button--m-primary--focus--Color: var(--sword-button-text);
  --pf-v5-c-button--m-primary--active--Color: var(--sword-button-text);
}

.pf-v5-c-button.pf-m-secondary {
  --pf-v5-c-button--m-secondary--Color: var(--sword-link);
  --pf-v5-c-button--m-secondary--hover--Color: var(--sword-link-hover);
  --pf-v5-c-button--m-secondary--focus--Color: var(--sword-link-hover);
  --pf-v5-c-button--m-secondary--active--Color: var(--sword-link-hover);
  --pf-v5-c-button--after--BorderColor: var(--sword-link);
  --pf-v5-c-button--hover--after--BorderColor: var(--sword-link-hover);
}

.pf-v5-c-button.pf-m-link {
  --pf-v5-c-button--m-link--Color: var(--sword-link);
  --pf-v5-c-button--m-link--hover--Color: var(--sword-link-hover);
  --pf-v5-c-button--m-link--focus--Color: var(--sword-link-hover);
  --pf-v5-c-button--m-link--active--Color: var(--sword-link-hover);
}

/* ---------- 8. Accents: where the default blue marked "this one is selected" ---------- */
/* Current item in the side menu: coral marker */
.pf-v5-c-nav {
  --pf-v5-c-nav__link--m-current--after--BorderColor: var(--sword-coral);
  --pf-v5-c-nav__link--hover--after--BorderColor: var(--sword-purple);
}

/* Selected tab */
.pf-v5-c-tabs {
  --pf-v5-c-tabs__link--after--BorderColor: var(--sword-accent);
}

.pf-v5-c-tabs__item.pf-m-current {
  --pf-v5-c-tabs__link--after--BorderColor: var(--sword-accent);
}

/* On / off switches */
.pf-v5-c-switch {
  --pf-v5-c-switch__input--checked__toggle--BackgroundColor: var(--sword-accent);
}

/* Text fields: underline when selected */
.pf-v5-c-form-control {
  --pf-v5-c-form-control--focus--after--BorderBottomColor: var(--sword-accent);
}

/* Loading spinner */
.pf-v5-c-spinner {
  --pf-v5-c-spinner--Color: var(--sword-accent);
}
