/* ============================================================
   GALLERY — Outer Wrapper Width
============================================================ */
#gallery {
    max-width: 90vw !important;
    margin: 0 auto;
    padding-bottom: 2rem;
}

/* ============================================================
   THUMBNAILS — Fit, Shape, Pop Animation
============================================================ */
.gallery-grid img {
    width: 100%;
    height: 15rem;                  /* consistent thumbnail height */
    object-fit: cover;
    object-position: center;

    border-radius: 0.625rem;        /* 10px */

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease,
        opacity 0.4s ease;

    opacity: 0;                     /* fade-in default */
}

.gallery-grid img.loaded {
    opacity: 1;
}

.gallery-grid img:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}


/* ============================================================
   REMOVE DEFAULT GLIGHTBOX WHITE PANEL
============================================================ */
.glightbox-clean .gslide-description {
    background: transparent !important;
}


/* ============================================================
   FROSTED FLOATING CAPTION
============================================================ */
.gslide-description {
    position: absolute !important;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    width: auto !important;
    max-width: 80%;
    text-align: center;
    pointer-events: none;
}

.gdesc-inner {
    background: rgba(40, 40, 40, 0.35) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;

    padding: 0.625rem 1rem !important;   /* 10px 16px */
    border-radius: 0.875rem !important;  /* 14px */

    color: #fff !important;
    font-size: 0.95rem;
    line-height: 1.4;

    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
    display: inline-block !important;
    pointer-events: none;
}

.gdesc-inner::before {
    display: none !important;
}

.gslide-title,
.gslide-desc,
.gdesc-inner * {
    color: #fff !important;
}

/* ============================================================
   GALLERY GRID LAYOUT — FINAL, CLEAN VERSION
   Desktop = 3 columns
   Tablet = 2 columns
   Mobile Portrait = 1 column
   Mobile Landscape = 2 columns
============================================================ */

/* Desktop (default): 3 columns */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    width: 100%;
}

/* Tablet (768–1024px): 2 columns */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Portrait (≤ 767px): 1 column */
@media screen and (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Landscape: 2 columns */
@media screen and (max-width: 767px) and (max-height: 500px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ============================================================
   MATCH ARTICLE SPACING — MOBILE & TABLET
============================================================ */

/* Mobile spacing */
@media screen and (max-width: 767px) {
    #gallery {
        width: 98% !important;
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        margin: 0 auto !important;
    }
}

/* Tablet spacing */
@media screen and (min-width: 768px) and (max-width: 1024px) {
    #gallery {
        padding-left: 2rem !important;
        padding-right: 2rem !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }
}

