/* =====================================================
   STEM Projects Plugin — Frontend Styles
===================================================== */

:root {
    --sp-cream:  #f0ede6;
    --sp-dark: #3D4321;
    --sp-mid:    #6b6b5a;
    --sp-accent: #3d4a2e;
}

/* ── Filter Bar ── */
.stem-filter-bar {
    margin-bottom: 48px;
}

/* Row 1 — ALL */
.stem-filter-row-all {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #3D4321;
    padding-bottom: 10px;
    margin-bottom: 0;
}

.stem-filter-row-cats {
    display: flex;
    flex-wrap: wrap;
    gap: 0 40px;
    align-items: center;
    padding: 10px 0;
    padding-left: 0;
    justify-content: flex-start;
    margin-left: 40px;
}

/* Filter items */
.stem-filter-item {
    font-size: 16px;
    line-height: 23px;
    letter-spacing: 0;
    text-transform: uppercase;
    cursor: pointer;
    color: var(--sp-mid);
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 2px 0;
    transition: color .2s;
    user-select: none;
    white-space: nowrap;
}

.stem-filter-item:hover { color: var(--sp-dark); }

.stem-filter-item.active { color: var(--sp-dark); }

/* Radio dot */
.stem-filter-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 1.5px solid currentColor;
    display: inline-block;
    flex-shrink: 0;
    transition: background .2s;
    box-sizing: border-box;
}

.stem-filter-item.active .stem-filter-dot {
    background: var(--sp-dark);
}

/* ── Projects Grid ── */
.stem-projects-grid {
    display: grid;
    gap: 40px 20px;
}

.stem-cols-1 { grid-template-columns: 1fr; }
.stem-cols-2 { grid-template-columns: repeat(2, 1fr); }
.stem-cols-3 { grid-template-columns: repeat(3, 1fr); }
.stem-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .stem-cols-3,
    .stem-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .stem-cols-2,
    .stem-cols-3,
    .stem-cols-4 { grid-template-columns: 1fr; }
}
@media (max-width: 540px) {
    .stem-cols-1,
    .stem-cols-2,
    .stem-cols-3,
    .stem-cols-4 { grid-template-columns: 1fr; }
}

/* ── Project Card ── */
.stem-project-card {
    transition: opacity .3s;
}

.stem-project-card.hidden {
    display: none;
}

.stem-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.stem-card-image-wrap {
    overflow: hidden;
    aspect-ratio: 4 / 3;
    line-height: 0;
}

.stem-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .7s cubic-bezier(.25, .46, .45, .94);
}

.stem-card-no-image {
    width: 100%;
    aspect-ratio: 4/3;
    background: #ddd;
}

.stem-project-card:hover .stem-card-image {
    transform: scale(1.04);
}

.stem-card-info {
    padding: 14px 0 0;
}

.stem-card-title {
    font-family: 'Albra Book Light', sans-serif;
    font-size: 22px;
    font-weight: 300;
    line-height: 1.2;
    color: var(--sp-dark);
    letter-spacing: 0;
    text-transform: uppercase;
    margin: 0;
}

/* ── No results ── */
.stem-no-projects {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 0;
    color: var(--sp-mid);
    font-size: 14px;
}

/* ── Elementor Editor ── */
.stem-elementor-preview-notice {
    background: #fff8e1;
    border-left: 3px solid #f0c040;
    padding: 6px 10px;
    border-radius: 2px;
    margin-bottom: 12px;
}

/* ── Mobile Filter Drawer ── */
.stem-filter-mobile-toggle,
.stem-filter-mobile-drawer {
    display: none;
}

@media (max-width: 768px) {

    /* Hide desktop rows */
    .stem-filter-row-all,
    .stem-filter-row-cats {
        display: none;
    }

    /* Show mobile toggle button */
    .stem-filter-mobile-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        user-select: none;
        padding-bottom: 10px;
        border-bottom: 1px solid var(--sp-dark);
        width: 100%;
        font-size: 16px;
        line-height: 23px;
        font-weight: 600;
        letter-spacing: 0.15em;
        text-transform: uppercase;
        color: var(--sp-mid);
    }

    .stem-filter-mobile-toggle .stem-filter-toggle-arrow {
        display: inline-block;
        transition: transform 0.25s ease;
        font-style: normal;
        font-size: 16px;
        color: var(--sp-dark);
    }

    .stem-filter-mobile-toggle.open .stem-filter-toggle-arrow {
        transform: rotate(180deg);
    }

    /* Drawer */
    .stem-filter-mobile-drawer {
        display: none;
        flex-direction: column;
        gap: 0;
        padding: 6px 0 4px;
        margin-bottom: 32px;
    }

    .stem-filter-mobile-drawer.open {
        display: flex;
    }

    /* Items inside drawer */
    .stem-filter-mobile-drawer .stem-filter-item {
        font-size: 16px;
        line-height: 23px;
        padding: 9px 0;
        width: 100%;
    }

    .stem-filter-mobile-drawer .stem-filter-item:last-child {
        border-bottom: none;
    }

    /* Hide bar's own bottom margin when mobile */
    .stem-filter-bar {
        margin-bottom: 32px;
    }
}