/**
 * Case Study Styles
 * 
 * Clean, modern case study cards with better readability
 * Uses existing design tokens from main style.css
 * 
 * LAYOUT: Horizontal cards with 40% image (left) + 60% content (right)
 * RESPONSIVE: Stacks vertically on mobile (768px and below)
 * 
 * @package Aipxperts Child Theme
 * @version 2.0.0
 */

/* Base Case Study Container - Full Width */
.case-study-listing {
    width: 100%;
    margin: 0;
    padding: var(--spacing-sm);
}

.case-study-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

/* Individual Case Study Card - Horizontal Layout (40% Image + 60% Content) */
/* FORCE HORIZONTAL LAYOUT - Image Left, Content Right */
.case-study-card {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
    background: #ffffff;
    border: 1px solid #f0f0f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s ease;
    position: relative;
    min-height: 300px;
}

.case-study-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 20px rgba(224, 0, 0, 0.08);
}

/* Card Image Section - 40% Width (Left Column) */
.case-study-image {
    flex: 0 0 40% !important;
    width: 40% !important;
    max-width: 40% !important;
    position: relative;
    overflow: hidden;
    background: #fafafa;
    height: 100% !important; /* Full height to match content */
}

.case-study-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.case-study-card:hover .case-study-image img {
    transform: scale(1.05);
}

.case-study-image a {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* Card Content Section - 60% Width (Right Column) */
.case-study-content {
    flex: 1 !important;
    width: 60% !important;
    max-width: 60% !important;
    padding: var(--spacing-sm);
    display: flex;
    flex-direction: column;
    gap: 6px; /* Further reduced gap for tighter spacing */
    background: #ffffff !important; /* Pure white background */
}

/* Project Header Info */
.case-study-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 6px; /* Further reduced gap */
}

.case-study-project-info {
    flex: 1;
}

/* Project Name */
.case-study-project-name {
    font-size: var(--fs-small);
    font-weight: var(--fw-medium);
    color: var(--color-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 4px;
}

/* Hover effect removed - same color as default */

/* Project Location and Industry Container */
.case-study-location-industry {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* Project Location */
.case-study-location {
    font-size: var(--fs-xsmall);
    color: #666;
    background: #f8f8f8;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

/* Industry Inline with Location - Same styling as location */
.case-study-industry-inline {
    font-size: var(--fs-xsmall);
    color: #666;
    background: #f8f8f8;
    padding: 4px 8px;
    border-radius: 6px;
    display: inline-block;
}

.case-study-industry-inline span {
    display: inline-block;
    margin-right: 4px;
    padding: 1px 4px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 3px;
    font-size: var(--fs-xsmall);
}

/* Feature Icon */
.case-study-feature-icon {
    flex-shrink: 0;
    margin-left: var(--spacing-sm);
}

.case-study-feature-icon img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

/* Main Title */
.case-study-title {
    font-size: var(--fs-h5);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    margin: 0 0 6px 0; /* Further reduced gap */
    line-height: 1.3;
}

/* Hover effect removed - same color as default */

/* Description */
.case-study-description {
    font-size: var(--fs-body);
    color: #555;
    line-height: 1.6;
    margin: 0 0 6px 0; /* Further reduced gap */
}

/* Industry Info - Nice Background */
/* Removed - Now inline with location */

/* Technology Section */
.case-study-technology {
    margin-bottom: 6px; /* Further reduced gap */
    padding: 6px 0;
    border-top: 1px solid #f0f0f0;
    padding-top: 10px;
}

.case-study-technology-label {
    font-size: var(--fs-xsmall);
    color: #888;
    font-weight: var(--fw-medium);
    margin: 0 0 6px 0; /* Further reduced gap */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-study-tech-icons {
    display: flex;
    gap: 6px; /* Reduced gap between icons */
    flex-wrap: wrap;
    align-items: center;
}

.case-study-tech-icon {
    display: inline-block;
    transition: all 0.2s ease;
    cursor: pointer;
    padding: 2px;
    border-radius: 8px;
}

.case-study-tech-icon:hover {
    transform: translateY(-2px);
    background: rgba(224, 0, 0, 0.05);
}

.case-study-tech-icon img {
    width: 20px; /* Moderate size - not too small, not too big */
    height: 20px; /* Moderate size - not too small, not too big */
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.case-study-tech-icon:hover img {
    border-color: var(--color-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Call to Action Button - Nice Styling */
.case-study-button {
    margin-top: auto;
}

.case-study-button a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: var(--spacing-sm);
    background: linear-gradient(135deg, var(--color-primary) 0%, #d10000 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-small);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(224, 0, 0, 0.2);
}

.case-study-button a:hover {
    background: linear-gradient(135deg, #d10000 0%, var(--color-primary) 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(224, 0, 0, 0.3);
}

.case-study-button a:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(224, 0, 0, 0.1);
}

.case-study-button-arrow {
    font-style: normal;
    transition: transform 0.2s ease;
}

.case-study-button a:hover .case-study-button-arrow {
    transform: translateX(3px);
}

/* No image placeholder */
.case-study-no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 200px;
    background: #fafafa;
    color: #888;
    font-size: var(--fs-small);
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    font-weight: var(--fw-medium);
}

/* Load More Button */
.case-study-load-more {
    text-align: center;
    margin-top: var(--spacing-lg);
}

.case-study-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: var(--fw-semibold);
    font-size: var(--fs-body);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.case-study-load-more-btn:hover {
    background: #d10000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(224, 0, 0, 0.2);
}

.case-study-load-more-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(224, 0, 0, 0.1);
}

/* Loading States */
.case-study-load-more-btn.is-loading {
    pointer-events: none;
    opacity: 0.7;
    background: #ccc !important;
}

.case-study-load-more-btn.is-loading .spinner {
    display: inline-block;
}

.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages - Removed unused classes */

/* No Results */
.no-casestudy, .no-results {
    text-align: center;
    padding: var(--spacing-xl);
    color: #888;
    font-size: var(--fs-body);
}

/* Responsive Design */
@media (max-width: 768px) {
    .case-study-listing {
        padding: var(--spacing-sm);
    }
    
    .case-study-grid {
        gap: var(--spacing-sm);
    }
    
    /* Stack cards vertically on mobile */
    .case-study-card {
        flex-direction: column !important;
        min-height: auto;
    }
    
    .case-study-image {
        flex: 0 0 200px !important;
        width: 100% !important;
        max-width: 100% !important;
        height: 200px;
    }
    
    .case-study-content {
        width: 100% !important;
        max-width: 100% !important;
        padding: var(--spacing-sm);
    }
    
    .case-study-header {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .case-study-feature-icon {
        margin-left: 0;
        margin-top: var(--spacing-sm);
    }
    
    .case-study-tech-icons {
        justify-content: center;
    }
    
    .case-study-button a {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .case-study-listing {
        padding: var(--spacing-sm);
    }
    
    .case-study-content {
        padding: var(--spacing-sm);
    }
    
    .case-study-load-more-btn {
        width: 100%;
        justify-content: center;
    }
}
