/*
 * Apartment listing refinements:
 * - keep mobile specifications aligned inside the card
 * - give listing cards a restrained scroll entrance
 */

.apartments-index-section .apartment-card {
    --apartment-reveal-delay: var(--micro-delay, 0ms);
}

.apartments-index-section .apartment-card.micro-reveal {
    opacity: 0;
    transform: translate3d(0, 34px, 0) scale(.985);
    transition:
        opacity .72s cubic-bezier(.22, 1, .36, 1) var(--apartment-reveal-delay),
        transform .72s cubic-bezier(.22, 1, .36, 1) var(--apartment-reveal-delay),
        border-color .28s ease,
        box-shadow .28s ease;
}

.apartments-index-section .apartment-card.micro-reveal.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
}

.apartments-index-section .apartment-card.micro-reveal .apartment-image img {
    transform: scale(1.055);
    transition: transform 1s cubic-bezier(.22, 1, .36, 1) var(--apartment-reveal-delay);
}

.apartments-index-section .apartment-card.micro-reveal.is-visible .apartment-image img {
    transform: scale(1);
}

.apartments-index-section .apartment-card.micro-reveal.is-visible:hover .apartment-image img {
    transform: scale(1.04);
}

@media (max-width: 720px) {
    .apartments-index-section .apartment-card-spec-grid {
        width: 100%;
        min-width: 0;
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 0 !important;
        padding: 10px 0 !important;
        border-top: 1px solid rgba(15, 23, 42, .1) !important;
        border-bottom: 1px solid rgba(15, 23, 42, .1) !important;
        background: transparent !important;
        overflow: hidden;
    }

    .apartments-index-section .apartment-mini-spec,
    .apartments-index-section .apartment-mini-spec + .apartment-mini-spec {
        min-width: 0;
        min-height: 48px;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 2px 7px !important;
        border: 0 !important;
        border-left: 1px solid rgba(15, 23, 42, .1) !important;
        text-align: center;
    }

    .apartments-index-section .apartment-mini-spec:first-child {
        border-left: 0 !important;
    }

    .apartments-index-section .apartment-mini-spec .spec-icon {
        display: none !important;
    }

    .apartments-index-section .apartment-mini-spec > span:not(.spec-icon) {
        width: 100%;
        margin: 0 !important;
        color: var(--muted);
        font-size: 9px !important;
        line-height: 1.1 !important;
        letter-spacing: .06em;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .apartments-index-section .apartment-mini-spec strong {
        width: 100%;
        min-width: 0;
        margin: 0;
        font-size: clamp(10.5px, 3.2vw, 12.5px) !important;
        line-height: 1.15 !important;
        white-space: normal !important;
        overflow-wrap: anywhere;
    }

    html[data-theme="dark"] .apartments-index-section .apartment-card-spec-grid {
        border-color: rgba(255, 255, 255, .12) !important;
    }

    html[data-theme="dark"] .apartments-index-section .apartment-mini-spec,
    html[data-theme="dark"] .apartments-index-section .apartment-mini-spec + .apartment-mini-spec {
        border-left-color: rgba(255, 255, 255, .12) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .apartments-index-section .apartment-card.micro-reveal,
    .apartments-index-section .apartment-card.micro-reveal .apartment-image img {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
