/**
 * Case Study Cards
 * Shared by the Portfolio page (Case Studies section) and the case study pages (More Case Studies).
 * Loaded by includes/header.php for $active_page 'portfolio' and 'case-study'.
 * Markup: components/case-card.php
 */

.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.case-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(
        135deg,
        rgba(255, 149, 0, 0.05) 0%,
        rgba(30, 38, 55, 0.7) 50%,
        rgba(255, 149, 0, 0.05) 100%
    );
    border: 2px solid rgba(255, 149, 0, 0.45);
    border-radius: 25px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(15px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow:
        0 10px 35px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(255, 149, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.case-card:hover {
    border-color: #FF9500;
    background: linear-gradient(
        135deg,
        rgba(255, 149, 0, 0.06) 0%,
        rgba(30, 38, 55, 0.85) 50%,
        rgba(255, 149, 0, 0.06) 100%
    );
    transform: translateY(-8px);
    box-shadow:
        0 20px 45px rgba(0, 0, 0, 0.5),
        0 0 45px rgba(255, 149, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.case-cover {
    aspect-ratio: 1672 / 941;
    overflow: hidden;
    border-bottom: 2px solid rgba(255, 149, 0, 0.3);
}

.case-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.case-card:hover .case-cover img {
    transform: scale(1.04);
}

.case-body {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: 1;
    padding: 30px 30px 28px;
}

/* Corner bracket, same as the expertise cards */
.case-body::before {
    content: '';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 35px;
    height: 35px;
    border-top: 2px solid rgba(255, 149, 0, 0.5);
    border-right: 2px solid rgba(255, 149, 0, 0.5);
    transition: all 0.3s ease;
    pointer-events: none;
}

.case-card:hover .case-body::before {
    border-color: #FF9500;
}

.case-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-right: 50px; /* room for the corner bracket */
}

.case-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 30px;
    border: 1px solid rgba(255, 149, 0, 0.35);
    background: rgba(255, 149, 0, 0.08);
    color: #FFB340;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
}

.case-tag i {
    color: #FF9500;
    font-size: 12px;
}

.case-tag .fi {
    width: 16px;
    height: 12px;
    border-radius: 2px;
    line-height: 12px;
}

.case-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    line-height: 1.3;
    color: #FFFFFF;
}

.case-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.case-metric strong {
    display: block;
    color: #FF9500;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
    font-variant-numeric: tabular-nums;
}

.case-metric span {
    display: block;
    margin-top: 4px;
    color: #94A3B8;
    font-size: 12px;
    line-height: 1.4;
}

.case-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: auto;
}

.case-platforms {
    display: flex;
    gap: 8px;
}

.case-platforms i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #E5E5E5;
    font-size: 14px;
    transition: all 0.3s ease;
}

.case-card:hover .case-platforms i {
    border-color: rgba(255, 149, 0, 0.5);
    color: #FF9500;
}

.case-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #FF9500;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.case-link i {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.case-card:hover .case-link i {
    transform: translateX(4px);
}

@media (max-width: 768px) {
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .case-body {
        padding: 22px 20px;
    }

    .case-body::before {
        top: 14px;
        right: 14px;
        width: 26px;
        height: 26px;
    }

    .case-tags {
        padding-right: 36px;
    }

    .case-title {
        font-size: 19px;
    }

    .case-metric strong {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .case-metric span {
        font-size: 11px;
    }
}
