/* FHSU — Fort Hays State University black and gold, layered over CTFd's core theme.
 *
 * Original CSS targeting CTFd's existing Bootstrap 5.3 classes. Contains no CTFd code.
 *
 * DESIGN RULE, derived from measurement rather than taste:
 *   FHSU athletic gold #FFC72C against white is 1.56:1 — far below the 4.5:1 WCAG AA
 *   minimum for text. It is therefore used ONLY as a background, where black text on it
 *   scores 13.46:1. Where gold must carry text, light mode darkens it to #8C6A16
 *   (5.01:1 on white) and dark mode brightens it to #F0BE3E (8.92:1 on #212529).
 *
 * Every ratio quoted below was computed, not estimated.
 */

:root {
  /* Brand. Swap these two if the official FHSU hex values differ. */
  --fhsu-gold: #ffc72c;
  --fhsu-black: #000000;

  /* Accessible gold variants — see the design rule above. */
  --fhsu-gold-on-light: #8c6a16; /* 5.01:1 on white */
  --fhsu-gold-on-dark: #f0be3e; /* 8.92:1 on #212529 */
  --fhsu-gold-hover: #e8b32e;

  /* Bootstrap primary -> gold. Buttons take black text, so this stays safe. */
  --bs-primary: var(--fhsu-gold);
  --bs-primary-rgb: 255, 199, 44;

  --bs-link-color: var(--fhsu-gold-on-light);
  --bs-link-color-rgb: 140, 106, 22;
  --bs-link-hover-color: #6f5411;

  --bs-focus-ring-color: rgba(255, 199, 44, 0.4);
}

:root[data-bs-theme="dark"] {
  --bs-link-color: var(--fhsu-gold-on-dark);
  --bs-link-color-rgb: 240, 190, 62;
  --bs-link-hover-color: #ffd964;
}

/* ---------------------------------------------------------------- buttons */
/* Gold fill, black label: 13.46:1. The strongest brand surface available. */
.btn-primary {
  --bs-btn-bg: var(--fhsu-gold);
  --bs-btn-border-color: var(--fhsu-gold);
  --bs-btn-color: var(--fhsu-black);
  --bs-btn-hover-bg: var(--fhsu-gold-hover);
  --bs-btn-hover-border-color: var(--fhsu-gold-hover);
  --bs-btn-hover-color: var(--fhsu-black);
  --bs-btn-active-bg: #d9a821;
  --bs-btn-active-border-color: #d9a821;
  --bs-btn-active-color: var(--fhsu-black);
  --bs-btn-disabled-bg: var(--fhsu-gold);
  --bs-btn-disabled-border-color: var(--fhsu-gold);
  --bs-btn-disabled-color: var(--fhsu-black);
  font-weight: 600;
}

.btn-outline-primary {
  --bs-btn-color: var(--fhsu-gold-on-light);
  --bs-btn-border-color: var(--fhsu-gold);
  --bs-btn-hover-bg: var(--fhsu-gold);
  --bs-btn-hover-border-color: var(--fhsu-gold);
  --bs-btn-hover-color: var(--fhsu-black);
  --bs-btn-active-bg: var(--fhsu-gold);
  --bs-btn-active-color: var(--fhsu-black);
}

:root[data-bs-theme="dark"] .btn-outline-primary {
  --bs-btn-color: var(--fhsu-gold-on-dark);
}

/* ------------------------------------------------------------------ navbar */
/* Black bar in both modes — it is the brand, and it makes the gold read. */
.navbar {
  background-color: var(--fhsu-black) !important;
  border-bottom: 3px solid var(--fhsu-gold);
}

.navbar .navbar-brand {
  color: #ffffff !important;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.navbar .nav-link,
.navbar .navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.78) !important;
}

.navbar .nav-link:hover,
.navbar .navbar-nav .nav-link:hover,
.navbar .nav-link:focus {
  color: var(--fhsu-gold) !important;
}

/* Current page gets the gold underline rather than a colour change alone —
   colour is not the only signal, which matters for colour-blind users. */
.navbar .nav-link.active {
  color: var(--fhsu-gold) !important;
  box-shadow: inset 0 -3px 0 0 var(--fhsu-gold);
}

/* -------------------------------------------------------------- focus ring */
/* Keyboard focus must stay obvious. Gold ring plus offset so it is visible
   against both a black navbar and a light card. */
:focus-visible {
  outline: 3px solid var(--fhsu-gold);
  outline-offset: 2px;
}

.btn:focus-visible,
.form-control:focus {
  border-color: var(--fhsu-gold);
  box-shadow: 0 0 0 0.25rem rgba(255, 199, 44, 0.35);
}

/* --------------------------------------------------------------- challenges */
/* Challenge tiles get a gold top edge; solved ones fill the edge in.
   The solved state also carries CTFd's own check icon, so this is reinforcement,
   not the sole indicator. */
.challenge-button,
.challenge-card {
  border-top: 3px solid transparent;
  transition:
    border-color 0.15s ease,
    transform 0.1s ease;
}

.challenge-button:hover,
.challenge-card:hover {
  border-top-color: var(--fhsu-gold);
  transform: translateY(-2px);
}

.challenge-button.solved-challenge,
.challenge-card.solved-challenge {
  border-top-color: var(--fhsu-gold);
}

/* ------------------------------------------------------------------ badges */
.badge.bg-primary,
.badge.text-bg-primary {
  background-color: var(--fhsu-gold) !important;
  color: var(--fhsu-black) !important;
}

/* ------------------------------------------------------------------- misc */
.progress-bar {
  background-color: var(--fhsu-gold);
}

/* Section rules and the scoreboard's leading row pick up the accent. */
hr {
  border-top-color: rgba(255, 199, 44, 0.35);
}

table.table thead th {
  border-bottom: 2px solid var(--fhsu-gold);
}

/* Headings stay near-black in light mode rather than pure grey — closer to the
   printed brand, and a touch more contrast. */
h1,
h2,
h3,
.display-5 {
  color: #14161a;
}

:root[data-bs-theme="dark"] h1,
:root[data-bs-theme="dark"] h2,
:root[data-bs-theme="dark"] h3,
:root[data-bs-theme="dark"] .display-5 {
  color: #f3f4f6;
}
