/**
 * iBreathe 4-Box Grid
 *
 * Structural rules are fixed and live here.
 * Per-instance values arrive as custom properties on .ibr-4box-grid-wrapper,
 * set inline by ibr-4box-grid.php. Fallbacks below match the Shopify defaults.
 */

/* ---------------------------------------------------------------
   Outer strip — breaks out of the theme container to full viewport width
   --------------------------------------------------------------- */

.ibr-4box-grid-wrapper {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	box-sizing: border-box;
	padding-top: 20px;
	padding-bottom: 20px;
	margin-top: var(--ibr4-mt-desktop, 40px);
	margin-bottom: var(--ibr4-mb-desktop, 40px);
	background-color: var(--ibr4-bg-color, transparent);
	background-image: var(--ibr4-bg-image, none);
	background-size: var(--ibr4-bg-size, cover);
	background-repeat: var(--ibr4-bg-repeat, no-repeat);
	background-position: center;
	color: var(--ibr4-text-color, #000000);
}

/* WordPress's block layout system sets margin-block-start/end on children of
   .is-layout-constrained and .is-layout-flow, including a first-child reset to
   zero. Those are logical properties and resolve to the same computed value as
   margin-top/bottom, so they compete with the rule above. Restating them here
   as logical properties at a higher specificity settles it, on any template. */
.ibr-4box-grid-wrapper.alignfull {
	margin-block-start: var(--ibr4-mt-desktop, 40px);
	margin-block-end: var(--ibr4-mb-desktop, 40px);
}

/* ---------------------------------------------------------------
   Inner container — width constrained by Blocksy's .ct-container
   --------------------------------------------------------------- */

.ibr-4box-grid {
	width: 100%;
	box-sizing: border-box;
	text-align: left;
}

/* Blocksy applies its own vertical padding to .ct-container; the strip
   already supplies that, so remove it here to avoid doubling up. */
.ibr-4box-grid-wrapper .ibr-4box-grid.ct-container {
	padding-top: 0;
	padding-bottom: 0;
}

/* Text inherits the section colour rather than the theme's heading colour. */
.ibr-4box-grid .banner-grid-title,
.ibr-4box-grid .banner-item-title,
.ibr-4box-grid .banner-item-text {
	color: inherit;
}

.ibr-4box-grid .banner-grid-title {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	margin-top: 0;
	margin-bottom: 15px;
	padding: 0;
}

/* ---------------------------------------------------------------
   Grid
   --------------------------------------------------------------- */

.ibr-4box-grid .banner-grid-core {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
	margin: 0;
	padding: 0;
	width: 100%;
}

/* ---------------------------------------------------------------
   Cards
   --------------------------------------------------------------- */

.ibr-4box-grid .banner-grid-item {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}

.ibr-4box-grid .banner-image-wrapper {
	display: block;
	background-color: #ffffff;
	border-radius: 6px;
	margin: 0 0 10px 0;
	overflow: hidden;
	box-shadow: 0 0 4px rgba(0, 0, 0, 0.15);
	aspect-ratio: 1;
}

.ibr-4box-grid .banner-image-wrapper img,
.ibr-4box-grid .banner-image-wrapper video {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.ibr-4box-grid .banner-image-placeholder {
	background-color: #ffffff;
	height: 100%;
}

.ibr-4box-grid .banner-item-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.3;
	margin: 0;
}

.ibr-4box-grid .banner-item-text {
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	margin: 0;
}

/* ---------------------------------------------------------------
   Mobile — 749px breakpoint, as per the Shopify section
   --------------------------------------------------------------- */

@media screen and (max-width: 749px) {

	.ibr-4box-grid-wrapper {
		margin-top: var(--ibr4-mt-mobile, 20px);
		margin-bottom: var(--ibr4-mb-mobile, 20px);
		padding-top: 25px;
		padding-bottom: 25px;
	}

	.ibr-4box-grid-wrapper.alignfull {
		margin-block-start: var(--ibr4-mt-mobile, 20px);
		margin-block-end: var(--ibr4-mb-mobile, 20px);
	}

	.ibr-4box-grid .banner-grid-core {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
}
