/* =============================================================================
   ECW – Elementor Cards Widget | Frontend Styles
   Version: 1.0.0
   ============================================================================= */

/* ----------------------------------------
   1. CSS Custom Properties (defaults)
   ---------------------------------------- */
:root {
	--ecw-card-bg:              #ffffff;
	--ecw-card-radius:          12px;
	--ecw-card-shadow:          0 4px 24px rgba(0, 0, 0, 0.08);
	--ecw-card-shadow-hover:    0 16px 48px rgba(0, 0, 0, 0.14);
	--ecw-overlay-bg:           linear-gradient(180deg, rgba(15, 23, 42, 0) 0%, rgba(15, 23, 42, 0.88) 100%);
	--ecw-btn-bg:               #ffffff;
	--ecw-btn-color:            #0f172a;
	--ecw-btn-radius:           6px;
	--ecw-btn-padding:          10px 24px;
	--ecw-badge-bg:             #6366f1;
	--ecw-badge-color:          #ffffff;
	--ecw-title-color:          #0f172a;
	--ecw-subtitle-color:       #6366f1;
	--ecw-desc-color:           #64748b;
	--ecw-transition:           0.4s ease;
}

/* ----------------------------------------
   2. Grid Layout
   ---------------------------------------- */
.ecw-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
	width: 100%;
}

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

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

/* ----------------------------------------
   3. Card Base
   ---------------------------------------- */
.ecw-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: var(--ecw-card-bg);
	border-radius: var(--ecw-card-radius);
	box-shadow: var(--ecw-card-shadow);
	overflow: hidden;
	transition: box-shadow var(--ecw-transition), transform var(--ecw-transition);
	will-change: transform, box-shadow;
}

.ecw-card:hover {
	box-shadow: var(--ecw-card-shadow-hover);
}

/* ----------------------------------------
   4. Media (Image / Icon) Wrapper
   ---------------------------------------- */
.ecw-card__media {
	position: relative;
	flex-shrink: 0;
	overflow: hidden;
}

.ecw-card__image-wrap {
	position: relative;
	width: 100%;
	padding-bottom: 66%; /* Default 3:2 ratio – overridden by Elementor selector */
	overflow: hidden;
	background-color: #f1f5f9;
}

.ecw-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.ecw-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform var(--ecw-transition);
}

/* Zoom image on hover */
.ecw-card--zoom-image:hover .ecw-card__image img {
	transform: scale(1.07);
}

/* Icon (replaces image) */
.ecw-card__icon {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background-color: #f1f5f9;
}

.ecw-card__icon i,
.ecw-card__icon svg {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: var(--ecw-subtitle-color);
	fill: var(--ecw-subtitle-color);
}

/* ----------------------------------------
   5. Overlay
   ---------------------------------------- */
.ecw-card__overlay {
	position: absolute;
	inset: 0;
	background: var(--ecw-overlay-bg);
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 28px;
	opacity: 0;
	transition: opacity var(--ecw-transition);
	pointer-events: none;
}

.ecw-card:hover .ecw-card__overlay {
	opacity: 1;
	pointer-events: auto;
}

.ecw-card__overlay-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	transition: transform var(--ecw-transition), opacity var(--ecw-transition);
}

/* ============================
   5a. Animation: Slide Up
   ============================ */
.ecw-card--anim-slide-up .ecw-card__overlay-inner {
	transform: translateY(20px);
	opacity: 0;
}

.ecw-card--anim-slide-up:hover .ecw-card__overlay {
	opacity: 1;
}

.ecw-card--anim-slide-up:hover .ecw-card__overlay-inner {
	transform: translateY(0);
	opacity: 1;
}

/* ============================
   5b. Animation: Fade
   ============================ */
.ecw-card--anim-fade .ecw-card__overlay {
	opacity: 0;
}

.ecw-card--anim-fade:hover .ecw-card__overlay {
	opacity: 1;
}

/* ============================
   5c. Animation: Zoom
   ============================ */
.ecw-card--anim-zoom .ecw-card__overlay {
	opacity: 0;
	transform: scale(1.06);
}

.ecw-card--anim-zoom:hover .ecw-card__overlay {
	opacity: 1;
	transform: scale(1);
}

/* ----------------------------------------
   6. Badge / Label
   ---------------------------------------- */
.ecw-card__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 4px 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.4;
	border-radius: 50px;
	background-color: var(--ecw-badge-bg);
	color: var(--ecw-badge-color);
	white-space: nowrap;
}

/* Badge on image */
.ecw-card__badge--on-image {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
}

/* Badge in content body */
.ecw-card__body .ecw-card__badge {
	margin-bottom: 12px;
}

/* ----------------------------------------
   7. Card Body
   ---------------------------------------- */
.ecw-card__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 24px;
	gap: 0;
}

/* ----------------------------------------
   8. Typography
   ---------------------------------------- */
.ecw-card__subtitle {
	margin: 0 0 6px 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--ecw-subtitle-color);
}

.ecw-card__title {
	margin: 0 0 10px 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--ecw-title-color);
}

.ecw-card__description {
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
	color: var(--ecw-desc-color);
	flex: 1;
}

/* ----------------------------------------
   9. Button
   ---------------------------------------- */
.ecw-card__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: var(--ecw-btn-padding);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 0.02em;
	text-decoration: none;
	border-radius: var(--ecw-btn-radius);
	background-color: var(--ecw-btn-bg);
	color: var(--ecw-btn-color);
	border: 2px solid transparent;
	cursor: pointer;
	transition: background-color var(--ecw-transition),
	            color var(--ecw-transition),
	            border-color var(--ecw-transition),
	            transform var(--ecw-transition),
	            box-shadow var(--ecw-transition);
	white-space: nowrap;
}

.ecw-card__button:hover {
	text-decoration: none;
}

/* ----------------------------------------
   10. Featured Card Variation
   ---------------------------------------- */
.ecw-card--featured {
	border: 2px solid var(--ecw-subtitle-color, #6366f1);
}

.ecw-card--featured .ecw-card__title {
	color: inherit;
}

/* ----------------------------------------
   11. Accessibility & Focus
   ---------------------------------------- */
.ecw-card__button:focus-visible {
	outline: 2px solid var(--ecw-subtitle-color, #6366f1);
	outline-offset: 3px;
}

/* ----------------------------------------
   12. Elementor Editor Enhancements
   ---------------------------------------- */
.elementor-editor-active .ecw-card__overlay {
	/* Show partially in editor for easier styling */
}

/* ----------------------------------------
   13. Staggered Entrance Animation (JS-driven)
   ---------------------------------------- */
.ecw-card--will-animate {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity 0.5s ease calc(var(--ecw-anim-delay, 0ms)),
	            transform 0.5s ease calc(var(--ecw-anim-delay, 0ms)),
	            box-shadow var(--ecw-transition);
}

.ecw-card--will-animate.ecw-card--visible {
	opacity: 1;
	transform: translateY(0);
}

/* ----------------------------------------
   14. Keyboard Focus Overlay
   ---------------------------------------- */
.ecw-card--focused .ecw-card__overlay {
	opacity: 1;
	pointer-events: auto;
}

.ecw-card--focused .ecw-card__overlay-inner {
	transform: translateY(0);
	opacity: 1;
}

/* ----------------------------------------
   15. Reduced Motion Support
   ---------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.ecw-card,
	.ecw-card__image img,
	.ecw-card__overlay,
	.ecw-card__overlay-inner,
	.ecw-card__button {
		transition: none !important;
		animation: none !important;
	}
}
