/* Data Safety Assurance (data-safety.tech).
   Same structure as mca-website's site.css, with this site's own navy and light-blue palette. */

@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: italic; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-400-italic.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap;
  src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); }

/* ---- Palette ------------------------------------------------------------ */
:root {
  --ink: #1F2933;
  --muted: #4B5866;
  --line: #D7E0E7;
  --white: #FFFFFF;
  --page: #F6F9FB;

  --navy: #1D3A5C;        /* headings, banner, buttons */
  --navy-dark: #152B45;   /* footer */
  --sky: #8CC8E6;         /* the old site's light blue, as an accent */
  --sky-tint: #E6F2F9;    /* panels, chips */
  --link: #1F5C8F;

  --wrap: 74rem;
  --radius: 4px;
}

/* ---- Base --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--page);
}
img { max-width: 100%; height: auto; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; }

h1, h2, h3, h4 { line-height: 1.2; font-weight: 600; margin: 0 0 0.6em; }
h2 { font-size: 1.6rem; color: var(--navy); }
h3, .h3 { font-size: 1.25rem; color: var(--navy); }
p { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1.5rem; }
.section { padding-top: 3rem; padding-bottom: 1rem; }
.section:last-child { padding-bottom: 4rem; }
.prose > *, p.prose { max-width: 46rem; }
.prose h2 { margin-top: 1.6em; }
.small { font-size: 0.9375rem; color: var(--muted); }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--white); padding: 0.5rem 1rem; z-index: 10; }
.skip-link:focus { left: 1rem; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Header ------------------------------------------------------------- */
.site-header { background: var(--white); border-top: 6px solid var(--sky); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 0.75rem; }
.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--ink); padding-bottom: 0.75rem; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-weight: 600; font-size: 1.125rem; color: var(--navy); }
.brand-tag { font-size: 0.8125rem; color: var(--muted); }

.nav { display: flex; flex-wrap: wrap; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 0.75rem 0.75rem 0.65rem; min-height: 44px;
  color: var(--muted); font-weight: 500; text-decoration: none;
  border-bottom: 3px solid transparent;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--line); }
.nav a[aria-current="page"] { color: var(--navy); font-weight: 600; border-bottom-color: var(--sky); }

/* ---- Banners ------------------------------------------------------------ */
.banner { background: var(--navy); color: var(--white); }
.banner-inner { padding-top: 3rem; padding-bottom: 3rem; }
.banner h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); margin-bottom: 0.4em; max-width: 26em; }
.banner .lede { font-size: 1.1875rem; color: #D3E5F1; max-width: 40em; margin: 0; }
.banner-meta { color: var(--sky); font-weight: 500; margin: 0; }
.hero .banner-inner { padding-top: 4.5rem; padding-bottom: 4.5rem; }
.hero h1 { font-size: clamp(2rem, 4.5vw, 3rem); max-width: 22em; }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 2rem 0 0; }

