/*
 * DrND's Knowledge Hub™ branding layer for DrND's Question Bank.
 * Loaded after the upstream styles.css; it only re-points design tokens and adds the few
 * elements that belong to the integration (back link, site footer, About page).
 * Palette: navy #1E3A8A, blue #2563EB, gold #D4AF37. Fonts: Inter (body), Poppins (headings).
 */

:root {
  --primary:        #1E3A8A;
  --primary-light:  #2563EB;
  --primary-dark:   #172554;
  --primary-50:     #eef3fc;
  --primary-glow:   rgba(37,99,235,.18);
  --gold:           #D4AF37;
  --gold-text:      #7a5c00;
  --font-body:      'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head:      'Poppins', 'Inter', system-ui, sans-serif;
  /* the upstream muted label colour is below WCAG AA on the light background */
  --text-4:         #5b6b80;
}
:root:not([data-theme="dark"]) {
  /* upstream #0f9b82 is 3.15:1 on the light background; this is above 4.5:1 */
  --success:        #0b7a66;
}
[data-theme="dark"] {
  /* :root above has the same specificity and comes later, so the upstream dark values must be restated */
  --primary-50:     rgba(37,99,235,.16);
  --primary-glow:   rgba(37,99,235,.28);
  --text-4:         #93a6bd;
  --accent-text:    #7aa7f5;
  --gold-text:      #E6C85C;
}

/* Headings */
h1, h2, h3, .site-header__title, .section__title, .modal-title { font-family: var(--font-head); }

/* Header: gold rule, brand focus ring that the upstream CSS suppressed, back link */
.site-header { border-bottom: 2px solid var(--gold); }
.site-header__brand:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 3px; border-radius: 8px; }
.site-header__title em { color: var(--primary-light); }
.site-header__mark { border-radius: 8px; }
.site-header__back {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px; border-radius: 9px;
  font: 600 .82rem/1 var(--font-body); color: var(--accent-text); text-decoration: none;
  border: 1px solid var(--border-strong); background: transparent; white-space: nowrap;
}
.site-header__back:hover { background: var(--primary-50); }
.site-header__back:focus-visible { outline: 2px solid var(--primary-light); outline-offset: 2px; }
:focus-visible { outline-color: var(--primary-light); }
[data-theme="dark"] :focus-visible { outline-color: #93b8ff; }

.skip-link {
  position: absolute; left: 12px; top: -48px; z-index: 1000; padding: 10px 14px; border-radius: 8px;
  background: var(--primary); color: #fff; font: 600 .9rem var(--font-body); text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* Site footer (outside #app) */
.drnd-footer {
  position: relative; z-index: 1; border-top: 1px solid var(--border);
  padding: 18px 24px 28px; text-align: center; font-size: .82rem; color: var(--text-3);
}
.drnd-footer nav { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; margin-bottom: 8px; }
.drnd-footer a, .dashboard__footer a { color: var(--accent-text); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.drnd-footer p { max-width: 760px; margin: 0 auto; }

/* About / credits page */
.about { position: relative; z-index: 1; max-width: 820px; margin: 0 auto; padding: 28px 24px 56px; }
.about h1 { font-size: 1.7rem; color: var(--text); margin-bottom: 6px; }
.about h2 { font-size: 1.15rem; margin: 28px 0 8px; color: var(--text); }
.about p, .about li { color: var(--text-2); line-height: 1.7; }
.about ul { padding-left: 1.2rem; margin: 8px 0; }
.about a { color: var(--accent-text); font-weight: 600; }
.about .note {
  border-left: 4px solid var(--gold); background: var(--surface-solid); border-radius: 8px;
  padding: 12px 16px; margin: 14px 0; box-shadow: var(--shadow-sm);
}
.about code { font-family: var(--font-mono); font-size: .88em; background: var(--primary-50); padding: 1px 5px; border-radius: 4px; }
.about .back { display: inline-block; margin-bottom: 14px; }

@media (max-width: 520px) {
  .site-header__inner { padding: 0 12px; gap: 8px; }
  .site-header__back span { display: none; }
  .site-header__back { padding: 0 10px; }
  .drnd-footer { padding: 16px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* Upstream renders the exam sidebar's topic dot as a block above the title; keep it inline with it */
.exam-sidebar__title .topic-dot { display: inline-block; margin-right: 6px; vertical-align: middle; color: var(--accent-text); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Dark theme: the navy brand colour is for fills; where upstream used it as text colour on a dark surface it is
   unreadable, so those few rules use the lighter accent instead. */
[data-theme="dark"] a,
[data-theme="dark"] code,
[data-theme="dark"] .badge,
[data-theme="dark"] .breadcrumb__link,
[data-theme="dark"] .subsubject-card__icon,
[data-theme="dark"] .question-card__number,
[data-theme="dark"] .harvest-link,
[data-theme="dark"] .icon-btn:hover,
[data-theme="dark"] .palette-btn:hover { color: var(--accent-text); }
[data-theme="dark"] .breadcrumb__link { opacity: 1; }
[data-theme="dark"] .site-header__title em { color: #7aa7f5; }
