/* ==========================================================================
   AG Community Slider
   ========================================================================== */

.ag-community-slider {
	position: relative;
	width: 100%;
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
}

.ag-community-slider.is-dragging {
	cursor: grabbing;
	user-select: none;
}

/* --------------------------------------------------------------------------
   Slides Container — Absolute stacking (no height jumping)
   -------------------------------------------------------------------------- */

.ag-community-slider__slides {
	position: relative;
	width: 100%;
	height: var(--ag-slider-height, 600px);
	min-height: 520px;
}

/* --------------------------------------------------------------------------
   Individual Slide — All slides stacked, only active is visible
   -------------------------------------------------------------------------- */

.ag-community-slider__slide {
	position: absolute;
	inset: 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	width: 100%;
}

.ag-community-slider__slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.ag-motion-enhanced .ag-community-slider__slide.is-active {
	/* GSAP handles transitions — no CSS animation needed */
}

/* --------------------------------------------------------------------------
   Content Panel (Left)
   -------------------------------------------------------------------------- */

.ag-community-slider__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	background: var(--ag-slide-bg, #F2F2F2);
	padding: 64px 64px 96px 7vw;
	/* 96px bottom = 48px nav offset + 36px nav height + 12px gap */
	overflow: hidden;
	min-height: 0;
	/* Grid child fix */
}

.ag-slide-label {
	font-family: var(--ag-font-heading) !important;
	font-weight: 600 !important;
	font-size: max(11px, 0.9vw) !important;
	line-height: var(--ag-line-height-body) !important;
	text-box-edge: cap alphabetic;
	text-box-trim: trim-both;
	text-transform: uppercase;
	letter-spacing: var(--ag-tracking-wider);
	margin-bottom: 16px;
}

.ag-community-slider__content h3 {
	font-weight: 300 !important;
	color: var(--ag-dark);
	margin-bottom: 24px;
}

.ag-community-slider__body {
	font-family: var(--ag-font-body) !important;
	font-weight: 400 !important;
	font-size: max(14px, 1.2vw) !important;
	line-height: 1.5 !important;
	color: var(--ag-text-gray);
	margin-bottom: 40px;
	max-width: 90%;
}

/* --------------------------------------------------------------------------
   CTA Button
   -------------------------------------------------------------------------- */

.ag-community-slider__btn {
	display: inline-block;
	font-family: var(--ag-font-heading) !important;
	font-weight: 600;
	font-size: max(13px, 1vw);
	line-height: 1.5;
	letter-spacing: var(--ag-tracking-normal);
	color: var(--ag-dark);
	border: 2px solid var(--ag-olive);
	border-radius: 50px;
	padding: 24px 64px;
	text-box-edge: cap alphabetic;
	text-box-trim: trim-both;
	text-decoration: none;
	transition: background var(--ag-motion-duration-base, 0.46s) var(--ag-motion-ease-standard, cubic-bezier(0.22, 1, 0.36, 1)),
		color var(--ag-motion-duration-base, 0.46s) var(--ag-motion-ease-standard, cubic-bezier(0.22, 1, 0.36, 1)),
		border-color var(--ag-motion-duration-base, 0.46s) var(--ag-motion-ease-standard, cubic-bezier(0.22, 1, 0.36, 1));
	align-self: flex-start;
}

.ag-community-slider__btn:hover,
.ag-community-slider__btn:focus {
	background: var(--ag-olive);
	border-color: var(--ag-olive);
	color: var(--ag-white);
}

.ag-community-slider__btn:focus-visible {
	outline: 2px solid var(--ag-olive);
	outline-offset: 3px;
}

.ag-community-slider__cta-row {
	display: flex;
	align-items: center;
	gap: 24px;
	align-self: flex-start;
}

.ag-community-slider__number-mobile {
	display: none;
}

/* --------------------------------------------------------------------------
   Image Panel (Right)
   -------------------------------------------------------------------------- */

.ag-community-slider__image {
	position: relative;
	overflow: hidden;
	min-height: 0;
	/* Grid child fix — allow shrinking below intrinsic size */
}

.ag-community-slider__image::before {
	content: '';
	position: absolute;
	top: 0;
	right: 0;
	width: 50%;
	height: 100%;
	background: var(--ag-white);
	clip-path: polygon(100% 50%, 50% 100%, 100% 100%);
	z-index: 1;
	pointer-events: none;
}

.ag-community-slider__img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover !important;
}

/* --------------------------------------------------------------------------
   Slide Number
   -------------------------------------------------------------------------- */

.ag-community-slider__number {
	position: absolute;
	bottom: 24px;
	right: 40px;
	font-family: var(--ag-font-heading);
	font-weight: 400;
	font-size: max(40px, 3.9vw);
	line-height: 1;
	letter-spacing: var(--ag-tracking-wider);
	color: var(--ag-olive);
	z-index: 2;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Decorative Lettermark
   -------------------------------------------------------------------------- */

.ag-community-slider__lettermark {
	position: absolute;
	top: 50%;
	right: 5%;
	transform: translateY(-50%);
	width: max(200px, 25vw);
	height: auto;
	color: rgba(255, 255, 255, 0.12);
	pointer-events: none;
	z-index: 1;
}

.ag-community-slider__lettermark svg {
	width: 100%;
	height: auto;
	display: block;
}

/* --------------------------------------------------------------------------
   Navigation — Counter + Progress Bar
   -------------------------------------------------------------------------- */

.ag-community-slider__nav {
	position: absolute;
	bottom: 48px;
	left: 7vw;
	display: flex;
	align-items: center;
	gap: 12px;
	z-index: 5;
}

/* Arrow buttons — borderless circles with chevron */
.ag-community-slider__nav-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: none;
	border-radius: 50%;
	background: transparent;
	color: var(--ag-dark);
	cursor: pointer;
	padding: 0;
	transition: color 0.2s ease, background 0.2s ease;
}

