/* Full-width breakout: works inside any theme container */
.bwacp {
	position: relative;
	width: 100vw;
	left: 50%;
	margin-left: -50vw;
	height: var(--bwacp-h, 70vh);
	min-height: 240px;
	overflow: hidden;
	background: #111;
	color: #fff;
	box-sizing: border-box;
}
body:has(.bwacp) { overflow-x: clip; }

.bwacp-track, .bwacp-slide { position: absolute; inset: 0; }
.bwacp-slide {
	opacity: 0;
	visibility: hidden;
	transition: opacity var(--bwacp-speed, 800ms) ease, visibility 0s linear var(--bwacp-speed, 800ms);
}
.bwacp-slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 1;
	transition: opacity var(--bwacp-speed, 800ms) ease;
}
.bwacp-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0,0,0,var(--bwacp-overlay, .3)), rgba(0,0,0,calc(var(--bwacp-overlay, .3) / 3)));
	pointer-events: none;
}
.bwacp .bwacp-img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
	margin: 0;
}
.bwacp-cover { position: absolute; inset: 0; z-index: 2; }

.bwacp-caption {
	position: absolute;
	z-index: 3;
	left: 50%;
	bottom: 12%;
	transform: translateX(-50%);
	width: min(90%, 900px);
	text-align: center;
}
.bwacp-caption h2 { margin: 0 0 .4em; color: #fff; font-size: clamp(1.6rem, 4vw, 3rem); line-height: 1.15; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.bwacp-caption p  { margin: 0 0 1em; color: #fff; font-size: clamp(1rem, 1.8vw, 1.25rem); text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.bwacp-btn {
	display: inline-block;
	padding: .75em 1.6em;
	background: #fff;
	color: #111 !important;
	text-decoration: none;
	font-weight: 600;
	border-radius: 999px;
	transition: transform .2s;
}
.bwacp-btn:hover { transform: translateY(-2px); }

.bwacp-prev, .bwacp-next {
	position: absolute;
	top: 50%;
	z-index: 5;
	transform: translateY(-50%);
	width: 48px;
	height: 48px;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,0,.4);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	transition: background .2s;
}
.bwacp-prev { left: 16px; }
.bwacp-next { right: 16px; }
.bwacp-prev:hover, .bwacp-next:hover { background: rgba(0,0,0,.7); }

.bwacp-dots {
	position: absolute;
	z-index: 5;
	left: 0; right: 0; bottom: 16px;
	display: flex;
	justify-content: center;
	gap: 8px;
}
.bwacp-dots button {
	width: 10px; height: 10px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255,255,255,.5);
	cursor: pointer;
}
.bwacp-dots button.is-active { background: #fff; transform: scale(1.3); }

.bwacp button:focus-visible, .bwacp a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
	.bwacp-slide, .bwacp-slide.is-active { transition: none; }
}

.bwacp { touch-action: pan-y; }

/* ---------- Tablet + mobile image fitting (iPad, tablets, phones) ---------- */
@media (max-width: 1024px), (pointer: coarse) and (max-width: 1366px) {
	/* Mode 1: full image, no cropping – slider takes the image's own proportions */
	.bwacp.bwacp-m-full { height: auto !important; min-height: 0 !important; }
	.bwacp.bwacp-m-full .bwacp-track { position: relative; inset: auto; display: grid; }
	.bwacp.bwacp-m-full .bwacp-slide { position: relative; inset: auto; grid-area: 1 / 1; }
	.bwacp.bwacp-m-full .bwacp-img { width: 100%; height: auto !important; object-fit: contain !important; }

	/* Mode 2: fixed height, cropped to fill */
	.bwacp.bwacp-m-cover { height: var(--bwacp-mh, 60vh); min-height: 0; }
}

/* ---------- Mobile ---------- */
@media (max-width: 768px) {
	.bwacp-caption { bottom: 34px; width: 88%; }
	.bwacp-caption h2 { font-size: clamp(1.05rem, 5vw, 1.5rem); margin-bottom: .3em; }
	.bwacp-caption p {
		font-size: .875rem;
		margin-bottom: .7em;
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}
	.bwacp-btn { padding: .55em 1.2em; font-size: .875rem; }

	.bwacp-prev, .bwacp-next { width: 32px; height: 32px; font-size: 20px; }
	.bwacp-prev { left: 8px; }
	.bwacp-next { right: 8px; }
	.bwacp-dots { bottom: 10px; gap: 6px; }
	.bwacp-dots button { width: 8px; height: 8px; }
}

/* ---------- Kill stray theme / editor spacing around the slider ---------- */
.bwacp.bwacp { display: block; margin-top: var(--bwacp-mt, 0); margin-bottom: 0; padding: 0; border: 0; }
p:has(> .bwacp) { margin: 0; padding: 0; }
p:has(> .bwacp) > br { display: none; }
p:empty:has(+ .bwacp), p:empty:has(+ p > .bwacp) { display: none; margin: 0; padding: 0; }
