/* Communities page: search, emirate chips, sorting and the cards. */
.cmx-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.cmx-head h2 {
    margin-bottom: 0;
}

.cmx-total {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    color: var(--hd-muted);
    font-size: 14px;
    white-space: nowrap;
}

.cmx-total b {
    color: var(--hd-ink);
    font: 700 20px var(--hd-serif);
}

.cmx-total i {
    width: 4px;
    height: 4px;
    margin-inline: 8px;
    border-radius: 50%;
    background: var(--hd-gold-lite);
}

/* Search line */
.cmx-bar {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.cmx-search {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 58px;
    padding-inline: 20px 14px;
    background: #fff;
    border: 1px solid var(--hd-line);
    border-radius: 14px;
    box-shadow: 0 6px 22px rgba(110, 75, 35, .06);
    cursor: text;
    transition: border-color .2s, box-shadow .2s;
}

.cmx-search:focus-within {
    border-color: var(--hd-gold-lite);
    box-shadow: 0 0 0 4px rgba(210, 165, 108, .18), 0 10px 28px rgba(110, 75, 35, .1);
}

.cmx-search > .hd-i {
    color: var(--hd-gold);
    width: 22px;
    height: 22px;
}

.cmx-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: none;
    font: 16px var(--hd-sans);
    color: var(--hd-ink);
}

.cmx-search input::placeholder {
    color: #ab9e8f;
}

.cmx-search input::-webkit-search-cancel-button {
    display: none;
}

.cmx-search kbd {
    padding: 2px 8px;
    border: 1px solid var(--hd-line);
    border-radius: 6px;
    background: var(--hd-sand-2);
    color: var(--hd-muted);
    font: 12px var(--hd-sans);
}

.cmx-search:has(input:not(:placeholder-shown)) kbd,
.cmx-search:focus-within kbd {
    display: none;
}

.cmx-clear {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 50%;
    background: var(--hd-sand);
    color: var(--hd-gold-dark);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.cmx-clear:hover {
    background: var(--hd-gold-lite);
}

.cmx-sort {
    display: flex;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--hd-line);
    border-radius: 14px;
}

.cmx-sort button {
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--hd-muted);
    font: 600 14px var(--hd-sans);
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.cmx-sort button.is-on {
    background: var(--hd-sand);
    color: var(--hd-gold-dark);
}

/* Emirate chips */
.cmx-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.cmx-chips button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid var(--hd-line);
    border-radius: 999px;
    background: #fff;
    color: var(--hd-ink);
    font: 600 14px var(--hd-sans);
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s;
}

.cmx-chips button:hover {
    border-color: var(--hd-gold-lite);
}

.cmx-chips small {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--hd-sand-2);
    color: var(--hd-muted);
    font-size: 12px;
    text-align: center;
}

.cmx-chips button.is-on {
    border-color: var(--hd-gold);
    background: var(--hd-gold);
    color: #fff;
}

.cmx-chips button.is-on small {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

.cmx-found {
    margin: 18px 0 0;
    color: var(--hd-muted);
    font-size: 14px;
}

/* Cards */
.cmx-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
    margin-top: 24px;
}

.cmx-card {
    position: relative;
    display: block;
    height: 320px;
    overflow: hidden;
    border-radius: 16px;
    color: #fff;
    text-decoration: none;
    background: var(--hd-sand);
    box-shadow: var(--hd-shadow);
    transition: transform .35s cubic-bezier(.16, 1, .3, 1), box-shadow .35s;
    animation: cmx-in .45s cubic-bezier(.16, 1, .3, 1) both;
}

.cmx-card[hidden] {
    display: none;
}

@keyframes cmx-in {
    from { opacity: 0; transform: translateY(10px); }
}

.cmx-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s cubic-bezier(.16, 1, .3, 1);
}

