/* ECZ Online Systems – shared styles (index.html, registration.html)
   Type: Barlow (body) + Barlow Semi Condensed (headings), self-hosted, SIL OFL.
   Colour: bright ECZ green, matching the ECZ Service Portal. */

@font-face { font-family: "Barlow"; src: url("../fonts/barlow-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow"; src: url("../fonts/barlow-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semicondensed-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Barlow Semi Condensed"; src: url("../fonts/barlow-semicondensed-700.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }

:root {
  --field: #00773a;       /* ECZ green: buttons, links, active chips (white text 5.7:1) */
  --field-dark: #005f2e;  /* hover */
  --hero-from: #00733a;   /* hero gradient, left to right */
  --hero-to: #0a9a4f;
  --leaf: #e2f3e8;        /* pale green: icon tiles */
  --wash: #f0f8f3;        /* row hover */
  --sun: #ffd34d;         /* focus ring on green */
  --paper: #f3f6f4;
  --ink: #14241b;
  --muted: #56635b;
  --line: #d7dfd9;
  --focus: #c25e00;       /* copper, darkened to hold contrast on white */

  --wrap: 1040px;
  --pad: 28px;

  --sans: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --display: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}

html {
  /* keep keyboard-focused rows clear of the pinned header and footer */
  scroll-padding-top: var(--sticky-h, 170px);
  scroll-padding-bottom: 64px;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
}
main { flex: 1; padding-bottom: 24px; }
.wrap { max-width: var(--wrap); padding-left: var(--pad); padding-right: var(--pad); }

/* ---------- Masthead: logo far left, link far right ---------- */
.masthead { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid var(--line); }
.masthead .wrap { max-width: none; padding-left: 32px; padding-right: 32px; }
.topnav { min-height: 72px; padding: 10px 0; gap: 20px; }

.brand { display: flex; align-items: center; gap: 14px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-logo, .brand-fallback { width: 50px; height: 50px; flex: 0 0 50px; border-radius: 50%; object-fit: contain; }
.brand-fallback {
  display: none; align-items: center; justify-content: center;
  background: var(--field); color: #fff; font: 700 18px var(--display);
}
.brand-name { border-left: 1px solid var(--line); padding-left: 14px; font: 600 21px/1.15 var(--display); }
.brand-name small { display: block; margin-top: 3px; color: var(--muted); font: 500 14px/1.2 var(--sans); }

.nav-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border: 1px solid var(--field); border-radius: 8px;
  color: var(--field); font-size: 15px; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .15s;
}
.nav-pill:hover { background: var(--leaf); color: var(--field-dark); }

/* ---------- Hero ---------- */
/* Pinned below the masthead; --hero-stick (set in app.js) lets the heading scroll away so only the search band stays. */
.hero {
  position: sticky; top: var(--hero-stick, -70px); z-index: 20;
  overflow: hidden; color: #fff; padding: 26px 0 20px;
  background:
    radial-gradient(circle at 96% -30%, rgba(255,255,255,.10) 0 170px, transparent 171px),
    radial-gradient(circle at 78% 150%, rgba(255,255,255,.07) 0 120px, transparent 121px),
    linear-gradient(100deg, var(--hero-from) 0%, #00843f 55%, var(--hero-to) 100%);
  transition: box-shadow .2s;
}
.is-scrolled .hero { box-shadow: 0 8px 18px rgba(0, 60, 30, .18); }

.hero h1 { margin: 0 0 4px; font: 700 clamp(28px, 3vw, 38px)/1.1 var(--display); letter-spacing: -.005em; }
.hero p.lead { margin: 0; color: #e3f4e9; font-size: 17px; font-weight: 400; line-height: 1.4; }

.search-box { position: relative; margin-top: 16px; }
.search-box > i {
  position: absolute; left: 18px; top: 50%; transform: translateY(-50%); z-index: 1;
  color: var(--field); font-size: 19px; pointer-events: none;
}
.search-box input {
  height: 52px; padding: 0 96px 0 50px;
  border: 0; border-radius: 10px; background: #fff; color: var(--ink);
  font: 400 17px var(--sans);
}
.search-box input::placeholder { color: #6b776f; }
.search-box input:focus { outline: 3px solid var(--sun); outline-offset: 2px; box-shadow: none; }
.search-box kbd {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--paper); color: var(--muted); font: 500 13px var(--sans);
}

/* ---------- Filters + count on one row ---------- */
.filter-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 18px 0 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 38px; padding: 0 16px;
  border: 1px solid #c3cfc6; border-radius: 999px; background: #fff; color: var(--ink);
  font: 500 15px var(--sans);
  transition: border-color .15s, background-color .15s, color .15s;
}
.chip:hover { border-color: var(--field); color: var(--field); }
.chip.active { background: var(--field); border-color: var(--field); color: #fff; }
.result-count { color: var(--muted); font-size: 15px; white-space: nowrap; }

/* ---------- Directory: one list, rows divided ---------- */
.sys-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.sys-list[hidden] { display: none; }
.sys-item {
  display: flex; align-items: center; gap: 16px;
  margin-top: -1px; padding: 14px 20px; border-top: 1px solid var(--line); /* first visible row's rule is clipped */
  color: var(--ink); text-decoration: none;
  transition: background-color .15s;
}
.sys-item[hidden] { display: none !important; }
.sys-item:hover { background: var(--wash); color: var(--ink); }

.sys-icon {
  flex: 0 0 44px; height: 44px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--leaf); color: var(--field); font-size: 21px;
}
.sys-body { flex: 1; min-width: 0; }
.sys-title { font: 600 19px/1.25 var(--display); }
.sys-desc { margin-top: 1px; color: var(--muted); font-size: 15px; line-height: 1.4; }
.sys-url { display: none; }
.sys-tag { color: var(--muted); font-size: 14px; font-weight: 500; white-space: nowrap; }
.sys-arrow {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border: 1px solid var(--field); border-radius: 8px;
  color: var(--field); font-size: 15px; font-weight: 600; white-space: nowrap;
  transition: background-color .15s, color .15s;
}
.sys-item:hover .sys-arrow { background: var(--field); color: #fff; }

mark { padding: 0 1px; border-radius: 2px; background: #ffeaa0; color: inherit; }

.empty {
  display: none; padding: 32px 16px; text-align: center; color: var(--muted);
  background: #fff; border: 1px dashed #c3cfc6; border-radius: 12px;
}
.empty i { display: block; margin-bottom: 6px; font-size: 26px; }

/* Sits at the bottom of the screen on short pages and stays pinned there while scrolling. */
.site-footer {
  position: sticky; bottom: 0; z-index: 20;
  background: #fff; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 14px;
}
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 20px; padding-top: 12px; padding-bottom: 12px; }
.site-footer p { margin: 0; }

/* ---------- Focus ---------- */
.chip:focus-visible, .nav-pill:focus-visible, .brand:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.sys-item:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; } /* inset: the list clips overflow */

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .sys-tag { display: none; }
}
@media (max-width: 575.98px) {
  :root { --pad: 16px; }
  .masthead .wrap { padding-left: 16px; padding-right: 16px; }
  .topnav { min-height: 60px; gap: 10px; }
  .brand { gap: 10px; }
  .brand-logo, .brand-fallback { width: 40px; height: 40px; flex-basis: 40px; font-size: 14px; }
  .brand-name { border: 0; padding: 0; font-size: 16px; }
  .brand-name small { font-size: 12px; margin-top: 1px; }
  .nav-pill { padding: 6px 10px; font-size: 13px; gap: 5px; }

  .hero { padding: 20px 0 16px; }
  .hero h1 { font-size: 26px; }
  .hero p.lead { font-size: 15px; }
  .search-box { margin-top: 14px; }
  .search-box > i { left: 14px; font-size: 18px; }
  .search-box input { height: 48px; padding: 0 12px 0 42px; font-size: 16px; } /* 16px stops iOS zoom */
  .search-box kbd { display: none; }

  .filter-card { padding: 14px 0 12px; }
  .chips { gap: 6px; }
  .chip { min-height: 34px; padding: 0 12px; font-size: 14px; }
  .result-count { font-size: 14px; }

  .sys-item { gap: 12px; padding: 12px 14px; }
  .sys-icon { flex-basis: 38px; height: 38px; border-radius: 9px; font-size: 18px; }
  .sys-title { font-size: 17px; }
  .sys-desc { font-size: 14px; }
  .sys-arrow { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .sys-arrow .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

  .site-footer { font-size: 13px; }
  .site-footer .wrap { padding-top: 10px; padding-bottom: 10px; }
  .site-footer .wrap > span { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sys-item, .sys-arrow, .chip, .nav-pill, .hero { transition: none; }
}
