/* ==========================================================================
   Allera V2: photos with stripes -- the offset block (Rand's option 2, picked by
   the Captain 2026-11-18). Replaces the gutter stripes in theme.css and
   woocommerce.css.

   Why option 2: nothing is ever cut. Any photo Adam or Rommel uploads later
   shows whole, whatever is near its edges; the angled-edge option could only
   be kept safe by someone choosing a cut side for every photo by hand.

   Applies to the "Photo with stripes" image block (.is-style-blob: home hero,
   Meet the founder, About) and the class page photo (.allera-product__photo).
   The photo is a clean rectangle on a solid block offset down and right (navy
   on light sections; gold on navy, in look-a.css), with short stripes rising
   from the block's corner. Nothing overlaps the photo.
   Loaded on the front end and in the block editor (functions.php).
   ========================================================================== */

:is(.is-style-blob, .allera-product__photo) {
	--sw: var(--v2-stripes-w);
	--gap: 14px;
	--off: 22px;
	--block: var(--v2-navy);
	position: relative;
	isolation: isolate;
	padding-right: 0 !important;
	margin-right: calc(var(--off) + var(--sw) + var(--gap)) !important;
	margin-bottom: var(--off) !important;
	border-radius: 0 !important;
}
:is(.is-style-blob, .allera-product__photo) img {
	position: relative;
	z-index: 1;
	border-radius: 0 !important;
	box-shadow: none;
}
:is(.is-style-blob, .allera-product__photo)::before {
	content: "";
	position: absolute;
	z-index: 0;
	top: var(--off);
	left: var(--off);
	right: calc(-1 * var(--off));
	bottom: calc(-1 * var(--off));
	background: var(--block);
	pointer-events: none;
}
:is(.is-style-blob, .allera-product__photo)::after {
	content: "";
	position: absolute;
	z-index: 0;
	top: auto;
	bottom: calc(-1 * var(--off));
	left: calc(100% + var(--off) + var(--gap));
	right: auto;
	width: var(--sw);
	height: 46%;
	background: var(--v2-stripes);
	transform: skewX(var(--v2-skew));
	transform-origin: bottom left;
	pointer-events: none;
}
/* Class photos are uploaded by hand and come in every shape, so show them whole at their own
   proportions (the template's 4:3 crop cut the soccer players' heads off). Very tall photos are
   capped in height rather than cropped. The block hugs the photo. */
.allera-product__photo { width: fit-content; max-width: calc(100% - var(--off) - var(--sw) - var(--gap)); }
.allera-product__photo img {
	aspect-ratio: auto !important;
	width: auto !important;
	max-width: 100%;
	height: auto !important;
	max-height: 30rem;
	object-fit: contain !important;
}

/* The stripes lean out past the block; never let them widen the page. */
:is(.allera-hero, .allera-page-hero, .alignfull):has(:is(.is-style-blob, .allera-product__photo)) { overflow-x: clip; }
/* The class page title band had its own stripes at the right edge; the photo carries them now. */
.single-product .allera-page-hero::after { content: none; }

@media (max-width: 781px) {
	:is(.is-style-blob, .allera-product__photo) {
		--sw: var(--v2-stripes-sm-w);
		--gap: 8px;
		--off: 12px;
	}
	:is(.is-style-blob, .allera-product__photo)::after {
		height: 34%;
		background: var(--v2-stripes-sm);
	}
}