.ag-community-slider__nav-arrow:hover,
.ag-community-slider__nav-arrow:focus {
	color: var(--ag-olive);
	background: rgba(135, 168, 14, 0.08);
}

.ag-community-slider__nav-arrow:focus-visible {
	outline: 2px solid var(--ag-olive);
	outline-offset: 2px;
}

.ag-community-slider__nav-arrow svg {
	width: 16px;
	height: 16px;
}

/* Counter row: current + progress + total */
.ag-community-slider__counter {
	display: flex;
	align-items: center;
	gap: 10px;
	font-family: var(--ag-font-heading);
	font-weight: 500;
	font-size: 14px;
	line-height: 1;
	color: var(--ag-dark);
	letter-spacing: 0.05em;
}

/* Progress track */
.ag-community-slider__progress-track {
	width: 60px;
	height: 2px;
	background: rgba(0, 0, 0, 0.1);
	border-radius: 1px;
	overflow: hidden;
	position: relative;
}

/* Progress fill — CSS animation driven by --ag-autoplay-speed */
.ag-community-slider__progress-fill {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	width: 0;
	background: var(--ag-olive);
	border-radius: 1px;
}

.ag-community-slider__progress-fill.is-animating {
	animation: agProgressFill var(--ag-autoplay-speed, 7000ms) linear forwards;
}

/* Pause animation on hover */
.ag-community-slider.is-paused .ag-community-slider__progress-fill.is-animating {
	animation-play-state: paused;
}

@keyframes agProgressFill {
	from {
		width: 0;
	}

	to {
		width: 100%;
	}
}

/* --------------------------------------------------------------------------
   Responsive — Tablet
   -------------------------------------------------------------------------- */

@media (max-width: 999px) {
	.ag-community-slider__slides {
		height: var(--ag-slider-height-tablet, 500px);
		min-height: 480px;
	}

	.ag-community-slider__content {
		padding: 48px 40px 80px;
		/* 32px nav offset + 36px nav height + 12px gap */
	}

	.ag-community-slider__nav {
		bottom: 32px;
		left: 40px;
	}
}

/* --------------------------------------------------------------------------
   Responsive — Mobile
   -------------------------------------------------------------------------- */

@media (max-width: 689px) {
	.ag-community-slider__slides {
		height: var(--ag-slider-height-mobile, 580px);
	}

	.ag-community-slider__slide {
		grid-template-columns: 1fr;
		grid-template-rows: 250px 1fr;
	}

	.ag-community-slider__image {
		order: -1;
		overflow: hidden;
	}

	.ag-community-slider__content {
		padding: 40px 24px 72px;
		/* 24px nav offset + 36px nav height + 12px gap */
		background: var(--ag-slide-bg-mobile, var(--ag-slide-bg, #F2F2F2));
	}

	.ag-community-slider__number {
		bottom: 16px;
		top: auto;
		right: 16px;
		font-size: 36px;
	}

	.ag-community-slider__lettermark {
		top: auto;
		bottom: 0;
		right: 0;
		transform: none;
		width: 140px;
	}

	.ag-community-slider__nav {
		bottom: 24px;
		left: 24px;
	}

	.ag-community-slider__progress-track {
		width: 40px;
	}

	/* Hide image panel on mobile when setting is off */
	.ag-community-slider--hide-image-mobile .ag-community-slider__slide {
		grid-template-rows: 1fr;
	}

	.ag-community-slider--hide-image-mobile .ag-community-slider__image {
		display: none;
	}

	.ag-community-slider--hide-image-mobile .ag-community-slider__lettermark {
		display: none;
	}

	.ag-community-slider--hide-image-mobile .ag-community-slider__content {
		justify-content: flex-start;
		padding-bottom: 132px;
	}

	.ag-community-slider--hide-image-mobile .ag-community-slider__cta-row {
		display: flex;
		align-self: stretch;
		justify-content: space-between;
		gap: 12px;
		width: 100%;
	}

	.ag-community-slider--hide-image-mobile .ag-community-slider__btn {
		align-self: auto;
	}

	.ag-community-slider--hide-image-mobile .ag-community-slider__number-mobile {
		display: inline-block;
		font-family: var(--ag-font-heading);
		font-weight: 400;
		font-size: clamp(52px, 14vw, 72px);
		line-height: 0.9;
		letter-spacing: var(--ag-tracking-wider);
		color: var(--ag-olive);
		pointer-events: none;
	}
}

@media (max-width: 376px) {
	.ag-community-slider {
		overflow: visible !important;
	}

	.ag-community-slider__nav {
		bottom: -40px;
		left: 24px;
	}
}