/* ==========================================================================
   Ad Slots Component
   ========================================================================== */

.iise-ad-container {
    width: 100%;
    overflow: hidden;
}

/* Leaderboard layout — centered, full width */
.iise-ad-layout-leaderboard {
    text-align: center;
}

.iise-ad-layout-leaderboard .iise-ad-slot {
    display: inline-block;
}

/* Sidebar layout */
.iise-ad-layout-sidebar .iise-ad-slot {
    margin-bottom: 1.5rem;
}

/* Grid layout */
.iise-ad-layout-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    justify-content: center;
}

.iise-ad-layout-grid .iise-ad-slot {
    flex: 0 0 auto;
}

/* In-content layout — centered block */
.iise-ad-layout-inline {
    text-align: center;
    margin: 1.5rem 0;
}

.iise-ad-layout-inline .iise-ad-slot {
    display: inline-block;
}

/* The annual conference seams emit layoutStyle values named after the ad
   product ("in-content", "billboard", "footer", "hero-cobrand"); give each a
   concrete centered treatment so the container classes aren't unstyled. */
.iise-ad-layout-in-content {
    text-align: center;
    margin: 1.5rem 0;
}

.iise-ad-layout-in-content .iise-ad-slot {
    display: inline-block;
}

.iise-ad-layout-billboard,
.iise-ad-layout-footer {
    text-align: center;
}

.iise-ad-layout-billboard .iise-ad-slot,
.iise-ad-layout-footer .iise-ad-slot {
    display: inline-block;
}

/* Hero co-brand — centered fluid pill/strip */
.iise-ad-layout-hero-cobrand {
    display: flex;
    justify-content: center;
}

.iise-ad-layout-hero-cobrand .iise-ad-slot {
    max-width: 100%;
}

/* Recirculation row — 4-up "Sponsored Recommendations" strip */
.iise-ad-layout-recirculation-row {
    --row-cells: repeat(4, minmax(0, 1fr));
    display: grid;
    grid-template-columns: var(--row-cells);
    gap: 1.25rem;
    padding: 1.5rem 0;
}

.iise-ad-layout-recirculation-row .iise-ad-row__label {
    grid-column: 1 / -1;
    font-size: 0.875rem;
    line-height: 1;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #666;
    margin-bottom: 0.5rem;
}

.iise-ad-layout-recirculation-row .iise-ad-row__cell {
    min-height: 200px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 0.5rem;
    overflow: hidden;
}

.iise-ad-layout-recirculation-row .iise-ad-row__cell .iise-ad-slot {
    width: 100%;
    height: 100%;
    display: block;
}

@media (max-width: 1024px) {
    .iise-ad-layout-recirculation-row {
        --row-cells: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .iise-ad-layout-recirculation-row {
        --row-cells: 1fr;
    }
}

/* Sticky-sidebar layout pattern — consumed by templates that want a per-section
   sticky ad slot (e.g., the conference schedule day cards). The slot itself is
   unaware; the wrapping template provides the .has-ad-sidebar 2-col grid. */
.has-ad-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.has-ad-sidebar .has-ad-sidebar__ad .iise-ad-slot {
    position: sticky;
    top: 110px;
    align-self: start;
}

@media (max-width: 1024px) {
    .has-ad-sidebar {
        grid-template-columns: 1fr;
    }
}

/* Reserve layout space for billboard / half-page slots while they render. GPT
   size mapping in iise-ads.js controls actual responsive behavior; CSS does
   not enforce viewport-based hiding. */
.iise-ad-slot[data-ad-size~="970x250"] {
    min-height: 250px;
}

.iise-ad-slot[data-ad-size~="300x600"] {
    min-height: 600px;
}

/* ==========================================================================
   Ad Slot States
   ========================================================================== */

.iise-ad-slot {
    min-height: 0;
    transition: min-height 0.3s;
}

.iise-ad-empty {
    display: none !important;
}

.iise-ad-loaded {
    min-height: auto;
}

/* ==========================================================================
   Sticky Ad Support
   ========================================================================== */

.iise-ad-sticky {
    position: sticky;
    top: 1rem;
    z-index: 10;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 767px) {
    .iise-ad-layout-leaderboard .iise-ad-slot,
    .iise-ad-layout-inline .iise-ad-slot,
    .iise-ad-layout-in-content .iise-ad-slot,
    .iise-ad-layout-billboard .iise-ad-slot,
    .iise-ad-layout-footer .iise-ad-slot {
        max-width: 100%;
        overflow-x: auto;
    }
}

/* ==========================================================================
   Pre-Roll Video Ad Overlay
   ========================================================================== */

/* Lazyframe is already position:relative and gets its 16:9 height from
   `.lazyframe[data-ratio="16:9"]:before { padding-top: 56.25% }` in misc_lazyframe-video.css.
   We add overflow:hidden to clip the poster <img> — uSkinned sizes it 4:3 (1152×864)
   and pulls it up with translateY(-50%), so it overhangs the 16:9 box by 108px top/bottom.
   Without clipping, hardware-compositing at fractional device-pixel offsets produces a 1px
   aliasing line on top/right at some viewports. */
.lazyframe-video[data-preroll="true"] {
    overflow: hidden;
}

/* Pre-roll overlay — absolutely positioned to fill the (now aspect-locked) lazyframe container */
.iise-preroll-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    background: #000;
    overflow: hidden;
}


/* IMA's injected video element fills the overlay so the linear creative is visible.
   Excludes the placeholder video we pass to AdDisplayContainer — see .iise-preroll-slot-video below.
   Note: do NOT blanket-size iframes — IMA injects OMID viewability iframes (about:blank)
   that must stay hidden. Sizing them to 100% covers the creative with opaque black. */
.iise-preroll-overlay video:not(.iise-preroll-slot-video) {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Placeholder <video> we pass to google.ima.AdDisplayContainer. IMA injects its own
   video for the actual creative, so this one must stay hidden; otherwise its default
   black rendering box paints over the ad. */
.iise-preroll-slot-video {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Override uSkinned's .lazyframe iframe { background-color: black } rule for IMA's
   UI/bridge iframes — they must be transparent so the ad video plays visibly underneath. */
.iise-preroll-overlay iframe {
    background-color: transparent !important;
}
