/* L&B Tools - Auto Gallery / Premium editorial skin */
.lb-auto-gallery {
    --lb-gallery-radius: 18px;
    --lb-gallery-gap: 10px;
    width: 100%;
    clear: both;
    margin: 36px 0 44px;
    padding: 5px;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .055);
    border-radius: 16px;
    box-shadow:
        0 26px 70px rgba(15, 23, 42, .075),
        0 8px 24px rgba(15, 23, 42, .04),
        0 1px 2px rgba(15, 23, 42, .025);
}

.lb-auto-gallery *,
.lb-gallery-modal * { box-sizing: border-box; }

.lb-auto-gallery-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 0;
    overflow: hidden;
    border-radius: var(--lb-gallery-radius);
    background: #fff;
    isolation: isolate;
}

.lb-auto-gallery-main-button {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    padding: 3px;
    margin: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
    appearance: none;
}

/* Theme-proof reset: many legacy L&B/theme button:hover rules add a gray overlay. */
body .lb-auto-gallery button.lb-auto-gallery-main-button,
body .lb-auto-gallery button.lb-auto-gallery-main-button:hover,
body .lb-auto-gallery button.lb-auto-gallery-main-button:focus,
body .lb-auto-gallery button.lb-auto-gallery-main-button:focus-visible,
body .lb-auto-gallery button.lb-auto-gallery-main-button:active {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    box-shadow: none !important;
    filter: none !important;
    opacity: 1 !important;
    color: inherit !important;
}

/* Keep keyboard focus visible without tinting the image area. */
body .lb-auto-gallery button.lb-auto-gallery-main-button:focus-visible {
    outline: 2px solid rgba(17,17,17,.35) !important;
    outline-offset: -4px;
}

.lb-auto-gallery-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 11px;
    user-select: none;
    -webkit-user-drag: none;
    opacity: 1;
    transform: scale(1);
    transition: opacity .32s ease, transform .38s cubic-bezier(.2,.7,.2,1);
    will-change: opacity, transform;
}

.lb-auto-gallery-main-image.is-fading {
    opacity: 0;
    transform: scale(.992);
}

.lb-auto-gallery-caption {
    position: absolute;
    z-index: 3;
    left: 15px;
    bottom: 14px;
    width: fit-content;
    max-width: min(72%, 760px);
    padding: 9px 13px;
    border: 1px solid rgba(255, 255, 255, .82);
    border-radius: 9px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: blur(12px) saturate(130%);
    backdrop-filter: blur(12px) saturate(130%);
    color: #151515;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
    font-size: 12.5px;
    line-height: 1.4;
    letter-spacing: .005em;
    pointer-events: none;
}
.lb-auto-gallery-caption:empty { display: none; }

.lb-auto-gallery-nav {
    position: absolute;
    z-index: 4;
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(12px) saturate(135%);
    backdrop-filter: blur(12px) saturate(135%);
    color: #111;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .1);
    cursor: pointer;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}
body .lb-auto-gallery button.lb-auto-gallery-nav:hover,
body .lb-auto-gallery button.lb-auto-gallery-nav:focus,
body .lb-auto-gallery button.lb-auto-gallery-nav:active {
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #111 !important;
    filter: none !important;
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.025);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .13);
}
.lb-auto-gallery-nav {
    font-size: 0;
}
.lb-auto-gallery-nav::before {
    content: '';
    display: block;
    position: relative;
    top: -1.5px;
    width: 9px;
    height: 9px;
    border-top: 1.8px solid currentColor;
    border-left: 1.8px solid currentColor;
    transform-origin: 50% 50%;
}
.lb-auto-gallery-prev::before { transform: rotate(-45deg); margin-left: 3px; }
.lb-auto-gallery-next::before { transform: rotate(135deg); margin-right: 3px; }
.lb-auto-gallery-prev { left: 12px; }
.lb-auto-gallery-next { right: 12px; }

.lb-auto-gallery-counter {
    position: absolute;
    z-index: 4;
    top: 14px;
    right: 14px;
    min-width: 44px;
    padding: 7px 11px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    background: rgba(17, 17, 17, .78);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .055em;
    text-align: center;
    pointer-events: none;
}

