/* Index page specific styles */

/* Hero Section - FIXED IMAGE DISPLAY */
.hero {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: #0a0a0a;
}

/* Use the img element for better reliability */
.hero-background-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    z-index: 1;
    content: url('images/CP.jpeg');
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(10, 10, 10, 0.5) 0%, rgba(26, 26, 26, 0.5) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    padding: 0 40px;
}

/* Gallery Section */
.gallery-section {
    padding: 100px 40px;
    max-width: 1400px;
    margin: 0 auto;
}

/* Featured Work Section */
.featured-section {
    margin-bottom: 100px;
}

.featured-title {
    text-align: center;
    font-size: 32px;
    font-weight: 100;
    letter-spacing: 2px;
    margin-bottom: 60px;
    background: linear-gradient(45deg, #ffffff, #888888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-bottom: 40px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    aspect-ratio: 4/3;
    border-radius: 8px;
    background: transparent;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    opacity: 0;
    transform: translateY(50px);
    /* Better performance for mobile */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    padding: 10px;
    /* ADDED: Gives images breathing room */
}

.gallery-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item img {
    max-width: 90%;
    /* CHANGED: From 100% to 90% to show more of the image */
    max-height: 90%;
    /* CHANGED: From 100% to 90% to show more of the image */
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    /* Better image quality on mobile */
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover::after {
    opacity: 1;
}

/* Add shimmer animation for loading placeholders */
@keyframes shimmer {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* Controls */
.gallery-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
}

.control-btn {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    letter-spacing: 1px;
    font-weight: 300;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.control-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Tablet styles */
@media (max-width: 1199px) and (min-width: 769px) {
    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .gallery-section {
        padding: 80px 30px;
    }
}

/* Mobile styles - KEEP IMG ELEMENT VISIBLE */
@media (max-width: 768px) {
    .hero {
        height: 100vh;
        min-height: 100vh;
        min-height: -webkit-fill-available;
    }

    /* Switch to mobile image */
    .hero-background-image {
        content: url('images/con2.jpg');
        display: block;
    }

    /* Adjust hero content for mobile */
    .hero-content {
        z-index: 3;
        /* Ensure it's above the image */
        max-width: 90%;
        padding: 0 20px;
        text-align: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
        letter-spacing: 2px;
        margin-bottom: 15px;
    }

    .hero-content p {
        font-size: 16px;
        letter-spacing: 1px;
        margin-bottom: 30px;
    }

    .gallery-section {
        padding: 60px 20px;
    }

    .featured-section {
        margin-bottom: 60px;
    }

    /* Make featured grid single column on mobile for better image quality */
    .featured-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
        margin: 0 auto 40px auto;
    }

    /* Ensure gallery items maintain aspect ratio */
    .gallery-item {
        aspect-ratio: unset;
        /* Remove fixed aspect ratio on mobile */
        min-height: 250px;
        /* Set minimum height instead */
        max-height: 400px;
        /* Allow more height for portraits */
        padding: 10px;
        height: auto;
        /* Let height adjust to content */
    }

    .gallery-item img {
        max-width: 95%;
        max-height: 95%;
        width: auto;
        height: auto;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .featured-title {
        font-size: 26px;
        margin-bottom: 40px;
    }

    .gallery-controls {
        flex-direction: row;
        /* Keep horizontal on mobile */
        justify-content: center;
        gap: 15px;
        flex-wrap: wrap;
    }

    .control-btn {
        min-width: 80px;
        padding: 10px 20px;
        text-align: center;
        font-size: 14px;
    }
}

/* Very small mobile devices */
@media (max-width: 480px) {
    .hero-background-image {
        content: url('images/con2.jpg');
        object-position: center center;
    }

    .hero-content h1 {
        font-size: 2rem;
        letter-spacing: 1px;
    }

    .hero-content p {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .gallery-section {
        padding: 40px 15px;
    }

    .featured-title {
        font-size: 24px;
        letter-spacing: 1px;
    }

    .gallery-item {
        aspect-ratio: unset;
        /* Remove fixed aspect ratio on very small screens too */
        min-height: 200px;
        max-height: 350px;
        padding: 15px;
        height: auto;
    }

    .gallery-item img {
        max-width: 90%;
        max-height: 90%;
        width: auto;
        height: auto;
    }

    /* Ensure featured grid works well on very small screens */
    .featured-grid {
        max-width: 300px;
    }
}

/* Landscape orientation on mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        height: 100vh;
        min-height: 100vh;
    }

    .hero-background-image {
        content: url('images/con2.jpg');
        object-position: center center;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
        /* Force GPU acceleration for smoother performance */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .gallery-item {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }

    .gallery-item img {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Improve touch interactions */
@media (hover: none) and (pointer: coarse) {
    .hero {
        /* Ensure touch interactions work smoothly */
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .gallery-item:active {
        transform: scale(0.98);
    }

    .control-btn:active {
        transform: translateY(0);
        background: rgba(255, 255, 255, 0.2);
    }
}