/* styles/pages/models.css: the catalog (src/pages/models.jsx). A cabinet of cards: the header with its figures in the lede, a
   strip of modalities that sticks under the nav, a rail of facets, and the card grid. */
.mxh { position: relative; isolation: isolate; padding: clamp(118px, 11vw, 150px) 0 calc(clamp(8px, 1vw, 16px) + 120px); margin-bottom: -24px; }
.mxh::before { content: ''; position: absolute; z-index: -1; inset: 0; background: var(--vellum);
  -webkit-mask: linear-gradient(#000, #000) 0 0 / 100% calc(100% - 118px) no-repeat, url(../../images/edge-seam.png) 0 100% / 576px 120px repeat-x;
  mask: linear-gradient(#000, #000) 0 0 / 100% calc(100% - 118px) no-repeat, url(../../images/edge-seam.png) 0 100% / 576px 120px repeat-x; }
.mxh__grid { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.mxh__copy { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; justify-items: start; min-width: 0; }
.mxh__copy .search { width: min(100%, 560px); }
.mxh__copy .lede b { font-weight: 500; font-size: .94em; color: var(--ink); }
.mxh__art { width: 100%; margin: -24px -2vw -8px 0; }

.mx { padding-bottom: clamp(96px, 10vw, 140px); }
/* the toolbar sticks under the nav; its ::before fills the strip beside and above it so rows never show through */
.mx__bar { position: sticky; z-index: 20; top: 66px; display: flex; align-items: center; gap: 16px; margin-bottom: 12px; padding: 12px 0; background: var(--paper);
  box-shadow: 0 1px 0 var(--line); }
.mx__bar::before { content: ""; position: absolute; z-index: -1; left: calc(50% - 50vw); right: calc(50% - 50vw); top: -66px; bottom: 0; background: var(--paper); }
.mx__tabs { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); padding-right: 32px; }
.mx__tabs::-webkit-scrollbar { display: none; }
.mx__tab { flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 13px; border: 0; border-radius: 999px; background: none; font: 500 14px/1 var(--sans); color: var(--ink-3); cursor: pointer; transition: background-color 160ms ease, color 160ms ease; white-space: nowrap; }
.mx__tab .num { font-size: 12px; color: var(--ink-3); }
.mx__tab[aria-pressed="true"] { background: var(--dark); color: var(--cream); }
.mx__tab[aria-pressed="true"] .num { color: var(--gold); opacity: 1; }
.mx__tools { flex: none; display: flex; gap: 8px; }
.mx__filters { display: none; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: rgba(248,243,234,.7); box-shadow: inset 0 0 0 1px var(--line-2); font: 500 14px/1 var(--sans); color: var(--ink); cursor: pointer; }
.mx__filters svg { width: 15px; height: 15px; color: var(--ink-3); }
.mx__filters .num { font-size: 12px; color: var(--umber); }
@media (hover: hover) and (pointer: fine) { .mx__tab[aria-pressed="false"]:hover { background: var(--paper-lo); color: var(--ink); } }

.mx__grid { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }

/* rail */
.mx__rail { position: sticky; top: 140px; max-height: calc(100svh - 160px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 4px 4px 24px 0; display: grid; gap: 6px; }
.mx__railhead { display: flex; align-items: center; gap: 10px; min-height: 32px; }
.mx__railh { margin: 0 auto 0 0; font: 400 22px/1 var(--serif); letter-spacing: -0.01em; }
.mx__clear { border: 0; background: none; padding: 6px 0; font: 500 13px/1 var(--sans); color: var(--umber); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(138,79,44,.35); }
.mx__close, .mx__railfoot, .mx__scrim { display: none; }
.fs { margin: 0; padding: 14px 0 10px; border: 0; border-top: 1px solid var(--line); display: grid; gap: 1px; min-width: 0; }
.fs legend { float: left; width: 100%; padding: 0 0 8px; font: 500 12.5px/1 var(--sans); color: var(--ink-3); }
.fs .seg { width: 100%; }
.seg--fill { display: flex; }
.seg--fill button { flex: 1; justify-content: center; padding: 0 6px; }
.fs__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fchip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 10px 0 8px; border: 0; border-radius: 9px; background: var(--porcelain); box-shadow: inset 0 0 0 1px var(--line); font: 500 13px/1 var(--sans); color: var(--ink-2); cursor: pointer; transition: background-color 140ms ease, box-shadow 140ms ease, color 140ms ease; }
.mx__rail::-webkit-scrollbar { display: none; }
.fchip img { flex: none; width: 16px; height: 16px; object-fit: contain; }
.fchip img.is-tile, .chk__mk img.is-tile { object-fit: cover; border-radius: 4px; }
.fchip__g { flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 5px; background: var(--paper-lo); font: 400 11px/1 var(--serif); color: var(--ink-2); padding-top: .26em; }
.fchip .num { font-size: 12px; color: var(--ink-3); }
.fchip[aria-pressed="true"] { background: var(--dark); color: var(--cream); box-shadow: none; }
.fchip[aria-pressed="true"] .num { color: var(--gold); }
.fchip[aria-pressed="true"] img.inv { filter: brightness(0) invert(94%) sepia(10%) saturate(300%) hue-rotate(340deg); }
.fchip.is-zero { opacity: .45; }
@media (hover: hover) and (pointer: fine) { .fchip[aria-pressed="false"]:hover { box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink); } }
.fs__more { justify-self: start; margin-top: 6px; border: 0; background: none; padding: 4px 0; font: 500 13px/1 var(--sans); color: var(--ink-2); cursor: pointer; border-bottom: 1px solid var(--line-2); }

.chk { position: relative; display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 32px; padding: 3px 6px 3px 2px; border-radius: var(--r-sm); cursor: pointer; transition: background-color 140ms ease; }
.chk input { position: absolute; opacity: 0; width: 18px; height: 18px; margin: 0; cursor: pointer; }
.chk__box { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line-2); background: var(--porcelain); transition: background-color 140ms ease, box-shadow 140ms ease; }
.chk__box svg { width: 12px; height: 12px; color: var(--cream); opacity: 0; transform: scale(.6); transition: opacity 140ms ease, transform 200ms var(--out); }
.chk input:checked + .chk__box { background: var(--dark); box-shadow: none; }
.chk input:checked + .chk__box svg { opacity: 1; transform: none; }
html[data-kbd] .chk input:focus-visible + .chk__box { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--umber); }
.chk__l { font: 400 14px/1.25 var(--sans); color: var(--ink-2); min-width: 0; }
.chk__l:has(.chk__mk) { display: flex; align-items: center; gap: 8px; }
.chk__mk { flex: none; display: grid; place-items: center; width: 16px; height: 16px; }
.chk__mk img { width: 16px; height: 16px; object-fit: contain; }
.chk__l small { display: block; margin-top: 2px; font: 400 12px/1.2 var(--mono); color: var(--ink-3); }
.chk input:checked ~ .chk__l { color: var(--ink); font-weight: 500; }
.chk__n { font-size: 12px; color: var(--ink-3); }
.chk.is-zero .chk__l, .chk.is-zero .chk__n { opacity: .45; }
@media (hover: hover) and (pointer: fine) { .chk:hover { background: var(--paper-lo); } .mx__clear:hover { text-decoration-color: var(--umber); } }

