/**
 * PX Card - Static CSS
 *
 * Two visual styles:
 *   --card:    white card with shadow, floats on section background.
 *   --section: full-bleed white background, no shadow.
 *
 * Both share the same two-column image + content grid.
 */

/* ==========================================================================
   Section wrapper
   ========================================================================== */

.px-card {
	/*padding: var(--space-d3) 0;*/
}

/* Section style — transparent, no card appearance */

/* ==========================================================================
   Container (two-column grid)
   ========================================================================== */

.px-card__container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: stretch;
	width: 100%;
	max-width: var(--row-width);

	margin: var(--space-d3) auto;
}

/* Card style — shadow + white bg on the container */
.px-card--card .px-card__container {
	background-color: var(--white);
	box-shadow: var(--shadow-elevated);
}

/* ==========================================================================
   Image position (left / right via grid-template-areas)
   ========================================================================== */

.px-card--image-left .px-card__container {
	grid-template-areas: "image content";
}

.px-card--image-right .px-card__container {
	grid-template-areas: "content image";
}

/* ==========================================================================
   No media — full-width content (auto-applied when no image/video)
   ========================================================================== */

.px-card--no-media .px-card__container {
	grid-template-columns: 1fr;
	grid-template-areas: "content";
}

.px-card--no-media .px-card__content {
	padding-top: 0;
	padding-bottom: 0;
}

/* ==========================================================================
   Image column
   ========================================================================== */

.px-card__image {
	grid-area: image;
	position: relative;
	margin: 0;
	min-height: 17.5rem;
	overflow: hidden;
}

.px-card__img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Placeholder — shown when no image is set (keeps two-column layout) */
.px-card__placeholder {
	width: 100%;
	height: 100%;
	background-color: var(--sand-light);
}

/* Video trigger fills the image area */
.px-card__image--video .px-video-popup-trigger {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* Sizing: auto — desktop only; whoever is taller wins, image crops when content is taller */
@media (min-width: 993px) {
	.px-card--sizing-auto .px-card__image {
		min-height: 0;
	}

	.px-card--sizing-auto .px-card__img {
		position: static;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

/* Desktop-only: square image ratio for section style */
@media (min-width: 993px) {
	.px-card--ratio-square.px-card--sizing-auto .px-card__image {
		aspect-ratio: 1 / 1;
		align-self: start;
	}
}

/* Desktop / mobile image toggle */
.px-card__img--mobile {
	display: none;
}

/* ==========================================================================
   Content column
   ========================================================================== */

.px-card__content {
	grid-area: content;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: var(--space-d1);
	min-width: 0;

	padding: var(--space-d3);
}

.px-card__body,
.px-card__text {
	overflow-x: auto;
}

.px-card__body table,
.px-card__text table {
	max-width: 100%;
	word-break: break-word;
	overflow-wrap: anywhere;
}

/* Builder mode — pin content to top so heading doesn't shift on FAQ toggle */
.px-card--has-builder .px-card__content {
	justify-content: flex-start;
}

/* Builder items — spacing between blocks */
.px-card__builder > .px-accordion__container,
.px-card__builder > .px-card__text,
.px-card__builder > .px-card__contact-cards,
.px-card__builder > .px-card__downloads,
.px-card__builder > .px-card__btn-wrap,
.px-card__builder > .px-card__form {
	margin-bottom: var(--space-d1);
}

.px-card__text p {
	margin-top: 0;
}

.px-card__text p:last-child {
	margin-bottom: 0;
}

.px-card__builder > :last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Responsive — Tablet (≤ 992px)
   ========================================================================== */

@media (max-width: 992px) {
	.px-card__container {
		grid-template-columns: 1fr;
	}

	/* Image always on top on tablet/mobile */
	.px-card--image-left .px-card__container {
		grid-template-areas:
			"image"
			"content";
	}

	.px-card--image-right .px-card__container {
		grid-template-areas:
			"image"
			"content";
	}

	/* Single column: square image on mobile */
	.px-card__image {
		aspect-ratio: 1 / 1;
		min-height: 0;
		margin-bottom: var(--space-d2);
		/* WebKit needs explicit width on grid items for aspect-ratio to resolve */
		width: 100%;
	}

}

/* ==========================================================================
   Responsive — Phone (≤ 767px)
   ========================================================================== */

@media (max-width: 767px) {
	.px-card__container {
		margin: var(--space-d2) auto;
	}

	.px-card__content {
		padding: 0;
	}

	.px-card--card .px-card__content {
		padding: var(--space-d2);
	}

	.px-card__img--desktop {
		display: none;
	}

	.px-card__img--mobile {
		display: block;
	}
}