/* ---- Buttons ------------------------------------------------------------ */
.button {
  display: inline-block; padding: 0.7rem 1.3rem; min-height: 44px;
  background: var(--navy); color: var(--white); font: inherit; font-weight: 600; text-decoration: none;
  border: 2px solid var(--navy); border-radius: var(--radius); cursor: pointer;
}
.button:hover { filter: brightness(1.15); }
.hero .button { background: var(--sky); border-color: var(--sky); color: var(--navy); }
.hero .button-ghost { background: transparent; border-color: #D3E5F1; color: var(--white); }

/* ---- Grids, cards, split layout ----------------------------------------- */
.grid { display: grid; gap: 1.5rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.card { background: var(--white); border: 1px solid var(--line); padding: 1.75rem; border-radius: var(--radius); }
.card > :last-child { margin-bottom: 0; }
.card.feature { border-top: 5px solid var(--sky); }

.split { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 1fr); }
.split-side img { display: block; margin-bottom: 1.25rem; }
@media (min-width: 56rem) {
  .split { grid-template-columns: minmax(0, 1fr) 18rem; }
}
.downloads { list-style: none; padding: 0; }
.downloads li { margin-bottom: 0.5rem; }

/* ---- Accident search ---------------------------------------------------- */
.search-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 56rem) {
  .search-layout { grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
  .filters { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.filters { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.filter-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.search-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-row input {
  flex: 1; min-width: 0; min-height: 44px; padding: 0.5rem 0.65rem;
  font: inherit; border: 1px solid #9AA9B6; border-radius: var(--radius);
}
.search-row .button { padding-left: 0.9rem; padding-right: 0.9rem; }

.facet { border-top: 1px solid var(--line); }
.facet summary { cursor: pointer; padding: 0.7rem 0; font-weight: 600; color: var(--navy); }
.facet-count { font-weight: 400; color: var(--muted); font-size: 0.9375rem; }
.facet fieldset { border: 0; margin: 0 0 0.75rem; padding: 0; max-height: 16rem; overflow-y: auto; }
.option { display: flex; align-items: baseline; gap: 0.5rem; padding: 0.2rem 0; font-size: 0.9375rem; cursor: pointer; }
.option input { margin: 0; flex: none; width: 1.05rem; height: 1.05rem; accent-color: var(--navy); }
.option .count { margin-left: auto; color: var(--muted); font-size: 0.875rem; }
.option.empty { color: #8796A3; }
.filter-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; border-top: 1px solid var(--line); padding-top: 1rem; margin-bottom: 0.75rem; }

.results-count { font-size: 1.25rem; margin-bottom: 0.75rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0 0 1.5rem; }
.chip {
  display: inline-block; padding: 0.3rem 0.8rem; border-radius: 999px;
  background: var(--sky-tint); color: var(--navy); font-weight: 500; font-size: 0.9375rem; text-decoration: none;
}
.chip:hover { background: #D2E8F4; }

.accident-card {
  display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 1.25rem;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.25rem; margin-bottom: 1rem;
}
.accident-card.no-picture { grid-template-columns: minmax(0, 1fr); }
.accident-card .thumb { width: 7.5rem; height: 5.5rem; object-fit: cover; border-radius: var(--radius); }
.accident-card h2 { margin-bottom: 0.2em; }
.accident-card .meta { color: var(--muted); font-size: 0.9375rem; margin-bottom: 0.5rem; }
.accident-card .summary > :last-child { margin-bottom: 0.6rem; }
@media (max-width: 36rem) {
  .accident-card { grid-template-columns: minmax(0, 1fr); }
  .accident-card .thumb { width: 100%; height: 9rem; }
}
.tags { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; padding: 0; margin: 0; }
.tags li { font-size: 0.8125rem; padding: 0.1rem 0.55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }

/* ---- Accident page ------------------------------------------------------- */
.lede-text { font-size: 1.1875rem; }
.accident-text img { max-width: 100%; }
.accident-picture { margin: 0 0 1.5rem; }
.accident-picture img { border-radius: var(--radius); margin-bottom: 0.4rem; }
.sources li { margin-bottom: 0.6rem; overflow-wrap: anywhere; }
.facts { margin: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; }
.facts dt { font-weight: 600; color: var(--navy); font-size: 0.9375rem; }
.facts dd { margin: 0 0 0.75rem; }
.facts dd:last-child { margin-bottom: 0; }

/* ---- Tables (privacy policy) ------------------------------------------------ */
.table-scroll { overflow-x: auto; margin-bottom: 1em; }
table { border-collapse: collapse; width: 100%; font-size: 0.9375rem; background: var(--white); }
th, td { border: 1px solid var(--line); padding: 0.6rem 0.75rem; text-align: left; vertical-align: top; }
th { background: var(--sky-tint); }

/* ---- Footer ----------------------------------------------------------------- */
.site-footer { background: var(--navy-dark); color: #D3DDE6; font-size: 0.9375rem; margin-top: 2rem; }
.site-footer a { color: #FFFFFF; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding-top: 2.5rem; padding-bottom: 2.5rem; }
.footer-inner p { margin: 0 0 0.25rem; }
.footer-name { font-weight: 600; }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.5rem; list-style: none; margin: 0; padding: 0; }

@media (max-width: 40rem) {
  .nav a { padding: 0.6rem 0.5rem; }
  .banner-inner { padding-top: 2.25rem; padding-bottom: 2.25rem; }
  .hero .banner-inner { padding-top: 3rem; padding-bottom: 3rem; }
}
