/*
 * Grid Layouts CSS - Replaces Carousel Functionality
 * This file provides consistent grid styling across the entire site
 * to replace all carousel/slideshow functionality
 */

/* ==========================================================================
   GLOBAL GRID STYLES
   ========================================================================== */

/* Project Images Grid Container */
.project-images-grid,
.project-gallery .project-images-grid {
    padding: 1rem 0;
    width: 100%;
}

/* Image Container Base Styles */
.image-container,
.gallery-project .image-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    background: #fff;
    margin-bottom: 1rem;
}

.image-container:hover,
.gallery-project .image-container:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

/* Project Grid Images */
.project-grid-image,
.project-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    border-radius: 0;
}

/* Featured Image Styles */
.featured-image .project-grid-image,
.featured-image .project-image,
.image-container.featured .project-image {
    height: 400px;
    max-height: 600px;
}

/* Image Hover Effects */
.image-container:hover .project-grid-image,
.image-container:hover .project-image {
    transform: scale(1.05);
}

/* Image Overlay Styles */
.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    color: white;
    padding: 1.5rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-container:hover .image-overlay {
    transform: translateY(0);
}

.image-caption,
.image-overlay .image-caption {
    margin: 0;
}

.image-caption p,
.image-overlay .image-caption p,
.image-overlay p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    color: white;
    font-weight: 500;
}

/* ==========================================================================
   GRID LAYOUT VARIATIONS
   ========================================================================== */

/* Default Grid Style */
.grid-style-default .image-container {
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

/* Modern Grid Style */
.grid-style-modern .image-container {
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.grid-style-modern .image-container:hover {
    box-shadow: 0 25px 60px rgba(0,0,0,0.2);
}

/* Minimal Grid Style */
.grid-style-minimal .image-container {
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.grid-style-minimal .image-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Masonry Grid Style */
.grid-style-masonry .image-container {
    break-inside: avoid;
    margin-bottom: 1.5rem;
}

.grid-style-masonry .project-images-grid {
    column-count: 2;
    column-gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-style-masonry .project-images-grid {
        column-count: 3;
    }
}

/* ==========================================================================
   RESPONSIVE GRID LAYOUTS
   ========================================================================== */

/* Mobile Responsive */
@media (max-width: 768px) {
    .project-grid-image,
    .project-image {
        height: 200px;
    }
    
    .featured-image .project-grid-image,
    .featured-image .project-image,
    .image-container.featured .project-image {
        height: 300px;
    }
    
    .image-overlay {
        padding: 1rem;
    }
    
    .image-caption p,
    .image-overlay p {
        font-size: 0.9rem;
    }
    
    .grid-style-masonry .project-images-grid {
        column-count: 1;
    }
}

/* Tablet Responsive */
@media (min-width: 769px) and (max-width: 1024px) {
    .project-grid-image,
    .project-image {
        height: 220px;
    }
    
    .featured-image .project-grid-image,
    .featured-image .project-image,
    .image-container.featured .project-image {
        height: 350px;
    }
    
    .grid-style-masonry .project-images-grid {
        column-count: 2;
    }
}

/* Desktop Large */
@media (min-width: 1200px) {
    .project-grid-image,
    .project-image {
        height: 280px;
    }
    
    .featured-image .project-grid-image,
    .featured-image .project-image,
    .image-container.featured .project-image {
        height: 500px;
    }
}

/* ==========================================================================
   WORDPRESS THEME SPECIFIC STYLES
   ========================================================================== */

/* Page Gallery Template */
.gallery-section .project-images-grid {
    margin-bottom: 2rem;
}

/* Single Portfolio Template */
.portfolio-single .project-images-grid {
    margin-bottom: 3rem;
}

.portfolio-single .featured-image-container {
    text-align: center;
    margin-bottom: 2rem;
}

/* Gallery Project Items */
.gallery-project {
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.gallery-project .project-images-grid {
    padding: 0;
}

/* ==========================================================================
   ANIMATION AND TRANSITIONS
   ========================================================================== */

/* Fade-in animation for images */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.image-container {
    animation: fadeInUp 0.6s ease-out;
}

.image-container:nth-child(2) {
    animation-delay: 0.1s;
}

.image-container:nth-child(3) {
    animation-delay: 0.2s;
}

.image-container:nth-child(4) {
    animation-delay: 0.3s;
}

/* Disable animations on mobile for performance */
@media (max-width: 768px) {
    .image-container {
        animation: none;
    }
}

/* ==========================================================================
   ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */

/* Focus states for accessibility */
.image-container:focus-within {
    outline: 2px solid #149ddd;
    outline-offset: 2px;
}

/* Reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
    .image-container,
    .project-grid-image,
    .project-image,
    .image-overlay {
        transition: none;
        animation: none;
    }
    
    .image-container:hover {
        transform: none;
    }
    
    .image-container:hover .project-grid-image,
    .image-container:hover .project-image {
        transform: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .image-container {
        border: 2px solid #000;
    }
    
    .image-overlay {
        background: rgba(0,0,0,0.9);
    }
}

/* ==========================================================================
   PRINT STYLES
   ========================================================================== */

@media print {
    .image-overlay {
        position: static;
        background: none;
        color: #000;
        transform: none;
        padding: 0.5rem 0;
    }
    
    .image-container {
        box-shadow: none;
        break-inside: avoid;
    }
}