/* list */
.mx__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 16px; padding: 8px 0 14px; margin-bottom: 18px; border-bottom: 1px solid var(--ink); }
.mx__head .snapnote { flex-basis: 100%; }
.mx__count { margin: 0; font: 400 14.5px/1.4 var(--sans); letter-spacing: 0; color: var(--ink-2); text-wrap: wrap; }
.mx__count b { font-weight: 500; color: var(--ink); }
.mx__count q { color: var(--ink); }

/* under 960 px the rail is a bottom sheet */
@media (max-width: 960px) {
  .mxh__grid { grid-template-columns: minmax(0, 1fr); }
  .mxh__art { margin: 0; order: -1; max-width: 560px; justify-self: center; }
  .mx__bar { position: static; flex-wrap: wrap; }
  .mx__bar::before { display: none; }
  .mx__tabs { order: 2; flex-basis: 100%; }
  .mx__tools { width: 100%; flex-wrap: wrap; row-gap: 8px; justify-content: space-between; }
  .mx__filters { display: inline-flex; }
  .mx__grid { grid-template-columns: minmax(0, 1fr); }
  .mx__scrim { display: block; position: fixed; z-index: 70; inset: 0; background: rgba(23,17,13,.4); opacity: 0; pointer-events: none; transition: opacity 260ms ease; }
  .mx__scrim[data-open] { opacity: 1; pointer-events: auto; }
  .mx__rail { position: fixed; z-index: 71; left: 0; right: 0; bottom: 0; top: auto; max-height: 86svh; padding: 18px var(--gutter) 0; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -24px 60px -20px rgba(23,17,13,.45);
    transform: translateY(102%); visibility: hidden; transition: transform 380ms var(--drawer), visibility 0s linear 380ms; }
  .mx__rail[data-open] { transform: none; visibility: visible; transition: transform 420ms var(--drawer); }
  .mx__close { display: grid; place-items: center; width: 40px; height: 40px; margin-left: 4px; border: 0; border-radius: 50%; background: var(--paper-lo); cursor: pointer; }
  .mx__close svg { width: 16px; height: 16px; }
  .mx__railfoot { display: block; position: sticky; bottom: 0; margin: 8px calc(-1 * var(--gutter)) 0; padding: 12px var(--gutter) max(16px, env(safe-area-inset-bottom)); background: linear-gradient(rgba(239,230,218,0), var(--paper) 30%); }
  .mx__railfoot .btn { width: 100%; }
  .chk { min-height: 44px; }
}
html.is-locked { overflow: hidden; }

