/**
 * Building Landing Page Styles
 *
 * Responsive, SEO-friendly styles for condominium building pages.
 * Follows existing BNE landing page design system.
 *
 * @since MLD 6.92.1
 */

/* ============================================
   Hero Section
   ============================================ */

.bldg-hero {
    position: relative;
    min-height: 320px;
    padding-top: var(--bne-header-height, 70px); /* Clear fixed header navigation */
    background-size: cover;
    background-position: center;
    background-color: #1a365d;
    display: flex;
    align-items: flex-end;
}

.bldg-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0.1) 100%);
}

.bldg-hero__content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 32px;
    color: white;
}

.bldg-breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
    font-size: 13px;
    opacity: 0.85;
}

.bldg-breadcrumbs li:not(:last-child)::after {
    content: '›';
    margin-left: 6px;
}

.bldg-breadcrumbs a {
    color: white;
    text-decoration: none;
}

.bldg-breadcrumbs a:hover {
    text-decoration: underline;
}

.bldg-hero__title {
    font-size: 2.2rem;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.2;
}

.bldg-hero__address {
    font-size: 1.05rem;
    margin: 0 0 16px;
    opacity: 0.9;
}

.bldg-hero__stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.bldg-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(4px);
}

.bldg-stat--active { background: rgba(16,185,129,0.25); }
.bldg-stat--pending { background: rgba(245,158,11,0.25); }
.bldg-stat--sold { background: rgba(99,102,241,0.25); }
.bldg-stat--price { background: rgba(255,255,255,0.2); }

/* ============================================
   Overview Section
   ============================================ */

.bldg-overview {
    background: white;
    padding: 40px 0;
}

.bldg-overview__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-overview h2 {
    font-size: 1.5rem;
    margin: 0 0 16px;
    color: #1a202c;
}

.bldg-overview__description {
    font-size: 1.05rem;
    line-height: 1.7;
    color: #4a5568;
    margin: 0 0 24px;
}

.bldg-overview__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
}

.bldg-fact {
    background: #f7fafc;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.bldg-fact__label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #718096;
    margin-bottom: 4px;
}

.bldg-fact__value {
    display: block;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a202c;
}

.bldg-overview__freshness {
    margin-top: 16px;
    color: #a0aec0;
}

/* ============================================
   Unit Types Table
   ============================================ */

.bldg-unit-types {
    background: #f7fafc;
    padding: 40px 0;
}

.bldg-unit-types__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-unit-types h2 {
    font-size: 1.5rem;
    margin: 0 0 20px;
    color: #1a202c;
}

.bldg-table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bldg-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.bldg-table th {
    background: #edf2f7;
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #4a5568;
    white-space: nowrap;
}

.bldg-table td {
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
    color: #2d3748;
}

.bldg-table tbody tr:hover {
    background: #f7fafc;
}

