/* ============================================================================
   GIP Bank — base: reset, typography, layout primitives.
   ========================================================================== */

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

* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: 1.55;
  color: var(--body);
  background: var(--page-bg);
  -webkit-font-smoothing: antialiased;
}

body.site-public { font-size: var(--text-lead); }

img, svg, video { display: block; max-width: 100%; }

input, button, textarea, select { font: inherit; color: inherit; }

/* ── Headings ─────────────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 650;
  line-height: 1.25;
  text-wrap: balance;
}
h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }
h4 { font-size: var(--text-h4); }
h5 { font-size: var(--text-h5); }

.t-display {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--brand);
}
.t-hero { font-size: var(--text-hero); line-height: 1.15; }

.t-eyebrow {
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.t-eyebrow--gold { color: var(--gold-600); }
.on-dark .t-eyebrow, .t-eyebrow--on-dark { color: var(--gold-300); }

.t-mono { font-family: var(--font-mono); font-size: 0.925em; }
.t-num { font-variant-numeric: tabular-nums; }
.t-muted { color: var(--muted); }
.t-small { font-size: var(--text-small); }
.t-caption { font-size: var(--text-caption); }
.t-center { text-align: center; }

/* ── Links ────────────────────────────────────────────────────────────────── */
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

/* ── Focus (non-negotiable) ───────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
  border-radius: 2px;
}
.on-dark :focus-visible { outline-color: var(--focus-ring-on-dark); }

/* ── Motion preferences ───────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ── Layout primitives ────────────────────────────────────────────────────── */
.container {
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--sp-7);
}

.stack > * + * { margin-top: var(--sp-5); }
.stack-lg > * + * { margin-top: var(--sp-7); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.split {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-5);
  flex-wrap: wrap;
}

.grid { display: grid; gap: var(--sp-6); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.hairline { border: 0; border-top: 1px solid var(--hairline); }

.gold-rule {
  border: 0;
  border-top: 2px solid var(--gold-400);
  width: 48px;
  margin: 0;
}

/* ── Icons ────────────────────────────────────────────────────────────────── */
.icon {
  width: 18px;
  height: 18px;
  flex: none;
  stroke-width: 1.75;
}
.icon--sm { width: 14px; height: 14px; }
.icon--lg { width: 24px; height: 24px; }

/* ── Utility ──────────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip-to-content: hidden until keyboard focus. */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: -60px;
  z-index: 200;
  background: var(--surface-dark);
  color: var(--white);
  padding: 10px 16px;
  border-radius: var(--r-sm);
  font-weight: 600;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: var(--sp-4); text-decoration: none; }

.scroll-x { overflow-x: auto; }

/* Ministry emblem (coat of arms) — rendered as an image by seal() */
img.seal { object-fit: contain; display: inline-block; vertical-align: middle; }

::selection { background: var(--green-100); color: var(--green-950); }

/* ── Premium custom scrollbars ───────────────────────────────────────────── */
* { scrollbar-width: thin; scrollbar-color: rgba(13,78,55,.34) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 3px solid transparent;
  background: linear-gradient(180deg, var(--green-500), var(--green-700)) padding-box;
  transition: background .2s;
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--gold-400), var(--gold-600)) padding-box;
}
::-webkit-scrollbar-corner { background: transparent; }
/* Dark surfaces (portal sidebar) get a gold-tinted thumb for contrast */
.sidebar { scrollbar-color: rgba(207,168,61,.5) transparent; }
.sidebar::-webkit-scrollbar-thumb { background: linear-gradient(180deg, var(--gold-400), var(--gold-600)) padding-box; }
.sidebar::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #E4C572, var(--gold-500)) padding-box; }
/* Compact scrollbars inside scrollable panels */
.table-wrap::-webkit-scrollbar, .psearch__results::-webkit-scrollbar,
.cmdbar__results::-webkit-scrollbar { width: 9px; height: 9px; }
