/* ==========================================================================
   LDM Promo Grid — v1.0.4
   Card grid for Popup Maker popups. Two looks:
     .ldm-promo--glass  frosted rounded panel (default)
     .ldm-promo--float  no panel; cards float over the blurred page
   Tweak the custom properties below rather than the rules.
   ========================================================================== */

.ldm-promo {
	--ldm-accent: #c2317a;            /* site magenta, used for glow + focus ring */
	--ldm-panel-radius: 24px;
	--ldm-card-radius: 14px;
	--ldm-gap: clamp(10px, 1.6vw, 16px);
	--ldm-cols: 3;                     /* set per-popup by the shortcode's columns / mobile_columns */
	--ldm-cols-mobile: 2;
	--ldm-zoom: 1.06;                  /* image zoom on hover */
	--ldm-lift: -4px;                  /* card lift on hover */
	--ldm-ease: cubic-bezier(.2, .7, .2, 1);
	--ldm-serif: "Playfair Display", Georgia, "Times New Roman", serif;
	--ldm-sans: inherit;

	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 1040px;
	margin: 0 auto;
	color: #fff;
	font-family: var(--ldm-sans);
}
.ldm-promo *,
.ldm-promo *::before,
.ldm-promo *::after { box-sizing: border-box; }

/* ---------- Look A: glass panel ---------- */
.ldm-promo--glass {
	padding: clamp(18px, 3vw, 34px);
	border-radius: var(--ldm-panel-radius);
	background:
		radial-gradient(120% 80% at 0% 0%, rgba(194, 49, 122, .18), transparent 60%),
		linear-gradient(160deg, rgba(36, 14, 32, .86), rgba(10, 5, 12, .92));
	-webkit-backdrop-filter: blur(18px) saturate(1.2);
	backdrop-filter: blur(18px) saturate(1.2);
	/* hairline instead of a border: reads as an edge, not a frame */
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, .07),
		0 40px 100px -30px rgba(0, 0, 0, .85);
	animation: ldm-promo-in .55s var(--ldm-ease) both;
}

/* ---------- Look B: floating cards ---------- */
.ldm-promo--float { padding: 8px; }
.ldm-promo--float .ldm-promo__card {
	box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .9);
}

/* ---------- Header ---------- */
.ldm-promo__head {
	text-align: center;
	margin: 0 48px clamp(14px, 2.4vw, 26px);
}
.ldm-promo__eyebrow {
	margin: 0 0 6px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .32em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .55);
}
.ldm-promo__eyebrow::before,
.ldm-promo__eyebrow::after {
	content: "";
	display: inline-block;
	width: 28px;
	height: 1px;
	margin: 0 12px;
	vertical-align: middle;
	background: currentColor;
	opacity: .6;
}
.ldm-promo__title {
	margin: 0;
	font-family: var(--ldm-serif);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(22px, 3vw, 34px);
	line-height: 1.15;
	letter-spacing: 0;
	text-transform: none;
	color: #fff;
}

/* ---------- Close button ---------- */
.ldm-promo__close {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 3;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .08);
	color: rgba(255, 255, 255, .8);
	cursor: pointer;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
	transition: background .25s, color .25s, transform .4s var(--ldm-ease);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}
.ldm-promo__close svg { width: 16px; height: 16px; display: block; }
.ldm-promo__close:hover {
	background: rgba(255, 255, 255, .18);
	color: #fff;
	transform: rotate(90deg);
}
.ldm-promo--float .ldm-promo__close { top: -6px; right: -6px; }

/* ---------- Grid + cards ---------- */
.ldm-promo__grid {
	display: grid;
	grid-template-columns: repeat(var(--ldm-cols), minmax(0, 1fr));
	gap: var(--ldm-gap);
}

.ldm-promo__card {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	border-radius: var(--ldm-card-radius);
	/* Safari: keep rounded corners clipped while the child image scales */
	isolation: isolate;
	-webkit-mask-image: -webkit-radial-gradient(white, black);
	background: #111;
	color: #fff;
	text-decoration: none !important;
	border: 0 !important;
	box-shadow: 0 0 0 1px rgba(255, 255, 255, .06), 0 10px 30px -14px rgba(0, 0, 0, .8);
	transition:
		transform .5s var(--ldm-ease),
		box-shadow .5s var(--ldm-ease),
		opacity .4s,
		filter .4s;
	animation: ldm-card-in .6s var(--ldm-ease) both;
	animation-delay: calc(120ms + var(--i, 0) * 60ms);
}

.ldm-promo__media,
.ldm-promo__media img {
	display: block;
	width: 100%;
	height: 100%;
}
.ldm-promo__media img {
	object-fit: cover;
	max-width: none;
	border-radius: 0;
	transform: scale(1.001);
	transition: transform .9s var(--ldm-ease);
}

/* soft light sweep across the card on hover */
.ldm-promo__card::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .16) 50%, transparent 65%);
	transform: translateX(-120%);
	transition: transform 0s;
}

