/* ============================================================
   apartments.css
   Scoped styles for the Апартаменти page.
   Naming prefix: .proj-  .bld-card
   All values aligned with tokens.css design system.
   ============================================================ */

/* ── Page hero ───────────────────────────────────────────────────────────── */
.proj-hero {
    padding-top: 124px; /* height of solid nav */
    padding-bottom: 48px;
    background: #fff;
}

.proj-hero__inner {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 32px;
    padding-top: 60px;
}

.proj-hero__bar {
    width: 9px;
    height: 72px;
    background: var(--g-primary);
    border-radius: 4px;
    flex-shrink: 0;
}

.proj-hero__title {
    font-family: var(--font-display);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 700;
    color: var(--c-text-dark);
    margin: 0;
    line-height: 1.1;
}


/* ── Tab filter bar ──────────────────────────────────────────────────────── */
.proj-tabs {
    position: sticky;
    top: 0; /* stick below nothing — nav is above */
    z-index: 80;
    background: #fff;
    border-bottom: none;
}

.proj-tabs__nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0;
    padding: 0;
}

.proj-tabs__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    font-family: var(--font-ui);
    font-size: 16px;
    font-weight: 500;
    color: var(--c-text-dark);
    text-decoration: none;
    border-radius: 4px 4px 0 0;
    transition: color 0.18s ease;
    white-space: nowrap;
}

.proj-tabs__tab:hover {
    color: #C4161C;
}

/* Active tab: red gradient fill, white text */
.proj-tabs__tab--active {
    background: var(--g-primary);
    color: #fff;
    font-weight: 600;
}

.proj-tabs__tab--active:hover {
    color: #fff;
}

/* Full-width red underline below the tab bar */
.proj-tabs__underline {
    height: 3px;
    background: var(--g-primary);
    width: 100%;
}


/* ── List section (Текущи / Завършени) ───────────────────────────────────── */
.proj-grid-section {
    padding: 64px 0 80px;
    background: var(--c-bg-light);
    min-height: 400px;
}

.proj-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

/* Empty state */
.proj-empty {
    font-family: var(--font-ui);
    font-size: 18px;
    color: #888;
    text-align: center;
    padding: 80px 0;
}


/* ── Building card — full-width horizontal ───────────────────────────────── */
.bld-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(36, 37, 39, 0.08);
    display: grid;
    grid-template-columns: 1fr 55%; /* text left | image right */
    min-height: 320px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.bld-card:hover {
    box-shadow: 0 8px 32px rgba(196, 22, 28, 0.12);
    transform: translateY(-2px);
}

/* LEFT — text body */
.bld-card__body {
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

/* Red accent bar above title (matches Figma) */
.bld-card__accent-bar {
    width: 48px;
    height: 5px;
    background: var(--g-primary);
    border-radius: 3px;
    margin-bottom: 8px;
}

.bld-card__title {
    font-family: var(--font-display);
    font-size: clamp(22px, 2.5vw, 32px);
    font-weight: 700;
    color: var(--c-text-dark);
    margin: 0;
    line-height: 1.2;
}

.bld-card__subtitle {
    font-family: var(--font-ui);
    font-size: 15px;
    color: #555;
    margin: 0;
}

.bld-card__location {
    font-family: var(--font-ui);
    font-size: 13px;
    color: #888;
    margin: 0;
}

.bld-card__stage {
    font-family: var(--font-ui);
    font-size: 13px;
    color: #666;
    margin: 4px 0 0;
}

/* Stats strip */
.bld-card__stats {
    display: flex;
    flex-direction: row;
    gap: 32px;
    margin-top: 16px;
}

.bld-card__stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

.bld-card__stat-value {
    font-family: var(--font-display);
    font-size: clamp(24px, 2.8vw, 36px);
    font-weight: 700;
    background: var(--g-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.bld-card__stat-label {
    font-family: var(--font-ui);
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* RIGHT — image area */
.bld-card__img-wrap {
    position: relative;
    overflow: hidden;
    background: #e5e5e5;
}

.bld-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bld-card:hover .bld-card__img {
    transform: scale(1.03);
}

.bld-card__img-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e8e8 0%, #d0d0d0 100%);
}

/* Status badge */
.bld-card__badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 5px 14px;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.bld-card__badge--active {
    background: var(--g-primary);
    color: #fff;
}

.bld-card__badge--done {
    background: rgba(28, 27, 23, 0.75);
    color: #fff;
}


/* ── Map section ─────────────────────────────────────────────────────────── */
.proj-map-section {
    position: relative;
    width: 100%;
}

.proj-map {
    width: 100%;
    height: 620px;
    z-index: 1;
}

/* Leaflet custom pins */
.map-leaflet-pin {
    width: 32px;
    height: 42px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.map-leaflet-pin--active {
    background: linear-gradient(0deg, #C4161C 0%, #F05123 100%);
}

.map-leaflet-pin--done {
    background: linear-gradient(0deg, #555 0%, #888 100%);
}

/* Leaflet popup */
.map-popup {
    font-family: var(--font-ui);
    min-width: 160px;
}

.map-popup__title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text-dark);
    display: block;
    margin-bottom: 4px;
}

.map-popup__sub {
    font-size: 13px;
    color: #666;
    margin: 0 0 6px;
}

.map-popup__status {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    background: var(--g-primary);
    color: #fff;
}


/* ══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 1024px) {
    .bld-card {
        grid-template-columns: 1fr 50%;
    }

    .bld-card__body {
        padding: 32px 36px;
    }
}

@media (max-width: 768px) {
    .proj-hero {
        padding-bottom: 32px;
    }

    .proj-hero__bar {
        height: 48px;
    }

    .proj-tabs__tab {
        padding: 10px 20px;
        font-size: 14px;
    }

    .proj-grid-section {
        padding: 40px 0 60px;
    }

    .proj-list {
        gap: 24px;
    }

    /* Stack card vertically on mobile — image on top, text below */
    .bld-card {
        grid-template-columns: 1fr;
        grid-template-rows: 240px auto;
    }

    .bld-card__img-wrap {
        order: -1; /* image first */
    }

    .bld-card__body {
        padding: 24px 24px 28px;
    }

    .proj-map {
        height: 420px;
    }
}

@media (max-width: 480px) {
    .proj-tabs__tab {
        padding: 10px 14px;
        font-size: 13px;
    }

    .bld-card__stats {
        gap: 20px;
    }
}