/* ============================================
   BM Projects Grid — Frontend Styles
   Palette: taupe, warm grey, soft sage green, off-white
   Font: Oxygen (inherits from theme)
   ============================================ */

.bm-projects-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ---------- Filter Bar ---------- */

.bm-filter-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 36px 0 28px;
}

.bm-filter-btn {
    font-family: inherit;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.5px;
    padding: 10px 22px;
    border: 1px solid var(--bm-filter-bdr, #b5ab96);
    background: transparent;
    color: var(--bm-title, #333a2d);
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.bm-filter-btn:hover,
.bm-filter-btn.active {
    background: var(--bm-filter-bg, #5e6b52);
    border-color: var(--bm-filter-bg, #5e6b52);
    color: #fff;
}

/* ---------- Grid ---------- */

.bm-projects-grid {
    display: grid;
    grid-template-columns: repeat(var(--bm-cols, 3), 1fr);
    gap: var(--bm-gap, 24px);
}

@media (max-width: 768px) {
    .bm-projects-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .bm-projects-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ---------- Card ---------- */

.bm-project-card {
    display: block;
    text-decoration: none;
    overflow: hidden;
    position: relative;
    opacity: 1;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Hide cards when filtered out */
.bm-project-card.bm-hidden {
    display: none;
}

.bm-project-card__img {
    position: relative;
    aspect-ratio: var(--bm-ratio, 4/5);
    overflow: hidden;
    background: #e8e4dd;
}

.bm-project-card__img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.bm-project-card:hover .bm-project-card__img img {
    transform: scale(1.06);
}

/* Placeholder when no featured image */
.bm-project-card__placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e8e4dd 0%, #d4cfca 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Overlay on hover */
.bm-project-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(51, 58, 45, 0.85) 0%,
        rgba(51, 58, 45, 0.25) 40%,
        transparent 100%
    );
    opacity: 0;
    transition: opacity 0.5s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
}

.bm-project-card:hover .bm-project-card__overlay {
    opacity: 1;
}

.bm-project-card__cat {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: #adb08f;
    margin-bottom: 6px;
}

.bm-project-card__overlay-title {
    font-size: 20px;
    font-weight: 300;
    color: #fff;
    line-height: 1.3;
    margin: 0 0 4px;
}

.bm-project-card__loc {
    font-size: 13px;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.6);
}

/* Info below image */
.bm-project-card__info {
    padding: 16px 2px 8px;
}

.bm-project-card__title {
    font-size: 18px;
    font-weight: 400;
    color: var(--bm-title, #333a2d);
    margin: 0 0 4px;
    line-height: 1.3;
}

.bm-project-card__subtitle {
    font-size: 13px;
    font-weight: 300;
    color: var(--bm-sub, #918b82);
    margin: 0;
}

/* ---------- Animation: fade in on filter ---------- */

.bm-project-card.bm-fade-in {
    animation: bmFadeIn 0.4s ease forwards;
}

@keyframes bmFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}
