/* School Projects Showcase */
.sps-showcase {
    --sps-btn:    #e86321;
    --sps-accent: #1a6b4a;
    --sps-radius: 12px;
    --sps-img-w:  42%;
    --sps-border: #e4e7ed;
    --sps-text:   #1a1a2e;
    --sps-muted:  #5a6172;
    --sps-surf:   #ffffff;
    --sps-shadow: 0 2px 12px rgba(0,0,0,.07);
    --sps-shadow-h: 0 6px 24px rgba(0,0,0,.13);
    --t: .22s cubic-bezier(.4,0,.2,1);
    width: 100%;
    font-family: inherit;
}

/* ── Filter bar ── */
.sps-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 14px 16px;
    margin-bottom: 24px;
    background: linear-gradient(135deg,#f0f5ff,#e8f5ee);
    border-radius: calc(var(--sps-radius) + 4px);
    border: 1px solid #dde6f0;
}
.sps-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 15px;
    border-radius: 999px;
    border: 1.5px solid var(--sps-border);
    background: #fff;
    color: var(--sps-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t);
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    line-height: 1;
}
.sps-filter-btn:hover {
    border-color: var(--sps-accent);
    color: var(--sps-accent);
    background: #f0faf5;
    transform: translateY(-1px);
}
.sps-filter-btn.active {
    background: var(--sps-accent);
    border-color: var(--sps-accent);
    color: #fff;
    box-shadow: 0 3px 10px rgba(26,107,74,.28);
}
.sps-count {
    font-size: 11px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.25);
}
.sps-filter-btn:not(.active) .sps-count {
    background: #edf0f7;
    color: var(--sps-muted);
}

/* ── Grid ── */
.sps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

/* ── Card ── */
.sps-card {
    background: var(--sps-surf);
    border-radius: var(--sps-radius);
    border: 1px solid var(--sps-border);
    box-shadow: var(--sps-shadow);
    overflow: hidden;
    position: relative;
    transition: transform var(--t), box-shadow var(--t);
}
.sps-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--sps-shadow-h);
}

/* Category badge — top right */
.sps-cat-wrap {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
    max-width: 55%;
}

/* Horizontal layout */
.sps-inner {
    display: flex;
    min-height: 195px;
}

/* Image panel */
.sps-img-wrap {
    flex: 0 0 var(--sps-img-w);
    display: block;
    overflow: hidden;
    background: #e8eef5;
    position: relative;
}
.sps-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s ease;
}
.sps-card:hover .sps-img { transform: scale(1.04); }
.sps-img-placeholder {
    width: 100%;
    height: 100%;
    min-height: 195px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg,#e8f5ee,#dde8fa);
    opacity: .7;
}

/* Content panel */
.sps-body {
    flex: 1 1 0;
    min-width: 0;
    padding: 16px 18px 14px;
    display: flex;
    flex-direction: column;
}

/* Title */
.sps-title {
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 7px;
    color: var(--sps-text);
    /* leave room for top-right badge */
    padding-right: 8px;
}
.sps-title a { color: inherit; text-decoration: none; transition: color var(--t); }
.sps-title a:hover { color: var(--sps-accent); }

/* Description */
.sps-desc {
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--sps-muted);
    margin: 0 0 10px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Footer row */
.sps-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--sps-border);
}
.sps-subcats { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; min-width: 0; }

/* Author */
.sps-author {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: var(--sps-muted);
    white-space: nowrap;
}
.sps-author a { color: var(--sps-muted); text-decoration: none; font-weight: 500; }
.sps-author a:hover { color: var(--sps-accent); }
.sps-avatar { border-radius: 50%; width:20px!important; height:20px!important; }

/* Explore button */
.sps-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 15px;
    background: var(--sps-btn);
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 999px;
    font-size: 12.5px;
    font-weight: 600;
    transition: filter var(--t), transform var(--t), box-shadow var(--t);
    box-shadow: 0 2px 8px rgba(232,99,33,.22);
    margin-left: auto;
    white-space: nowrap;
}
.sps-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.sps-btn:active { transform: scale(.97); }

/* Badges */
.sps-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    line-height: 1.4;
}
.sps-badge-cat {
    background: rgba(255,255,255,.88);
    color: var(--sps-accent);
    border: 1px solid rgba(26,107,74,.25);
    backdrop-filter: blur(3px);
}
.sps-badge-sub {
    background: #eef1f8;
    color: #4a5568;
    border: 1px solid #dde1ec;
}

/* Animation */
@keyframes sps-up { from { opacity:0; transform:translateY(18px); } to { opacity:1; transform:none; } }
.sps-animate { animation: sps-up .38s ease both; }
.sps-card:nth-child(1){ animation-delay:.04s }
.sps-card:nth-child(2){ animation-delay:.09s }
.sps-card:nth-child(3){ animation-delay:.14s }
.sps-card:nth-child(4){ animation-delay:.19s }
.sps-card:nth-child(5){ animation-delay:.24s }
.sps-card:nth-child(6){ animation-delay:.29s }

/* Empty states */
.sps-empty, .sps-no-match {
    text-align: center;
    padding: 50px 20px;
    color: var(--sps-muted);
    font-size: 15px;
}

/* Responsive — stack image above on small screens */
@media (max-width: 600px) {
    .sps-inner { flex-direction: column; }
    .sps-img-wrap { flex: none; width: 100%; height: 175px; }
    .sps-cat-wrap { max-width: 90%; }
    .sps-btn { margin-left: 0; }
    .sps-title { padding-right: 0; }
}

@media (min-width: 880px) {
    .sps-grid { grid-template-columns: 1fr 1fr; }
}
