/* ══════════════════════════════════════════════════════════════
   Single Listing Template — NP Listings
   ══════════════════════════════════════════════════════════════ */

/* ── Header Override ─────────────────────────────────────────── */

.single-listing #masthead,
.single-listing .site-main-header-wrap .site-header-row-container-inner {
    background: var(--global-palette3);
}

/* ── Base / Layout ───────────────────────────────────────────── */

.np-single-listing {
    max-width: 1280px;
    margin: 0 auto;
    font-family: inherit;
    color: #1a1a1a;
    line-height: 1.6;
}

.np-single-listing *,
.np-single-listing *::before,
.np-single-listing *::after {
    box-sizing: border-box;
}

.np-listing-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem 1rem;
}

.np-section {
    margin-bottom: 2.5rem;
}

.np-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f0f0f0;
}


/* ── Listing Header ─────────────────────────────────────────── */

.np-listing-header {
    margin-bottom: 0.5rem;
}

.np-listing-type-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 4px;
    background: #f0f5ff;
    color: #4a7cff;
    margin-bottom: 0.5rem;
}

/* T09: Construction-status badge sits inline with the type badge. */
.np-listing-badges {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}

.np-listing-badges .np-listing-type-badge {
    margin-bottom: 0;
}

.np-listing-construction-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px;
    border-radius: 4px;
}

.np-listing-construction-badge.is-ready {
    background: #e8f7ee;
    color: #1f8a4c;
}

.np-listing-construction-badge.is-offplan {
    background: #f0f5ff;
    color: #4a7cff;
}

.np-listing-construction-badge.is-progress {
    background: #fff4e5;
    color: #c2670a;
}

.np-listing-construction-badge.is-resale {
    background: #f1f3f5;
    color: #5c6470;
}

.np-listing-construction-badge.is-newbuild {
    background: #f0f5ff;
    color: #4a7cff;
}

.np-listing-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.35rem;
    color: #1a1a1a;
    line-height: 1.25;
}

.np-listing-location {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    color: #777;
    margin: 0;
}

.np-listing-location svg {
    flex-shrink: 0;
    color: #4a7cff;
}


/* ── Mobile inline price block (T17) ────────────────────────── */
/* Sits between header and quick-stats; hidden where the desktop
   sidebar takes over (see breakpoint below). */

.np-mobile-price {
    margin: 0.25rem 0 1rem;
    padding: 0.75rem 0;
    border-top: 1px solid #eef0f3;
    border-bottom: 1px solid #eef0f3;
}

.np-mobile-price__badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #4a7cff;
    margin-bottom: 0.35rem;
}

.np-mobile-price__amount {
    margin: 0;
    font-size: clamp(1.875rem, 7.5vw, 2.375rem);
    font-weight: 800;
    letter-spacing: -0.01em;
    line-height: 1.1;
    color: #1a1a1a;
}

.np-mobile-price--poa .np-mobile-price__amount {
    font-size: clamp(1.5rem, 6vw, 1.875rem);
    color: #2a2a2a;
}

.np-mobile-price__meta {
    margin: 0.3rem 0 0;
    font-size: 0.85rem;
    color: #777;
}


/* ── Hero Gallery Grid ───────────────────────────────────────── */

.np-hero {
    position: relative;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0.75rem 0.75rem 0;
}

.np-hero-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 0.25rem;
    border-radius: 12px;
    overflow: hidden;
}

.np-hero-grid--single {
    grid-template-columns: 1fr;
}

/* Shared image tile styles */
.np-hero-main,
.np-hero-side-top,
.np-hero-side-bottom {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: zoom-in;
}

/* Main (large left) image */
.np-hero-main {
    position: relative;
    height: 42vw;
    min-height: 300px;
    max-height: 520px;
}

/* Right column: two stacked images */
.np-hero-side {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.np-hero-side-top,
.np-hero-side-bottom {
    flex: 1 1 50%;
    min-height: 0;
}

/* "Show all photos" button — bottom-right of main image */
.np-hero-photos-btn {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    backdrop-filter: blur(6px);
    z-index: 2;
}

.np-hero-photos-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.np-hero-photos-btn svg {
    flex-shrink: 0;
}


/* ── Quick Stats ─────────────────────────────────────────────── */

.np-quick-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 0.5rem;
}

.np-stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    min-width: 0;
}

.np-stat-icon {
    flex-shrink: 0;
    color: #4a7cff;
    display: flex;
    align-items: center;
}

.np-stat-value {
    font-weight: 600;
    font-size: 1rem;
    white-space: nowrap;
}

.np-stat-label {
    font-size: 0.8125rem;
    color: #777;
    white-space: nowrap;
}


/* ── Tab Navigation ──────────────────────────────────────────── */