/* view switch beside the sort */
.mx__view { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: rgba(248,243,234,.7); box-shadow: inset 0 0 0 1px var(--line-2); }
.mx__view button { display: grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 999px; background: none; color: var(--ink-3); cursor: pointer; transition: background-color 160ms var(--out), color 160ms ease; }
.mx__view button svg { width: 16px; height: 16px; }
.mx__view button[aria-pressed="true"] { background: var(--dark); color: var(--cream); }
@media (hover: hover) and (pointer: fine) { .mx__view button[aria-pressed="false"]:hover { color: var(--ink); background: var(--paper-lo); } }
html[data-kbd] .mx__view button:focus-visible { outline: 2px solid var(--umber); outline-offset: 1px; }

/* the ledger: one model to a line, prices in tabular figures, a hairline between */
.ledger { min-width: 0; }
.ledger__head, .ledger__row { display: grid; grid-template-columns: minmax(0, 2.4fr) 76px 84px 84px minmax(0, 1.3fr); gap: 16px; align-items: center; }
.ledger__head { padding: 0 0 10px; border-bottom: 1px solid var(--line-2); font: 500 12.5px/1 var(--sans); color: var(--ink-3); }
.ledger__rows { margin: 0; padding: 0; list-style: none; }
.ledger__row { min-height: 56px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ledger__who { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 12px; align-items: center; min-width: 0; }
.ledger__names { display: grid; gap: 2px; min-width: 0; }
.ledger__names a { font: 500 15px/1.25 var(--sans); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__names code { font: 400 12px/1.2 var(--mono); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ledger__row > .num { font-size: 14px; color: var(--ink); }
.ledger__one { grid-column: span 2; }
.ledger__one small { font: 400 12.5px/1 var(--sans); color: var(--ink-3); }
.ledger__can { font: 400 13px/1.35 var(--serif); color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
@media (max-width: 1100px) { .ledger__head, .ledger__row { grid-template-columns: minmax(0, 2fr) 68px 76px 76px; } .ledger__can, .ledger__head > :last-child { display: none; } }
@media (max-width: 640px) {
  .ledger__head { display: none; }
  .ledger__row { grid-template-columns: minmax(0, 1fr) auto auto; row-gap: 4px; padding: 10px 0; }
  .ledger__who { grid-column: 1 / -1; }
  .ledger__row > .num { font-size: 13px; color: var(--ink-2); }
  .ledger__row > .num::before { content: attr(data-k); margin-right: 6px; font: 400 12px/1 var(--sans); color: var(--ink-3); }
  .ledger__one { grid-column: span 2; }
  .ledger__row > .num:empty { display: none; }
}
