/* Projects Page Specific Styles */

/* Project Gallery Grid */
.gallery {
    padding: 4rem 0;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.project-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-link:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.project-card {
    background: var(--bg);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 0;
    margin: 0;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: inherit;
}

.page-hero-image {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
}

.page-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 75%;
}

/* Force horizontal/landscape aspect ratio for all project images */

.project-image {
    width: 100%;
    height: 340px;
    overflow: hidden;
    background: #f0f0f0;
    position: relative;
    border-radius: 16px 16px 0 0;
    cursor: zoom-in;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
}

/* Fallback for old structure without .project-image wrapper */
.project-card img {
    width: 100%;
    height: 340px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
    display: block;
}

.project-meta {
    padding: 1.5rem;
}

.project-meta strong {
    display: block;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.project-meta small {
    color: var(--muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

/* CTA Inline */
.cta-inline {
    padding: 2rem 0 4rem;
    text-align: center;
}

.cta-inline p {
    margin: 0;
    font-size: 1.125rem;
    color: var(--muted);
    background: transparent;
}

.cta-inline .btn.primary {
    margin-top: 1.5rem;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: lightboxZoom 0.3s ease;
}

@keyframes lightboxZoom {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    width: auto;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: -50px;
    right: 0;
    background: transparent;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    line-height: 1;
}

.lightbox-close:hover {
    transform: scale(1.1);
}

.lightbox-caption {
    position: absolute;
    bottom: -60px;
    left: 0;
    right: 0;
    color: white;
    text-align: center;
    font-size: 1.125rem;
    font-weight: 600;
}

.lightbox-caption small {
    display: block;
    font-size: 0.875rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.25rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .project-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .project-image,
    .project-card img {
        height: 320px;
    }
}

@media (max-width: 768px) {
    .project-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .project-image,
    .project-card img {
        height: 380px;
    }
    
    .project-meta {
        padding: 1.25rem;
    }
    
    .project-meta strong {
        font-size: 1rem;
    }
    
    .cta-inline {
        padding: 1.5rem 0 3rem;
    }
    
    .cta-inline p {
        font-size: 1rem;
    }
    
    .lightbox-content {
        max-width: 95%;
        max-height: 85%;
    }
    
    .lightbox-close {
        top: -45px;
        font-size: 36px;
    }
    
    .lightbox-caption {
        font-size: 1rem;
        bottom: -50px;
    }
}

@media (max-width: 390px) {
    .gallery {
        padding: 3rem 0;
    }
    
    .project-image,
    .project-card img {
        height: 320px;
    }
    
    .project-meta {
        padding: 1rem;
    }
    
    .project-meta strong {
        font-size: 0.95rem;
    }
    
    .project-meta small {
        font-size: 0.8rem;
    }
}

/* Focus styles for accessibility */
.project-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 4px;
}