/* =============================================================
 * Vakira Cosmetics — Banner Promo widget
 *
 * Two promo banners sharing a row. The whole tile is the link, so
 * everything here serves one goal: make the tile read as pressable
 * and keep the pair reading as a pair.
 *
 * Notes on what this deliberately does NOT do:
 *
 *   - The two banners are `1fr 1fr`, never `auto`. Letting the grid
 *     size them to their images makes one promo bigger than the
 *     other because of a crop decision, and the bigger one silently
 *     becomes the primary offer.
 *   - The hover moves the tile, it does not decorate it. A border
 *     that appears on hover shifts layout and tells the visitor
 *     nothing; 4px of travel and a shadow say "button".
 *   - The caption's "Link Text" is a span, not an <a> or <button>.
 *     A real control nested inside the banner's own anchor would be
 *     invalid markup and would give the same destination two tab
 *     stops.
 * ============================================================= */

.bsp-promo {
	--bsp-pm-gap: 24px;
	--bsp-pm-radius: 8px;
	--bsp-pm-text: #FFFFFF;
	--bsp-pm-cta: #FFFFFF;
	--bsp-pm-cta-bg: #EF3595;
	--bsp-pm-ease: cubic-bezier(.2, .75, .5, 1);
	--bsp-pm-dur: .45s;

	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(0, 1fr));
	gap: var(--bsp-pm-gap);
}

/* -------------------------------------------------------------
 * The banner tile
 * ----------------------------------------------------------- */
.bsp-promo__item {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--bsp-pm-radius);
	/* 2.4:1 — the shape of the banner artwork this was built for
	 * (1942 × 809). The control overrides it; this is only what an
	 * untouched widget shows. */
	aspect-ratio: 12 / 5;
	background-color: #FFF9FC;
	text-decoration: none;
	/* isolation so the scrim and overlay stack inside the tile's own
	 * context and cannot be re-ordered by a theme z-index. */
	isolation: isolate;
	transition:
		transform var(--bsp-pm-dur) var(--bsp-pm-ease),
		box-shadow var(--bsp-pm-dur) var(--bsp-pm-ease);
}

/* The radius has to be clipped on the image too: a transform on the
 * child during hover can paint a hairline outside the parent's
 * rounded corner on some engines. */
.bsp-promo__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	transition: transform var(--bsp-pm-dur) var(--bsp-pm-ease);
	/* Pulls the image off the parent's clip edge so the zoom never
	 * exposes a 1px seam of background at the corners. */
	transform: scale(1.001);
}

.bsp-promo--shadow .bsp-promo__item {
	box-shadow: 0 2px 10px rgba(22, 18, 31, .08);
}

/* -------------------------------------------------------------
 * Hover
 *
 * Only the anchor variant reacts: a tile with no URL is not a
 * control and must not pretend to be one.
 * ----------------------------------------------------------- */
a.bsp-promo__item:focus-visible {
	outline: 2px solid var(--bsp-pm-cta-bg);
	outline-offset: 3px;
}

.bsp-promo--hover-zoom a.bsp-promo__item:hover .bsp-promo__img,
.bsp-promo--hover-zoom a.bsp-promo__item:focus-visible .bsp-promo__img,
.bsp-promo--hover-zoom-lift a.bsp-promo__item:hover .bsp-promo__img,
.bsp-promo--hover-zoom-lift a.bsp-promo__item:focus-visible .bsp-promo__img {
	transform: scale(1.06);
}

.bsp-promo--hover-lift a.bsp-promo__item:hover,
.bsp-promo--hover-lift a.bsp-promo__item:focus-visible,
.bsp-promo--hover-zoom-lift a.bsp-promo__item:hover,
.bsp-promo--hover-zoom-lift a.bsp-promo__item:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(22, 18, 31, .16);
}

/* Shine: a diagonal highlight crossing the tile once per hover.
 * ::after rather than a real element so the sweep cannot be read by
 * a screen reader or caught by the caption's own stacking. */
.bsp-promo--hover-shine .bsp-promo__item::after {
	content: "";
	position: absolute;
	inset: 0 auto 0 -60%;
	width: 45%;
	z-index: 3;
	pointer-events: none;
	background: linear-gradient(
		100deg,
		rgba(255, 255, 255, 0) 0%,
		rgba(255, 255, 255, .38) 50%,
		rgba(255, 255, 255, 0) 100%
	);
	transform: skewX(-18deg);
	transition: left .7s var(--bsp-pm-ease);
}

.bsp-promo--hover-shine a.bsp-promo__item:hover::after,
.bsp-promo--hover-shine a.bsp-promo__item:focus-visible::after {
	left: 115%;
}

