/**
 * AJ Custom Buttons - Frontend Presentation Styles (v1.1.1)
 */

:root {
	--ajcb-card-hover-scale: 1.03;
	--ajcb-img-zoom: 1.08;
	--ajcb-transition-timing: cubic-bezier(0.25, 1, 0.5, 1);
	--ajcb-transition-duration: 0.4s;
	--ajcb-gap-x: 24px;
	--ajcb-slides-visible: 3;
	--ajcb-edge-clearance: 20px;
}

.ajcb-wrapper {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	overflow: visible;
}

/* ==========================================================================
   TRACK CONTAINER (UNLOCKED OVERFLOW TO PREVENT CLIPPING)
   ========================================================================== */

.ajcb-track-container {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

/* In Grid Mode: Allow cards to expand beyond without cropping */
.ajcb-layout-grid .ajcb-track-container {
	overflow: visible !important;
}

/* In Slider Mode: Horizontal scrolling enabled with scroll-padding */
.ajcb-layout-slider .ajcb-track-container {
	overflow-x: auto;
	overflow-y: visible;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none; /* Firefox */
	-ms-overflow-style: none; /* IE/Edge */
}

.ajcb-layout-slider .ajcb-track-container::-webkit-scrollbar {
	display: none; /* Chrome, Safari */
}

/* Built-in safety clearance prevents side/top/bottom clipping */
.ajcb-track {
	box-sizing: border-box;
	margin: 0;
	padding: var(--ajcb-edge-clearance, 20px);
	list-style: none;
}

/* Grid Layout Mode */
.ajcb-layout-grid .ajcb-track {
	display: grid;
	width: 100%;
	grid-template-columns: repeat(3, 1fr);
	column-gap: var(--ajcb-gap-x);
	row-gap: 24px;
}

/* Slider / Carousel Mode */
.ajcb-layout-slider .ajcb-track {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--ajcb-gap-x);
}

.ajcb-grid-item {
	display: flex;
	box-sizing: border-box;
	min-width: 0;
	position: relative;
	transition: z-index 0.3s ease;
}

/* Elevate hovered grid item over neighbor items */
.ajcb-grid-item:hover,
.ajcb-grid-item:focus-within {
	z-index: 25;
}

.ajcb-layout-slider .ajcb-grid-item {
	flex: 0 0 calc((100% - (var(--ajcb-slides-visible) - 1) * var(--ajcb-gap-x)) / var(--ajcb-slides-visible));
	scroll-snap-align: start;
}

/* ==========================================================================
   SLIDER SIDE ARROWS
   ========================================================================== */

.ajcb-slider-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 30;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background-color: rgba(255, 255, 255, 0.95);
	color: #1a1a1a;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 50%;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	transition: all 0.3s ease;
	outline: none;
}

.ajcb-slider-prev {
	left: -20px;
}

.ajcb-slider-next {
	right: -20px;
}

.ajcb-slider-arrow:hover:not(:disabled) {
	background-color: #c5a880;
	color: #ffffff;
	transform: translateY(-50%) scale(1.08);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}

.ajcb-slider-arrow:disabled {
	opacity: 0.25;
	cursor: not-allowed;
	pointer-events: none;
}

.ajcb-slider-arrow svg {
	width: 20px;
	height: 20px;
	display: block;
}

/* ==========================================================================
   MASTER CARD
   ========================================================================== */

.ajcb-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	width: 100%;
	overflow: hidden;
	box-sizing: border-box;
	text-decoration: none !important;
	color: inherit;
	background-color: #fbf9f5;
	isolation: isolate;
	transform: translateZ(0);
	transition: transform var(--ajcb-transition-duration) var(--ajcb-transition-timing),
	            box-shadow var(--ajcb-transition-duration) var(--ajcb-transition-timing),
	            background-color var(--ajcb-transition-duration) ease;
}

/* Geometry Presets */
.ajcb-shape-square {
	aspect-ratio: 1 / 1;
	border-radius: 0;
}

.ajcb-shape-rounded_square {
	aspect-ratio: 1 / 1;
	border-radius: 20px;
}

