:root {
    --listing-ink: #1d2635;
    --listing-navy: #17233b;
    --listing-gold: #c8a85b;
    --listing-gold-dark: #a9893e;
    --listing-cream: #f7f3eb;
    --listing-paper: #ffffff;
    --listing-muted: #6e7682;
    --listing-border: #e3e5e8;
}

body.listings-page {
    background: #f5f6f7;
    color: var(--listing-ink);
}


.listings-page .nav a.active {
    color: var(--listing-gold-dark);
}

.listings-page .nav a.active::after {
    width: 100%;
}

.listings-hero {
    position: relative;
    display: grid;
    min-height: 520px;
    overflow: hidden;
    place-items: center;
    background:
        url("/img/hero/hero3.jpg")
        center 48% / cover no-repeat;
}

.listings-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(
            90deg,
            rgba(13, 23, 40, 0.86) 0%,
            rgba(20, 30, 47, 0.62) 48%,
            rgba(20, 30, 47, 0.34) 100%
        );
}

.listings-hero-content {
    position: relative;
    z-index: 1;
    width: min(1180px, calc(100% - 48px));
    padding: 90px 0;
    color: #ffffff;
}

.listings-eyebrow {
    margin: 0 0 12px;
    color: var(--listing-gold);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.listings-hero h1 {
    max-width: 760px;
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.8rem, 6vw, 5.4rem);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 0.98;
}

.listings-hero-content > p:not(.listings-eyebrow) {
    max-width: 620px;
    margin: 24px 0 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.05rem;
    line-height: 1.7;
}

.listings-hero-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.listings-hero-summary span {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
}

.listings-hero-summary strong {
    color: var(--listing-gold);
    font-size: 1rem;
}

.listings-content {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 78px 0 90px;
}

.listings-intro {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 36px;
    margin-bottom: 32px;
}

.listings-intro h2 {
    margin: 0;
    color: var(--listing-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2rem, 4vw, 3.1rem);
    font-weight: 500;
}

.listings-intro > div > p:last-child {
    max-width: 650px;
    margin: 12px 0 0;
    color: var(--listing-muted);
    line-height: 1.65;
}

.listings-contact-link {
    display: flex;
    align-items: flex-end;
    flex-direction: column;
    flex: 0 0 auto;
    color: var(--listing-muted);
    font-size: 0.8rem;
    line-height: 1.5;
    text-decoration: none;
}

.listings-contact-link strong {
    color: var(--listing-gold-dark);
    font-size: 0.92rem;
}

.listings-toolbar {
    margin-bottom: 30px;
    padding: 22px;
    border: 1px solid var(--listing-border);
    border-radius: 16px;
    background: var(--listing-paper);
    box-shadow: 0 8px 28px rgba(23, 35, 59, 0.055);
}

.listings-filter-grid {
    display: grid;
    grid-template-columns:
        minmax(230px, 1.5fr)
        repeat(4, minmax(130px, 0.8fr));
    gap: 14px;
}

.listings-filter-grid label {
    min-width: 0;
}

.listings-filter-grid label > span {
    display: block;
    margin-bottom: 7px;
    color: var(--listing-navy);
    font-size: 0.68rem;
    font-weight: 850;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.listings-filter-grid input,
.listings-filter-grid select {
    width: 100%;
    min-height: 45px;
    padding: 0 12px;
    border: 1px solid #d7dbe0;
    border-radius: 9px;
    outline: none;
    background: #ffffff;
    color: var(--listing-ink);
    font: inherit;
}

.listings-filter-grid input:focus,
.listings-filter-grid select:focus {
    border-color: var(--listing-gold);
    box-shadow: 0 0 0 3px rgba(200, 168, 91, 0.16);
}

.listings-toolbar-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 17px;
    padding-top: 16px;
    border-top: 1px solid var(--listing-border);
}

.listings-toolbar-footer p {
    margin: 0;
    color: var(--listing-muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.listings-toolbar-footer button {
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--listing-gold-dark);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    cursor: pointer;
}

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

.public-property-card {
    display: flex;
    min-width: 0;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--listing-border);
    border-radius: 16px;
    background: var(--listing-paper);
    box-shadow: 0 8px 26px rgba(23, 35, 59, 0.065);
    transition:
        transform 0.22s ease,
        box-shadow 0.22s ease,
        border-color 0.22s ease;
}

.public-property-card:hover {
    transform: translateY(-5px);
    border-color: #d4be82;
    box-shadow: 0 18px 40px rgba(23, 35, 59, 0.13);
}

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

.public-property-image {
    position: relative;
    display: block;
    height: 245px;
    overflow: hidden;
    background: #e8eaed;
}

