/* ── Row & Columns ── */
#category-cards .row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
}

.case-col {
    display: flex;
    padding: 10px 15px;
}

/* ── Link ── */
.case-category-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* ── Card ── */
.case-category-card {
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 30px 20px 24px;
    text-align: center;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* pushes title to bottom */
    cursor: pointer;
}

.case-category-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

/* ── Image Box — fixed size, same for all ── */
.case-category-icon {
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    flex-shrink: 0;
}

.case-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* keeps full image visible, no cropping */
    display: block;
}

/* ── Title — always at bottom, same line ── */
.case-category-title {
    font-size: 16px;
    font-weight: 600;
    color: #333333;
    margin: 0;
    line-height: 1.3;
    width: 100%;
    text-align: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* ── Case Files Images ── */
.casefile-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

/* ── Back Button ── */
.back-btn-wrap {
    position: fixed;
    bottom: 30px;
    inset-inline-end: 30px;
    margin: 0;
    padding: 0;
    z-index: 999;
}
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 2px solid #e0a800;
    color: #333333;
    font-size: 14px;
    font-weight: 600;
    padding: 9px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.back-btn:hover {
    background: #e0a800;
    color: #ffffff;
    translate: calc(-4px * var(--rk-x, 1)) 0;
}

.back-arrow {
    font-size: 18px;
    line-height: 1;
}

/* ── Fade animation ── */
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
}

#casestudies-work {
    animation: fadeSlideDown 0.35s ease forwards;
}

/* ────────────────────────────
   TABLET — 768px
──────────────────────────── */
@media (max-width: 768px) {

    .case-col {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        padding: 6px 8px;
    }

    .case-category-card {
        padding: 20px 12px 18px;
    }

    .case-category-icon {
        width: 110px;
        height: 110px;
        margin-bottom: 14px;
    }

    .case-category-title {
        font-size: 13px;
        padding-top: 12px;
    }

    #casestudies-work .col-md-3,
    #casestudies-work .col-sm-4,
    #casestudies-work .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

/* ────────────────────────────
   MOBILE — 480px
──────────────────────────── */
@media (max-width: 480px) {

    .case-col {
        flex: 0 0 33.333%;
        max-width: 33.333%;
        padding: 4px 5px;
    }

    .case-category-card {
        padding: 14px 8px 14px;
    }

    .case-category-icon {
        width: 75px;
        height: 75px;
        margin-bottom: 10px;
    }

    .case-category-title {
        font-size: 11px;
        font-weight: 700;
        padding-top: 10px;
    }

    #casestudies-work .col-6 {
        flex: 0 0 50%;
        max-width: 50%;
        padding-left: 4px;
        padding-right: 4px;
    }

    .back-btn-wrap {
        margin-left: 10px;
    }

    .back-btn {
        font-size: 12px;
        padding: 7px 14px;
    }
}

/* ────────────────────────────
   TINY — 360px
──────────────────────────── */
@media (max-width: 360px) {

    .case-category-icon {
        width: 58px;
        height: 58px;
    }

    .case-category-title {
        font-size: 10px;
    }
}