/* optional text label (for artwork without a baked-in button) */
.ldm-promo__label {
	position: absolute;
	left: 50%;
	bottom: 12px;
	z-index: 1;
	transform: translateX(-50%);
	padding: 8px 18px;
	border-radius: 999px;
	background: rgba(0, 0, 0, .45);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .18em;
	text-transform: uppercase;
	white-space: nowrap;
	/* set here, not inherited from the <a>: the site's a:visited / a:focus /
	   a:active colours (black) beat .ldm-promo__card's colour on specificity */
	color: #fff !important;
	transition: background .3s;
}
.ldm-promo a.ldm-promo__card:is(:link, :visited, :hover, :focus, :active) { color: #fff; }

/* ---------- Two-link cards ---------- */
.ldm-promo__cover {
	position: absolute;
	inset: 0;
	z-index: 1;
}
.ldm-promo__actions {
	position: absolute;
	left: 10px;
	right: 10px;
	bottom: 12px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;               /* stacks to two rows when the card is narrow */
	justify-content: center;
	gap: 6px;
}
.ldm-promo .ldm-promo__btn {
	flex: 0 1 auto;
	padding: 8px 14px;
	border: 0;
	border-radius: 999px;
	background: rgba(0, 0, 0, .45);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .35);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: .14em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	color: #fff !important;
	transition: background .3s;
}
/* beat the site's a:visited / a:focus / a:active colours */
.ldm-promo .ldm-promo__btn:is(:link, :visited, :hover, :focus, :active) {
	color: #fff !important;
	text-decoration: none;
}
.ldm-promo__btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---------- Hover (real pointers only — no sticky hover on phones) ---------- */
@media (hover: hover) and (pointer: fine) {
	.ldm-promo__card:hover {
		transform: translateY(var(--ldm-lift));
		box-shadow:
			0 0 0 1px rgba(255, 255, 255, .18),
			0 22px 44px -16px color-mix(in srgb, var(--ldm-accent) 70%, transparent),
			0 12px 30px -12px rgba(0, 0, 0, .9);
	}
	.ldm-promo__card:hover .ldm-promo__media img { transform: scale(var(--ldm-zoom)); }
	.ldm-promo__card:hover::after {
		transform: translateX(120%);
		transition: transform 1.1s var(--ldm-ease);
	}
	.ldm-promo__card:hover .ldm-promo__label { background: var(--ldm-accent); }
	.ldm-promo .ldm-promo__btn:hover { background: var(--ldm-accent); }

	/* quiet the other cards so the hovered one leads */
	.ldm-promo__grid:hover .ldm-promo__card:not(:hover) {
		opacity: .62;
		filter: saturate(.75);
	}
}

.ldm-promo__card:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
	box-shadow: 0 0 0 6px var(--ldm-accent);
}
.ldm-promo__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* ---------- Entrance (re-runs every time Popup Maker shows the popup) ---------- */
@keyframes ldm-promo-in {
	from { opacity: 0; transform: translateY(14px) scale(.97); }
	to   { opacity: 1; transform: none; }
}
@keyframes ldm-card-in {
	from { opacity: 0; transform: translateY(12px) scale(.96); }
	to   { opacity: 1; transform: none; }
}

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
	.ldm-promo { --ldm-panel-radius: 18px; --ldm-card-radius: 10px; }
	/* on the grid, not .ldm-promo — the inline --ldm-cols on .ldm-promo would win there */
	.ldm-promo__grid { grid-template-columns: repeat(var(--ldm-cols-mobile), minmax(0, 1fr)); }
	.ldm-promo--glass { padding: 16px 14px 14px; }
	.ldm-promo__head { margin: 4px 44px 14px; }
	.ldm-promo__eyebrow { font-size: 10px; letter-spacing: .24em; }
	.ldm-promo__eyebrow::before,
	.ldm-promo__eyebrow::after { display: none; }
	.ldm-promo__close { top: 10px; right: 10px; width: 34px; height: 34px; }
	.ldm-promo__actions { left: 8px; right: 8px; bottom: 8px; gap: 5px; }
	.ldm-promo .ldm-promo__btn { padding: 6px 10px; font-size: 10px; letter-spacing: .1em; }
	.ldm-promo--float .ldm-promo__close { top: -4px; right: -4px; }
}

@media (prefers-reduced-motion: reduce) {
	.ldm-promo,
	.ldm-promo__card,
	.ldm-promo__media img,
	.ldm-promo__card::after { animation: none !important; transition: none !important; }
	.ldm-promo__card:hover { transform: none; }
	.ldm-promo__card:hover .ldm-promo__media img { transform: none; }
}

/* ==========================================================================
   Popup Maker overrides — only for popups that contain an .ldm-promo.
   Strips the theme's frame so our panel is the whole popup.
   ========================================================================== */
.pum-overlay:has(.ldm-promo) {
	background-color: rgba(12, 4, 12, .55) !important;
	-webkit-backdrop-filter: blur(10px) saturate(1.1);
	backdrop-filter: blur(10px) saturate(1.1);
}
.pum-container:has(.ldm-promo) {
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
}
.pum-container:has(.ldm-promo) {
	/* never wider than the screen, whatever size is set in Popup Maker */
	max-width: calc(100vw - 24px) !important;
	min-width: 0 !important;
}
.pum-container:has(.ldm-promo) > .pum-close { display: none !important; }
.pum-container:has(.ldm-promo) .pum-content { outline: 0; }
.pum-container:has(.ldm-promo) .pum-content > p:empty { display: none; }

/* ---------- Page-lock shift fix (site-wide, any Popup Maker popup) ----------
   When a popup opens, Popup Maker hides the page scrollbar and pads every
   direct child of <body> with a hard-coded 15px to make up for it. Phones (and
   Macs set to hide scrollbars) have no scrollbar taking up width, so the whole
   page jumps 15px left and a strip of bare body background shows on the right.
   Pad by the real scrollbar width instead, measured by the plugin's inline JS
   (0 on phones). */
html.pum-open.pum-open-overlay.pum-open-scrollable body > :not([aria-modal="true"]) {
	padding-right: var(--ldm-sbw, 0px) !important;
}