.lb-auto-gallery-thumbs-wrap {
    position: relative;
    margin-top: 7px;
    padding: 2px 1px 0;
    background: #fff;
}
.lb-auto-gallery-thumbs {
    display: flex;
    gap: var(--lb-gallery-gap);
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 2px 5px;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.lb-auto-gallery-thumbs::-webkit-scrollbar { display: none; }

.lb-auto-gallery-thumb {
    flex: 0 0 104px;
    width: 104px;
    height: 70px;
    padding: 3px;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 9px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    opacity: .62;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .035);
    transition: opacity .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.lb-auto-gallery-thumb:hover {
    opacity: .9;
    transform: translateY(-1px);
    border-color: rgba(15, 23, 42, .18);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .07);
}
.lb-auto-gallery-thumb.is-active {
    opacity: 1;
    border-color: #181818;
    box-shadow: 0 0 0 1px #181818, 0 7px 20px rgba(15, 23, 42, .075);
}
.lb-auto-gallery-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 5px;
    object-fit: cover;
}

/* Modal */
html.lb-gallery-modal-open,
body.lb-gallery-modal-open { overflow: hidden !important; }

.lb-gallery-modal {
    position: fixed;
    z-index: 2147483000;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background: rgba(9, 10, 11, .965);
    color: #fff;
}
.lb-gallery-modal.is-open { display: flex; }
.lb-gallery-modal-dialog {
    position: relative;
    width: min(96vw, 1680px);
    height: min(92vh, 1120px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.lb-gallery-modal-image {
    display: block;
    max-width: calc(100% - 110px);
    max-height: calc(100% - 36px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    opacity: 1;
    transform: scale(1);
    transition: opacity .28s ease, transform .32s cubic-bezier(.2,.7,.2,1);
    will-change: opacity, transform;
}
.lb-gallery-modal-image.is-fading {
    opacity: 0;
    transform: scale(.992);
}
.lb-gallery-modal-caption {
    position: absolute;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    max-width: min(78%, 900px);
    padding: 8px 12px;
    border-radius: 11px;
    background: rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    color: rgba(255,255,255,.94);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}
.lb-gallery-modal-caption:empty { display: none; }
.lb-gallery-modal-close,
.lb-gallery-modal-nav {
    position: absolute;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.94);
    color: #111;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(0,0,0,.2);
    transition: background .2s ease, color .2s ease, transform .2s ease;
}
.lb-gallery-modal-close:hover,
.lb-gallery-modal-nav:hover {
    background: #111;
    color: #fff;
}
.lb-gallery-modal-close {
    top: 0;
    right: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    font-size: 27px;
    line-height: 1;
}
.lb-gallery-modal-nav {
    top: 50%;
    width: 48px;
    height: 62px;
    transform: translateY(-50%);
    border-radius: 12px;
    padding: 0 !important;
    font-size: 0;
}
.lb-gallery-modal-nav::before {
    content: '';
    display: block;
    position: relative;
    top: -1.5px;
    width: 11px;
    height: 11px;
    border-top: 2px solid currentColor;
    border-left: 2px solid currentColor;
    transform-origin: 50% 50%;
}
.lb-gallery-modal-prev::before { transform: rotate(-45deg); margin-left: 3px; }
.lb-gallery-modal-next::before { transform: rotate(135deg); margin-right: 3px; }
body .lb-gallery-modal button.lb-gallery-modal-nav:hover,
body .lb-gallery-modal button.lb-gallery-modal-nav:focus,
body .lb-gallery-modal button.lb-gallery-modal-nav:active {
    background: #fff !important;
    background-color: #fff !important;
    background-image: none !important;
    color: #111 !important;
    filter: none !important;
    opacity: 1 !important;
    transform: translateY(-50%) scale(1.025);
}
.lb-gallery-modal-prev { left: 0; }
.lb-gallery-modal-next { right: 0; }
.lb-gallery-modal-counter {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    background: rgba(255,255,255,.09);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: rgba(255,255,255,.94);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .055em;
}

.lb-gallery-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 767px) {
    .lb-auto-gallery {
        margin: 24px 0 32px;
        padding: 4px;
        border-radius: 12px;
        box-shadow: 0 14px 40px rgba(15, 23, 42, .065), 0 4px 14px rgba(15, 23, 42, .035);
    }
    .lb-auto-gallery-stage {
        aspect-ratio: 16 / 9;
        height: auto;
        min-height: 0;
        border-radius: 11px;
    }
    .lb-auto-gallery-main-button { padding: 2px; }
    .lb-auto-gallery-main-image { border-radius: 9px; }
    .lb-auto-gallery-nav {
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
    .lb-auto-gallery-prev { left: 9px; }
    .lb-auto-gallery-next { right: 9px; }
    .lb-auto-gallery-counter {
        top: 11px;
        right: 11px;
        padding: 6px 9px;
    }
    .lb-auto-gallery-caption {
        left: 12px;
        bottom: 11px;
        max-width: calc(100% - 36px);
        padding: 7px 10px;
        font-size: 11.5px;
    }
    .lb-auto-gallery-thumb {
        flex-basis: 82px;
        width: 82px;
        height: 58px;
        border-radius: 11px;
    }
    .lb-gallery-modal { padding: 12px; }
    .lb-gallery-modal-dialog { height: calc(100vh - 24px); }
    .lb-gallery-modal-image {
        max-width: calc(100% - 16px);
        max-height: calc(100% - 78px);
    }
    .lb-gallery-modal-nav {
        width: 40px;
        height: 56px;
        font-size: 26px;
    }
    .lb-gallery-modal-prev { left: 4px; }
    .lb-gallery-modal-next { right: 4px; }
    .lb-gallery-modal-caption {
        max-width: calc(100% - 34px);
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lb-auto-gallery-thumbs { scroll-behavior: auto; }
    .lb-auto-gallery-nav,
    .lb-auto-gallery-thumb,
    .lb-auto-gallery-main-image,
    .lb-gallery-modal-image { transition: none; }
}

/* v1.5.8 — ultra-tight 16:9 stage, theme-proof */
body .lb-auto-gallery {
    padding: 3px !important;
}
body .lb-auto-gallery .lb-auto-gallery-stage {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
}
body .lb-auto-gallery button.lb-auto-gallery-main-button,
body .lb-auto-gallery button.lb-auto-gallery-main-button:hover,
body .lb-auto-gallery button.lb-auto-gallery-main-button:focus,
body .lb-auto-gallery button.lb-auto-gallery-main-button:focus-visible,
body .lb-auto-gallery button.lb-auto-gallery-main-button:active {
    position: absolute !important;
    inset: 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 2px !important;
    border: 0 !important;
    border-radius: 0 !important;
    line-height: 0 !important;
    overflow: hidden !important;
}
body .lb-auto-gallery .lb-auto-gallery-main-image {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: none !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    object-fit: contain !important;
    object-position: center !important;
}
body .lb-auto-gallery .lb-auto-gallery-thumbs-wrap {
    margin-top: 4px !important;
    padding: 0 !important;
}
body .lb-auto-gallery .lb-auto-gallery-thumbs {
    padding: 2px 0 2px !important;
}
@media (max-width: 767px) {
    body .lb-auto-gallery { padding: 2px !important; }
    body .lb-auto-gallery button.lb-auto-gallery-main-button,
    body .lb-auto-gallery button.lb-auto-gallery-main-button:hover,
    body .lb-auto-gallery button.lb-auto-gallery-main-button:focus,
    body .lb-auto-gallery button.lb-auto-gallery-main-button:focus-visible,
    body .lb-auto-gallery button.lb-auto-gallery-main-button:active {
        padding: 1px !important;
    }
}

/* v1.5.9 — Align gallery and in-content media to the 970px editorial column. */
body.lb-auto-gallery-enabled .lb-auto-gallery {
    width: 100% !important;
    max-width: 970px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

@media (min-width: 768px) {
    /* Regular editorial images: same visual width as the 970px featured image. */
    body.lb-auto-gallery-enabled .entry-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .post-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .article-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .single-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img) {
        display: block !important;
        width: auto !important;
        max-width: min(970px, 100%) !important;
        height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Keep common image wrappers aligned too, so captions stay with the image. */
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .entry-content .wp-caption,
    body.lb-auto-gallery-enabled .post-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .post-content .wp-caption,
    body.lb-auto-gallery-enabled .article-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .article-content .wp-caption,
    body.lb-auto-gallery-enabled .single-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .single-content .wp-caption {
        width: auto !important;
        max-width: 970px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (max-width: 767px) {
    body.lb-auto-gallery-enabled .lb-auto-gallery {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.lb-auto-gallery-enabled .entry-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .post-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .article-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .single-content img:not(.wp-post-image):not(.lb-auto-gallery-main-image):not(.lb-auto-gallery-thumb img),
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .entry-content .wp-caption,
    body.lb-auto-gallery-enabled .post-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .post-content .wp-caption,
    body.lb-auto-gallery-enabled .article-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .article-content .wp-caption,
    body.lb-auto-gallery-enabled .single-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .single-content .wp-caption {
        max-width: 100% !important;
        height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}



/* v1.5.10 — Break editorial media out of narrow text columns to the 970px image column. */
@media (min-width: 768px) {
    /* The theme constrains editorial text (often 720px). Media is allowed to break out
       to the same 970px width as the featured image while remaining centered. */
    body.lb-auto-gallery-enabled .lb-auto-gallery,
    body.lb-auto-gallery-enabled .entry-content figure.wp-caption,
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .entry-content .wp-caption,
    body.lb-auto-gallery-enabled .post-content figure.wp-caption,
    body.lb-auto-gallery-enabled .post-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .post-content .wp-caption,
    body.lb-auto-gallery-enabled .article-content figure.wp-caption,
    body.lb-auto-gallery-enabled .article-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .article-content .wp-caption,
    body.lb-auto-gallery-enabled .single-content figure.wp-caption,
    body.lb-auto-gallery-enabled .single-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .single-content .wp-caption {
        box-sizing: border-box !important;
        width: min(970px, calc(100vw - 40px)) !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Force captioned / block images to actually use the breakout wrapper width. */
    body.lb-auto-gallery-enabled .entry-content figure.wp-caption > img,
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-image > img,
    body.lb-auto-gallery-enabled .entry-content .wp-caption > img,
    body.lb-auto-gallery-enabled .post-content figure.wp-caption > img,
    body.lb-auto-gallery-enabled .post-content figure.wp-block-image > img,
    body.lb-auto-gallery-enabled .post-content .wp-caption > img,
    body.lb-auto-gallery-enabled .article-content figure.wp-caption > img,
    body.lb-auto-gallery-enabled .article-content figure.wp-block-image > img,
    body.lb-auto-gallery-enabled .article-content .wp-caption > img,
    body.lb-auto-gallery-enabled .single-content figure.wp-caption > img,
    body.lb-auto-gallery-enabled .single-content figure.wp-block-image > img,
    body.lb-auto-gallery-enabled .single-content .wp-caption > img {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Standalone editorial images, including images placed inside a 720px paragraph. */
    body.lb-auto-gallery-enabled .entry-content p > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .entry-content > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .post-content p > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .post-content > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .article-content p > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .article-content > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .single-content p > img:not(.wp-post-image):not(.lb-auto-gallery-main-image),
    body.lb-auto-gallery-enabled .single-content > img:not(.wp-post-image):not(.lb-auto-gallery-main-image) {
        box-sizing: border-box !important;
        display: block !important;
        width: min(970px, calc(100vw - 40px)) !important;
        max-width: none !important;
        height: auto !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* Keep captions aligned to the full media width. */
    body.lb-auto-gallery-enabled .entry-content .wp-caption-text,
    body.lb-auto-gallery-enabled .post-content .wp-caption-text,
    body.lb-auto-gallery-enabled .article-content .wp-caption-text,
    body.lb-auto-gallery-enabled .single-content .wp-caption-text {
        width: 100% !important;
        max-width: 100% !important;
    }
}

@media (max-width: 767px) {
    body.lb-auto-gallery-enabled .lb-auto-gallery,
    body.lb-auto-gallery-enabled .entry-content figure.wp-caption,
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .entry-content .wp-caption,
    body.lb-auto-gallery-enabled .post-content figure.wp-caption,
    body.lb-auto-gallery-enabled .post-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .post-content .wp-caption,
    body.lb-auto-gallery-enabled .article-content figure.wp-caption,
    body.lb-auto-gallery-enabled .article-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .article-content .wp-caption,
    body.lb-auto-gallery-enabled .single-content figure.wp-caption,
    body.lb-auto-gallery-enabled .single-content figure.wp-block-image,
    body.lb-auto-gallery-enabled .single-content .wp-caption {
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        transform: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}


/* v1.5.11 — Match YouTube embeds to the 970px editorial media column. */
@media (min-width: 768px) {
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .entry-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .post-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .post-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .article-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .article-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .single-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .single-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube-nocookie.com/embed"] {
        box-sizing: border-box !important;
        width: min(970px, calc(100vw - 40px)) !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    body.lb-auto-gallery-enabled figure.wp-block-embed-youtube .wp-block-embed__wrapper,
    body.lb-auto-gallery-enabled .wp-block-embed-youtube .wp-block-embed__wrapper {
        width: 100% !important;
        max-width: 100% !important;
    }

    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube-nocookie.com/embed"] {
        display: block !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        border: 0 !important;
    }
}

@media (max-width: 767px) {
    body.lb-auto-gallery-enabled .entry-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .entry-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .post-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .post-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .article-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .article-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .single-content figure.wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .single-content .wp-block-embed-youtube,
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube-nocookie.com/embed"] {
        box-sizing: border-box !important;
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        transform: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .entry-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .post-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .article-content iframe[src*="youtube-nocookie.com/embed"],
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube.com/embed"],
    body.lb-auto-gallery-enabled .single-content iframe[src*="youtube-nocookie.com/embed"] {
        display: block !important;
        aspect-ratio: 16 / 9 !important;
        height: auto !important;
        border: 0 !important;
    }
}


/* v1.5.12 — Astra YouTube wrapper fix: remove the legacy responsive spacer that
   otherwise stacks on top of our 16:9 sizing and creates a large blank area. */
body.lb-auto-gallery-enabled .ast-oembed-container.lb-youtube-embed-wrap {
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 0 !important;
    padding: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    aspect-ratio: 16 / 9 !important;
    position: relative !important;
    overflow: hidden !important;
    line-height: 0 !important;
}

body.lb-auto-gallery-enabled .ast-oembed-container.lb-youtube-embed-wrap::before,
body.lb-auto-gallery-enabled .ast-oembed-container.lb-youtube-embed-wrap::after {
    content: none !important;
    display: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

body.lb-auto-gallery-enabled .ast-oembed-container.lb-youtube-embed-wrap > iframe.lb-youtube-embed-frame {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    aspect-ratio: auto !important;
    border: 0 !important;
}

@media (min-width: 768px) {
    body.lb-auto-gallery-enabled .entry-content .ast-oembed-container.lb-youtube-embed-wrap,
    body.lb-auto-gallery-enabled .post-content .ast-oembed-container.lb-youtube-embed-wrap,
    body.lb-auto-gallery-enabled .article-content .ast-oembed-container.lb-youtube-embed-wrap,
    body.lb-auto-gallery-enabled .single-content .ast-oembed-container.lb-youtube-embed-wrap {
        width: min(970px, calc(100vw - 40px)) !important;
        max-width: none !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin: 1.6em 0 !important;
    }
}

@media (max-width: 767px) {
    body.lb-auto-gallery-enabled .entry-content .ast-oembed-container.lb-youtube-embed-wrap,
    body.lb-auto-gallery-enabled .post-content .ast-oembed-container.lb-youtube-embed-wrap,
    body.lb-auto-gallery-enabled .article-content .ast-oembed-container.lb-youtube-embed-wrap,
    body.lb-auto-gallery-enabled .single-content .ast-oembed-container.lb-youtube-embed-wrap {
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        transform: none !important;
        margin: 1.25em auto !important;
    }
}

/* v1.5.13 — Wider gallery canvas on desktop, while editorial images/video stay 970px. */
@media (min-width: 768px) {
    body.lb-auto-gallery-enabled .lb-auto-gallery {
        width: min(1100px, calc(100vw - 40px)) !important;
        max-width: none !important;
        position: relative !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 767px) {
    body.lb-auto-gallery-enabled .lb-auto-gallery {
        width: 100% !important;
        max-width: 100% !important;
        left: auto !important;
        transform: none !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* v1.5.14 — Slightly taller desktop stage so common editorial photos fill more of the 1100px canvas. */
@media (min-width: 768px) {
    body.lb-auto-gallery-enabled .lb-auto-gallery .lb-auto-gallery-stage {
        aspect-ratio: 16 / 10 !important;
        height: auto !important;
    }

    body.lb-auto-gallery-enabled .lb-auto-gallery .lb-auto-gallery-main-image {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
        object-position: center center !important;
    }
}
