/* Map-first layout based on the supplied card UI -------------------------- */
@media (min-width: 821px) {
  .amenities-shell {
    position: relative;
    display: block;
    --card-rail-height: clamp(190px, 24dvh, 220px);
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
  }
  .map-panel {
    position: absolute;
    inset: 0 0 auto 0;
    height: calc(100% - var(--card-rail-height));
  }
  .amenities-panel {
    position: absolute;
    z-index: 5;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    pointer-events: none;
  }
  .intro {
    position: absolute;
    z-index: 2;
    top: 28px;
    left: 28px;
    width: min(390px, 30vw);
    padding: 25px 28px 27px;
    background: var(--paper);
    border: 1px solid var(--line);
    pointer-events: auto;
  }
  .intro h1 {
    margin: 14px 0 17px;
    font-size: clamp(2.8rem, 3.9vw, 5rem);
  }
  .intro .lede {
    font-size: 0.88rem;
    line-height: 1.55;
  }
  .reach {
    display: none;
  }
  .modes-bar {
    position: absolute;
    top: 22px;
    left: 28px;
    transform: none;
    padding: 14px clamp(20px, 2.4vw, 34px) 0;
    background: var(--ink);
    pointer-events: auto;
  }
  .route-summary {
    position: absolute;
    z-index: 6;
    right: 28px;
    bottom: calc(var(--card-rail-height) + 18px);
    width: min(390px, 31vw);
    min-height: 64px;
    padding: 12px 15px;
    background: var(--ink);
    border: 0;
    color: white;
    pointer-events: auto;
  }
  .route-summary__status {
    color: #d7d4ce;
  }
  .cards {
    position: absolute;
    z-index: 4;
    right: 0;
    bottom: 0;
    left: 0;
    box-sizing: border-box;
    height: var(--card-rail-height);
    display: flex;
    gap: 14px;
    padding: 14px 20px 18px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgb(255 255 255 / 100%);
    border-top: 1px solid var(--line);
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 20px;
    scroll-behavior: smooth;
    overscroll-behavior-inline: contain;
    pointer-events: auto;
    cursor: grab;
  }
  .cards.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    /* Smooth scrolling animates every scrollLeft write, so the rail lags
       behind the cursor while dragging. */
    scroll-behavior: auto;
    user-select: none;
  }
  .amenity-card {
    position: relative;
    flex: 0 0 440px;
    min-width: 440px;
    height: 100%;
    align-self: stretch;
    display: grid;
    grid-template-columns: 46% 54%;
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
    background: #050505;
    border: 1px solid transparent;
    border-radius: 0;
    scroll-snap-align: start;
    scroll-margin-inline: 20px;
    color: white;
  }
  .amenity-card:hover,
  .amenity-card.is-selected {
    background: #1c1c1c;
    border-color: transparent;
    transform: none;
  }
  .amenity-card.is-selected {
    background: var(--white);
    border-color: #b2b2b2;
    color: var(--ink);
  }
  .amenity-card.is-selected .amenity-card__category {
    color: var(--ink);
  }
  .amenity-card__image {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    order: 2;
  }
  .amenity-card__veil {
    display: none;
  }
  .amenity-card__content {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 18px 20px;
    text-align: left;
  }
  .amenity-card__category {
    color: white;
    font-size: 0.62rem;
    letter-spacing: 0.16em;
  }
  .amenity-card__journey {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: auto 0 12px;
    line-height: 1;
  }
  .amenity-card__journey strong {
    font: 300 3.75rem/0.82 "DM Sans", sans-serif;
    letter-spacing: -0.06em;
  }
  .amenity-card__journey span {
    padding-bottom: 3px;
    font-size: 0.9rem;
    letter-spacing: 0.12em;
  }
  .amenity-card h2 {
    margin: 0;
    font: 400 1rem/1.2 "DM Sans", sans-serif;
  }
  .amenity-card p {
    display: none;
  }
  .amenity-card__meta {
    display: none;
  }
  .destination-marker[hidden] {
    display: none;
  }
  .destination-marker::after {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}
