/* MLW Ad Manager — Frontend Ad Styles */

.mlw-ad-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin: 0 0 16px;
}

/* ── Card base ── */
.mlw-ad-card {
    display: inline-block;
    max-width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.mlw-ad-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-1px);
}

/* ── Link ── */
.mlw-ad-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.mlw-ad-link img {
    display: block;
    max-width: 100%;
    height: auto;
    border-bottom: 1px solid #e5e7eb;
}
/* Images without explicit dimensions: fill card width */
.mlw-ad-link img:not([width]) {
    width: 100%;
}

/* ── Title ── */
.mlw-ad-title {
    display: block;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: center;
}

/* ── Lazy loading placeholder ── */
.mlw-ad-card img.mlw-lazy {
    min-height: 100px;
    background: #f3f4f6;
    animation: mlw-pulse 1.5s ease-in-out infinite;
}

@keyframes mlw-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.6; }
}

/* ── HTML5 container ── */
.mlw-html5-container {
    padding: 0;
    overflow: hidden;
}
.mlw-html5-container iframe {
    width: 100%;
    border: none;
}

/* ── Video container ── */
.mlw-video-container {
    position: relative;
    width: 100%;
}
.mlw-video-container iframe,
.mlw-video-container video {
    display: block;
    width: 100%;
}

/* ── Video lazy placeholder ── */
.mlw-video-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    background: #1f2937;
    cursor: pointer;
    aspect-ratio: 16 / 9;
}
.mlw-play-icon {
    font-size: 48px;
    color: #fff;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.mlw-video-placeholder:hover .mlw-play-icon {
    opacity: 1;
}

/* ── Desktop / Mobile image toggle ── */
.mlw-mobile-img {
    display: none !important;
}
.mlw-desktop-img {
    display: block;
}

/* ── Injected ad in content ── */
.mlw-injected-ad {
    margin: 24px 0;
    clear: both;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .mlw-ad-group {
        gap: 12px;
    }
    .mlw-ad-card {
        border-radius: 6px;
    }
    /* Swap desktop/mobile images */
    .mlw-desktop-img {
        display: none !important;
    }
    .mlw-mobile-img {
        display: block !important;
    }
}
