/**
 * Expanded Cards Widget — Picklemall Widgets
 */

/* ── Full-width section wrapper ───────────────────────────────────────────── */

.pm-exp-section {
	position: relative;
	/* clip X only — overflow-x: clip does not force overflow-y, so accents
	   at the bottom can bleed naturally into the next section */
	overflow-x: clip;
	width: 100%;
}

/* ── Max-width inner container (1440px, centred) ─────────────────────────── */

.pm-exp {
	max-width: 1440px;
	margin: 0 auto;
	padding-bottom: clamp(3rem, 7vw, 8rem);
	width: 100%;
	position: relative;
	z-index: 1;
}

/* ── Decorative accents ───────────────────────────────────────────────────── */

.pm-exp-deco {
	position: absolute;
	pointer-events: none;
	user-select: none;
	display: block;
}

/* stain.svg: tiled texture behind cards */
.pm-exp-deco--stain {
	inset: 0;
	width: 100%;
	height: 100%;
	background-repeat: repeat;
	background-size: 600px auto;
	background-position: center center;
	opacity: 0.6;
	z-index: -1;
}

/* exp-shape.svg: large bold anchor, bleeds into the next section */
.pm-exp-deco--shape {
	bottom: clamp(-6rem, -8vw, -3rem);
	left: 0;
	width: clamp(240px, 55%, 600px);
	z-index: 0;
}

/* exclamation.svg: inside .pm-exp-grid, bottom-right */
.pm-exp-deco--exclamation {
	right: -80px;
	bottom: clamp(-3rem, -4vw, -1.5rem);
	width: clamp(70px, 15%, 180px);
	z-index: 10;
}

/* ── Slider viewport (provides breathing room around the grid) ───────────── */

.pm-exp-slider {
	width: 100%;
	padding: 32px 24px;
	box-sizing: border-box;
}

/* ── Grid ─────────────────────────────────────────────────────────────────── */

.pm-exp-grid {
	display: flex;
	flex-direction: row;
	gap: 6px;
	height: 540px;
	width: 100%;
	position: relative;
	/* exclamation is positioned inside here */
}

/* ── Card wrap — flex item and hover target ──────────────────────────────── */

.pm-exp-card-wrap {
	position: relative;
	flex: 1 1 0;
	cursor: pointer;
	transition: flex 0.55s ease;
}

/* Collapse all wraps when grid is hovered (3+ cards only) */
.pm-exp-grid--expandable:hover .pm-exp-card-wrap {
	flex: 0 0 16%;
}

/* Hovered wrap expands to 64% */
.pm-exp-grid--expandable .pm-exp-card-wrap:hover {
	flex: 0 0 64% !important;
}

/* ── Card — visual frame (image + overlays) ──────────────────────────────── */

.pm-exp-card {
	position: relative;
	height: 100%;
	border-radius: 20px;
	border: 20px solid var(--pm-color-cyan, #17E6DB);
	overflow: hidden;
}

/* ── Mobile body — hidden on desktop ─────────────────────────────────────── */

.pm-exp-mobile-body {
	display: none;
}

/* ── Full-card link overlay ───────────────────────────────────────────────── */

.pm-exp-link {
	position: absolute;
	inset: 0;
	z-index: 5;
}

/* ── Background image ─────────────────────────────────────────────────────── */

.pm-exp-img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.7s ease;
	z-index: 0;
}

.pm-exp-img--placeholder {
	background-color: #2a4a48;
}

.pm-exp-card-wrap:hover .pm-exp-img {
	transform: scale(1.05);
}

/* ── Dark gradient overlay ────────────────────────────────────────────────── */

.pm-exp-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(0deg, rgba(0, 0, 0, 0.68) 0%, transparent 65%);
	z-index: 1;
}

/* ── Icon badge (white circle, orange border + icon) ─────────────────────── */

