/* The rentals page's own top padding (theme Additional CSS, .nac-page.rentals
   .nac-page-body{padding-block:...}) is meant for text-led pages; the filter
   panel already reads as the page's header, so it doesn't need that much
   breathing room above it. Matches the theme rule's own class combination
   (.nac-page.rentals .nac-page-body) so this specificity actually wins —
   a plain .nac-page-body:has(...) was losing to it silently. */
.nac-page.rentals .nac-page-body:has(.ajlisting-filters) {
    padding-top: 0.25rem;
}

/* The block wrapper divs the page builder puts around the shortcode each
   carry their own default top padding; harmless normally, but stacked on
   top of the override above they re-created the same gap this is meant to
   remove. Scoped to this exact wrapper chain so it doesn't touch div-blocks
   used elsewhere on the site. */
.nac-page.rentals .nac-page-body .nac-wrap,
.nac-page.rentals .shortcode-marker-ajlistings {
    padding-top: 0;
}

.ajlisting-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.ajlisting-filter-city-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    min-width: 260px;
    padding: 1.2rem 1.75rem;
    border: 1px solid var(--nac-border, #d9e3dc);
    border-radius: 1rem;
    background: var(--nac-mist, #edf3ef);
}

.ajlisting-filter-city {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: var(--nac-forest, #183c32);
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.ajlisting-filter-city input {
    width: 1.3rem;
    height: 1.3rem;
    accent-color: var(--nac-green, #2e6b58);
    cursor: pointer;
}

.ajlisting-filter-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
}

.ajlisting-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1rem;
    border: 1px solid var(--nac-border, #d9e3dc);
    border-radius: 999px;
    background: #fff;
    color: var(--nac-ink, #15221d);
    font-size: 0.9rem;
    font-weight: 650;
    cursor: pointer;
    user-select: none;
}

.ajlisting-filter-chip:has(input:checked) {
    border-color: var(--nac-green, #2e6b58);
    background: var(--nac-green, #2e6b58);
    color: #fff;
}

.ajlisting-filter-chip input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--nac-green, #2e6b58);
    cursor: pointer;
}

.ajlisting-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.ajlisting-view-toggle {
    display: inline-flex;
    border: 1px solid var(--nac-border, #d9e3dc);
    border-radius: 999px;
    overflow: hidden;
}

.ajlisting-view-btn {
    padding: 0.55rem 1.15rem;
    border: 0;
    background: #fff;
    color: var(--nac-muted, #5e7068);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

.ajlisting-view-btn.is-active {
    background: var(--nac-green, #2e6b58);
    color: #fff;
}

.ajlisting-sort {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--nac-forest, #183c32);
    font-size: 0.85rem;
    font-weight: 700;
}

.ajlisting-sort-select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--nac-border, #d9e3dc);
    border-radius: 0.6rem;
    background: #fff;
    font-size: 0.85rem;
}

.ajlisting-no-matches {
    padding: 1.5rem;
    margin-bottom: 1.75rem;
    border: 1px dashed var(--nac-sage, #91ad9c);
    border-radius: 1rem;
    background: var(--nac-mist, #edf3ef);
    color: var(--nac-muted, #5e7068);
    text-align: center;
}

.ajlisting-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2.25rem;
}

.ajlisting-card {
    overflow: hidden;
    border: 1px solid var(--nac-border, #d9e3dc);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 12px 32px rgba(21, 34, 29, 0.07);
}

.ajlisting-card.is-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.ajlisting-card.is-clickable:hover {
    box-shadow: 0 18px 40px rgba(21, 34, 29, 0.12);
    transform: translateY(-2px);
}

.ajlisting-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0 1.25rem 1.15rem;
}

.ajlisting-thumb {
    display: block;
    width: 64px;
    height: 64px;
    border-radius: 0.6rem;
    background-color: var(--nac-mist, #edf3ef);
    background-position: center;
    background-size: cover;
    flex-shrink: 0;
}

.ajlisting-body {
    padding: 1.15rem 1.25rem;
}

.ajlisting-body small {
    color: #2e6b58;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.7rem;
}

.ajlisting-body h3 {
    margin: 0.5rem 0;
    color: #183c32;
    font-size: 1.05rem;
}

.ajlisting-body p {
    margin: 0;
    color: #5e7068;
    font-size: 0.9rem;
}

.ajlisting-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    align-items: baseline;
    margin: 0.85rem 0;
}

.ajlisting-facts strong {
    color: #183c32;
    font-size: 1.2rem;
}

.ajlisting-facts i {
    font-size: 0.72rem;
    font-style: normal;
}

.ajlisting-facts span {
    font-size: 0.85rem;
    color: #5e7068;
}

.ajlisting-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.ajlisting-map-link {
    color: var(--nac-muted, #5e7068) !important;
}

/* List view: a compact toggle for scanning many rentals at once, image
   beside the details instead of stacked (the card layout keeps images
   below the text; the DOM order is unchanged, just re-flowed). */
.ajlisting-grid.is-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.ajlisting-grid.is-list .ajlisting-card {
    display: flex;
    flex-direction: row-reverse;
}

.ajlisting-grid.is-list .ajlisting-thumbs {
    flex-wrap: wrap;
    align-content: flex-start;
    width: 160px;
    flex-shrink: 0;
    padding: 1.15rem;
}

.ajlisting-grid.is-list .ajlisting-thumb {
    width: calc(50% - 0.25rem);
    height: 70px;
}

.ajlisting-grid.is-list .ajlisting-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.ajlisting-empty {
    padding: clamp(3rem, 7vw, 6rem);
    border: 1px dashed #91ad9c;
    border-radius: 1.3rem;
    text-align: center;
    background: #edf3ef;
}

.ajlisting-empty h3 {
    color: #183c32;
    font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.ajlisting-empty p {
    color: #5e7068;
}

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

@media (max-width: 640px) {
    .ajlisting-grid.is-list .ajlisting-card {
        flex-direction: column;
    }

    .ajlisting-grid.is-list .ajlisting-thumbs {
        width: auto;
    }
}

@media (max-width: 560px) {
    .ajlisting-grid {
        grid-template-columns: 1fr;
    }

    .ajlisting-filter-city-block {
        min-width: 0;
        width: 100%;
    }
}

/* On-site listing detail page (?listing=<id>) */
.ajlisting-detail-back {
    display: inline-block;
    margin-bottom: 1.25rem;
    color: var(--nac-green, #2e6b58);
    font-weight: 700;
    font-size: 0.9rem;
}

.ajlisting-carousel {
    margin-top: 2.25rem;
}

.ajlisting-carousel-viewport {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 1rem;
    background: var(--nac-mist, #edf3ef);
}

.ajlisting-carousel-slide {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.ajlisting-carousel-slide.is-active {
    display: block;
}

.ajlisting-carousel-prev,
.ajlisting-carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--nac-forest, #183c32);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(21, 34, 29, 0.18);
}

.ajlisting-carousel-prev {
    left: 0.85rem;
}

.ajlisting-carousel-next {
    right: 0.85rem;
}

.ajlisting-carousel-thumbs {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
}

.ajlisting-carousel-thumb {
    width: 68px;
    height: 68px;
    flex-shrink: 0;
    border: 2px solid transparent;
    border-radius: 0.6rem;
    background-color: var(--nac-mist, #edf3ef);
    background-position: center;
    background-size: cover;
    cursor: pointer;
    padding: 0;
}

.ajlisting-carousel-thumb.is-active {
    border-color: var(--nac-green, #2e6b58);
}

body.ajlisting-lightbox-open {
    overflow: hidden;
}

.ajlisting-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 15, 13, 0.94);
}

.ajlisting-lightbox[hidden] {
    display: none;
}

.ajlisting-lightbox-image {
    max-width: min(90vw, 1300px);
    max-height: 86vh;
    object-fit: contain;
    border-radius: 0.5rem;
}

.ajlisting-lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.75rem;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

.ajlisting-lightbox-prev,
.ajlisting-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
}

.ajlisting-lightbox-prev {
    left: 1.5rem;
}

.ajlisting-lightbox-next {
    right: 1.5rem;
}

.ajlisting-lightbox-count {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

@media (max-width: 640px) {
    .ajlisting-lightbox-prev,
    .ajlisting-lightbox-next {
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.4rem;
    }
}

.ajlisting-detail-layout {
    display: grid;
    grid-template-columns: 1.6fr 0.9fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: start;
}

.ajlisting-detail-main small {
    color: var(--nac-green, #2e6b58);
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.ajlisting-detail-main h1 {
    margin: 0.5rem 0;
    color: var(--nac-forest, #183c32);
    font-size: clamp(1.9rem, 3.4vw, 2.75rem);
}

.ajlisting-detail-address {
    color: var(--nac-muted, #5e7068);
    font-size: 1.05rem;
}

.ajlisting-detail-address a {
    color: var(--nac-green, #2e6b58) !important;
}

.ajlisting-detail-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1.25rem;
    margin: 1.5rem 0;
    padding: 1.25rem 0;
    border-top: 1px solid var(--nac-border, #d9e3dc);
    border-bottom: 1px solid var(--nac-border, #d9e3dc);
}

.ajlisting-detail-facts strong {
    color: var(--nac-forest, #183c32);
    font-size: 1.6rem;
}

.ajlisting-detail-facts i {
    font-style: normal;
    font-size: 0.85rem;
}

.ajlisting-detail-facts span {
    color: var(--nac-muted, #5e7068);
    font-size: 0.95rem;
}

.ajlisting-detail-description {
    color: var(--nac-muted, #5e7068);
    line-height: 1.75;
}

.ajlisting-detail-main h3 {
    margin: 2rem 0 0.75rem;
    color: var(--nac-forest, #183c32);
}

.ajlisting-detail-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ajlisting-detail-features li {
    color: var(--nac-muted, #5e7068);
    font-size: 0.92rem;
}

.ajlisting-detail-features li::before {
    content: '✓';
    margin-right: 0.5rem;
    color: var(--nac-gold, #d8aa55);
}

.ajlisting-detail-sidebar {
    position: sticky;
    top: 6.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    padding: 1.5rem;
    border: 1px solid var(--nac-border, #d9e3dc);
    border-radius: 1rem;
    background: var(--nac-mist, #edf3ef);
}

.ajlisting-detail-fact-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ajlisting-detail-fact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.9rem;
}

.ajlisting-detail-fact span {
    color: var(--nac-muted, #5e7068);
}

.ajlisting-detail-fact strong {
    color: var(--nac-forest, #183c32);
}

.ajlisting-detail-apply {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 1.3rem;
    border-radius: 0.75rem;
    background: var(--nac-gold, #d8aa55);
    color: var(--nac-ink, #15221d) !important;
    font-weight: 800;
    text-align: center;
}

.ajlisting-detail-contact {
    text-align: center;
    color: var(--nac-green, #2e6b58) !important;
    font-weight: 700;
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    .ajlisting-detail-layout {
        grid-template-columns: 1fr;
    }

    .ajlisting-detail-sidebar {
        position: static;
    }
}

@media (max-width: 640px) {
    .ajlisting-carousel-viewport {
        aspect-ratio: 4 / 3;
    }
}