.public-property-image::after {
    position: absolute;
    inset: auto 0 0;
    height: 38%;
    background:
        linear-gradient(
            to top,
            rgba(11, 20, 35, 0.44),
            transparent
        );
    content: "";
    pointer-events: none;
}

.public-property-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.public-property-card:hover .public-property-image img {
    transform: scale(1.045);
}

.public-property-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    flex-direction: column;
    gap: 7px;
    color: #8b929c;
    font-size: 0.78rem;
    font-weight: 800;
}

.public-property-empty span {
    font-size: 2rem;
}

.public-property-badges {
    position: absolute;
    top: 14px;
    right: 14px;
    left: 14px;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.public-featured-badge,
.public-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 29px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 0.63rem;
    font-weight: 900;
    letter-spacing: 0.035em;
    text-transform: uppercase;
    backdrop-filter: blur(9px);
}

.public-featured-badge {
    margin-right: auto;
    background: rgba(255, 255, 255, 0.93);
    color: #80651f;
}

.public-status-badge {
    margin-left: auto;
    background: rgba(23, 35, 59, 0.9);
    color: #ffffff;
}

.public-property-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 21px;
}

.public-property-price {
    margin-bottom: 7px;
    color: var(--listing-gold-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    font-weight: 700;
}

.public-property-body h2 {
    margin: 0;
    overflow: hidden;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.18rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-property-body h2 a {
    color: var(--listing-navy);
    text-decoration: none;
}

.public-property-location {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    min-height: 36px;
    margin: 7px 0 15px;
    color: var(--listing-muted);
    font-size: 0.76rem;
    line-height: 1.45;
}

.public-property-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 15px;
    padding: 12px 0;
    border-top: 1px solid var(--listing-border);
    border-bottom: 1px solid var(--listing-border);
}

.public-property-meta span {
    min-width: 0;
    padding: 0 8px;
    border-right: 1px solid var(--listing-border);
    color: var(--listing-muted);
    font-size: 0.63rem;
    text-align: center;
}

.public-property-meta span:first-child {
    padding-left: 0;
}

.public-property-meta span:last-child {
    padding-right: 0;
    border-right: 0;
}

.public-property-meta strong {
    display: block;
    margin-bottom: 2px;
    overflow: hidden;
    color: var(--listing-navy);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.public-property-type {
    align-self: flex-start;
    margin-bottom: 10px;
    padding: 6px 9px;
    border-radius: 7px;
    background: var(--listing-cream);
    color: #66562f;
    font-size: 0.64rem;
    font-weight: 850;
}

.public-property-desc {
    display: -webkit-box;
    margin: 0 0 18px;
    color: #59616c;
    font-size: 0.76rem;
    line-height: 1.6;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.public-view-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 42px;
    margin-top: auto;
    padding: 0 14px;
    border-radius: 9px;
    background: var(--listing-navy);
    color: #ffffff;
    font-size: 0.73rem;
    font-weight: 850;
    text-decoration: none;
    transition: background 0.18s ease;
}

.public-view-btn:hover {
    background: var(--listing-gold-dark);
}

.public-view-btn span {
    font-size: 1rem;
}

.listings-empty-state,
.listings-no-results {
    padding: 60px 25px;
    border: 1px dashed #cfd4da;
    border-radius: 17px;
    background: #ffffff;
    text-align: center;
}

.listings-empty-state > span,
.listings-no-results > span {
    display: block;
    margin-bottom: 12px;
    font-size: 2.5rem;
}

.listings-empty-state h2,
.listings-no-results h2 {
    margin: 0;
    color: var(--listing-navy);
    font-family: Georgia, "Times New Roman", serif;
}

.listings-empty-state p,
.listings-no-results p {
    max-width: 580px;
    margin: 12px auto 21px;
    color: var(--listing-muted);
    line-height: 1.65;
}

.listings-empty-state a,
.listings-no-results button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    padding: 0 17px;
    border: 0;
    border-radius: 9px;
    background: var(--listing-navy);
    color: #ffffff;
    font: inherit;
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
    cursor: pointer;
}

.listings-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 58px max(24px, calc((100% - 1180px) / 2));
    background: var(--listing-navy);
    color: #ffffff;
}

.listings-cta h2 {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 500;
}

.listings-cta div > p:last-child {
    max-width: 680px;
    margin: 12px 0 0;
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.listings-cta > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-height: 48px;
    padding: 0 20px;
    border-radius: 9px;
    background: var(--listing-gold);
    color: var(--listing-navy);
    font-size: 0.8rem;
    font-weight: 900;
    text-decoration: none;
}

.listings-page .footer a {
    color: inherit;
    text-decoration: none;
}

.listings-page .footer a:hover {
    color: var(--listing-gold);
}

/* =========================================================
   Property detail compatibility
   ========================================================= */

