/* NTSB accident history (issue #194): the "View NTSB accident history" button
   on an aircraft listing, the records inside its dialog, and the
   /ntsb-accident-history page.

   The dialog itself wears the Catalog card's shell from catalog-card.css
   (.catalog-scrim / -dialog / -close / -head / -note / -actions / -cta): a
   centred dialog, a bottom sheet at 640px and under. This file adds only what
   that shell has no rule for. Tokens are the site's v3 palette, scoped. */
.ntsb-entry,
.ntsb-records,
.ntsb-page {
  --ntsb-ink: #0e1a2b;
  --ntsb-slate: #3d5166;
  --ntsb-muted: #4a6e82;
  --ntsb-royal: #2843a7;
  --ntsb-white: #ffffff;
  --ntsb-snow: #f8fafc;
  --ntsb-snow2: #eef4f8;
  --ntsb-border: rgba(90, 138, 167, 0.18);
  --ntsb-border2: rgba(90, 138, 167, 0.1);
  /* Severity: red = fatal / destroyed, amber = serious / substantial. */
  --ntsb-severe-bg: #fdecee;
  --ntsb-severe-ink: #9b1c2c;
  --ntsb-serious-bg: #fff4e0;
  --ntsb-serious-ink: #8a4b00;
  --ntsb-neutral-bg: #eef2f6;
  --ntsb-neutral-ink: #3d5166;
}

/* ── The button in the listing's sidebar (page_details.css's
   .btn-cta-secondary, with the sidebar's own side padding). ── */
.ntsb-entry {
  padding: 14px 20px 6px;
}
.ntsb-entry .btn-cta-secondary:focus-visible {
  outline: 3px solid var(--ntsb-royal);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .ntsb-entry {
    padding: 12px 14px 4px;
  }
}

/* ── Records ── */
.ntsb-records {
  list-style: none;
  margin: 18px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ntsb-record {
  padding: 14px 16px;
  border: 1px solid var(--ntsb-border);
  border-radius: 12px;
  background: var(--ntsb-white);
}
.ntsb-record-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.ntsb-record-date {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ntsb-ink);
  font-variant-numeric: tabular-nums;
}
.ntsb-record-type {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ntsb-muted);
}
.ntsb-record-meta {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ntsb-slate);
  overflow-wrap: anywhere;
}
.ntsb-pills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
}
.ntsb-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
}
.ntsb-pill--severe {
  background: var(--ntsb-severe-bg);
  color: var(--ntsb-severe-ink);
}
.ntsb-pill--serious {
  background: var(--ntsb-serious-bg);
  color: var(--ntsb-serious-ink);
}
.ntsb-pill--neutral {
  background: var(--ntsb-neutral-bg);
  color: var(--ntsb-neutral-ink);
}
.ntsb-record-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--ntsb-border2);
  font-size: 12px;
  line-height: 1.5;
  color: var(--ntsb-muted);
}
.ntsb-report-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ntsb-royal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ntsb-report-link svg {
  width: 12px;
  height: 12px;
}
.ntsb-report-link:focus-visible,
.ntsb-login:focus-visible,
.ntsb-retry:focus-visible {
  outline: 3px solid var(--ntsb-royal);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Below the records or the empty note: the source and what the data is not. */
.ntsb-disclaimer {
  margin: 16px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--ntsb-muted, #4a6e82);
}
.ntsb-disclaimer strong {
  font-weight: 600;
  color: var(--ntsb-slate, #3d5166);
}

/* "Log in" next to the Sign up CTA, and the Retry link. */
.ntsb-login {
  flex-shrink: 0;
  white-space: nowrap;
}
.ntsb-login,
.ntsb-retry {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: #2843a7;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ── /ntsb-accident-history ── */
.ntsb-page {
  /* catalog-card.css defines these on its dialog only; the page uses its
     note and CTA too. */
  --pl-ink: #0e1a2b;
  --pl-slate: #3d5166;
  --pl-muted: #4a6e82;
  --pl-royal: #2843a7;
  --pl-royal-lt: #3a58c4;
  --pl-white: #ffffff;
  --pl-snow2: #eef4f8;
  --pl-border: rgba(90, 138, 167, 0.18);
  --pl-border2: rgba(90, 138, 167, 0.1);
  --pl-danger: #b00020;
  --pl-ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  background: var(--ntsb-snow);
  color: var(--ntsb-ink);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
}
.ntsb-page-main {
  width: min(100% - 32px, 760px);
  margin: 0 auto;
  padding: 150px 0 64px;
}
.ntsb-page h1 {
  margin: 0;
  font-family: "Libre Baskerville", Georgia, serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--ntsb-ink);
}
.ntsb-page-lede {
  margin: 10px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ntsb-slate);
}
.ntsb-search {
  margin-top: 26px;
  padding: 24px;
  border: 1px solid var(--ntsb-border2);
  border-radius: 14px;
  background: var(--ntsb-white);
  box-shadow:
    0 2px 16px rgba(40, 67, 167, 0.07),
    0 1px 3px rgba(14, 26, 43, 0.04);
}
.ntsb-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.ntsb-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.ntsb-field label {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ntsb-muted);
}
.ntsb-field input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--ntsb-border);
  border-radius: 8px;
  background: var(--ntsb-white);
  font: inherit;
  font-size: 15px;
  color: var(--ntsb-ink);
}
.ntsb-field input:focus-visible {
  outline: 3px solid var(--ntsb-royal);
  outline-offset: 1px;
  border-color: var(--ntsb-royal);
}
/* "Add the make to search by serial number.": guidance, not an error, so
   slate (red on this page means a fatal accident). Empty, it takes no room. */
.ntsb-form-hint {
  margin: 12px 0 0;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ntsb-slate);
}
.ntsb-form-hint:empty {
  margin: 0;
}
.ntsb-results {
  margin-top: 22px;
}
@media (max-width: 720px) {
  .ntsb-fields {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .ntsb-page-main {
    padding-top: 112px;
  }
  .ntsb-page h1 {
    font-size: 27px;
  }
  .ntsb-search {
    padding: 18px 16px;
  }
  /* catalog-card.css makes the actions a sticky footer inside its sheet;
     on the page they stay in the flow. */
  .ntsb-page .catalog-actions {
    position: static;
    padding: 0;
    background: none;
  }
}
