/* ==========================================================================
   rp_success_stories — success stories listing + filters
   Based on the Creative Elements template design (uid 150010000).
   ========================================================================== */

.success-stories-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 16px;
    font-family: 'Montserrat', sans-serif;
    align-items: start;
}

/* -------------------------------------------------------------- Filters -- */
.filters-container {
    background: #fff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 24px;
    position: sticky;
    top: 24px;
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filters-title {
    font-weight: 700;
    color: #1f2937;
    font-size: 15px;
}

.filters-count {
    background-color: #eef1fb;
    color: #4f66b8;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.filter-group {
    margin-bottom: 16px;
}

.filter-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.filter-select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1.5px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    color: #1f2937;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.filter-select:focus {
    outline: none;
    border-color: #4f66b8;
}

.filter-clear {
    width: 100%;
    margin-top: 8px;
    padding: 12px;
    border: 1.5px solid #4b5563;
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.filter-clear:hover {
    background-color: #f8f9fa;
}

/* ---------------------------------------------------------------- Grid -- */
.stories-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.stories-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    padding: 40px 0;
    font-size: 16px;
}

/* ---------------------------------------------------------------- Card -- */
.card {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
    background: #fff;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card-image {
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: 300px;
    display: block;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.card-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
}

.brand-logo {
    width: 120px;
    height: 80px;
    object-fit: contain;
    object-position: left;
    align-self: flex-start;
}

.card-content h4 {
    margin: 0;
    font-size: 20px;
    line-height: 1.3;
    color: #1f2937;
    font-weight: 700;
    height: 78px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.tag {
    background-color: #eef1fb;
    color: #4f66b8;
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 12px;
    width: fit-content;
    font-weight: 600;
    flex-shrink: 0;
}

.cta-container {
    margin-top: auto;
    flex-shrink: 0;
}

.cta-button {
    display: block;
    width: 100%;
    height: 38px;
    border: 1.5px solid #4b5563;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s;
    line-height: 38px;
    text-align: center;
    color: #4b5563;
}

.cta-button:hover {
    background-color: #f8f9fa;
}

.card-permanent {
    background-color: #eef1fb;
}

/* Hidden by filter / by initial limit */
.card.filter-hidden {
    display: none;
}

.stories-grid.limited .card:nth-child(n + 5):not(.card-permanent) {
    display: none;
}

/* --------------------------------------------------------------- Toggle -- */
.toggle-stories-btn {
    display: block;
    margin: 40px auto 0;
    padding: 16px 32px;
    border-radius: 10px;
    background: #55c65e;
    color: #fff;
    border: none;
    font-family: inherit;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
}

.toggle-stories-btn:hover {
    background-color: #49b552;
}

/* -------------------------------------------------------------- Mobile -- */
@media (max-width: 992px) {
    .success-stories-wrapper {
        grid-template-columns: 1fr;
    }
    .filters-container {
        position: static;
    }
}

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