/* ============================================================
 *  AD CONTAINER STYLES
 *  Blends with the matrix/cyberpunk design system.
 *  If no ad loads, the container collapses to zero height.
 * ============================================================ */

.ad-container {
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1.25rem 1rem 1rem;
    border: 1px solid rgba(0, 255, 65, 0.08);
    border-radius: 12px;
    background: rgba(0, 255, 65, 0.015);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* Subtle top accent line */
.ad-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 255, 65, 0.12), transparent);
}

/* "Sponsored" label — tiny, muted, non-intrusive */
.ad-container__label {
    font-family: var(--font-mono, 'Share Tech Mono', monospace);
    font-size: 0.625rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.2);
    text-align: center;
    margin-bottom: 0.5rem;
    user-select: none;
}

/* Inner wrapper for actual ad content */
.ad-container__inner {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 50px;
    width: 100%;
}

/* Make ad iframes/images responsive */
.ad-container__inner iframe,
.ad-container__inner img {
    max-width: 100%;
    height: auto;
}

/* ── Inside card grids: span full row ── */
.card-grid > .ad-container {
    grid-column: 1 / -1;
    margin: 0.5rem 0;
    max-width: none;
}

/* ── Hide containers where ad failed to load ── */
.ad-container.ad-container--empty {
    display: none !important;
    margin: 0;
    padding: 0;
    border: none;
}

/* ── Mobile adjustments ── */
@media (max-width: 768px) {
    .ad-container {
        margin: 1.5rem auto;
        padding: 1rem 0.75rem 0.75rem;
        border-radius: 8px;
    }
}

@media (max-width: 480px) {
    .ad-container {
        margin: 1rem auto;
        padding: 0.75rem 0.5rem 0.5rem;
    }

    .ad-container__label {
        font-size: 0.5625rem;
    }
}