.pm-exp-icon {
	position: absolute;
	top: 1.25rem;
	left: 50%;
	transform: translateX(-50%);
	width: 62px;
	height: 62px;
	background: #fff;
	border-radius: 50%;
	border: 2px solid var(--pm-color-orange, #E85D22);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 4;
	transition: left 0.55s ease, transform 0.55s ease;
	flex-shrink: 0;
}

.pm-exp-icon i,
.pm-exp-icon svg {
	color: var(--pm-color-orange, #E85D22);
	font-size: 1.4rem;
	width: 26px;
	height: 26px;
}

/* Left-aligned idle state */
.pm-exp-section--align-left .pm-exp-icon {
	left: 1.25rem;
	transform: translateX(0);
}

/* On hover: icon always anchors left */
.pm-exp-card-wrap:hover .pm-exp-icon {
	left: 1.25rem;
	transform: translateX(0);
}

/* ── Stain / shape background — full-width, slide in on hover ────────────── */

.pm-exp-stain {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: auto;
	z-index: 2;
	opacity: 0;
	pointer-events: none;
	user-select: none;
	transform: translateX(-30px);
	transition: opacity 0.45s ease, transform 0.5s ease;
}

.pm-exp-card-wrap:hover .pm-exp-stain {
	opacity: 1;
	transform: translateX(0);
}

/* ── Content (title + description) ───────────────────────────────────────── */

.pm-exp-content {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 3;
	padding: 1.75rem 1.5rem;
	text-align: center;
	transition: opacity 0.3s ease;
}

/* Fade out content on sibling cards — expandable grids only */
.pm-exp-grid--expandable:hover .pm-exp-card-wrap:not(:hover) .pm-exp-content {
	opacity: 0;
	pointer-events: none;
}

/* Left-align when this wrap is hovered */
.pm-exp-card-wrap:hover .pm-exp-content {
	text-align: left;
}

/* ── Title ────────────────────────────────────────────────────────────────── */

.pm-exp-title {
	font-family: var(--pm-font-header, 'A Love of Thunder', serif);
	font-size: clamp(1.75rem, 2.5vw, 2.25rem);
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin: 0;
	line-height: 1;
}

/* ── Description ──────────────────────────────────────────────────────────── */

.pm-exp-desc {
	font-size: 1rem;
	color: rgba(255, 255, 255, 0.9);
	margin: 0;
	line-height: 1.5;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	transition: max-height 0.5s ease, opacity 0.4s ease, margin-top 0.3s ease;
}

.pm-exp-card-wrap:hover .pm-exp-desc {
	max-height: 6rem;
	opacity: 1;
	margin-top: 0.625rem;
}

/* ── Collapsed rotated label ──────────────────────────────────────────────── */

.pm-exp-label {
	position: absolute;
	top: 65%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(-90deg);
	white-space: nowrap;
	z-index: 4;
	color: #fff;
	font-family: var(--pm-font-header, 'A Love of Thunder', serif);
	font-size: clamp(1.25rem, 1.8vw, 1.75rem);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	opacity: 0;
	pointer-events: none;
	user-select: none;
	transition: opacity 0.3s ease;
}

/* Show rotated label only in expandable grids when a sibling is hovered */
.pm-exp-grid--expandable:hover .pm-exp-card-wrap:not(:hover) .pm-exp-label {
	opacity: 1;
}

/* ── Navigation arrows (hidden on desktop) ───────────────────────────────── */

.pm-exp-nav {
	display: none;
	justify-content: center;
	gap: 3rem;
	align-items: center;
	margin-top: 1.75rem;
}

.pm-exp-nav-btn {
	background: none;
	border: none;
	cursor: pointer;
	padding: 0.5rem;
	line-height: 0;
	transition: opacity 0.2s ease;
}

.pm-exp-nav-btn:hover {
	opacity: 0.75;
}

.pm-exp-nav-btn:disabled {
	opacity: 0.3;
	cursor: default;
}

.pm-exp-nav-arrow {
	width: 80px;
	height: auto;
	display: block;
}

/* Flip the same SVG to point right */
.pm-exp-nav-arrow--next {
	transform: rotate(180deg);
}

/* ── Mobile: image card + below-card content + arrows ───────────────────── */

@media (max-width: 768px) {

	/* Stain: tighter tiles for smaller viewport */
	.pm-exp-deco--stain {
		background-size: 500px auto;
		opacity: 0.5;
		background-repeat: repeat-x;
	}

	/* Shape: smaller for mobile */
	.pm-exp-deco--shape {
		width: clamp(160px, 55vw, 260px);
		top: -25%;
	}

	/* Exclamation: bottom-right of the image area (image = 300px from grid top) */
	.pm-exp-deco--exclamation {
		right: 24px;
		/* aligned with card edge */
		top: 200px;
		/* near bottom of 300px image */
		bottom: auto;
		left: auto;
		width: clamp(50px, 14vw, 90px);
	}

	/* Remove desktop breathing room */
	.pm-exp-slider {
		padding: 0;
	}

	/* Grid: position context for stacked wraps; height = image + content */
	.pm-exp-grid {
		display: block;
		position: relative;
		height: 500px !important;
	}

	/* Card wraps: stack + crossfade */
	.pm-exp-card-wrap {
		position: absolute;
		inset: 0;
		display: flex;
		flex-direction: column;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.4s ease;
		cursor: default;
	}

	.pm-exp-card-wrap.is-active {
		opacity: 1;
		pointer-events: auto;
	}

	/* Card: image portion, horizontal margins give breathing room */
	.pm-exp-card {
		flex: 0 0 300px;
		margin: 0 24px;
		border: none;
		border-radius: 16px;
		overflow: hidden;
	}

	/* Icon: stays inside card, repositioned to top-left */
	.pm-exp-card .pm-exp-icon {
		top: 1rem;
		left: 1rem;
		transform: none;
		transition: none;
	}

	/* Hide desktop-only overlays inside card */
	.pm-exp-card .pm-exp-content,
	.pm-exp-card .pm-exp-label,
	.pm-exp-card .pm-exp-stain {
		display: none;
	}

	/* Mobile body: title + desc below the image */
	.pm-exp-mobile-body {
		display: block;
		flex: 1;
		padding: 1.25rem 24px;
	}

	/* Title in mobile body */
	.pm-exp-mobile-body .pm-exp-title {
		font-size: clamp(1.5rem, 5vw, 2rem);
		color: #fff;
	}

	/* Desc in mobile body: always fully visible */
	.pm-exp-mobile-body .pm-exp-desc {
		max-height: none;
		overflow: visible;
		opacity: 1;
		margin-top: 0.5rem;
		transition: none;
		color: rgba(255, 255, 255, 0.9);
	}

	/* Show navigation arrows */
	.pm-exp-nav {
		display: flex;
	}
}