.ajcb-shape-rounded_rectangle {
	aspect-ratio: 3 / 4;
	border-radius: 20px;
}

.ajcb-shape-circle {
	aspect-ratio: 1 / 1;
	border-radius: 50%;
}

.ajcb-shape-oval {
	aspect-ratio: 3 / 4;
	border-radius: 50% / 40%;
}

.ajcb-shape-pill {
	aspect-ratio: 16 / 9;
	border-radius: 9999px;
}

/* Media & Overlay Stack */
.ajcb-card-media-wrapper {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 1;
	overflow: hidden;
}

.ajcb-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1);
	transition: transform var(--ajcb-transition-duration) var(--ajcb-transition-timing);
}

.ajcb-card-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 15, 15, 0.25);
	transition: background var(--ajcb-transition-duration) ease;
}

/* Card Content Area */
.ajcb-card-content {
	position: relative;
	z-index: 2;
	display: flex;
	flex-direction: column;
	box-sizing: border-box;
	width: 100%;
	pointer-events: none;
}

.ajcb-card-title {
	margin: 0 0 6px 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.4rem;
	font-weight: 600;
	line-height: 1.25;
	color: #ffffff;
	transition: color 0.3s ease;
}

.ajcb-card-subtitle {
	margin: 0 0 16px 0;
	padding: 0;
	font-size: 0.95rem;
	line-height: 1.4;
	color: #e5e5e5;
	transition: color 0.3s ease;
}

/* ==========================================================================
   CALL TO ACTION BUTTON
   ========================================================================== */

.ajcb-btn-wrapper {
	margin-top: 8px;
}

.ajcb-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	border-radius: 30px;
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	background-color: #ffffff;
	color: #1a1a1a;
	border: 1px solid transparent;
	box-sizing: border-box;
	pointer-events: auto;
	cursor: pointer;
	transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, transform 0.3s var(--ajcb-transition-timing), box-shadow 0.3s ease;
}

.ajcb-btn-icon svg,
.ajcb-btn-icon i {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* DESKTOP HOVER INTERACTIONS */
@media (hover: hover) and (pointer: fine) {
	.ajcb-has-card-zoom:hover {
		transform: scale(var(--ajcb-card-hover-scale));
		z-index: 20;
	}

	.ajcb-card:hover .ajcb-card-image {
		transform: scale(var(--ajcb-img-zoom));
	}

	.ajcb-card:hover .ajcb-card-overlay {
		background: rgba(15, 15, 15, 0.50);
	}

	/* Button Reveal on Card Hover */
	.ajcb-reveal-slide_up .ajcb-btn {
		opacity: 0;
		transform: translateY(20px);
	}
	.ajcb-card:hover.ajcb-reveal-slide_up .ajcb-btn {
		opacity: 1;
		transform: translateY(0);
	}

	.ajcb-reveal-fade_in .ajcb-btn {
		opacity: 0;
	}
	.ajcb-card:hover.ajcb-reveal-fade_in .ajcb-btn {
		opacity: 1;
	}

	.ajcb-reveal-zoom_in .ajcb-btn {
		opacity: 0;
		transform: scale(0.85);
	}
	.ajcb-card:hover.ajcb-reveal-zoom_in .ajcb-btn {
		opacity: 1;
		transform: scale(1);
	}

	/* Direct Button Hover */
	.ajcb-btn:hover {
		box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
	}
}

/* Touch Devices */
@media (hover: none) {
	.ajcb-btn {
		opacity: 1 !important;
		transform: none !important;
	}
}

/* Accessible Focus Rings */
.ajcb-card:focus-visible,
.ajcb-slider-arrow:focus-visible {
	outline: 3px solid #c5a880;
	outline-offset: 4px;
	z-index: 35;
}

/* Reduced Motion Mode */
@media (prefers-reduced-motion: reduce) {
	.ajcb-card,
	.ajcb-card-image,
	.ajcb-card-overlay,
	.ajcb-btn,
	.ajcb-track-container {
		transition: none !important;
		transform: none !important;
		scroll-behavior: auto !important;
	}
	.ajcb-btn {
		opacity: 1 !important;
	}
}