.gallery-layout--cover,
.gallery-layout--diptych,
.gallery-layout--mosaic,
.gallery-layout--portraits {--gallery-columns:repeat(2,minmax(0,1fr))}
.gallery-layout--cinema {--gallery-columns:minmax(0,1fr);--gallery-ratio:16/9}
.gallery-layout--portraits {--gallery-ratio:3/4}
.gallery-layout--squares {--gallery-ratio:1}
.gallery-layout--strip {--gallery-columns:repeat(3,minmax(0,1fr));--gallery-ratio:1}
:is(.gallery-widget,.be-preview-gallery)[class*="gallery-layout--"] > :is(.gallery-grid,.gallery-layout-track) {
  grid-template-columns:var(--gallery-columns,repeat(auto-fit,minmax(min(100%,130px),1fr)));
}
:is(.gallery-widget,.be-preview-gallery).gallery-layout--strip > :is(.gallery-grid,.gallery-layout-track) {gap:4px}
.gallery-layout--cover > :is(.gallery-grid,.gallery-layout-track) > :nth-child(1 of :not([hidden])) {grid-column:1/-1;--gallery-frame-ratio:16/9}
.gallery-layout--cover > :is(.gallery-grid,.gallery-layout-track) > :nth-child(1 of :not([hidden])) {
  box-shadow:0 9px 20px -14px rgb(0 0 0 / .52),0 2px 5px -3px rgb(0 0 0 / .27);
}
.gallery-layout--mosaic > :is(.gallery-grid,.gallery-layout-track) > :nth-child(3n+1 of :not([hidden])) {grid-column:1/-1;--gallery-frame-ratio:2/1}
.gallery-ratio--square {--gallery-chosen-ratio:1}
.gallery-ratio--classic {--gallery-chosen-ratio:4/3}
.gallery-ratio--wide {--gallery-chosen-ratio:16/9}
.gallery-ratio--tall {--gallery-chosen-ratio:3/4}
.gallery-wide-frames {container-type:inline-size;min-width:0}
@container (min-width:480px) {
  .gallery-wide-frames > :is(.gallery-grid--carousel,.gallery-layout-track) {--gallery-wide-frame-width:100%}
  .gallery-wide-frames > :is(.gallery-grid--carousel,.gallery-layout-track):has(> figure:nth-child(2 of :not([hidden]))) {
    --gallery-wide-frame-width:calc((100% - var(--gallery-frame-gap,8px)) / 2)
  }
  .gallery-wide-frames--3 > :is(.gallery-grid--carousel,.gallery-layout-track):has(> figure:nth-child(3 of :not([hidden]))) {
    --gallery-wide-frame-width:calc((100% - 2 * var(--gallery-frame-gap,8px)) / 3)
  }
}
:is(.gallery-widget,.be-preview-gallery):is([class*="gallery-layout--"],[class*="gallery-ratio--"]) :is(figure,.gallery-layout-thumb) img {
  aspect-ratio:var(--gallery-chosen-ratio,var(--gallery-frame-ratio,var(--gallery-ratio,4/3)));
}
.gallery-layout--strip figure img,.gallery-layout--strip figure a[data-gallery-photo] {border-radius:4px}
.be-gallery-choices {grid-template-columns:repeat(auto-fill,minmax(min(100%,105px),1fr))}
.be-gallery-choices label > span {height:100%;align-content:start}
.be-gallery-choices .be-preview-gallery {width:100%;padding:3px;background:var(--be-background);border-radius:5px}
.be-gallery-choices .gallery-layout-track {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:2px;align-items:start}
.be-gallery-choices .gallery-layout-track > .gallery-layout-thumb {margin:0;border:0;border-radius:3px}
.be-gallery-choices .gallery-layout-track > .gallery-layout-thumb img {display:block;width:100%;object-fit:cover}
.be-gallery-choices .be-preview-gallery--single .gallery-layout-track {grid-template-columns:1fr}
.be-gallery-choices .be-preview-gallery--carousel .gallery-layout-track {grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:75%;overflow:hidden}
.be-gallery-choices :is(.gallery-layout--squares,.gallery-layout--strip) .gallery-layout-track {grid-template-columns:repeat(3,minmax(0,1fr))}
.be-gallery-choices .be-preview-gallery.gallery-layout--diptych .gallery-layout-track {gap:7px}
.gallery-layout--diptych:is(.gallery-widget,.be-preview-gallery) > :is(.gallery-grid,.gallery-layout-track) {gap:14px}
.be-gallery-editor-title {display:flex;align-items:center;gap:8px;min-width:0;overflow-wrap:anywhere}
.be-gallery-editor-title img {width:48px;height:42px;object-fit:cover;border-radius:6px;flex:none}
@media(max-width:420px) {
  .be-gallery-choices {grid-template-columns:repeat(2,minmax(0,1fr))}
}

