/* ==========================================================================
   Vivasoft Case Study Grid — case-study-grid.css
   ========================================================================== */

/* ---------- Loading overlay ---------- */
.vcsg-wrapper {
    position: relative;
}

.vcsg-wrapper.is-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.6);
    z-index: 10;
    border-radius: 8px;
    pointer-events: none;
}

.vcsg-wrapper.is-loading .vcsg-grid {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

/* ---------- Filter bar ---------- */
.vcsg-filter-bar-outer {
    background-color: #F8F8FC;
}

.vcsg-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding-bottom: 24px;
    width: 1200px;
    margin: 0 auto;
}

.vcsg-filter-item {
    display: flex;
    align-items: center;
}

.vcsg-all-select-input {
    display: flex;
    gap: 20px;
}

.vcsg-filter-search {
    margin-left: auto;
    width: 320px;
}

/* ---------- Select ---------- */
.vcsg-select {
    height: 44px;
    width: 256px;
    padding: 0 36px 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    cursor: pointer;
    box-sizing: border-box;
    min-width: 160px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.vcsg-select:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ---------- Search ---------- */
.vcsg-search {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.vcsg-search:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.15);
}

/* ---------- Clear All Button ---------- */
.vcsg-clear-all {
    display: none;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 20px;
    font-size: 14px;
    line-height: 1;
    color: #fff;
    background-color: #e74c3c;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.vcsg-clear-all.is-visible {
    display: inline-flex;
}

.vcsg-clear-all:hover {
    background-color: #c0392b;
}

.vcsg-clear-all:active {
    transform: scale(0.98);
}

/* ---------- Grid content outer / inner ---------- */
.vcsg-grid-content-outer {
    background-color: #0C0A25;
}

.vcsg-grid-content-inner {
    width: 1200px;
    margin: 0 auto;
    padding: 40px 0;
    box-sizing: border-box;
}

/* ---------- Grid ---------- */
.vcsg-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    column-gap: 24px;
    row-gap: 24px;
    box-sizing: border-box;
}

/* ---------- Card ---------- */
.vcsg-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.25s ease;
    box-sizing: border-box;
}

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

/* Whole-card clickable link */
.vcsg-card-link {
    display: flex;
    flex-direction: column;
    flex: 1;
    color: inherit;
    text-decoration: none;
}

.vcsg-card-link:hover {
    text-decoration: none;
    color: inherit;
}

/* ---------- Card Image ---------- */
.vcsg-card-image {
    position: relative;
    width: 100%;
    padding-bottom: 60%;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 24px;
    background: linear-gradient(180deg, #110E32 0%, #D9D3FF 100%);
}

/* Overlay layer — controlled by Elementor "Overlay Color / Gradient" control */
.vcsg-card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

.vcsg-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
    box-sizing: border-box;
    border-radius: 16px;
    transform: scale(calc(1 - 0.12));
}

/* Category badge overlaid on image */
.vcsg-card-top-text {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    display: inline-block;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    color: #fff;
    background-color: rgba(0, 0, 0, 0.55);
    border-radius: 4px;
    white-space: nowrap;
    pointer-events: none;
}

/* ---------- Card Content ---------- */
.vcsg-card-content {
    flex: 1;
    padding: 20px;
    box-sizing: border-box;
}

.vcsg-card-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #1a1a1a;
}

.vcsg-card-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.65;
    color: #555;
}

/* ---------- Card Info Grid (Industry meta) ---------- */
.vcsg-card-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0;
    padding: 12px 20px;
    background-color: #f8f8f8;
    border-radius: 0 0 12px 12px;
    box-sizing: border-box;
}

.vcsg-info-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 8px 0;
}

.vcsg-info-label {
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #888;
    line-height: 1.3;
}

.vcsg-info-value {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.4;
}

/* ---------- No Results ---------- */
.vcsg-no-results {
    grid-column: 1 / -1;
    width: 100%;
    padding: 40px 0;
    font-size: 16px;
    color: #888;
    text-align: center;
}

/* ---------- Pagination ---------- */
.vcsg-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.vcsg-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    color: #333;
    background-color: #f0f0f0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
    box-sizing: border-box;
}

.vcsg-page-btn:hover:not(.is-active) {
    background-color: #e0e0e0;
    color: #1a1a1a;
}

.vcsg-page-btn.is-active {
    background-color: #1a73e8;
    color: #fff;
    pointer-events: none;
}

.vcsg-page-btn:active {
    transform: scale(0.96);
}

.vcsg-page-ellipsis {
    display: inline-flex;
    align-items: center;
    min-width: 24px;
    height: 40px;
    color: #999;
    font-size: 16px;
    letter-spacing: 2px;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .vcsg-grid {
        grid-template-columns: 1fr;
    }

    .vcsg-filter-bar {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
    }

    .vcsg-filter-item {
        width: 100%;
    }

    .vcsg-all-select-input {
        flex-direction: column;
        width: 100%;
    }

    .vcsg-select {
        width: 100%;
    }

    .vcsg-filter-search,
    .vcsg-search {
        width: 100%;
        margin-left: 0;
    }

    .vcsg-clear-all {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .vcsg-filter-bar {
        width: 100%;
        margin: 0 auto;
        flex-direction: column-reverse;
    }

    .vcsg-all-select-input {
        flex-direction: column;
        width: 100%;
    }

    .vcsg-filter-search {
        margin-left: 0;
        width: 100%;
    }

    .vcsg-select {
        width: 100%;
    }

    .vcsg-grid-content-inner {
        width: 100%;
        margin: 0 auto;
        padding: 40px 16px;
        box-sizing: border-box;
    }

    .vcsg-card-image img {
        transform: scale(calc(1 - 0.1));
    }

    .vcsg-grid {
        grid-template-columns: repeat(1, 1fr);
    }

    .vcsg-card-info-grid {
        grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    }
}