/**
 * Editorial Gallery Caption Styles — 1.0.68
 * Native gallery by default; optional branded black caption tabs.
 */
:root{
    --ib-gallery-caption-bg:#080808;
    --ib-gallery-caption-color:#fff;
    --ib-gallery-caption-overlap:18px;
    --ib-gallery-caption-space:34px;
}

/* DEFAULT / NATIVE GALLERY -------------------------------------------------
 * Do not alter the editor-selected gallery columns, crop, image size, gap or
 * alignment. Only normalize each non-tab caption below its own image and
 * center the text. The legacy `ib-caption-plain` class is retained so galleries
 * saved by 1.0.64–1.0.66 continue to match the new default state. */
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery:not(.is-style-ib-caption-notch).has-nested-images figure.wp-block-image > figcaption,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery:not(.is-style-ib-caption-notch) .blocks-gallery-item figcaption,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .blocks-gallery-grid:not(.is-style-ib-caption-notch) .blocks-gallery-item figcaption{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    display:block;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:9px 4px 0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--ib-caption-color,var(--ib-muted,#666))!important;
    box-shadow:none!important;
    font-family:var(--ib-caption-font,var(--ib-font-meta,Montserrat,Arial,sans-serif))!important;
    font-size:clamp(9px,.68vw,11px)!important;
    font-weight:500!important;
    font-style:normal!important;
    line-height:1.45!important;
    letter-spacing:.035em!important;
    text-align:center!important;
    text-transform:none!important;
    text-shadow:none!important;
    white-space:normal;
    overflow-wrap:anywhere;
}

body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery:not(.is-style-ib-caption-notch).has-nested-images figure.wp-block-image > figcaption::before,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery:not(.is-style-ib-caption-notch).has-nested-images figure.wp-block-image > figcaption::after{
    content:none!important;
    display:none!important;
}

/* OPTIONAL BLACK TABS ----------------------------------------------------- */
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery.is-style-ib-caption-notch figure.blocks-gallery-item,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .blocks-gallery-grid.is-style-ib-caption-notch .blocks-gallery-item{
    position:relative;
    overflow:visible!important;
    margin-bottom:var(--ib-gallery-caption-space)!important;
}

body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image > figcaption,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery.is-style-ib-caption-notch .blocks-gallery-item figcaption,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .blocks-gallery-grid.is-style-ib-caption-notch .blocks-gallery-item figcaption{
    position:absolute!important;
    z-index:3;
    left:50%!important;
    right:auto!important;
    top:auto!important;
    bottom:calc(-1 * var(--ib-gallery-caption-overlap))!important;
    transform:translateX(-50%);
    display:block;
    width:max-content!important;
    min-width:min(190px,calc(100% - 28px));
    max-width:calc(100% - 28px)!important;
    margin:0!important;
    padding:11px 18px 12px!important;
    border:0!important;
    border-radius:0!important;
    background:var(--ib-gallery-caption-bg)!important;
    color:var(--ib-gallery-caption-color)!important;
    box-shadow:0 9px 24px rgba(0,0,0,.16);
    font-family:var(--ib-caption-font,var(--ib-font-meta,Montserrat,Arial,sans-serif))!important;
    font-size:clamp(10px,.72vw,12px)!important;
    font-weight:600!important;
    font-style:normal!important;
    line-height:1.35!important;
    letter-spacing:.055em!important;
    text-align:center!important;
    text-transform:none!important;
    text-shadow:none!important;
    white-space:normal;
    overflow-wrap:anywhere;
}

body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image > figcaption::before,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image > figcaption::after{
    content:none!important;
    display:none!important;
}

body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery.is-style-ib-caption-notch,
    .blocks-gallery-grid.is-style-ib-caption-notch
){
    overflow:visible!important;
}

/* GUTENBERG PREVIEW ------------------------------------------------------- */
.editor-styles-wrapper .wp-block-gallery:not(.is-style-ib-caption-notch).has-nested-images figure.wp-block-image > figcaption,
.editor-styles-wrapper .wp-block-gallery:not(.is-style-ib-caption-notch) .blocks-gallery-item figcaption,
.editor-styles-wrapper .blocks-gallery-grid:not(.is-style-ib-caption-notch) .blocks-gallery-item figcaption{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    display:block;
    width:100%!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:9px 4px 0!important;
    border:0!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--ib-editor-body-color,#626262)!important;
    box-shadow:none!important;
    font-family:var(--ib-editor-body-font,var(--ib-font-meta,Montserrat,Arial,sans-serif))!important;
    font-size:10px!important;
    font-weight:500!important;
    font-style:normal!important;
    line-height:1.45!important;
    letter-spacing:.035em!important;
    text-align:center!important;
    text-transform:none!important;
    text-shadow:none!important;
    white-space:normal;
    overflow-wrap:anywhere;
}

.editor-styles-wrapper .wp-block-gallery:not(.is-style-ib-caption-notch).has-nested-images figure.wp-block-image > figcaption::before,
.editor-styles-wrapper .wp-block-gallery:not(.is-style-ib-caption-notch).has-nested-images figure.wp-block-image > figcaption::after{
    content:none!important;
    display:none!important;
}