/* Darken on hover — opt-in, and only meaningful under a caption. */
.bsp-promo--overlay .bsp-promo__item::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-color: rgba(22, 18, 31, 0);
	transition: background-color var(--bsp-pm-dur) var(--bsp-pm-ease);
	pointer-events: none;
}

.bsp-promo--overlay a.bsp-promo__item:hover::before,
.bsp-promo--overlay a.bsp-promo__item:focus-visible::before {
	background-color: rgba(22, 18, 31, .22);
}

/* -------------------------------------------------------------
 * Caption
 * ----------------------------------------------------------- */
.bsp-promo__caption {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: flex-end;
	gap: 6px;
	padding: clamp(16px, 3vw, 32px);
	color: var(--bsp-pm-text);
	pointer-events: none;
}

/* The scrim is on the caption, not the tile, so a banner whose text
 * lives inside the artwork never gets a gradient it did not ask for. */
.bsp-promo--scrim .bsp-promo__caption {
	background: linear-gradient(
		to top,
		rgba(16, 12, 24, .62) 0%,
		rgba(16, 12, 24, .28) 45%,
		rgba(16, 12, 24, 0) 78%
	);
}

.bsp-promo--cap-top-left .bsp-promo__caption {
	justify-content: flex-start;
}

.bsp-promo--cap-top-left.bsp-promo--scrim .bsp-promo__caption {
	background: linear-gradient(
		to bottom,
		rgba(16, 12, 24, .62) 0%,
		rgba(16, 12, 24, .28) 45%,
		rgba(16, 12, 24, 0) 78%
	);
}

.bsp-promo--cap-center-left .bsp-promo__caption {
	justify-content: center;
}

.bsp-promo--cap-center .bsp-promo__caption {
	justify-content: center;
	align-items: center;
	text-align: center;
}

.bsp-promo--cap-center-left.bsp-promo--scrim .bsp-promo__caption,
.bsp-promo--cap-center.bsp-promo--scrim .bsp-promo__caption {
	background: rgba(16, 12, 24, .34);
}

.bsp-promo__title {
	font-size: clamp(18px, 2.1vw, 28px);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	/* The caption sits on a photograph; without this the descenders
	 * disappear into a light patch of the image. */
	text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

.bsp-promo__sub {
	font-size: clamp(13px, 1.1vw, 15px);
	line-height: 1.45;
	opacity: .92;
	max-width: 32ch;
	text-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}

/* Reads as a button, is not one — the banner's anchor already owns
 * the click, so this must never take its own tab stop. */
.bsp-promo__cta {
	display: inline-block;
	margin-top: 6px;
	padding: 9px 18px;
	border-radius: 999px;
	background-color: var(--bsp-pm-cta-bg);
	color: var(--bsp-pm-cta);
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: .01em;
	transition: transform var(--bsp-pm-dur) var(--bsp-pm-ease);
}

.bsp-promo--hover-none a.bsp-promo__item:hover .bsp-promo__cta {
	transform: none;
}

a.bsp-promo__item:hover .bsp-promo__cta,
a.bsp-promo__item:focus-visible .bsp-promo__cta {
	transform: translateX(3px);
}

/* -------------------------------------------------------------
 * Stacking
 *
 * Breakpoints match Elementor's own tablet / mobile defaults so the
 * widget changes shape at the same width as everything around it.
 * ----------------------------------------------------------- */
@media (max-width: 1024px) {
	.bsp-promo--stack-tablet {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 767px) {
	.bsp-promo--stack-mobile,
	.bsp-promo--stack-tablet {
		grid-template-columns: 1fr;
	}
}

/* -------------------------------------------------------------
 * Reduced motion
 *
 * The hover feedback is removed, not just shortened: a zoom is the
 * exact kind of movement the setting is asking us to drop. The
 * shadow stays, so hover is still visibly acknowledged.
 * ----------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.bsp-promo__item,
	.bsp-promo__img,
	.bsp-promo__cta,
	.bsp-promo__item::before,
	.bsp-promo__item::after {
		transition: none;
	}

	.bsp-promo a.bsp-promo__item:hover,
	.bsp-promo a.bsp-promo__item:focus-visible {
		transform: none;
	}

	.bsp-promo a.bsp-promo__item:hover .bsp-promo__img,
	.bsp-promo a.bsp-promo__item:focus-visible .bsp-promo__img,
	.bsp-promo a.bsp-promo__item:hover .bsp-promo__cta,
	.bsp-promo a.bsp-promo__item:focus-visible .bsp-promo__cta {
		transform: none;
	}

	.bsp-promo--hover-shine a.bsp-promo__item:hover::after,
	.bsp-promo--hover-shine a.bsp-promo__item:focus-visible::after {
		left: -60%;
	}
}
