/*
 * Phone layout (≤ 700px). Loaded after the other site sheets, so it wins over their older phone rules.
 * Page-specific phone rules live next to the page (e.g. hudrat-communities.css).
 */
@media (max-width: 700px) {
    /* ---------- property cards: a sideways carousel of large cards ---------- */
    .hd-cards:not(.hd-cards--grid) {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 14px;
        margin-inline: -16px;
        padding: 4px 16px 18px;
        scroll-padding-inline: 16px;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .hd-cards:not(.hd-cards--grid)::-webkit-scrollbar {
        display: none;
    }

    .hd-cards:not(.hd-cards--grid) > .hd-pc,
    .hd-cards:not(.hd-cards--grid) > .hd-card {
        flex: 0 0 84%;
        min-width: 0;
        scroll-snap-align: start;
    }

    /* a card lifted on hover would be cut by the scrolling strip */
    .hd-cards:not(.hd-cards--grid) > .hd-pc:hover {
        transform: none;
    }

    .hd-cards--grid {
        grid-template-columns: 1fr;
    }

    /* ---------- inner page header ---------- */
    .page-hero {
        min-height: 0;
        margin: 12px 12px 0;
        padding: 38px 22px 32px;
        border-radius: 20px;
    }

    .page-hero h1 {
        color: #fff;
        font-size: clamp(30px, 9vw, 38px);
        line-height: 1.1;
        overflow-wrap: anywhere;
        margin: 8px 0 12px;
    }

    .page-hero p {
        margin: 0;
        font-size: 15px;
        line-height: 1.5;
    }

    /* ---------- Developers / Communities / Emirates switch: one row of three ---------- */
    .offplan-hub {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        margin-top: 14px;
        padding: 0 12px;
    }

    .offplan-hub a {
        height: auto;
        padding: 11px 4px 10px;
        gap: 4px;
        border-radius: 14px;
        font-size: 10.5px;
        letter-spacing: .03em;
    }

    .offplan-hub a b {
        font-size: 20px;
    }

    .offplan-hub a:hover,
    .offplan-hub a.active {
        transform: none;
    }

    /* ---------- developers: two compact columns ---------- */
    .directory-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .directory-grid > a {
        min-height: 0;
        gap: 10px;
        padding: 14px 12px;
        border-radius: 14px;
    }

    .directory-grid > a > b {
        flex: 0 0 38px;
        height: 38px;
        font-size: 18px;
    }

    .directory-grid strong {
        font-size: 14px;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .directory-grid small {
        margin-top: 2px;
        font-size: 12px;
    }

    .directory-search {
        width: 100%;
    }

    /* ---------- emirates: two compact columns ---------- */
    .location-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .location-grid > a {
        min-height: 128px;
        padding: 18px 16px;
        border-radius: 16px;
    }

    .location-grid strong {
        font-size: 20px;
        line-height: 1.15;
    }

    .location-grid small {
        font-size: 12px;
    }

    .location-grid span {
        margin-top: 12px;
        font-size: 13px;
    }

    /* ---------- property page: facts in a 2 × 2 grid ---------- */
    .hd-facts {
        grid-template-columns: 1fr 1fr;
    }

    .hd-fact,
    .hd-fact:nth-child(3n) {
        border-inline-end: 1px solid var(--hd-line);
    }

    .hd-fact:nth-child(2n) {
        border-inline-end: 0;
    }

    .hd-fact b {
        overflow-wrap: anywhere;
    }
}
