/* ============================================
   CASE STUDY PAGE - NOVINKA CONSTRUCTIONS
   ============================================ */

.case-study-section {
    padding: 120px 0 80px;
    background: var(--theme-bg-body);
    min-height: 80vh;
    transition: background-color 0.4s ease;
}

.case-study-container {
    max-width: 1000px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* --- Main Card --- */
.case-study-card {
    background: var(--theme-bg-surface);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 115, 230, 0.06);
    border: 1px solid var(--theme-border-color, rgba(0, 115, 230, 0.08));
    transition: background-color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* --- Header Navigation --- */
.case-study-header-nav {
    margin-bottom: 24px;
}

.btn-back-portfolio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Oswald', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--color-bright-blue);
    background: rgba(0, 115, 230, 0.08);
    padding: 8px 20px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.btn-back-portfolio:hover {
    background: var(--color-bright-blue);
    color: #FFFFFF;
    transform: translateX(-3px);
    border-color: var(--color-bright-blue);
}

.btn-back-portfolio.btn-primary {
    background: var(--color-bright-blue);
    color: #FFFFFF;
}

.btn-back-portfolio.btn-primary:hover {
    background: var(--color-blue-dark, #0059B3);
    color: #FFFFFF;
}

/* --- Project Header --- */
.case-study-header {
    margin-bottom: 30px;
}

.case-study-badges {
    margin-bottom: 12px;
}

.case-study-badge {
    display: inline-block;
    font-family: 'Oswald', sans-serif;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--color-bright-blue);
    background: rgba(0, 115, 230, 0.1);
    padding: 4px 16px;
    border-radius: 50px;
}

.case-study-title {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(28px, 4vw, 44px);
    font-weight: 700;
    color: var(--theme-text-heading);
    line-height: 1.2;
    margin: 0 0 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.case-study-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    color: var(--theme-text-muted);
    font-weight: 500;
}

/* --- Cover Image --- */
.case-study-cover-wrapper {
    position: relative;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 36px;
    box-shadow: 0 12px 30px rgba(0, 115, 230, 0.1);
    aspect-ratio: 16 / 9;
    max-height: 480px;
    background: #081B3A;
}

.case-study-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Content --- */
.case-study-content {
    margin-bottom: 40px;
}

.case-study-section-heading {
    font-family: 'Oswald', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--theme-text-heading);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 16px;
    border-bottom: 2px solid var(--theme-border-color, rgba(0, 115, 230, 0.1));
    padding-bottom: 8px;
}

.case-study-description {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--theme-text-body);
    opacity: 0.9;
    white-space: pre-line;
}

/* --- Gallery --- */
.case-study-gallery-section {
    margin-top: 40px;
    margin-bottom: 40px;
}

.case-study-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.case-study-gallery-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 4 / 3;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #1A3A5C;
}

.case-study-gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 115, 230, 0.2);
}

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

.case-study-gallery-item:hover img {
    transform: scale(1.06);
}

/* --- Footer Action Row --- */
.case-study-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--theme-border-color, rgba(0, 115, 230, 0.1));
}

/* --- State Cards (404 / Error) --- */
.case-study-state-card {
    text-align: center;
    padding: 60px 20px;
}

.case-study-state-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
}

.case-study-state-title {
    font-family: 'Oswald', sans-serif;
    font-size: 2rem;
    color: var(--theme-text-heading);
    margin-bottom: 12px;
    text-transform: uppercase;
}

.case-study-state-text {
    font-family: 'Inter', sans-serif;
    color: var(--theme-text-muted);
    max-width: 500px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.case-study-state-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================
    LIGHTBOX MODAL
   ============================================ */

.lightbox-modal {
    position: fixed;
    inset: 0;
    background: rgba(8, 27, 58, 0.92);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.lightbox-content {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 3rem;
    color: #FFFFFF;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.lightbox-close:hover {
    color: var(--color-bright-blue);
}

/* ============================================
    RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .case-study-card {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .case-study-cover-wrapper {
        aspect-ratio: 4 / 3;
    }

    .case-study-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-back-portfolio {
        text-align: center;
        justify-content: center;
    }

    .case-study-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .case-study-state-title {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .case-study-gallery-grid {
        grid-template-columns: 1fr;
    }
}