@media (max-width: 820px) {
  .amenities-shell {
    position: relative;
    display: block;
    width: 100%;
    height: 100svh;
    min-height: 620px;
    overflow: hidden;
    --mobile-map-height: 67%;
  }
  .map-panel {
    position: absolute;
    inset: 0 0 auto;
    height: var(--mobile-map-height);
    min-height: 0;
  }
  .amenities-panel {
    position: absolute;
    z-index: 5;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    pointer-events: none;
  }
  .reach {
    display: none;
  }
  .modes-bar {
    position: absolute;
    z-index: 7;
    top: 12px;
    right: 12px;
    left: 12px;
    justify-content: center;
    gap: clamp(30px, 11vw, 52px);
    padding: 10px 18px 0;
    pointer-events: auto;
  }
  .mode-btn {
    gap: 6px;
    padding-bottom: 8px;
  }
  .mode-btn i {
    height: 28px;
  }
  .mode-btn span {
    font-size: 0.58rem;
  }
  .route-summary {
    position: absolute;
    z-index: 7;
    top: calc(var(--mobile-map-height) - 62px);
    right: 12px;
    left: 12px;
    min-height: 52px;
    margin: 0;
    padding: 10px 12px;
    background: var(--ink);
    border: 0;
    color: white;
    pointer-events: auto;
  }
  .route-summary__status {
    max-width: 58%;
    color: #d7d4ce;
    font-size: 0.7rem;
    line-height: 1.25;
  }
  .route-summary__value {
    font-size: 1.1rem;
    white-space: nowrap;
  }
  .cards {
    position: absolute;
    z-index: 6;
    top: var(--mobile-map-height);
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    gap: 12px;
    margin: 0;
    padding: 12px 20px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgb(255 255 255 / 100%);
    border-top: 1px solid var(--line);
    scroll-snap-type: none;
    overscroll-behavior-inline: contain;
    pointer-events: auto;
  }
  .amenity-card {
    flex: 0 0 84vw;
    min-width: 84vw;
    height: 100%;
    align-self: stretch;
    display: grid;
    grid-template-columns: minmax(0, 46%) minmax(0, 54%);
    grid-template-rows: minmax(0, 1fr);
    padding: 0;
    overflow: hidden;
    background: #050505;
    color: var(--white);
    border-radius: 0;
    scroll-snap-align: none;
    transform: none;
  }
  .amenity-card__image {
    grid-column: 2;
    grid-row: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .amenity-card__veil {
    display: none;
  }
  .amenity-card__content {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 16px 14px;
  }
  .amenity-card:not(.is-selected) .amenity-card__category {
    color: var(--white);
  }
  .amenity-card__journey {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: auto 0 10px;
  }
  .amenity-card__journey strong {
    font: 400 clamp(2.1rem, 10vw, 2.8rem) "Playfair Display", serif;
  }
  .amenity-card__journey span {
    font-size: 0.75rem;
  }
  .amenity-card__meta {
    display: none;
  }
  .amenity-card h2 {
    margin: 0;
    font-size: clamp(1.05rem, 5vw, 1.35rem);
    line-height: 1.05;
  }
  .amenity-card p {
    display: -webkit-box;
    margin-top: 8px;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .amenity-card:hover:not(.is-selected) {
    background: #050505;
    color: var(--white);
  }
  .amenity-card.is-selected,
  .amenity-card.is-selected:hover {
    background: var(--white);
    border-color: #b2b2b2;
    color: var(--ink);
    transform: none;
  }
  .amenity-card.is-selected .amenity-card__category {
    color: var(--ink);
  }
  .origin-marker__label {
    left: 31px;
    min-width: 0;
    width: 42px;
    height: 42px;
    gap: 0;
    padding: 9px;
  }
  .origin-marker__logo {
    width: 24px;
    height: 24px;
  }
  .origin-marker__copy {
    display: none;
  }
  .amenity-marker__label {
    max-width: calc(100vw - 24px);
    white-space: normal;
  }
  .maplibregl-ctrl-top-right {
    top: 82px;
  }
}
