/*
  Shared tokens and resets for every page in this solution.

  Matches the bankwindhoek.com.na site styling (CI document: docs/ci/bank-windhoek-website-
  corporate-identity.md): Bank Windhoek red #ee2e24 for accents (the red bracket on page titles,
  bars), a deeper red #c4211a for red TEXT (dates, "Read more"; #ee2e24 is only 3.9:1 on white),
  navy #192f55 for headings and buttons, #27365b body text, grey #58595b for side-list headings,
  light grey #f0f1f0 rounded tiles, Calibri throughout, pill-shaped buttons (the site's Explore
  button and search box).

  These pages sit INSIDE the site's master page (BWHK folder in the master page gallery), so
  everything is scoped to .sp-app (the class on each page's root element). Nothing here styles
  html, body or bare elements outside it.

  The site's global CSS that reaches in here, and how it's handled:
    - Bootstrap 3.3.7 sets html to 10px        -> px only, never rem
    - BWHK.css: a { color: inherit !important; text-decoration: none !important }
                a:hover { color: #ee2e24 !important }
                                               -> every link colour we set carries !important,
                                                  on :link/:visited and on :hover
    - BWHK.css: h1-h4, body, p in Calibri, #27365b, normal weight; h1 36px, h2 24px,
      h3 18px, h4 and p 14px                   -> sizes, weights and colours set on our classes
    - BWHK.css: input, button, select, textarea { line-height: normal !important }
    - Bootstrap: label { font-weight: 700; margin-bottom: 5px }
                                               -> reset below with !important
    - Generic global class names (.item, .center, .show, .container, .row, .col-*, .hidden,
      .sidenav, .newsbar1...)                  -> every class of ours is prefixed
    - No * { margin: 0 } reset, so browser defaults apply: every margin and padding is set
      explicitly
*/
.sp-app {
  --app-navy: #192f55;          /* headings, buttons, outlines */
  --app-navy-dark: #0c2c54;
  --app-navy-band: #192f55;
  --app-brand-red: #ee2e24;     /* decorative only: bars, the title bracket, fills behind 18px+ white text */
  --app-red: #c4211a;           /* red text and small red labels (5.9:1 on white) */
  --app-grey: #58595b;          /* side-list headings (7:1 on white) */
  --app-muted: #5d6573;         /* readable small secondary text (6:1 on white) */
  --app-text: #27365b;          /* the site's body copy */
  --app-border: #d0d2d6;
  --app-rule: #dcdedf;
  --app-surface: #ffffff;
  --app-surface-alt: #f8f8f9;
  --app-tile: #f0f1f0;          /* the news tiles and side panels */
  --app-footer: #e6e7e8;
  --app-ok: #2e7d32;
  --app-warn: #a15c00;
  --app-focus: #c4211a;
  --app-radius: 16px;           /* tiles and panels (the old page's 30px, toned down) */
  --app-radius-small: 10px;
  --app-font: Calibri, Verdana, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
  --app-font-heading: Calibri, Verdana, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;

  box-sizing: border-box;
  color: var(--app-text);
  font-family: var(--app-font);
  font-size: 15px;
  line-height: 1.43;
}

/* The page's own centred column. The master page is full width (container-fluid), so the page
   supplies its own. Widths per kind of page (2026-10-07: 1170px looked narrow on wide screens):
     --app-page-max   1400px by default (news pages); admin pages 1600px (admin.css);
                      article pages 1320px (newsroom-article.css), whose text stays ~840px
     --app-gutter     15px on phones, growing to 40px on wide screens
   Page CSS sets only top/bottom padding, never left/right. */
.sp-app {
  --app-page-max: 1400px;
  --app-gutter: clamp(15px, 2.5vw, 40px);
}

.sp-app.sp-app {
  width: 100%;
  max-width: var(--app-page-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--app-gutter);
  padding-right: var(--app-gutter);
}

.sp-app *,
.sp-app *::before,
.sp-app *::after {
  box-sizing: border-box;
}

.sp-app :is(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) {
  margin: 0;
  color: inherit;
}

.sp-app :is(ul, ol) {
  padding: 0;
}

/* Bootstrap makes labels bold with a bottom margin; keep the reset firm */
.sp-app label {
  margin-left: 0 !important;
  font-weight: inherit;
  margin-bottom: 0 !important;
}

