/**
 * AI Frontend Editor — Public Content Styles
 *
 * Loaded for ALL visitors (not just editors).
 * Styles content structures created by the frontend editor
 * (block inserts, sliders, video embeds) so they render correctly.
 *
 * Keep this file MINIMAL — only what's needed for saved content.
 */

/* ─── Block Insert: Video ─── */
.aife-bi-block .aife-bi-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
}

.aife-bi-block .aife-bi-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ─── Block Insert: Image ─── */
.aife-bi-block img {
    max-width: 100%;
    height: auto;
}

/* ─── Slider (section-add) ─── */
.aife-sb-slider {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.aife-sb-slide {
    display: none;
}

.aife-sb-slide--active {
    display: block;
}

.aife-sb-slider-prev,
.aife-sb-slider-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(22, 22, 63, 0.85);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: background 0.15s ease, transform 0.15s ease;
}

.aife-sb-slider-prev { left: 10px; }
.aife-sb-slider-next { right: 10px; }

.aife-sb-slider-prev:hover,
.aife-sb-slider-next:hover {
    background: #e8960c;
    transform: translateY(-50%) scale(1.1);
}

.aife-sb-slider-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 4px;
}

.aife-sb-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.aife-sb-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.aife-sb-dot--active {
    background: #e8960c;
    transform: scale(1.2);
}

/* ─── Slider images ─── */
.aife-sb-slide img {
    width: 100%;
    height: auto;
    display: block;
}

/* ─── Section Builder rows (section-add): grid recovery ───
   When a customer saves a 2+ column layout, the structural .aife-sb-row class
   is stripped on save (only the inline grid-template-columns survives), AND the
   editor-only section-builder CSS is never loaded for visitors. Without
   display:grid the columns collapse to full-width stacked blocks and any
   image (width:100%) blows up to the full container width.
   Recover the grid here for ALL visitors. Scoped to added sections
   (.section-pad) so it cannot leak into the theme's own grids. */
.section-pad [style*="grid-template-columns"] {
    display: grid;
    gap: 2rem;
    align-items: center;
}
.section-pad [style*="grid-template-columns"] > * {
    min-width: 0; /* let long text / wide images shrink instead of forcing column blowout */
}
.section-pad [style*="grid-template-columns"] img {
    max-width: 100%;
    height: auto;
}
@media (max-width: 768px) {
    .section-pad [style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}
