/* ============================================================
   Gallery Ad Overlay
   ============================================================
   Displays ads that slide up from the bottom of a gallery image.
   Used inside .swiper elements within .gallery-container.
   z-index 15: above slides (z:1), below controls (z:20).
   ============================================================ */

.gallery-ad-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    overflow: hidden;
}

.gallery-ad-overlay.gallery-ad-visible {
    transform: translateY(0);
    pointer-events: auto;
}

/* Content wrapper */
.gallery-ad-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
}

/* Image ads */
.gallery-ad-content img {
    display: block;
    width: 100%;
    height: auto;
}

/* Text ads */
.gallery-ad-text {
    padding: 12px 40px 12px 20px;
    text-align: center;
    width: 100%;
    font-size: clamp(12px, 2.5vw, 18px);
    line-height: 1.4;
}

/* HTML ads */
.gallery-ad-html {
    width: 100%;
}

/* Link */
.gallery-ad-overlay a.gallery-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
    width: 100%;
}

/* Close button */
.gallery-ad-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gallery-ad-close:hover {
    background: rgba(0, 0, 0, 0.85);
}

/* Hide ads in fullscreen mode */
.gallery-container.is-fullscreen .gallery-ad-overlay {
    display: none;
}

/* Responsive: smaller close button on mobile */
@media (max-width: 768px) {
    .gallery-ad-close {
        width: 22px;
        height: 22px;
        font-size: 13px;
        top: 2px;
        right: 4px;
    }

    .gallery-ad-text {
        padding: 8px 30px 8px 12px;
    }
}
