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

  Matches the capricorn.com.na site styling (CI document: docs/ci/capricorn-website-corporate-
  identity.md). Flat and square: slate navy #30385a for titles, text and buttons, dark navy
  #011433 for hovered links, red #c8272b only for navigation hover and selected states,
  Calibri / Calibri Light, 1px grey rules instead of cards and shadows.

  These pages sit INSIDE the site's master page (CGP.master), 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 sets html to 10px              -> px only, never rem
    - CGP.css: a:hover AND a:visited forced to #011433 !important
                                               -> link-styled buttons re-assert colour with
                                                  !important on :visited and :hover
    - CGP.css: a { text-decoration: none !important }
    - CGP.css: h1-h4, body, p font-family with !important (Calibri / Calibri Light)
                                               -> we use the same families; sizes, weights and
                                                  colours are set on our own classes
    - CGP.css: label { margin-left: 5px !important; margin-bottom: 0 !important }
                                               -> reset below with !important
    - Generic global class names (.item, .featured, .center, .content, .header, .show, .grey,
      .hidden...)                              -> every class of ours is prefixed
    - No * { margin: 0 } reset here (unlike cam.com.na), so browser defaults apply: every
      margin and padding is still set explicitly
*/
.sp-app {
  --app-navy: #30385a;
  --app-navy-dark: #011433;
  --app-navy-band: #192f55;     /* the share ticker band */
  --app-red: #c8272b;
  --app-grey: #7f7f7f;          /* the site's grey: 4.0:1 on white, so only 18px+ or decorative */
  --app-muted: #5d6573;         /* readable small secondary text (6:1 on white) */
  --app-text: #30385a;          /* the site sets body copy in slate navy */
  --app-border: #d6d9de;
  --app-rule: #e8e8e8;          /* the rule under news tile rows */
  --app-surface: #ffffff;
  --app-surface-alt: #f8f8f9;   /* breadcrumb strip */
  --app-footer: #e6e8e9;
  --app-ok: #2e7d32;
  --app-warn: #a15c00;
  --app-focus: #c8272b;
  --app-font: Calibri, Candara, Segoe, "Segoe UI", Optima, Arial, sans-serif;
  --app-font-light: "Calibri Light", Calibri, Candara, Segoe, "Segoe UI", 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;
}

/* CGP.css nudges every label right with !important */
.sp-app label {
  margin-left: 0 !important;
  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 Light) ---- */
.sp-app .sp-title {
  font-family: var(--app-font-light);
  font-size: 36px;
  font-weight: 300;
  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: square. Primary is the site's Explore button: navy fill, 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: 0;
  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) {
  background: var(--app-navy);
  color: #fff !important;
}

/* CGP.css forces hovered and visited links to dark navy with !important; the site's Explore
   button inverts on hover (white fill, navy 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-navy);
  color: var(--app-navy) !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: 0;
  background: var(--app-surface);
  font-size: 14px;
}

.sp-app textarea.sp-input {
  padding: var(--space-2) var(--space-3);
  line-height: 1.4;
  resize: vertical;
}

.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;
  }
}
