/* WA Advertisers Carousel
 * Front-end styles. BEM-ish class names, scoped under .wa-adv.
 * Layout-agnostic base + per-layout rules (carousel / grid / single).
 */

.wa-adv {
	--wa-adv-gap: 16px;
	width: 100%;
}

/* ---- Header ---------------------------------------------------- */
.wa-adv__header {
	margin: 0 0 1rem;
}
.wa-adv__title {
	margin: 0 0 0.25rem;
}
.wa-adv__subtitle {
	margin: 0;
}

/* ---- Viewport / track (shared) -------------------------------- */
.wa-adv__viewport {
	position: relative;
}
.wa-adv__track {
	display: flex;
	gap: var(--wa-adv-gap);
}
.wa-adv__item {
	box-sizing: border-box;
	flex: 0 0 auto;
	margin: 0;
	background: transparent;
}
.wa-adv__item img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
}
.wa-adv__link {
	display: block;
	text-decoration: none;
}

/* ---- GRID ------------------------------------------------------ */
.wa-adv--grid .wa-adv__track {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
}
.wa-adv--grid .wa-adv__item {
	flex: initial;
	width: 100%;
}

/* ---- CAROUSEL -------------------------------------------------- */
.wa-adv--carousel .wa-adv__viewport {
	overflow: hidden;
}
.wa-adv--carousel .wa-adv__track {
	transition: transform 0.45s ease;
	will-change: transform;
}
/* Slide width is set inline by JS (flex-basis) based on slides-visible.
 * Before JS runs, fall back to a sensible 3-up so there's no jump. */
.wa-adv--carousel .wa-adv__item {
	flex: 0 0 calc((100% - (var(--wa-adv-gap) * 2)) / 3);
}

/* Arrows */
.wa-adv__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #fff;
	background: rgba(0, 0, 0, 0.55);
	border: none;
	border-radius: 50%;
	transition: opacity 0.2s ease, background 0.2s ease;
}
.wa-adv__arrow:hover {
	background: rgba(0, 0, 0, 0.8);
}
.wa-adv__arrow--prev { left: 8px; }
.wa-adv__arrow--next { right: 8px; }
.wa-adv__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

/* Dots */
.wa-adv__dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}
.wa-adv__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	cursor: pointer;
	background: rgba(0, 0, 0, 0.25);
	border: none;
	border-radius: 50%;
	transition: background 0.2s ease, transform 0.2s ease;
}
.wa-adv__dot.is-active {
	background: rgba(0, 0, 0, 0.75);
	transform: scale(1.2);
}

/* ---- SINGLE / FULL-WIDTH BANNER (one at a time) --------------- */
.wa-adv--single .wa-adv__track {
	display: block;
	position: relative;
}
.wa-adv--single .wa-adv__item {
	width: 100%;
	flex: initial;
}
/* Banner image fills the available width at its true proportions (never cropped). */
.wa-adv--single .wa-adv__item img {
	width: 100%;
	height: auto;
	object-fit: contain;
}
/* JS toggles .is-shown; before JS, show only the first item. */
.wa-adv--single .wa-adv__item { display: none; }
.wa-adv--single .wa-adv__item.is-shown,
.wa-adv--single .wa-adv__item:first-child { display: block; }
.wa-adv--single.wa-adv--js .wa-adv__item:first-child:not(.is-shown) { display: none; }
/* Gentle fade as each banner appears. */
.wa-adv--single.wa-adv--js .wa-adv__item.is-shown {
	animation: waAdvFade 0.5s ease;
}
@keyframes waAdvFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ---- CTA ------------------------------------------------------- */
.wa-adv__cta-wrap {
	margin-top: 1.25rem;
	text-align: center;
}
.wa-adv__cta {
	display: inline-block;
	padding: 12px 24px;
	color: #fff;
	background: #c8102e; /* tribune-ish red default; overridden by Style tab */
	text-decoration: none;
	border-radius: 4px;
}

/* ---- Empty / editor states ------------------------------------ */
.wa-adv__empty {
	padding: 1rem;
	text-align: center;
	opacity: 0.7;
}
/* Inactive ads are hidden on the live site; JS also enforces this.
 * They remain visible inside the Elementor editor (handled in PHP). */
.wa-adv__item--inactive { display: none; }
.elementor-editor-active .wa-adv__item--inactive {
	display: block;
	position: relative;
	outline: 2px dashed rgba(200, 16, 46, 0.6);
	outline-offset: -2px;
	opacity: 0.55;
}
.wa-adv__editor-flag {
	display: block;
	margin-top: 4px;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
	color: #c8102e;
}

/* Reduced motion: never auto-animate transforms. */
@media (prefers-reduced-motion: reduce) {
	.wa-adv--carousel .wa-adv__track { transition: none; }
	.wa-adv--single.wa-adv--js .wa-adv__item.is-shown { animation: none; }
}
