/* Force full width inside Elementor */
.elementor-widget-shortcode,
.elementor-widget-shortcode .elementor-widget-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Grid */
.gl-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--gl-columns, 4), 1fr) !important;
    gap: 4px;
    width: 100%;
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .gl-grid {
        grid-template-columns: 1fr !important;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .gl-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* 
 * The padding-bottom trick forces a true square
 * regardless of what Elementor does to aspect-ratio.
 * The inner .gl-inner is the actual positioned container.
 */
.gl-item {
    position: relative !important;
    width: 100% !important;
    padding-bottom: var(--gl-ratio-pad, 100%) !important;
    /* 100% = 1:1 square */
    overflow: hidden !important;
    background: #111;
    cursor: pointer;
    display: block !important;
}

/* The real container sits absolutely inside the padding box */
.gl-inner {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    overflow: hidden;
}

/* Image fills the inner container completely */
.gl-inner img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    transition: opacity 0.3s ease;
}

.gl-item:hover .gl-inner img {
    opacity: 0.55;
}

/* Overlay — invisible by default, centered on hover */
.gl-overlay {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 2;
    background: transparent;
}

.gl-item:hover .gl-overlay {
    opacity: 1;
}

/* Touch — always visible at low opacity */
@media (hover: none) {
    .gl-overlay {
        opacity: 1;
    }
}

/* Like button — NO background, NO border, just icon + number */
.gl-btn {
    all: unset !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 4px !important;
    cursor: pointer !important;
    pointer-events: all !important;
    color: #fff !important;
    transition: transform 0.15s ease !important;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.7));
}

.gl-btn:hover {
    transform: scale(1.2) !important;
}

.gl-btn:disabled {
    opacity: 0.5 !important;
    cursor: default !important;
}

/* Heart icon */
.gl-heart {
    font-size: 26px;
    line-height: 1;
    display: block;
}

/* Count number */
.gl-count {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #fff !important;
    letter-spacing: 0.5px;
    line-height: 1;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* =====================
   LIGHTBOX
   ===================== */
.gl-lightbox {
    display: none;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.95);
    z-index: 999999 !important;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.gl-lightbox.open {
    display: flex !important;
}

.gl-lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    display: block !important;
    position: relative !important;
    width: auto !important;
    height: auto !important;
}

@media (max-width: 480px) {
    .gl-lightbox-img {
        max-width: 100vw;
        max-height: 75vh;
        border-radius: 0;
    }
}

.gl-lightbox-nav {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 28px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 1000000;
}

.gl-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 480px) {
    .gl-lightbox-nav {
        width: 38px;
        height: 38px;
        font-size: 20px;
    }
}

.gl-prev {
    left: 16px !important;
}

.gl-next {
    right: 16px !important;
}

.gl-close {
    position: absolute !important;
    top: 16px !important;
    right: 20px !important;
    background: transparent !important;
    border: none !important;
    color: #fff !important;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    z-index: 1000001;
}

.gl-close:hover {
    opacity: 1;
}

.gl-lightbox-bar {
    margin-top: 20px;
    display: flex;
    align-items: center;
    z-index: 1000000;
    position: relative;
}

/* Lightbox like — same style, slightly bigger */
.gl-lightbox-like {
    all: unset !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    cursor: pointer !important;
    color: #fff !important;
    filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.7));
    font-size: 26px;
    transition: transform 0.15s ease;
}

.gl-lightbox-like:hover {
    transform: scale(1.15);
}

.gl-lightbox-count {
    font-size: 16px;
    font-weight: 700;
    color: #fff !important;
}