/**
 * OptConnect gallery sections (PR 3.13).
 *
 * One stylesheet for the media-carousel family — `optconnect/product-series` and
 * `optconnect/logo-wall`. The family's name is the widget's, not the rebuild's: both
 * patterns replace an Elementor `image-carousel` with a `core/gallery` that shows
 * every image at once, so there is no slider here, no track, no arrows and no
 * JavaScript. See either pattern's docblock for why.
 *
 * It is six rules, and deliberately so — `video-section.css` (PR 3.10) is the only
 * family that got away with fewer. Everything the sections need beyond them already
 * exists:
 *
 *   - **The 50/50 split, the stacking breakpoint and the 12px photo radius** come from
 *     `media-text.css` (PR 3.4) — `optconnect/product-series` reuses the
 *     `.oc-media-text--split` shell whole, exactly as `optconnect/media-text-cta` (PR
 *     3.5) and `optconnect/checklist-promo` (PR 3.6) do.
 *   - **The wall's flow layout** is `core/gallery`'s own flex layout, which already
 *     wraps and already centres a ragged last row. Only the item width is ours.
 *   - **The button** is `theme.json` plus `button.css` (PR 3.3).
 *
 * Same no-margins convention as the rest of the family stylesheets (`card-grid.css`,
 * PR 3.1): nothing inside a block-gapped group takes a `margin` here, because core's
 * flow layout emits `.wp-container-… > * + * { margin-block-start: … }` at one-class
 * specificity and this file loads after it. Spacing is `blockGap` in the pattern
 * markup.
 *
 * ⚠️ **The selectors carry one more class than they look like they need.** Core's own
 * gallery rules are `.wp-block-gallery.has-nested-images.columns-N > .wp-block-image`,
 * i.e. (0,3,1), and this file loads after core's, so a tie would already go to us. The
 * extra `.oc-gallery` in front makes it (0,4,1) instead, because the tie only holds
 * while `wp-block-library` keeps printing before the theme's stylesheets — which is
 * true today and is not a guarantee. One class is cheaper than finding out.
 */

/* --------------------------------------------------------------------------
 * The gallery itself — shared by both patterns
 * ---------------------------------------------------------------------- */

/* Both galleries save with `imageCrop: false`, so core adds no `is-cropped` and the
   images keep their natural aspect ratios and their natural heights — which in a
   two-up grid of product photos means rows of different heights and a ragged bottom
   edge. `aspect-ratio` + `object-fit: contain` gives every cell the same box and still
   crops nothing, which matters here: these are photographs of hardware, and
   `is-cropped`'s `object-fit: cover` would shave the antenna off a router whose source
   image is 1.29:1 in a row of 1.40:1 ones. 4/3 is the family's own shape, near enough —
   19 of the 21 photos are 600x429 or 2500x1788.
   `stretch` is the whole reason `align-items` appears: core centres gallery items, so
   without it the shorter figure floats in the middle of the taller row. */
.oc-gallery.wp-block-gallery.has-nested-images {
	align-items: stretch;
}

.oc-gallery.wp-block-gallery.has-nested-images > .wp-block-image img {
	aspect-ratio: 4 / 3;
	border-radius: 12px;
	object-fit: contain;
	width: 100%;
}

/* --------------------------------------------------------------------------
 * Logo wall
 * ---------------------------------------------------------------------- */

/* Centering is one rule on the section rather than a `textAlign` attribute on each
   block, matching `.oc-media-text--stacked` (PR 3.4) and `optconnect/hero-title`
   (PR 3.3). */
.oc-logo-wall {
	text-align: center;
}

/* `text-align` does not reach flex children, and core's gallery layout justifies left
   — measured, not assumed: eleven logos landed six-up and then five hard against the
   left margin, with a sixth column's worth of empty space trailing row one. Centring is
   the rule that makes a ragged last row look deliberate. It is scoped to the wall
   because the product gallery wants the opposite: its two columns should stay columns,
   so a five-image series (the ema row) keeps its odd image aligned under the first. */
.oc-gallery.oc-gallery--logos.wp-block-gallery.has-nested-images {
	justify-content: center;
}

/* `clamp()` rather than a column count, so the wall reflows with no breakpoint of ours
   — eleven logos land six-up at the 1140px content width, and step down to two-up at
   375px, without ever going below the 88px at which a wordmark stops being readable.
   The live widget's fixed `slides_to_show: 5` is what made six of the eleven
   unreachable in the first place, so a fixed count is the one thing not to reproduce.
   These are logos rather than photographs: square (all eleven files are 1200x1200 with
   the wordmark letterboxed inside), never rounded, and never cropped. */
.oc-gallery.oc-gallery--logos.wp-block-gallery.has-nested-images > .wp-block-image {
	flex: 0 1 clamp(88px, 13%, 150px);
}

.oc-gallery.oc-gallery--logos.wp-block-gallery.has-nested-images > .wp-block-image img {
	aspect-ratio: 1;
	border-radius: 0;
}

/* --------------------------------------------------------------------------
 * Partner logos — the co-branded landings' sign-off (/sethleds/,
 * /sandstar-connectivity/): the partner's mark beside OptConnect's.
 *
 * One height for both rather than one width, because the marks' aspect ratios differ
 * (775x190, 1200x364, 1201x280): at a shared 4.5rem they read as a pair. The flex
 * group wraps them one above the other on a phone; `min()` keeps a mark inside the
 * viewport where 4.5rem high would be wider than the column.
 * ---------------------------------------------------------------------- */
.oc-partner-logos .oc-partner-logos__logo img {
	width: auto;
	max-width: min(100%, 20rem);
	height: 4.5rem;
	object-fit: contain;
}

/* --------------------------------------------------------------------------
 * Wide logo wall — `/reseller-program/`'s partner logos (PR 6.1)
 *
 * Its 19 files are 250x100 with the wordmark centred, so the carrier wall's square
 * crop would leave each logo a strip in a tall box and the rows far apart. The
 * files' own 5:2 is kept, the basis widened to match.
 * ---------------------------------------------------------------------- */
.oc-gallery.oc-gallery--logos-wide.wp-block-gallery.has-nested-images > .wp-block-image {
	flex: 0 1 clamp(120px, 15%, 190px);
}

.oc-gallery.oc-gallery--logos-wide.wp-block-gallery.has-nested-images > .wp-block-image img {
	aspect-ratio: 5 / 2;
}
