/* Match the native Gallery columns setting on the front end. */
.wp-block-gallery.columns-1 { --rcc-gallery-columns: 1; }
.wp-block-gallery.columns-2 { --rcc-gallery-columns: 2; }
.wp-block-gallery.columns-3 { --rcc-gallery-columns: 3; }
.wp-block-gallery.columns-4 { --rcc-gallery-columns: 4; }
.wp-block-gallery.columns-5 { --rcc-gallery-columns: 5; }
.wp-block-gallery.columns-6 { --rcc-gallery-columns: 6; }
.wp-block-gallery.columns-7 { --rcc-gallery-columns: 7; }
.wp-block-gallery.columns-8 { --rcc-gallery-columns: 8; }

/* Native Gallery styles, shared by the editor and public pages. */
.wp-block-gallery.is-style-rcc-logos-compact,
.wp-block-gallery.is-style-rcc-logos {
  --rcc-logo-height: 80px;
  display: grid;
  grid-template-columns: repeat(var(--rcc-gallery-columns, 3), minmax(0, 1fr));
  align-items: start;
}
.wp-block-gallery.is-style-rcc-logos { --rcc-logo-height: 120px; }
.wp-block-gallery:is(.is-style-rcc-logos-compact, .is-style-rcc-logos) figure.wp-block-image {
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  align-self: start;
}
.wp-block-gallery:is(.is-style-rcc-logos-compact, .is-style-rcc-logos) figure.wp-block-image img {
  width: 100% !important;
  height: var(--rcc-logo-height) !important;
  max-height: var(--rcc-logo-height) !important;
  object-fit: contain !important;
  object-position: center;
  background: transparent;
}
.wp-block-gallery:is(.is-style-rcc-logos-compact, .is-style-rcc-logos) figure.wp-block-image figcaption {
  position: static;
  color: inherit;
  background: none;
  text-shadow: none;
  padding: 8px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.wp-block-gallery:is(.is-style-rcc-logos-compact, .is-style-rcc-logos) figure.wp-block-image::before {
  content: none;
}
.wp-block-gallery:is(.is-style-rcc-logos-compact, .is-style-rcc-logos) > .blocks-gallery-caption {
  grid-column: 1 / -1;
}
@media (max-width: 700px) {
  .wp-block-gallery.is-style-rcc-logos-compact,
  .wp-block-gallery.is-style-rcc-logos {
    grid-template-columns: repeat(min(var(--rcc-gallery-columns, 3), 2), minmax(0, 1fr));
  }
}

/* Native image captions: readable text below the image, also in the editor. */
.wp-block-image > .wp-element-caption {
  margin: 8px 0 0;
  color: #65706b;
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.wp-block-gallery.has-nested-images figure.wp-block-image > figcaption.wp-element-caption {
  position: static;
  flex: 0 0 auto;
  max-height: none;
  overflow: visible;
  margin: 8px 0 0;
  padding: 0;
  background: none;
  color: #65706b;
  text-shadow: none;
  font-size: 14px;
  line-height: 1.6;
  scrollbar-gutter: auto;
  will-change: auto;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(> figcaption.wp-element-caption)::before {
  content: none;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(> figcaption.wp-element-caption) {
  justify-content: flex-start;
}
.wp-block-gallery.has-nested-images figure.wp-block-image:has(> figcaption.wp-element-caption) > a,
.wp-block-gallery.has-nested-images figure.wp-block-image:has(> figcaption.wp-element-caption) > div {
  flex-grow: 0;
}
