/* listing-notices.css: the ADs & notices button and its pop-up (#194),
   moved out of page_details.css so any page can show them (issue #195: the
   valuation page's "Public records"). Linked by the component itself
   (components/listing-notices), never by a page.

   page_details.css gives its whole page a reset and these tokens on :root;
   another page has neither, so they are given here, scoped to the notices.
   The values are page_details.css's own, and the reset is :where(), so it
   weighs nothing: on the listing pages both change nothing. */
.listing-notices,
.ln-entry,
.ln-dialog {
  --snow2: #eef4f8;
  --royal: #2843a7;
  --ink: #0e1a2b;
  --slate: #3d5166;
  --muted2: #b0c4d0;
  --border: rgba(90, 138, 167, 0.15);
  --border2: rgba(90, 138, 167, 0.09);
  --ff-b: "Plus Jakarta Sans", sans-serif;
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
:where(.listing-notices, .ln-entry, .ln-dialog) :where(*, *::before, *::after) {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Airworthiness directives & notices (#194) ──
   components/listing-notices: the "View ADs & notices" button in the
   sidebar of the aircraft, engine and part pages, and the pop-up it opens
   (the Catalog card's shell, catalog-card.css; the dialog carries
   .listing-notices). Hue carries meaning and nothing else:
   red = a mandatory notice matched to this listing, amber = advisory,
   grey = may apply. Hairlines separate rows and groups, as in the specs
   table; no coloured bars. The red and amber pairs are the ones the vendor
   and admin pages already use for the same meanings. */
.listing-notices {
  --ln-red: #b91c1c;
  --ln-red-bg: #fef2f2;
  --ln-red-edge: #fecaca;
  --ln-red-dot: #dc2626;
  --ln-amber: #92400e;
  --ln-amber-bg: #fffbeb;
  --ln-amber-edge: #fde68a;
  --ln-amber-dot: #d97706;
  font-family: var(--ff-b);
}
.listing-notices .ln-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border2);
}
/* The card's own h2 rule draws the divider; here the head row draws it, so
   the counts sit on the same line as the title. */
.listing-notices .ln-head h2 {
  margin: 0;
  padding: 0;
  border-bottom: 0;
}
.listing-notices .ln-counts {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.listing-notices .ln-note {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--slate);
}

/* Groups: <details>, the browser's marker replaced by the chevron. */
.listing-notices .ln-group {
  border-bottom: 1px solid var(--border2);
}
.listing-notices .ln-group-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  cursor: pointer;
  list-style: none;
}
.listing-notices .ln-group-summary::-webkit-details-marker {
  display: none;
}
.listing-notices .ln-group-summary::marker {
  content: "";
}
.listing-notices .ln-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--muted2);
}
.listing-notices .ln-tone-mandatory .ln-dot {
  background: var(--ln-red-dot);
}
.listing-notices .ln-tone-advisory .ln-dot {
  background: var(--ln-amber-dot);
}
.listing-notices .ln-group-title {
  margin: 0;
  font-family: var(--ff-b);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.3;
  color: var(--ink);
}
.listing-notices .ln-group-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate);
}
.listing-notices .ln-chevron {
  flex: none;
  margin-left: auto;
  color: var(--slate);
  transition: transform 0.2s var(--ease);
}
.listing-notices .ln-group[open] > .ln-group-summary .ln-chevron {
  transform: rotate(180deg);
}
.listing-notices .ln-group-summary:hover .ln-group-title,
.listing-notices .ln-group-summary:hover .ln-chevron {
  color: var(--royal);
}

/* Rows */
.listing-notices .ln-list {
  list-style: none;
  margin: 0;
  padding: 0 0 6px 17px;
}
.listing-notices .ln-row {
  padding: 10px 0;
  border-top: 1px solid var(--border2);
}
.listing-notices .ln-row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}
.listing-notices .ln-number {
  font-size: 13px;
  font-weight: 700;
  color: var(--royal);
  text-decoration: none;
}
.listing-notices .ln-number:hover {
  text-decoration: underline;
}
.listing-notices .ln-type {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--snow2);
  color: var(--slate);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.5;
  white-space: nowrap;
}
/* The chip takes its group's tone: the rows don't repeat the class. */
.listing-notices .ln-tone-mandatory .ln-type {
  border-color: var(--ln-red-edge);
  background: var(--ln-red-bg);
  color: var(--ln-red);
}
.listing-notices .ln-tone-advisory .ln-type {
  border-color: var(--ln-amber-edge);
  background: var(--ln-amber-bg);
  color: var(--ln-amber);
}
.listing-notices .ln-meta {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate);
}
/* Two lines in the list; the notice's details show it whole. */
.listing-notices .ln-line {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.55;
  color: var(--ink);
}
.listing-notices .ln-foot {
  display: block;
  margin: 2px 0 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--slate);
}
.listing-notices .ln-asof {
  margin: 14px 0 0;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--slate);
}

.listing-notices .ln-open:focus-visible,
.listing-notices .ln-back:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 2px;
  border-radius: 8px;
}
.listing-notices .ln-group-summary:focus-visible {
  outline: 2px solid var(--royal);
  outline-offset: 4px;
  border-radius: 6px;
}
@media (max-width: 480px) {
  .listing-notices .ln-list {
    padding-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .listing-notices .ln-chevron {
    transition: none;
  }
}

/* The button in the sidebar (.btn-cta-secondary), with the sidebar's side
   padding; under the NTSB button it closes up to it (a <link> sits
   between them, so `~`, not `+`). */
.ln-entry {
  padding: 14px 20px 6px;
}
.ntsb-entry ~ .ln-entry {
  padding-top: 0;
}
.ln-entry .btn-cta-secondary:focus-visible {
  outline: 3px solid var(--royal);
  outline-offset: 2px;
}
@media (max-width: 480px) {
  .ln-entry {
    padding: 12px 14px 4px;
  }
  .ntsb-entry ~ .ln-entry {
    padding-top: 0;
  }
}

/* In the pop-up: the counts under the title, the note under them. */
.ln-dialog .ln-counts {
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
}
.ln-dialog .ln-note {
  margin: 16px 0 6px;
}

/* A row is one button: the whole row opens the notice. */
.listing-notices .ln-row {
  padding: 2px 0;
}
.listing-notices .ln-open {
  display: flex;
  align-items: center;
  gap: 12px;
  width: calc(100% + 16px);
  margin: 0 -8px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.listing-notices .ln-open:hover {
  background: var(--snow2);
}
.listing-notices .ln-open:hover .ln-number {
  text-decoration: underline;
}
.listing-notices .ln-open-text {
  display: block;
  flex: 1;
  min-width: 0;
}
.listing-notices .ln-open-icon {
  flex: none;
  color: var(--slate);
}
.listing-notices .ln-open:hover .ln-open-icon {
  color: var(--royal);
}

/* One notice's details. */
.listing-notices .ln-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 16px 0 14px;
  padding: 4px 8px 4px 2px;
  border: 0;
  background: none;
  color: var(--royal);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.listing-notices .ln-back:hover {
  text-decoration: underline;
}
.listing-notices .ln-detail .ln-row-head {
  margin: 0;
}
.listing-notices .ln-detail .ln-number {
  font-size: 16px;
  color: var(--ink);
}
.listing-notices .ln-detail-title {
  margin: 10px 0 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink);
  overflow-wrap: anywhere;
}
.listing-notices .ln-detail-summary {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--slate);
}
.listing-notices .ln-detail-note {
  margin: 14px 0 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--slate);
}