.be-gallery-choices .gallery-layout-thumb {display:block;min-width:0;overflow:hidden}
.be-gallery-choices .gallery-layout-thumb img {height:auto;aspect-ratio:var(--gallery-frame-ratio,var(--gallery-ratio,4/3))}
.be-gallery-choices .be-preview-gallery {height:120px;place-items:center}
.be-gallery-choices .gallery-layout-track {width:min(100%,138px);overflow:hidden}
.be-gallery-choices :is(.be-preview-gallery--single,.gallery-layout--cinema) .gallery-layout-track {width:min(100%,73px)}
.be-gallery-choices .gallery-layout--portraits .gallery-layout-track {width:min(100%,98px)}
.be-gallery-choices .gallery-layout--cover .gallery-layout-track {width:min(100%,124px)}
.be-gallery-choices .gallery-layout--squares .gallery-layout-track {grid-template-columns:repeat(2,minmax(0,1fr));width:min(100%,104px)}
.be-gallery-choices .be-preview-gallery {overflow:hidden}
.be-gallery-choices .be-preview-gallery--single .gallery-layout-track {width:min(100%,48px)}
.be-gallery-choices .gallery-layout--cinema .gallery-layout-track {width:min(100%,62px)}
.be-gallery-choices .gallery-layout--portraits .gallery-layout-track {width:min(100%,82px)}

.be-preview-gallery .gallery-layout-track > figure[hidden] {display:none}
:is(.gallery-grid:not(.gallery-grid--carousel),.be-preview-gallery:not(.be-preview-gallery--carousel) > .gallery-layout-track)[data-gallery-one-result] > figure:not([hidden]) {
  grid-column:1/-1;
}
:is(.gallery-grid--carousel,.be-preview-gallery--carousel > .gallery-layout-track)[data-gallery-one-result] {
  --gallery-wide-frame-width:100%;
}
.be-preview-gallery .gallery-collections:not([hidden]) {
  display:flex;flex-wrap:wrap;align-items:end;gap:6px 8px;margin:2px 0;
}
.be-preview-gallery .gallery-collections label {display:grid;gap:4px;min-width:0;font-size:.85rem;font-weight:650}
.gallery-collections :is(select,[data-gallery-collection-clear]) {
  min-height:44px;max-width:100%;font:inherit;color:inherit;
}
.be-preview-gallery .gallery-collections select,
.gallery-collections [data-gallery-collection-clear] {
  padding:6px 10px;border:1px solid var(--bp-line,var(--border));border-radius:8px;
  background:var(--bp-link,var(--card));
}
.be-preview-gallery .gallery-collections select {appearance:none;padding-inline-end:28px;
  background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);
  background-position:right 16px center,right 11px center;background-size:5px 5px;background-repeat:no-repeat
}
.gallery-collections [data-gallery-collection-clear] {cursor:pointer}
.gallery-collections [data-gallery-collection-clear]:is(:hover,:active) {
  background:color-mix(in srgb,var(--bp-link,var(--card)),currentColor 8%);
}
.gallery-collections :is(select,[data-gallery-collection-clear]):focus-visible {outline:2px solid currentColor;outline-offset:2px}
.be-preview-gallery .gallery-collections p:empty {position:absolute;clip-path:inset(50%)}
@media(forced-colors:active) {
  .be-preview-gallery .gallery-collections select {appearance:auto;background-image:none;padding-inline-end:10px}
}

:is(.gallery-widget,.be-preview-gallery)[style*="--gallery-frame-gap:"] > :is(.gallery-grid,.gallery-layout-track) {
  gap:var(--gallery-frame-gap);
}
:is(.gallery-widget,.be-preview-gallery)[style*="--gallery-frame-radius:"] figure,
.gallery-widget[style*="--gallery-frame-radius:"] :is([data-gallery-photo],img) {
  border-radius:var(--gallery-frame-radius);
}
:is(.gallery-widget,.be-preview-gallery)[style*="--gallery-caption-bg:"] figcaption {
  margin-block-start:3px;
  padding:.5rem .6rem;
  border-radius:var(--gallery-frame-radius,8px);
  background:var(--gallery-caption-bg);
  color:var(--gallery-caption-ink);
}
:is(.gallery-widget,.be-preview-gallery)[style*="--gallery-caption-bg:"] figcaption :is(.gallery-action,.be-preview-gallery-action) {
  background:transparent;border-color:currentColor;color:var(--gallery-caption-ink);
}
.gallery-widget[style*="--gallery-caption-bg:"] figcaption .gallery-action:is(:hover,:active) {
  background:color-mix(in srgb,currentColor 12%,transparent);
}
.gallery-widget[style*="--gallery-caption-bg:"] figcaption .gallery-action:focus-visible {
  outline:2px solid currentColor;outline-offset:2px;
}
:is(.gallery-widget,.be-preview-gallery)[style*="--gallery-caption-font:"] figcaption {
  font-family:var(--gallery-caption-font);
}
