/* ==========================================================================
   Grey Sky Capital: PMS empanelled distributors (distributors.html, /distributors)
   --------------------------------------------------------------------------
   Technical Summary
   - On top of legal.css. A disclosure card (icon, one line, "View list")
     opens the register in a native <dialog> modal: a head with the title and
     close button, a search field, the table in a scrolling body, and a foot
     line. On phones each row becomes a stacked block labelled by data-label.
   - The dialog's contents cannot be selected (user-select: none; the search
     box excepted) and do not print. distributors.js blocks copy and the
     select-all and copy keys.
   - Colour and type come from tokens.css only; the card and the dialog are
     lifted with the shared depth tokens.
   ========================================================================== */

/* The disclosure card */
.dst-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 20px;
  max-width: 960px; padding: clamp(20px, 3vw, 28px); background: var(--paper-100);
  border: 1px solid var(--paper-300); box-shadow: var(--lit-drop);
}
.dst-card__icon { display: grid; place-items: center; width: 56px; height: 56px; background: var(--paper-200); border: 1px solid var(--paper-300); }
.dst-card__icon svg { fill: none; stroke: var(--ink-head); stroke-width: 1.6; stroke-linecap: round; }
.dst-card__text { margin: 0; font-size: var(--lead-size); line-height: 1.5; color: var(--ink-body); }
.dst-card__btn, .dst-contact__btn {
  min-height: 44px; padding: 0 18px; cursor: pointer; white-space: nowrap;
  font-family: var(--font-mono); font-size: var(--eyebrow-size); font-weight: 500; letter-spacing: var(--eyebrow-tr); text-transform: uppercase;
  background: var(--ink-head); color: var(--paper-100); border: 1px solid var(--ink-head);
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.dst-card__btn:hover { background: var(--lime); color: var(--ink-head); }
.dst-card__btn:focus-visible, .dst__close:focus-visible, .dst-contact__btn:focus-visible, .dst__input:focus-visible,
.dst-contact a:focus-visible, .dst__body:focus-visible { outline: 3px solid var(--azure-ink); outline-offset: 2px; }
@media (max-width: 620px) {
  .dst-card { grid-template-columns: auto minmax(0, 1fr); }
  .dst-card__btn { grid-column: 1 / -1; }
}

/* The modal */
.dst {
  width: min(1180px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  display: none; flex-direction: column; color: var(--ink-body); background: var(--paper-100);
  border: 1px solid var(--paper-300); box-shadow: 0 30px 80px -30px color-mix(in srgb, var(--ink-head) 70%, transparent);
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
.dst[open] { display: flex; }
.dst::backdrop { background: color-mix(in srgb, var(--ink-head) 62%, transparent); }
.dst__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: clamp(20px, 3vw, 32px) clamp(20px, 3vw, 36px) 18px; border-bottom: 1px solid var(--paper-300); }
.dst__title { margin: 6px 0 0; font-size: var(--d2-size); line-height: var(--d2-lh); letter-spacing: var(--d2-tr); font-weight: 700; color: var(--ink-head); }
.dst__sub { margin: 8px 0 0; color: var(--ink-muted); }
.dst__close { flex: none; width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; font-size: 26px; line-height: 1; background: var(--paper-100); color: var(--ink-head); border: 1px solid var(--paper-300); }
.dst__close:hover { border-color: var(--ink-head); }
.dst__search { padding: 18px clamp(20px, 3vw, 36px) 6px; }
.dst__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dst__input {
  width: 100%; min-height: 48px; padding: 0 14px; border-radius: 0; -webkit-user-select: text; user-select: text;
  font-family: var(--font-sans); font-size: var(--body-size); color: var(--ink-head); background: var(--paper-100);
  border: 1px solid var(--grey-500); box-shadow: var(--lit-well);
}
.dst__body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 6px clamp(20px, 3vw, 36px) 12px; }
.dst__status { margin: 18px 0; color: var(--ink-muted); }
.dst__status a { color: var(--rust); }
.dst__foot { margin: 0; padding: 14px clamp(20px, 3vw, 36px); border-top: 1px solid var(--paper-300); font-size: 14px; color: var(--ink-muted); }
.dst-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* The table */
.dst-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.dst-table thead th {
  position: sticky; top: 0; z-index: 1; padding: 14px 16px 12px 0; text-align: left; background: var(--paper-100);
  font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted);
  border-bottom: 1px solid var(--ink-head);
}
.dst-table td, .dst-table tbody th { padding: 18px 16px 18px 0; text-align: left; vertical-align: top; border-bottom: 1px solid var(--paper-300); }
.dst-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--paper-200) 55%, transparent); }
.dst-table tbody th { font-weight: 700; color: var(--ink-head); min-width: 180px; }
.dst-aprn { font-family: var(--font-mono); font-size: 13px; color: var(--ink-muted); white-space: nowrap; }
.dst-contact { display: grid; gap: 4px; justify-items: start; font-variant-numeric: tabular-nums; }
.dst-contact__btn { margin-top: 8px; min-height: 40px; padding: 0 14px; background: var(--paper-100); color: var(--ink-head); border-color: var(--grey-500); }
.dst-contact__btn:hover { border-color: var(--ink-head); background: var(--paper-200); }
.dst-contact__person { font-weight: 600; color: var(--ink-head); }
.dst-contact a { color: var(--rust); text-underline-offset: 3px; overflow-wrap: anywhere; }

/* Phones: each row a stacked block */
@media (max-width: 760px) {
  .dst { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
  .dst-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .dst-table, .dst-table tbody, .dst-table tr, .dst-table td, .dst-table tbody th { display: block; }
  .dst-table tr { padding: 16px 0; border-bottom: 1px solid var(--paper-300); }
  .dst-table tbody tr:nth-child(even) { background: none; }
  .dst-table td, .dst-table tbody th { padding: 4px 0; border: 0; min-width: 0; }
  .dst-table td::before { content: attr(data-label); display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-muted); }
}

/* The list does not print */
@media print { .dst { display: none !important; } }