.np-tab-nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    display: flex;
    gap: 0;
    overflow-x: auto;
    border-bottom: 2px solid #f0f0f0;
    margin-bottom: 1.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.np-tab-nav::-webkit-scrollbar {
    display: none;
}

.np-tab {
    flex-shrink: 0;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    color: #777;
    font-weight: 500;
    font-size: 0.9375rem;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}

.np-tab:hover {
    color: #1a1a1a;
}

.np-tab.active {
    color: #1a1a1a;
    border-bottom-color: #4a7cff;
}


/* ── Description ─────────────────────────────────────────────── */

.np-description-text {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: #444;
}

.np-description-text p {
    margin: 0 0 1rem;
}


/* ── Details Table ───────────────────────────────────────────── */

.np-details-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.np-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: border-color 0.15s, background 0.15s;
}

.np-detail-row:hover {
    border-color: #c8d8ff;
    background: #f7f9ff;
}

.np-detail-row dt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 500;
    color: #555;
    font-size: 0.9375rem;
}

.np-detail-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f5ff;
    color: #4a7cff;
}

.np-detail-row dd {
    margin: 0;
    font-weight: 600;
    font-size: 0.9375rem;
    text-align: right;
    color: #1a1a1a;
}

.np-energy-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    color: #fff;
    font-weight: 700;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}


/* ── Features Grid ───────────────────────────────────────────── */

.np-features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
}

.np-feature-card {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.np-feature-card:hover {
    border-color: #c8d8ff;
    background: #f7f9ff;
    transform: translateY(-1px);
    color: #333;
    text-decoration: none;
}

.np-feature-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f5ff;
    color: #4a7cff;
}

.np-feature-name {
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.3;
}


/* ── Sidebar Card ────────────────────────────────────────────── */

.np-sidebar-card {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.np-listing-sidebar .np-sidebar-card {
    position: sticky;
    top: 2rem;
}

/* Price section */
.np-sidebar-price {
    background: #f7f9ff;
    border: 1px solid #e4ecff;
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    text-align: center;
}

.np-sidebar-badge {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 12px;
    border-radius: 999px;
    background: #4a7cff;
    color: #fff;
    margin-bottom: 0.6rem;
}

.np-sidebar-amount {
    font-size: 1.875rem;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
    margin-bottom: 0.85rem;
}

.np-sidebar-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.np-sidebar-detail {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4rem 0;
    border-top: 1px solid rgba(74, 124, 255, 0.1);
    text-align: left;
}

.np-sidebar-detail-label {
    font-size: 0.8125rem;
    color: #777;
}

.np-sidebar-detail-value {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #1a1a1a;
}

.np-sidebar-divider {
    display: none;
}

.np-contact-heading {
    font-size: 1rem;
    font-weight: 700;
    margin: 0 0 0.25rem;
    color: #1a1a1a;
}

.np-contact-subtext {
    font-size: 0.8125rem !important;
    line-height: 1.4 !important;
    color: #777;
    margin: 0 0 1rem;
}

.np-contact-form {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.np-form-field input,
.np-form-field textarea {
    width: 100%;
    padding: 0.6rem 0.75rem;
    font-size: 0.875rem !important;
    line-height: 1.4 !important;
    font-family: inherit;
    color: #333;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    transition: border-color 0.15s, background 0.15s;
    box-sizing: border-box;
}

.np-form-field input:focus,
.np-form-field textarea:focus {
    outline: none;
    border-color: #4a7cff;
    background: #fff;
}

.np-form-field textarea {
    resize: vertical;
    min-height: 70px;
}

.np-form-field input::placeholder,
.np-form-field textarea::placeholder {
    color: #aaa;
}

.np-contact-btn {
    display: block;
    width: 100%;
    padding: 0.85rem;
    background: #4a7cff;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.np-contact-btn:hover {
    background: #3a65d4;
}

.np-contact-btn:disabled {
    opacity: 0.7;
    cursor: default;
}

.np-contact-form .np-contact-btn {
    margin-top: 0.25rem;
}

.np-video-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.6rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #444;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: border-color 0.15s, color 0.15s;
}

.np-video-link:hover {
    border-color: #4a7cff;
    color: #4a7cff;
}


/* ── Manager Card ────────────────────────────────────────────── */

.np-manager-card {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 1.25rem 1.5rem;
    margin-top: 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    transition: border-color 0.15s;
}

.np-manager-card:hover {
    border-color: #c8d8ff;
}

.np-manager-eyebrow {
    font-size: 0.75rem;
    font-weight: 600;
    color: #4a7cff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 0 0 0.25rem;
}

.np-manager-heading {
    font-size: 1.125rem;
    font-weight: 700;
    margin: 0 0 0.2rem;
    color: #1a1a1a;
}

.np-manager-position {
    font-size: 0.8125rem;
    color: #777;
    margin: 0 0 0.5rem;
    font-style: italic;
}

.np-manager-bio {
    font-size: 0.75rem !important;
    line-height: 1.45 !important;
    color: #999 !important;
}

.np-manager-bio p {
    margin: 0;
    font-size: inherit !important;
    line-height: inherit !important;
}

.np-manager-photo {
    flex-shrink: 0;
}

.np-manager-img {
    width: 128px;
    height: 128px;
    border-radius: 50%;
    object-fit: cover;
}


/* ── Location & Map ──────────────────────────────────────────── */

.np-location-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.np-location-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
}

