/* ============================================================
   Cards Generator — Frontend Styles  v1.2.0
   Elementor control selectors override these base defaults.
   ============================================================ */

/* ── CSS custom properties ──────────────────────────────────── */

.acg-card--scrollable .acg-card-body {
	--acg-sb-thumb: #cccccc;
	--acg-sb-track: transparent;
}

.acg-ai-body {
	--acg-ai-sb-thumb: #dddddd;
	--acg-ai-sb-track: transparent;
}

/* ── Wrapper ────────────────────────────────────────────────── */

.acg-wrapper {
	width: 100%;
}

/* ── Grid ──────────────────────────────────────────────────── */

.acg-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 20px;
}

.acg-grid:not(.acg-equal-height) {
	align-items: start;
}

/* ── Card ──────────────────────────────────────────────────── */

.acg-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	transition: all 0.25s ease;
}

/* Full-card link wrapper */
.acg-card-link {
	display: flex;
	flex-direction: column;
	flex: 1;
	text-decoration: none !important;
	color: inherit;
}

.acg-card-link *,
.acg-card-link:hover *,
.acg-card-link:visited * {
	text-decoration: none !important;
}

/* ── Image ──────────────────────────────────────────────────── */

.acg-card-image {
	width: 100%;
	height: 220px;
	overflow: hidden;
	flex-shrink: 0;
	position: relative;
}

.acg-card-image img,
.acg-card-image .acg-img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	object-position: center center;
}

/* Overlay — color + opacity:1 are injected by Elementor on hover */
.acg-card-image::after {
	content: "";
	position: absolute;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.3s ease;
}

/* ── Badge ──────────────────────────────────────────────────── */

.acg-badge {
	position: absolute;
	z-index: 2;
	pointer-events: none;
	line-height: 1.4;
	white-space: nowrap;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	background: #e53935;
	color: #fff;
	padding: 3px 8px;
	border-radius: 4px;
}

.acg-badge--top-right    { top: 12px; right: 12px; }
.acg-badge--top-left     { top: 12px; left: 12px; }
.acg-badge--bottom-right { bottom: 12px; right: 12px; }
.acg-badge--bottom-left  { bottom: 12px; left: 12px; }

/* ── Card body ──────────────────────────────────────────────── */

.acg-card-body {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* ── Card body scroller ─────────────────────────────────────── */

.acg-card--scrollable .acg-card-body {
	overflow-y: auto;
	max-height: 320px;
	/* Firefox */
	scrollbar-width: thin;
	scrollbar-color: var(--acg-sb-thumb) var(--acg-sb-track, transparent);
}

/* Webkit (Chrome / Safari / Edge) */
.acg-card--scrollable .acg-card-body::-webkit-scrollbar {
	width: 4px;
}
.acg-card--scrollable .acg-card-body::-webkit-scrollbar-track {
	background-color: transparent;
}
.acg-card--scrollable .acg-card-body::-webkit-scrollbar-thumb {
	background-color: var(--acg-sb-thumb);
	border-radius: 4px;
}

/* ── Title ──────────────────────────────────────────────────── */

.acg-card-title {
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 8px;
}

/* ── Description ────────────────────────────────────────────── */

.acg-card-desc {
	color: #555;
	margin: 0;
}

/* ── AI Summary box ─────────────────────────────────────────── */

.acg-ai-summary {
	margin-top: 12px;
	padding: 14px 16px;
	background: #fff8f5;
	border: 1px solid #e8d8d0;
	border-radius: 8px;
}

.acg-ai-label {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 5px;
	margin: 0 0 10px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.6px;
	color: #aaaaaa;
}

.acg-ai-label-text {
	line-height: 1;
}

.acg-ai-icon {
	font-size: 13px;
	line-height: 1;
}

/* Scrollable container inside the AI box */
.acg-ai-body {
	/* overflow-y injected by Elementor max-height control when set */
	scrollbar-width: thin;
	scrollbar-color: var(--acg-ai-sb-thumb) var(--acg-ai-sb-track, transparent);
}

.acg-ai-body::-webkit-scrollbar {
	width: 4px;
}
.acg-ai-body::-webkit-scrollbar-track {
	background-color: transparent;
}
.acg-ai-body::-webkit-scrollbar-thumb {
	background-color: var(--acg-ai-sb-thumb);
	border-radius: 4px;
}

.acg-ai-text {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: #555;
}

/* ── Button ─────────────────────────────────────────────────── */

.acg-card-btn-wrap {
	margin-top: 12px;
	display: flex;
}

.acg-card-btn {
	display: inline-block;
	padding: 8px 20px;
	background: #222;
	color: #fff;
	border-radius: 4px;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.4;
	cursor: pointer;
	transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
	border: 1px solid transparent;
	text-decoration: none;
	user-select: none;
}

/* ── Reduced-motion (WCAG 2.2 / 2026 a11y standard) ────────── */

@media (prefers-reduced-motion: reduce) {
	.acg-card,
	.acg-card-image img,
	.acg-card-image::after,
	.acg-card-btn {
		transition: none !important;
	}
}

/* ── Responsive fallbacks ───────────────────────────────────── */

@media (max-width: 1024px) {
	.acg-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 767px) {
	.acg-grid {
		grid-template-columns: 1fr;
	}
}
