/* Gallery page title styling - reduced bottom margin */
.gallery-section .page-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    text-align: center;
    margin: 0 0 8px 0;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

/* Gallery page subtitle styling - smaller, lighter color */
.gallery-section .page-subtitle {
    font-size: 1rem;
    color: #999999;
    text-align: center;
    margin: 0 0 8px 0;
    font-weight: 300;
    line-height: 1.4;
}

/* Gallery header container - minimal spacing */
.gallery-header {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 8px 20px;
}

/* Professional Gallery Design - ZERO SPACES EVERYWHERE */
.gallery-section {
    padding: 0 !important;
    margin: 0;
    background: transparent;
    overflow-x: hidden;
    min-height: auto !important;
}

/* Remove any container padding that creates side gaps */
.gallery-section .container,
.gallery-section > .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
}

.gallery-container {
    columns: 4;
    column-gap: 0 !important;
    column-fill: balance;
    margin: 0 auto !important;
    padding: 0 !important;
    line-height: 0;
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    border: none !important;
    outline: none !important;
    font-size: 0 !important;
    letter-spacing: 0 !important;
    word-spacing: 0 !important;
}

.gallery-section img,
.gallery-container img,
.gallery-item {
    width: 100%;
    height: auto;
    max-height: 400px;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    transition: transform 0.3s ease;
    cursor: pointer;
    object-fit: cover;
    break-inside: avoid;
    outline: none !important;
    font-size: initial !important;
}

.gallery-section img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10;
    position: relative;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .gallery-container {
        columns: 3;
        column-gap: 0 !important;
    }
    
    .gallery-section img {
        max-height: 350px;
    }
}

@media screen and (max-width: 768px) {
    .gallery-section {
        padding: 0 !important;
        overflow-x: hidden;
        min-height: auto !important;
    }
    
    .gallery-header {
        padding: 15px 20px 8px 20px;
    }
    
    .gallery-section .page-title {
        font-size: 2rem;
        margin: 0 0 8px 0;
    }
    
    .gallery-section .page-subtitle {
        font-size: 0.9rem;
        margin: 0 0 8px 0;
    }
    
    .gallery-container {
        columns: 2;
        column-gap: 0 !important;
        padding: 0 !important;
        margin: 0 auto !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        line-height: 0;
    }
    
    .gallery-section img,
    .gallery-container img {
        border: 0 !important;
        border-radius: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-height: 300px;
        display: block !important;
        box-shadow: none !important;
        background: transparent !important;
    }
}

@media screen and (max-width: 480px) {
    .gallery-section {
        padding: 0 !important;
        overflow-x: hidden;
        min-height: auto !important;
    }
    
    .gallery-header {
        padding: 10px 15px 8px 15px;
    }
    
    .gallery-container {
        columns: 1;
        column-gap: 0 !important;
        margin: 0 auto !important;
        padding: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw !important;
        margin-right: -50vw !important;
        line-height: 0;
    }
    
    .gallery-section img,
    .gallery-container img {
        max-height: 250px;
    }
    
    .gallery-section .page-title {
        font-size: 1.75rem;
        margin: 0 0 8px 0;
    }
    
    .gallery-section .page-subtitle {
        font-size: 0.85rem;
        margin: 0 0 8px 0;
    }
}

/* Animation for images loading */
@media (prefers-reduced-motion: no-preference) {
    .gallery-section img {
        /* Animation disabled to fix flickering */
        opacity: 1 !important;
        transform: none !important;
        animation: none !important;
    }
    
    .gallery-section img:nth-child(1) { animation-delay: 0.1s; }
    .gallery-section img:nth-child(2) { animation-delay: 0.2s; }
    .gallery-section img:nth-child(3) { animation-delay: 0.3s; }
    .gallery-section img:nth-child(4) { animation-delay: 0.4s; }
    .gallery-section img:nth-child(5) { animation-delay: 0.5s; }
    .gallery-section img:nth-child(6) { animation-delay: 0.6s; }
    .gallery-section img:nth-child(7) { animation-delay: 0.7s; }
    .gallery-section img:nth-child(8) { animation-delay: 0.8s; }
    .gallery-section img:nth-child(9) { animation-delay: 0.9s; }
    .gallery-section img:nth-child(10) { animation-delay: 1.0s; }
    
    /* fadeInUp animation disabled */
}

/* Force remove any body/html margins that could create black spaces */
body.gallery {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Ensure main content has no spacing */
body.gallery main {
    margin: 0 !important;
    padding: 0 !important;
}

/* Remove any default spacing from gallery section container */
.gallery-section * {
    box-sizing: border-box !important;
}

/* Ensure no whitespace between images */
.gallery-container img + img {
    margin-top: 0 !important;
    margin-left: 0 !important;
}

/* Force grid items to have no spacing */
.gallery-container > * {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
}

/* Additional mobile touch improvements */
@media (max-width: 768px) {
    .gallery-section img {
        touch-action: manipulation;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        -khtml-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }
    
    .gallery-section img:hover {
        transform: scale(1.01);
        transition: transform 0.2s ease;
    }
}

/* Additional fixes for perfect edge-to-edge display */
.gallery-item,
.gallery-container > * {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    outline: none !important;
}

/* FINAL OVERRIDE - Force zero spacing everywhere */
body.gallery * {
    box-sizing: border-box !important;
}

/* Override any theme.css spacing for gallery page */
body.gallery section {
    padding: 0 !important;
    margin: 0 !important;
}

body.gallery .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

/* Ensure gallery section takes full width with no margins */
body.gallery .gallery-section {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: auto !important;
}

/* Force gallery container to be edge-to-edge */
body.gallery .gallery-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
}

/* Remove any inherited spacing from images */
body.gallery img {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    outline: none !important;
    vertical-align: top !important;
}

/* Ensure no gaps between grid items */
body.gallery .gallery-container > img {
    display: block !important;
    float: none !important;
    clear: none !important;
}/* =
=======================================
   MOBILE GALLERY FIXES - URGENT
   ======================================== */

@media screen and (max-width: 768px) {
  /* Remove full-bleed on mobile to prevent horizontal scroll */
  .gallery-container,
  body.gallery .gallery-container {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 0 16px !important;
    position: static !important;
    left: auto !important;
    right: auto !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .gallery-container img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: cover !important;
    border-radius: 8px !important;
    margin-bottom: 8px !important;
  }

  /* Ensure gallery section doesn't overflow */
  .gallery-section {
    overflow-x: hidden !important;
    padding: 40px 0 !important;
  }

  .gallery-section .container {
    padding: 0 16px !important;
    max-width: 100% !important;
  }
}