/* Card without a photo */
.cmx-ph {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background:
        radial-gradient(120% 80% at 85% 0%, rgba(220, 187, 143, .45), transparent 60%),
        linear-gradient(160deg, #8a5f37, #3a2a1a);
    transition: transform .8s cubic-bezier(.16, 1, .3, 1);
}

.cmx-ph--1 { background: radial-gradient(120% 80% at 15% 0%, rgba(220, 187, 143, .4), transparent 60%), linear-gradient(200deg, #a67548, #46321f); }
.cmx-ph--2 { background: radial-gradient(120% 80% at 80% 10%, rgba(243, 232, 216, .3), transparent 60%), linear-gradient(170deg, #6f5136, #2b2218); }
.cmx-ph--3 { background: radial-gradient(120% 80% at 30% 0%, rgba(210, 165, 108, .5), transparent 60%), linear-gradient(150deg, #b5875a, #5a3f26); }

.cmx-ph b {
    margin-bottom: 40px;
    color: rgba(243, 232, 216, .22);
    font: 700 120px/1 var(--hd-serif);
    letter-spacing: .04em;
}

.cmx-ph svg {
    position: absolute;
    inset: auto 0 0;
    width: 100%;
    height: 45%;
    fill: rgba(43, 34, 24, .35);
}

.cmx-card:hover .cmx-ph {
    transform: scale(1.06);
}

.cmx-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(38, 27, 15, .35) 0, transparent 26%, transparent 42%, rgba(38, 27, 15, .92));
}

.cmx-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 60px rgba(110, 75, 35, .22);
    color: #fff;
}

.cmx-card:hover img {
    transform: scale(1.06);
}

.cmx-top {
    position: absolute;
    z-index: 1;
    inset: 16px 16px auto;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.cmx-top em {
    padding: 5px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .9);
    color: var(--hd-ink);
    font: 600 12px var(--hd-sans);
    font-style: normal;
    backdrop-filter: blur(6px);
}

.cmx-top em.is-gold {
    margin-inline-start: auto;
    background: var(--hd-gold);
    color: #fff;
}

.cmx-body {
    position: absolute;
    z-index: 1;
    inset: auto 22px 20px;
    display: flex;
    flex-direction: column;
}

.cmx-body strong {
    font: 700 25px/1.15 var(--hd-serif);
}

.cmx-body strong mark {
    padding: 0 2px;
    border-radius: 4px;
    background: rgba(210, 165, 108, .55);
    color: inherit;
}

.cmx-body small {
    margin-top: 5px;
    color: #ece3d6;
    font-size: 14px;
}

.cmx-go {
    display: flex;
    align-items: center;
    gap: 6px;
    max-height: 0;
    margin-top: 0;
    overflow: hidden;
    opacity: 0;
    color: var(--hd-gold-lite);
    font: 700 13px var(--hd-sans);
    letter-spacing: .04em;
    transition: max-height .35s, margin-top .35s, opacity .35s;
}

.cmx-card:hover .cmx-go,
.cmx-card:focus-visible .cmx-go {
    max-height: 24px;
    margin-top: 10px;
    opacity: 1;
}

/* Nothing found */
.cmx-empty {
    margin-top: 24px;
    padding: 48px 24px;
    border: 1px dashed var(--hd-gold-lite);
    border-radius: 18px;
    background: #fff;
    text-align: center;
}

.cmx-empty > .hd-i {
    width: 40px;
    height: 40px;
    color: var(--hd-gold);
}

.cmx-empty h3 {
    margin: 12px 0 6px;
    font: 700 24px var(--hd-serif);
}

.cmx-empty p {
    max-width: 460px;
    margin: 0 auto 20px;
    color: var(--hd-muted);
}

.cmx-empty > div {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.cmx-reset {
    padding: 0 18px;
    border: 1px solid var(--hd-line);
    border-radius: 10px;
    background: none;
    color: var(--hd-gold-dark);
    font: 600 14px var(--hd-sans);
    cursor: pointer;
}

@media (max-width: 991px) {
    .cmx-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .cmx-head {
        flex-direction: column;
        align-items: start;
        gap: 10px;
    }

    .cmx-bar {
        flex-direction: column;
    }

    .cmx-search {
        flex: none;
        height: 54px;
    }

    .cmx-sort {
        align-self: start;
        height: 46px;
    }

    .cmx-search kbd {
        display: none;
    }

    .cmx-chips {
        flex-wrap: nowrap;
        overflow-x: auto;
        margin-inline: -16px;
        padding: 2px 16px 6px;
        scrollbar-width: none;
    }

    .cmx-chips button {
        flex: none;
    }

    /* two compact columns: the name and the badges, no description */
    .cmx-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        margin-top: 18px;
    }

    .cmx-card {
        height: 190px;
        border-radius: 14px;
    }

    .cmx-card:hover {
        transform: none;
    }

    .cmx-top {
        inset: 10px 10px auto;
        flex-wrap: wrap;
        gap: 4px;
    }

    .cmx-top em {
        padding: 3px 8px;
        font-size: 10.5px;
    }

    .cmx-body {
        inset: auto 12px 12px;
    }

    .cmx-body strong {
        font-size: 17px;
        overflow-wrap: anywhere;
    }

    .cmx-body small,
    .cmx-go {
        display: none;
    }

    .cmx-ph b {
        margin-bottom: 46px;
        font-size: 64px;
    }

    .cmx-more .hd-btn {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cmx-card,
    .cmx-card img {
        animation: none;
        transition: none;
    }
}

.cmx-more {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.cmx-more[hidden] {
    display: none;
}

.cmx-more .hd-btn {
    min-width: 240px;
    border: 1px solid var(--hd-gold);
    background: #fff;
    color: var(--hd-gold-dark);
    cursor: pointer;
}

.cmx-more .hd-btn:hover {
    background: var(--hd-gold);
    color: #fff;
}

/* author hint of a site photo whose licence asks for it */
.cmx-credit {
    position: absolute;
    z-index: 2;
    inset-inline-end: 12px;
    bottom: 12px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .35);
    color: rgba(255, 255, 255, .75);
    font: 600 11px/1 var(--hd-sans);
    cursor: help;
}

.cmx-credit:hover {
    background: rgba(0, 0, 0, .6);
    color: #fff;
}