.bldg-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.bldg-badge--active { background: #c6f6d5; color: #22543d; }
.bldg-badge--none { background: #e2e8f0; color: #718096; }

/* ============================================
   Listing Cards (Active + Pending)
   ============================================ */

.bldg-listings {
    background: white;
    padding: 40px 0;
}

.bldg-listings--pending {
    background: #fffbeb;
}

.bldg-listings__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-listings h2 {
    font-size: 1.5rem;
    margin: 0 0 20px;
    color: #1a202c;
}

.bldg-listings__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.bldg-listing-card {
    display: block;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bldg-listing-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.bldg-listing-card__photo {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
}

.bldg-listing-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bldg-listing-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    background: #f59e0b;
    color: white;
}

.bldg-listing-card__details {
    padding: 14px 16px;
}

.bldg-listing-card__price {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 4px;
}

.bldg-listing-card__specs {
    display: flex;
    gap: 12px;
    font-size: 14px;
    color: #4a5568;
    margin-bottom: 6px;
}

.bldg-listing-card__specs span::before {
    content: '';
}

.bldg-listing-card__address {
    font-size: 13px;
    color: #718096;
}

.bldg-listing-card__dom {
    font-size: 12px;
    color: #a0aec0;
    margin-top: 4px;
}

/* ============================================
   Sold History Table
   ============================================ */

.bldg-sold {
    background: #f7fafc;
    padding: 40px 0;
}

.bldg-sold__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-sold h2 {
    font-size: 1.5rem;
    margin: 0 0 16px;
    color: #1a202c;
}

.bldg-sold__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #4a5568;
}

.bldg-sold__summary strong {
    color: #1a202c;
}

.bldg-table--sold a {
    color: #0891b2;
    text-decoration: none;
}

.bldg-table--sold a:hover {
    text-decoration: underline;
}

.bldg-change { font-weight: 600; font-size: 13px; }
.bldg-change--up { color: #059669; }
.bldg-change--down { color: #dc2626; }

/* ============================================
   Map Section
   ============================================ */

.bldg-map {
    background: white;
    padding: 40px 0;
}

.bldg-map__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-map h2 {
    font-size: 1.5rem;
    margin: 0 0 20px;
    color: #1a202c;
}

.bldg-map__embed {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.bldg-map__image {
    width: 100%;
    height: auto;
    display: block;
}

.bldg-map__placeholder {
    padding: 40px;
    background: #edf2f7;
    text-align: center;
    color: #4a5568;
}

.bldg-map__actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

/* ============================================
   FAQ Section
   ============================================ */

.bldg-faq {
    background: #f7fafc;
    padding: 40px 0;
}

.bldg-faq__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-faq h2 {
    font-size: 1.5rem;
    margin: 0 0 24px;
    color: #1a202c;
}

.bldg-faq__item {
    background: white;
    border-radius: 10px;
    padding: 20px 24px;
    margin-bottom: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.bldg-faq__question {
    font-size: 1.05rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 8px;
}

.bldg-faq__answer p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #4a5568;
    margin: 0;
}

/* ============================================
   CTA Section
   ============================================ */

.bldg-cta {
    background: linear-gradient(135deg, #0891b2 0%, #0e7490 100%);
    color: white;
    padding: 48px 0;
}

.bldg-cta__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    text-align: center;
}

.bldg-cta h2 {
    font-size: 1.5rem;
    margin: 0 0 12px;
}

.bldg-cta p {
    font-size: 1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.bldg-cta__buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
   Buttons
   ============================================ */

.bldg-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: 2px solid transparent;
}

.bldg-btn--primary {
    background: white;
    color: #0891b2;
}

.bldg-btn--primary:hover {
    background: #f0fdfa;
}

.bldg-btn--outline {
    border-color: rgba(255,255,255,0.5);
    color: white;
    background: transparent;
}

.bldg-btn--outline:hover {
    background: rgba(255,255,255,0.1);
    border-color: white;
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
    .bldg-hero {
        min-height: 260px;
    }

    .bldg-hero__title {
        font-size: 1.6rem;
    }

    .bldg-hero__stats {
        gap: 8px;
    }

    .bldg-stat {
        font-size: 12px;
        padding: 4px 10px;
    }

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

    .bldg-listings__grid {
        grid-template-columns: 1fr;
    }

    .bldg-map__actions {
        flex-direction: column;
    }

    .bldg-cta__buttons {
        flex-direction: column;
        align-items: center;
    }

    .bldg-table th,
    .bldg-table td {
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .bldg-hero__content {
        padding: 24px 16px;
    }

    .bldg-hero__title {
        font-size: 1.3rem;
    }

    .bldg-overview__container,
    .bldg-unit-types__container,
    .bldg-listings__container,
    .bldg-sold__container,
    .bldg-map__container,
    .bldg-faq__container,
    .bldg-cta__container {
        padding: 0 16px;
    }
}

/* ============================================
   Buildings Index / Directory Page
   ============================================ */

.bldg-hero--index {
    min-height: 240px;
    background: linear-gradient(135deg, #1a365d 0%, #2d3748 100%);
}

/* Search bar in hero */
.bldg-search {
    margin-top: 20px;
    max-width: 560px;
}

.bldg-search__bar {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    padding: 4px 4px 4px 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.bldg-search__icon {
    flex-shrink: 0;
    color: #a0aec0;
    margin-right: 10px;
}

.bldg-search__input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 15px;
    color: #1a202c;
    background: transparent;
    padding: 10px 0;
    min-width: 0;
}

.bldg-search__input::placeholder {
    color: #a0aec0;
}

.bldg-search__clear {
    font-size: 22px;
    color: #a0aec0;
    text-decoration: none;
    padding: 0 10px;
    line-height: 1;
}

.bldg-search__clear:hover {
    color: #4a5568;
}

.bldg-search__btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: #0891b2;
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.bldg-search__btn:hover {
    background: #0e7490;
}

.bldg-city-nav {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.bldg-city-nav__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-city-nav__scroll {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.bldg-city-nav__scroll::-webkit-scrollbar {
    display: none;
}

.bldg-city-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    text-decoration: none;
    color: #4a5568;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.bldg-city-pill:hover {
    background: #edf2f7;
    color: #1a202c;
}

.bldg-city-pill--active {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
}

.bldg-city-pill--active:hover {
    background: #0e7490;
    color: white;
}

.bldg-city-pill__count {
    font-size: 11px;
    opacity: 0.7;
}

.bldg-index-grid {
    background: #f7fafc;
    padding: 32px 0 48px;
    min-height: 400px;
}

.bldg-index-grid__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.bldg-index-grid__items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.bldg-index-header {
    margin-bottom: 16px;
}

.bldg-index-header__count {
    font-size: 14px;
    color: #718096;
}

.bldg-index-card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 12px;
    padding: 18px 20px;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.15s, box-shadow 0.15s;
    border: 1px solid #e2e8f0;
    min-height: 130px;
}

.bldg-index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
    border-color: #0891b2;
}

.bldg-index-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 6px;
}

.bldg-index-card__name {
    font-size: 16px;
    font-weight: 600;
    color: #1a202c;
    line-height: 1.3;
}

.bldg-index-card__badge {
    flex-shrink: 0;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    background: #c6f6d5;
    color: #22543d;
    white-space: nowrap;
}

.bldg-index-card__address {
    font-size: 13px;
    color: #718096;
    margin-bottom: 6px;
}

.bldg-index-card__price {
    font-size: 14px;
    font-weight: 600;
    color: #0891b2;
    margin-bottom: 8px;
}

.bldg-index-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.bldg-index-card__total {
    font-size: 12px;
    color: #a0aec0;
}

.bldg-index-card__arrow {
    font-size: 16px;
    color: #cbd5e0;
    transition: color 0.2s, transform 0.2s;
}

.bldg-index-card:hover .bldg-index-card__arrow {
    color: #0891b2;
    transform: translateX(3px);
}

.bldg-index-empty {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
}

.bldg-index-empty svg {
    margin-bottom: 16px;
}

.bldg-index-empty h3 {
    font-size: 1.2rem;
    color: #4a5568;
    margin: 0 0 8px;
}

.bldg-index-empty p {
    font-size: 0.95rem;
    margin: 0;
}

.bldg-index-empty a {
    color: #0891b2;
    text-decoration: none;
}

.bldg-index-empty a:hover {
    text-decoration: underline;
}

.bldg-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 32px;
    padding: 16px 0;
}

.bldg-pagination__link {
    padding: 8px 16px;
    border-radius: 8px;
    background: white;
    color: #0891b2;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    border: 1px solid #e2e8f0;
    transition: all 0.2s;
}

.bldg-pagination__link:hover {
    background: #0891b2;
    color: white;
    border-color: #0891b2;
}

.bldg-pagination__info {
    font-size: 14px;
    color: #718096;
}

.bldg-pagination__current {
    padding: 8px 14px;
    border-radius: 8px;
    background: #0891b2;
    color: white;
    font-size: 14px;
    font-weight: 600;
}

@media (max-width: 768px) {
    .bldg-index-grid__items {
        grid-template-columns: 1fr;
    }

    .bldg-city-nav__container {
        padding: 0 16px;
    }
}
