/* Shortlist page: the compare table (hero), the resale cards and the
   viewing-trip panel. */
@layer page {
  .sl { padding-bottom: var(--sp-6); }
  .sl > section { margin-top: var(--sp-7); }
  .sl__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--sp-4); padding-block: var(--sp-2) var(--sp-5); }
  .sl__head h1 { font-size: var(--fs-3xl); }
  .sl__actions { display: flex; flex-wrap: wrap; gap: var(--sp-2); flex: 1 0 auto; }
  @media (min-width: 48em) { .sl__actions { justify-content: flex-end; } }
  .sl__share-result { flex-basis: 100%; font-size: var(--fs-s); color: var(--ink-2); overflow-wrap: anywhere; }
  .sl__gone { flex-basis: 100%; display: flex; align-items: center; gap: var(--sp-2); }
  /* A list someone sent, and sending this list (release 19). */
  .sl__shared, .sl__share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-5); margin-bottom: var(--sp-5); }
  .sl__shared { padding: var(--sp-4) var(--sp-5); border-left: 3px solid var(--brand); }
  .sl__share { padding-block: var(--sp-4); border-block: 1px solid var(--line); }
  .sl__share > p { flex: 1 1 18rem; margin: 0; }
  .sl__shared-title, .sl__share-title { font-size: var(--fs-l); flex-basis: 100%; margin: 0; }
  .sl__shared .stack { flex: 1 1 18rem; }
  .sl__shared .sl__shared-title { flex-basis: auto; }
  .sl__empty { margin-top: var(--sp-2); }
  .sl__empty .icon { color: var(--brand); }
  .sl__empty p { max-width: 38ch; }

  /* Compare table. Row labels in a sticky first column; one column per
     development, its photo and name as the column header. On a phone the
     table bleeds to the screen edges and scrolls sideways; from 64em the
     columns share the page width up to 24rem each. */
  .compare-scroll {
    --label: 6.25rem; --col-min: 11.5rem; --col-max: 16rem;
    margin-inline: calc(-1 * var(--gutter)); overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scroll-padding-left: var(--label); container-type: inline-size;
    /* A shadow at the right edge while more columns wait there; the
       page-coloured layers scroll with the content and cover it at the end. */
    background:
      linear-gradient(to left, var(--stone) 40%, rgba(243, 245, 246, 0)) right / 3rem 100% no-repeat local,
      linear-gradient(to left, rgba(22, 35, 59, 0.14), rgba(22, 35, 59, 0)) right / 1rem 100% no-repeat scroll;
  }
  .compare-scroll[data-cols="1"],
  .compare-scroll[data-cols="2"] { --cols: 2; }
  .compare-scroll[data-cols="3"] { --cols: 3; }
  .compare-scroll[data-cols="4"] { --cols: 4; }
  .compare-scroll[data-cols="5"] { --cols: 5; }
  .compare-scroll[data-cols="6"] { --cols: 6; }
  .compare-scroll[data-cols="7"] { --cols: 7; }
  .compare-scroll[data-cols="8"] { --cols: 8; }
  .compare-scroll[data-cols="9"] { --cols: 9; }
  .compare-scroll[data-cols="10"] { --cols: 10; }
  .compare { --col: clamp(var(--col-min), (100cqw - var(--label)) / var(--cols, 1), var(--col-max)); width: calc(var(--label) + var(--cols, 1) * var(--col)); table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--fs-s); }
  .compare th, .compare td { text-align: left; vertical-align: top; padding: var(--sp-3); border-bottom: 1px solid var(--line); }
  .compare thead th { padding-top: 0; border-bottom-color: var(--line-2); }
  .compare__label { width: var(--label); }
  .compare__col { width: var(--col); }
  .compare tbody th { position: sticky; left: 0; z-index: 2; background: var(--stone); font-weight: 500; font-size: var(--fs-xs); color: var(--ink-3); padding-top: calc(var(--sp-3) + 0.2rem); box-shadow: inset -1px 0 0 var(--line); }
  .compare thead .compare__label { position: sticky; left: 0; z-index: 2; background: var(--stone); }
  .compare th:first-child, .compare td:first-child { padding-left: var(--gutter); }
  .compare th:last-child, .compare td:last-child { padding-right: var(--gutter); }
  .compare td { font-weight: 500; }
  .compare td a { color: var(--ink); min-height: 1.5rem; display: inline-flex; align-items: center; }
  .compare__none { color: var(--line-2); }
  .compare__media { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius-l); overflow: hidden; background: var(--stone-2); }
  .compare__media img { width: 100%; height: 100%; object-fit: cover; }
  .compare__media img[data-placeholder] { object-fit: contain; padding: 14%; opacity: 0.45; }
  .compare__name { display: block; margin-top: var(--sp-3); font-weight: 650; font-size: var(--fs-m); line-height: 1.35; color: var(--ink); text-decoration: none; min-height: 1.5rem; }
  .compare__name:hover { text-decoration: underline; text-underline-offset: 0.14em; }
  .compare__ref { display: block; font-size: var(--fs-xs); font-weight: 400; }
  .compare__remove { display: inline-flex; align-items: center; margin-top: var(--sp-2); margin-left: -0.45rem; min-height: 2rem; padding: 0.2rem 0.45rem; border-radius: var(--radius); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
  .compare__remove:hover { background: var(--stone-2); color: var(--ink); }
  .compare__remove span { display: inline-flex; align-items: center; gap: 0.3rem; }
  .compare__remove[aria-pressed="false"] { color: var(--brand-ink); }
  .compare__remove[aria-pressed="false"] .compare__when-saved, .compare__remove[aria-pressed="true"] .compare__when-unsaved { display: none; }
  .compare__from { display: block; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; line-height: 1.2; }
  .compare__to { display: block; font-size: var(--fs-xs); color: var(--ink-2); font-weight: 400; margin-top: 0.1rem; }
  .compare .price--l { display: block; line-height: 1.2; }
  .compare .badge--drop { margin-top: var(--sp-2); }
  .compare .chips { gap: 0.3rem; }
  .compare__note { margin-top: var(--sp-3); }
  .compare__ghost-link { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-2); aspect-ratio: 4 / 3; padding: var(--sp-4); border: 1px dashed var(--line-2); border-radius: var(--radius-l); text-align: center; text-decoration: none; color: var(--ink-2); font-weight: 600; font-size: var(--fs-s); }
  .compare__ghost-link:hover { border-color: var(--ink); color: var(--ink); }
  .compare .compare__ghost { border-bottom-color: transparent; }
  @media (min-width: 64em) {
    .compare-scroll { --label: 10rem; --col-min: 13.5rem; --col-max: 40rem; margin-inline: 0; }
    .compare th:first-child, .compare td:first-child { padding-left: 0; }
    .compare th:last-child, .compare td:last-child { padding-right: var(--sp-3); }
    .compare tbody th { box-shadow: none; font-size: var(--fs-s); }
    .compare td { font-size: var(--fs-m); }
    .compare .price--l { font-size: var(--fs-xl); }
    .compare__media, .compare__ghost-link { aspect-ratio: 3 / 2; }
  }

  /* Viewing trip: the intro and the form side by side from 64em. */
  .trip { display: grid; gap: var(--sp-5); }
  .trip h2 { font-size: var(--fs-xl); }
  .trip__intro { display: grid; gap: var(--sp-4); align-content: start; }
  .trip__intro .lead-panel__lead { margin-bottom: 0; }
  .trip__intro .lead-panel__alt { margin-top: 0; }
  .trip__facts { display: grid; gap: var(--sp-2); font-size: var(--fs-s); }
  .trip__facts li { display: flex; gap: var(--sp-2); align-items: flex-start; }
  .trip__facts .icon { color: var(--ready); margin-top: 0.2em; }
  .trip .form__note { margin: 0; }
  @media (min-width: 64em) {
    .trip { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: var(--sp-7); padding: var(--sp-6); }
  }
}