.np-location-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    background: #f0f5ff;
    color: #4a7cff;
}

.np-location-text {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #333;
}

.np-location-link {
    color: #4a7cff;
    text-decoration: none;
    font-weight: 500;
}

.np-location-link:hover {
    text-decoration: underline;
}

.np-location-sep {
    color: #bbb;
    font-size: 1.1rem;
}

#np-location-map {
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    z-index: 0;
}


/* ── Related Listings ─────────────────────────────────────────── */

.np-related {
    margin-top: 3rem;
    padding-top: 2.5rem;
    padding-bottom: 5rem;
    border-top: 2px solid #f0f0f0;
}

.np-related .np-section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Reuses .np-card styles from archive-listing.css */
.np-related-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}


/* ── Responsive ──────────────────────────────────────────────── */

/* Tablet and up: two-column layout */
@media (min-width: 900px) {
    .np-listing-content {
        grid-template-columns: 1fr 340px;
    }

    /*
     * Manager card and Related are direct children of .np-listing-content so
     * that on mobile they flow after the sidebar. On desktop, span them across
     * both grid columns so they sit below the main+sidebar row as a full-width
     * footer section.
     */
    .np-listing-content > .np-manager-card,
    .np-listing-content > .np-related {
        grid-column: 1 / -1;
    }

    .np-details-grid {
        grid-template-columns: 1fr 1fr;
    }

    .np-features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .np-manager-card {
        padding: 1.25rem 1.5rem;
    }

    /* Sidebar shows the price card; hide the inline mobile price. */
    .np-mobile-price {
        display: none;
    }
}

/* Small tablet: bump features + related to multi-column, shrink map */
@media (min-width: 600px) and (max-width: 899px) {
    .np-features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .np-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #np-location-map {
        height: 320px;
    }
}

/* Mobile adjustments */
@media (max-width: 767px) {
    .np-hero {
        padding: 0;
    }

    .np-hero-grid {
        grid-template-columns: 1fr;
        border-radius: 0;
    }

    .np-hero-side {
        display: none;
    }

    .np-hero-main {
        height: 60vw;
        min-height: 260px;
        max-height: 400px;
    }

    .np-hero-photos-label {
        display: none;
    }

    .np-listing-content {
        padding: 1rem 1rem 0;
        gap: 1rem;
    }

    .np-listing-title {
        font-size: 1.375rem;
    }

    .np-section {
        margin-bottom: 1.75rem;
    }

    .np-section-title {
        font-size: 1.125rem;
    }

    /* Details rows: let label + value wrap when squeezed */
    .np-detail-row {
        flex-wrap: wrap;
        gap: 0.25rem 1rem;
    }

    .np-detail-row dd {
        text-align: left;
    }

    /* Manager card: photo above text on narrow screens */
    .np-manager-card {
        flex-direction: column-reverse;
        align-items: flex-start;
        text-align: left;
        padding: 1.25rem;
        gap: 0.85rem;
    }

    .np-manager-img {
        width: 96px;
        height: 96px;
    }

    .np-related {
        margin-top: 2rem;
        padding-top: 1.5rem;
        padding-bottom: 4rem;
    }

    .np-related .np-section-title {
        font-size: 1.25rem;
    }

    /*
     * Tab nav: sticky + overflow-x leaks horizontal scroll to the page on
     * mobile and fights the content-width container. Hide it — the page is
     * already a single vertical scroll on phones and the tabs add nothing.
     */
    .np-tab-nav {
        display: none !important;
    }
}

@media (max-width: 599px) {
    #np-location-map {
        height: 280px;
    }

    .np-quick-stats {
        gap: 0.5rem;
    }

    .np-stat-item {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: calc(50% - 0.5rem);
        padding: 0.4rem 0.75rem;
    }

    .np-stat-value {
        white-space: normal;
    }

    .np-stat-label {
        display: none;
    }

    .np-related-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    /* Drop sticky positioning so sidebar card flows with content */
    .np-listing-sidebar .np-sidebar-card {
        position: static;
    }
}

/* Extra-narrow phones */
@media (max-width: 380px) {
    .np-listing-title {
        font-size: 1.25rem;
    }

    .np-listing-content {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .np-sidebar-card {
        padding: 1.25rem;
    }

    .np-sidebar-amount {
        font-size: 1.625rem;
    }
}