.admin-wrapper {
    width: min(1180px, calc(100% - 48px));
    margin: 0 auto;
    padding: 55px 0 80px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 340px;
    padding: 55px;
    flex-direction: column;
    border-radius: 24px;
    background:
        linear-gradient(
            rgba(18, 27, 43, 0.68),
            rgba(18, 27, 43, 0.68)
        ),
        url("/img/hero/hero3.jpg")
        center / cover no-repeat;
    color: #ffffff;
    text-align: center;
}

.admin-header h1 {
    margin: 0;
    color: #ffffff;
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.2rem, 5vw, 3.7rem);
}

.admin-header p {
    max-width: 720px;
    color: rgba(255, 255, 255, 0.82);
    line-height: 1.65;
}

.admin-card,
.preview-shell {
    overflow: hidden;
    border: 1px solid var(--listing-border);
    border-radius: 18px;
    background: #ffffff;
    box-shadow: 0 12px 34px rgba(23, 35, 59, 0.09);
}

.admin-card {
    padding: 28px;
}

.section-title {
    margin-top: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--listing-border);
    color: var(--listing-navy);
}

.preview-hero {
    min-height: 430px;
    background-color: #e5e7eb;
    background-position: center;
    background-size: cover;
    cursor: pointer;
}

.preview-hero-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--listing-muted);
    font-weight: 800;
}

.preview-content {
    padding: 34px;
}

.preview-title-row {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--listing-border);
}

.preview-title-row h1 {
    margin: 0;
    color: var(--listing-navy);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 2.3rem;
}

.preview-title-row p {
    margin: 8px 0 0;
    color: var(--listing-muted);
}

.preview-price {
    color: var(--listing-gold-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.preview-link-buttons,
.preview-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 22px;
}

.preview-link-buttons a {
    padding: 11px 16px;
    border-radius: 9px;
    background: var(--listing-navy);
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
}

.preview-badges span {
    padding: 7px 10px;
    border-radius: 999px;
    background: var(--listing-cream);
    color: #67552c;
    font-size: 0.78rem;
    font-weight: 800;
}

.preview-stats {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 13px;
    margin: 26px 0;
}

.preview-stats div {
    padding: 17px;
    border: 1px solid var(--listing-border);
    border-radius: 13px;
    background: #f8f9fa;
    text-align: center;
}

.preview-stats strong,
.preview-stats span {
    display: block;
}

.preview-stats strong {
    color: var(--listing-navy);
    font-size: 1.35rem;
}

.preview-stats span {
    margin-top: 3px;
    color: var(--listing-muted);
    font-size: 0.75rem;
}

.preview-section {
    margin-top: 30px;
}

.preview-section p {
    color: #4f5966;
    line-height: 1.75;
}

.preview-features {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 22px;
}

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

.preview-gallery img {
    width: 100%;
    height: 190px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
}

.preview-open-house {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 26px;
    padding: 18px 20px;
    border: 1px solid #e1c678;
    border-radius: 14px;
    background: #fffaf0;
    color: #745a15;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox-image {
    max-width: 95%;
    max-height: 95%;
    border-radius: 12px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #ffffff;
    font-size: 55px;
    cursor: pointer;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    width: 60px;
    height: 60px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 40px;
    cursor: pointer;
}

.lightbox-prev {
    left: 25px;
}

.lightbox-next {
    right: 25px;
}

.lightbox-counter {
    position: absolute;
    bottom: 35px;
    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

@media (max-width: 1050px) {
    .listings-filter-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .listings-search-field {
        grid-column: span 2;
    }

    .public-property-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .listings-hero {
        min-height: 430px;
    }

    .listings-hero-content {
        width: min(100% - 34px, 1180px);
        padding: 65px 0;
    }

    .listings-content {
        width: min(100% - 30px, 1240px);
        padding: 55px 0 65px;
    }

    .listings-intro,
    .listings-cta {
        align-items: flex-start;
        flex-direction: column;
    }

    .listings-contact-link {
        align-items: flex-start;
    }

    .listings-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .listings-search-field {
        grid-column: 1 / -1;
    }

    .public-property-grid {
        grid-template-columns: 1fr;
    }

    .public-property-image {
        height: 280px;
    }

    .listings-cta {
        padding: 45px 24px;
    }

    .listings-cta > a {
        width: 100%;
    }

    .preview-title-row {
        flex-direction: column;
    }

    .preview-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .preview-features,
    .preview-gallery {
        grid-template-columns: 1fr;
    }

    .admin-wrapper {
        width: min(100% - 30px, 1180px);
    }
}

@media (max-width: 520px) {
    .listings-filter-grid {
        grid-template-columns: 1fr;
    }

    .listings-search-field {
        grid-column: auto;
    }

    .listings-toolbar-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-property-image {
        height: 230px;
    }

    .public-property-body {
        padding: 18px;
    }
}