.sp-app a:is(:link, :visited) {
  color: inherit !important;
}

.sp-app button,
.sp-app input,
.sp-app select,
.sp-app textarea {
  min-width: 0;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.sp-app [hidden] {
  display: none !important;
}

.sp-app :focus-visible {
  outline: 2px solid var(--app-focus);
  outline-offset: 2px;
}

.sp-app .sp-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- Page title: the site's h1 (36px Calibri, bold like its page titles) ---- */
.sp-app .sp-title {
  font-family: var(--app-font-heading);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--app-navy);
}

.sp-app .sp-subtitle {
  margin-top: var(--space-2);
  font-size: 17px;
  color: var(--app-muted);
}

/* ---- Buttons: pills, like the site's Explore button. Primary is red, inverts on hover ---- */
.sp-app .sp-btn,
.sp-app a.sp-btn:is(:link, :visited) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 36px;
  margin: 0;
  padding: 0 var(--space-5);
  border: 1px solid var(--app-navy);
  border-radius: 18px;
  background: var(--app-surface);
  color: var(--app-navy) !important;
  font-family: var(--app-font);
  font-size: 14px;
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}

.sp-app .sp-btn:hover,
.sp-app a.sp-btn:hover {
  border-color: var(--app-navy-dark);
  background: var(--app-surface-alt);
  color: var(--app-navy-dark) !important;
}

.sp-app .sp-btn--primary,
.sp-app a.sp-btn--primary:is(:link, :visited) {
  border-color: var(--app-red);
  background: var(--app-red);
  color: #fff !important;
}

/* BWHK.css turns hovered links red with !important; the site's Explore button inverts on hover
   (white fill, red border and text), so do the same */
.sp-app .sp-btn--primary:hover,
.sp-app a.sp-btn--primary:hover {
  background: var(--app-surface);
  border-color: var(--app-red);
  color: var(--app-red) !important;
}

.sp-app .sp-btn--danger:hover {
  background: var(--app-red);
  border-color: var(--app-red);
  color: #fff !important;
}

.sp-app .sp-btn--small {
  min-height: 28px;
  padding: 0 var(--space-3);
  font-size: 13px;
}

.sp-app .sp-btn:disabled,
.sp-app .sp-btn:disabled:hover {
  border-color: var(--app-border);
  background: var(--app-surface);
  color: var(--app-border) !important;
  cursor: default;
}

/* ---- Text inputs ---- */
.sp-app .sp-input {
  min-height: 36px;
  margin: 0;
  padding: 0 var(--space-3);
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius-small);
  background: var(--app-surface);
  font-size: 14px;
}

/* BWHK.css forces line-height: normal !important on every textarea */
.sp-app textarea.sp-input {
  padding: var(--space-2) var(--space-3);
  line-height: 1.4 !important;
  resize: vertical;
}

/* BWHK.css makes EVERY placeholder on the site white (::placeholder { color: #fff !important },
   meant for the search box in the red menu bar): on our white fields they were invisible, so a
   field falling back to the headline looked empty next to a counter that counted it
   (found 2026-10-13). Ours are grey again; .sp-app wins on specificity. */
.sp-app ::placeholder {
  color: #767c88 !important;   /* 4.5:1 on white */
  opacity: 1;
}

.sp-app :-ms-input-placeholder {
  color: #767c88 !important;
}

.sp-app ::-ms-input-placeholder {
  color: #767c88 !important;
}

.sp-app .sp-input:focus {
  border-color: var(--app-navy);
  outline: none;
}

/* ---- Spinner ---- */
.sp-app .sp-spinner {
  width: 26px;
  height: 26px;
  border: 3px solid var(--app-rule);
  border-top-color: var(--app-red);
  border-radius: 50%;
  animation: sp-spin 0.8s linear infinite;
}

@keyframes sp-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .sp-app .sp-spinner {
    animation: none;
  }
}

/* ---- The red bracket on page titles (the site's .pageMainNavRedContainer): an 8px red
   corner, 40px down and 80px across, top left of the title ---- */
.sp-app .sp-bracket {
  padding: 14px 0 0 18px;
  background-image: linear-gradient(var(--app-brand-red), var(--app-brand-red)), linear-gradient(var(--app-brand-red), var(--app-brand-red));
  background-repeat: no-repeat;
  background-size: 6px 36px, 64px 6px;
  background-position: left top, left top;
}