.editor-styles-wrapper .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image,
.editor-styles-wrapper .wp-block-gallery.is-style-ib-caption-notch figure.blocks-gallery-item,
.editor-styles-wrapper .blocks-gallery-grid.is-style-ib-caption-notch .blocks-gallery-item{
    position:relative;
    overflow:visible!important;
    margin-bottom:var(--ib-gallery-caption-space)!important;
}

.editor-styles-wrapper .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image > figcaption,
.editor-styles-wrapper .wp-block-gallery.is-style-ib-caption-notch .blocks-gallery-item figcaption,
.editor-styles-wrapper .blocks-gallery-grid.is-style-ib-caption-notch .blocks-gallery-item figcaption{
    position:absolute!important;
    z-index:8;
    left:50%!important;
    right:auto!important;
    top:auto!important;
    bottom:calc(-1 * var(--ib-gallery-caption-overlap))!important;
    transform:translateX(-50%);
    display:block;
    width:max-content!important;
    min-width:min(190px,calc(100% - 28px));
    max-width:calc(100% - 28px)!important;
    margin:0!important;
    padding:11px 18px 12px!important;
    border:0!important;
    border-radius:0!important;
    background:var(--ib-gallery-caption-bg)!important;
    color:var(--ib-gallery-caption-color)!important;
    box-shadow:0 9px 24px rgba(0,0,0,.16);
    font-family:var(--ib-editor-body-font,var(--ib-font-meta,Montserrat,Arial,sans-serif))!important;
    font-size:11px!important;
    font-weight:600!important;
    font-style:normal!important;
    line-height:1.35!important;
    letter-spacing:.055em!important;
    text-align:center!important;
    text-transform:none!important;
    text-shadow:none!important;
    white-space:normal;
    overflow-wrap:anywhere;
}

.editor-styles-wrapper :where(
    .wp-block-gallery.is-style-ib-caption-notch,
    .blocks-gallery-grid.is-style-ib-caption-notch
){
    overflow:visible!important;
}



/* ROW GEOMETRY EQUALIZER --------------------------------------------------
 * WordPress keeps the editor-selected number of columns and gap. JavaScript
 * reads the first image in the gallery and applies that ratio to every image
 * in the same gallery. Images are cropped with object-fit rather
 * than stretched, so portrait galleries stay even without deforming photography. */
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery.has-nested-images figure.wp-block-image.ib-gallery-item-equalized,
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > img:first-child,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > figure > img:first-child,
.editor-styles-wrapper :where(
    .wp-block-gallery.has-nested-images figure.wp-block-image.ib-gallery-item-equalized,
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > img:first-child,
.editor-styles-wrapper :where(
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > figure > img:first-child{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    aspect-ratio:var(--ib-gallery-row-ratio)!important;
    object-fit:cover!important;
    object-position:var(--ib-gallery-object-position,50% 50%)!important;
    flex:none!important;
}

body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery.has-nested-images figure.wp-block-image.ib-gallery-item-equalized,
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > a:first-child,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > figure > a:first-child,
.editor-styles-wrapper :where(
    .wp-block-gallery.has-nested-images figure.wp-block-image.ib-gallery-item-equalized,
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > a:first-child,
.editor-styles-wrapper :where(
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > figure > a:first-child{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    aspect-ratio:var(--ib-gallery-row-ratio)!important;
    overflow:hidden!important;
    flex:none!important;
}

body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery.has-nested-images figure.wp-block-image.ib-gallery-item-equalized,
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > a:first-child > img,
body.ib-et :where(
    .ib-article-content,
    .ib-int-story,
    .ib-exp-story
) :where(
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > figure > a:first-child > img,
.editor-styles-wrapper :where(
    .wp-block-gallery.has-nested-images figure.wp-block-image.ib-gallery-item-equalized,
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > a:first-child > img,
.editor-styles-wrapper :where(
    .wp-block-gallery .blocks-gallery-item.ib-gallery-item-equalized,
    .blocks-gallery-grid .blocks-gallery-item.ib-gallery-item-equalized
) > figure > a:first-child > img{
    display:block!important;
    width:100%!important;
    height:100%!important;
    max-width:none!important;
    object-fit:cover!important;
    object-position:var(--ib-gallery-object-position,50% 50%)!important;
}

@media(max-width:640px){
    :root{
        --ib-gallery-caption-overlap:15px;
        --ib-gallery-caption-space:29px;
    }
    body.ib-et :where(
        .ib-article-content,
        .ib-int-story,
        .ib-exp-story
    ) .wp-block-gallery.is-style-ib-caption-notch.has-nested-images figure.wp-block-image > figcaption,
    body.ib-et :where(
        .ib-article-content,
        .ib-int-story,
        .ib-exp-story
    ) .wp-block-gallery.is-style-ib-caption-notch .blocks-gallery-item figcaption,
    body.ib-et :where(
        .ib-article-content,
        .ib-int-story,
        .ib-exp-story
    ) .blocks-gallery-grid.is-style-ib-caption-notch .blocks-gallery-item figcaption{
        min-width:min(150px,calc(100% - 18px));
        max-width:calc(100% - 18px)!important;
        padding:9px 12px 10px!important;
        font-size:10px!important;
    }
}
