/* Offer lists (favourites, later city lists): the <main class="listing"> page and offer cards.
   Rules of the old theme in their order: css/home-new.css (.hn-main, .hn-offer-*), then css/listing.css (.hn-listing).
   Old names: .hn-main.hn-listing → .listing, .hn-section → .listing__section, .hn-container → .container,
   .hn-listing-head → .listing__head, .hn-kicker → .listing__kicker, .hn-offer-* → .offer-card__*. */

.listing,
.listing *,
.listing ::before,
.listing ::after {
    box-sizing: border-box;
}

.listing {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow-x: clip;
    color: var(--ink);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.listing *,
.listing ::before,
.listing ::after {
    margin: 0;
    padding: 0;
}

.listing .offer-card__location span {
    color: inherit;
}

.listing h1,
.listing h2,
.listing h3 {
    display: block;
    width: auto;
    text-transform: none;
    letter-spacing: normal;
    background: none;
    border: 0;
}

.listing h2::before,
.listing h2::after,
.listing h3::before,
.listing h3::after {
    content: none;
}

.listing a {
    color: inherit;
    text-decoration: none;
}

.listing img {
    display: block;
    max-width: 100%;
}

.listing button {
    font-family: inherit;
    cursor: pointer;
}

/* The reset above would otherwise remove the padding of the shared .container. */
.listing .container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 32px;
}

.listing__section {
    display: block;
    width: 100%;
    padding: 104px 0;
    background: var(--paper);
}

.listing__kicker {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 14px;
}

.offer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.offer-card {
    position: relative;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    margin: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-card);
    transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.offer-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: transparent;
}

/* The whole card is a link to the offer. */
.listing .offer-card__cta::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

.offer-card:hover .offer-card__cta {
    background: var(--red-dark);
}

.offer-card__media {
    position: relative;
    aspect-ratio: 16 / 10;
    background: var(--bg);
    overflow: hidden;
}

.offer-card__media > a {
    position: absolute;
    inset: 0;
    display: block;
}

.offer-card__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing .offer-card__media .favorite-button {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: rgba(255, 255, 255, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    margin: 0;
    color: var(--ink);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.14);
    transition: color 0.15s ease, box-shadow 0.15s ease;
}

.listing .offer-card__media .favorite-button:hover {
    color: var(--red);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}

.listing .offer-card__media .favorite-button svg {
    width: 18px;
    height: 18px;
}

.offer-card__body {
    padding: 24px 24px 0;
}

.listing .offer-card__name {
    font-size: 19px;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
    text-align: left;
    transition: color 0.15s ease;
    min-height: 2.6em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.offer-card:hover .offer-card__name {
    color: var(--red);
}

.offer-card__location {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-top: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    line-height: 1.45;
    text-align: left;
}

.offer-card__location span {
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.offer-card__location svg {
    width: 14px;
    height: 14px;
    flex: none;
    color: var(--muted-2);
}

.offer-card__specs {
    margin: 18px 24px 0;
    border-top: 1px solid var(--line);
}

.offer-card__spec {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
}

.offer-card__spec + .offer-card__spec {
    border-top: 1px solid var(--line);
}

.offer-card__specs dt {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--muted);
    white-space: nowrap;
}

.offer-card__specs dd {
    font-size: 14px;
    font-weight: 800;
    color: var(--ink);
    line-height: 1.4;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.listing .offer-card__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 20px 24px 24px;
    height: 50px;
    border: 0;
    border-radius: var(--radius);
    background: var(--red);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    transition: background 0.15s ease;
}

.listing .offer-card__cta:hover {
    background: var(--red-dark);
    color: #fff;
}

@media (max-width: 1180px) {
    .offer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .listing .container {
        padding: 0 20px;
    }

    .listing__section {
        padding: 64px 0;
    }
}

@media (max-width: 620px) {
    .offer-grid {
        display: flex;
        align-items: stretch;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        padding: 6px 0 14px;
        scrollbar-width: thin;
        scrollbar-color: var(--red) rgba(13, 14, 17, 0.08);
        -webkit-overflow-scrolling: touch;
    }

    .offer-grid::-webkit-scrollbar {
        height: 4px;
    }

    .offer-grid::-webkit-scrollbar-track {
        background: rgba(13, 14, 17, 0.08);
    }

    .offer-grid::-webkit-scrollbar-thumb {
        background: var(--red);
    }

    .offer-grid > * {
        scroll-snap-align: start;
        flex: 0 0 84%;
    }
}

/* ---------- css/listing.css ---------- */

.listing--list {
    background: var(--bg);
}

.listing--list .listing__section {
    background: transparent;
    padding: 40px 0 88px;
}

.listing__head {
    margin-bottom: 32px;
}

.listing__head .listing__kicker {
    margin-bottom: 12px;
}

/* main.css also gave every h1 border-box sizing and the container width. */
.listing--list .listing__head h1 {
    box-sizing: border-box;
    max-width: var(--container);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--ink);
    text-align: left;
    margin: 0;
}

@media (max-width: 760px) {
    .listing--list .listing__section {
        padding: 28px 0 64px;
    }
}

@media (max-width: 620px) {
    .listing--list .offer-grid {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 20px;
        overflow: visible;
        scroll-snap-type: none;
        padding: 0;
    }
}
