/* Case Studies New - Clean Design */
/* Use global.css variables (aliases for this page) */
:root {
    --background: var(--bg-primary);
    --text-main: var(--text-primary);
    --surface: var(--bg-primary);
    --border: var(--border-light);
    --bg-alt: var(--bg-secondary);
    --brand-primary: var(--primary);
}

/* Nav: align with global navbar layout (global has .nav-container flex; this page uses .nav-menu, .nav-cta) */
.navbar .nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--container-padding);
    width: 100%;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-menu .nav-link {
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
}

.nav-menu .nav-link:hover {
    color: var(--primary);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.nav-icon-btn:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.navbar .hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: none;
    border: none;
    cursor: pointer;
}

.navbar .hamburger .bar {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.navbar .hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.navbar .hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.navbar .hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
    }
    .nav-cta {
        display: none;
    }
    .navbar .hamburger {
        display: flex;
    }
}

/* Mobile menu overlay and panel (override global hide; case-studies uses same IDs) */
.mobile-menu-overlay {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 899;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu {
    top: 72px;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
}

.mobile-menu .mobile-menu-close {
    display: flex !important;
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.25rem;
}

.mobile-menu .mobile-menu-close:hover {
    background: var(--border-light);
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 48px 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-nav-menu li {
    margin: 0;
}

.mobile-nav-link,
.mobile-cta-link {
    display: block;
    padding: 14px 0;
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid var(--border-light);
}

.mobile-nav-link:hover,
.mobile-cta-link:hover {
    color: var(--primary);
}

.mobile-cta-link {
    margin-top: 8px;
    color: var(--primary);
    font-weight: 600;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Main Content */
.main-content {
    min-height: 100vh;
    background: var(--background);
    color: var(--text-main);
    padding-top: 80px; /* Account for fixed navbar */
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero-section {
    padding: 4rem 0;
    text-align: center;
    background: transparent;
}

.hero-title {
    font-family: 'Poppins', 'Inter', Arial, sans-serif;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 1.5rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Case Studies Section */
.case-studies-section {
    padding: 2rem 0 4rem 0;
}

/* Case Studies Grid */
.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    align-items: stretch;
}

/* Case Study Card - Clean Design Without Orange Borders */
.case-study-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    width: 100%;
    min-width: 0; /* allow shrink in grid so text truncation works */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 500px;
    overflow: hidden;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.case-study-card:hover {
    transform: translateY(-5px);
    border-color: var(--border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}



.case-study-card.coming-soon {
    opacity: 0.7;
    cursor: not-allowed;
}

.case-study-card.coming-soon:hover {
    transform: none;
    box-shadow: none;
}

/* Card Image - Consistent Aspect Ratio */
.card-image {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    background: var(--bg-alt);
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.case-study-card:hover .card-image img {
    transform: scale(1.05);
}

/* Card Content - Consistent Layout */
.card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
    justify-content: space-between;
}

.card-category {
    color: var(--brand-primary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1rem;
}

.card-title {
    color: var(--text-main);
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    text-align: left;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.55;
    margin-bottom: 1rem;
    text-align: left;
    flex: 1;
    font-weight: 400;
}

/* Orange Divider Line */
.card-divider {
    height: 3px;
    background: var(--brand-primary);
    margin: 0 0 1rem 0;
    border-radius: 2px;
    flex-shrink: 0;
    width: 100%;
}

/* Card Action - Orange Theme */
.card-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--brand-primary);
    font-weight: 500;
    font-size: 0.9rem;
    margin-top: auto;
    text-align: left;
}

.card-action i {
    transition: transform 0.3s ease;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-width: 0;
}

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



/* Responsive Design */
@media (max-width: 1200px) {
    .case-studies-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 1.5rem;
    }

    .case-study-card {
        padding: 1.5rem;
    }

    .hero-title {
        font-size: 3rem;
    }
}

@media (max-width: 1024px) {
    .case-studies-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 1.25rem;
        max-width: 100%;
    }

    .case-study-card {
        padding: 1.25rem;
        height: 450px;
    }
    
    .card-image {
        height: 150px;
        margin-bottom: 1.25rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding-top: 70px;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.25rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .case-studies-section {
        padding: 1.5rem 0 2.5rem 0;
    }

    /* Mobile: 1 card per row */
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
    }

    .case-study-card {
        padding: 1.25rem;
        height: auto;
        min-height: 0;
    }
    
    .card-image {
        height: 160px;
        margin-bottom: 1rem;
    }
    
    .card-category {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }
    
    .card-title {
        font-size: 1.1rem;
        font-weight: 700;
        line-height: 1.35;
        margin-bottom: 0.5rem;
        color: var(--text-main);
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        overflow: visible;
    }
    
    .card-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 0.75rem;
        color: var(--text-secondary);
        font-weight: 400;
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: unset;
        overflow: visible;
    }
    
    .card-divider {
        margin-bottom: 0.75rem;
    }
    
    .card-action {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .case-studies-section {
        padding: 1rem 0 1.5rem 0;
    }

    /* 1 card per row on small mobile */
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        max-width: 100%;
    }

    .case-study-card {
        padding: 1rem;
    }
    
    .card-image {
        height: 140px;
        margin-bottom: 0.75rem;
    }
    
    .card-category {
        font-size: 0.7rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-description {
        font-size: 0.875rem;
    }
    
    .card-action {
        font-size: 0.85rem;
    }
}

/* Very small mobile - 1 card per row */
@media (max-width: 360px) {
    .case-studies-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .case-study-card {
        padding: 0.875rem;
    }
    
    .card-image {
        height: 120px;
    }
    
    .card-title {
        font-size: 0.95rem;
    }
    
    .card-description {
        font-size: 0.8rem;
    }
}

/* Animation for cards appearing */
.case-study-card {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.case-study-card:nth-child(1) { animation-delay: 0.1s; }
.case-study-card:nth-child(2) { animation-delay: 0.2s; }
.case-study-card:nth-child(3) { animation-delay: 0.3s; }
.case-study-card:nth-child(4) { animation-delay: 0.4s; }
.case-study-card:nth-child(5) { animation-delay: 0.5s; }
.case-study-card:nth-child(6) { animation-delay: 0.6s; }
.case-study-card:nth-child(7) { animation-delay: 0.7s; }
.case-study-card:nth-child(8) { animation-delay: 0.8s; }
.case-study-card:nth-child(9) { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
