/* ==========================================================================
   Elementor News Carousel Widget — Styles
   ========================================================================== */

/* --------------------------------------------------------------------------
   Wrapper & Layout
   -------------------------------------------------------------------------- */
.encw-carousel-wrapper {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.encw-carousel-viewport {
	overflow: hidden;
	width: 100%;
}

.encw-carousel-track {
	display: flex;
	transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
	will-change: transform;
}

.encw-slide {
	flex: 0 0 auto;
	box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   Card — image fills the entire card as background
   -------------------------------------------------------------------------- */
.encw-card {
	position: relative;
	border-radius: 8px;
	overflow: hidden;
	min-height: 340px;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.encw-card:hover {
	/* transform y box-shadow controlados desde Elementor */
}

/* --------------------------------------------------------------------------
   Card image — absolute, fills card completely
   -------------------------------------------------------------------------- */
.encw-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	z-index: 0;
}

.encw-card__image a {
	display: block;
	width: 100%;
	height: 100%;
}

.encw-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	display: block;
	transition: transform 0.55s ease;
}

/* zoom on hover — activated by Elementor control via inline selector */
.encw-card:hover .encw-card__image img {
	transform: scale(1);
}

.encw-card__image-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
}

/* --------------------------------------------------------------------------
   Gradient overlay — darkens the bottom for text legibility
   -------------------------------------------------------------------------- */
.encw-card__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(to bottom, transparent 35%, rgba(0, 0, 0, 0.72) 100%);
	z-index: 1;
	pointer-events: none;
}

/* --------------------------------------------------------------------------
   Date badge — flush with top-left card corner
   -------------------------------------------------------------------------- */
.encw-date-badge {
	position: absolute;
	top: 0;
	left: 0;
	background-color: #2563eb;
	color: #ffffff;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 8px 12px;
	border-radius: 0 0 6px 0;
	line-height: 1;
	min-width: 52px;
	z-index: 3;
	pointer-events: none;
}

/* Day — large number */
.encw-date-badge__day {
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1;
	display: block;
}

/* Month | Year — smaller row */
.encw-date-badge__month-year {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	margin-top: 2px;
	display: flex;
	align-items: center;
	gap: 2px;
}

.encw-date-badge__separator {
	opacity: 0.6;
	font-weight: 400;
}

/* --------------------------------------------------------------------------
   Card body — positioned over overlay (default: bottom)
   -------------------------------------------------------------------------- */
.encw-card__body {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	top: auto;
	z-index: 2;
	padding: 16px 18px 20px;
	display: flex;
	flex-direction: column;
	transform: none;
}

/* Position: top */
.encw-card__body--top {
	bottom: auto;
	top: 0;
	transform: none;
}

/* Position: center */
.encw-card__body--center {
	bottom: auto;
	top: 50%;
	transform: translateY(-50%);
}

/* Position: bottom (default, explicit for specificity) */
.encw-card__body--bottom {
	top: auto;
	bottom: 0;
	transform: none;
}

/* --------------------------------------------------------------------------
   Title
   -------------------------------------------------------------------------- */
.encw-card__title {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 12px;
	color: #ffffff;
}

.encw-card__title a {
	color: inherit;
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.encw-card__title a:hover {
	opacity: 0.85;
}

/* --------------------------------------------------------------------------
   Excerpt
   -------------------------------------------------------------------------- */
.encw-card__excerpt {
	font-size: 0.9rem;
	color: rgba(255, 255, 255, 0.85);
	line-height: 1.6;
	margin: 0 0 14px;
}

/* --------------------------------------------------------------------------
   Button "Ver más" — starts as plain white "+", expands on hover
   -------------------------------------------------------------------------- */
.encw-btn-more {
	display: inline-flex;
	align-items: center;
	gap: 0;
	width: auto;
	background-color: transparent;
	color: #ffffff;
	text-decoration: none;
	border: none;
	cursor: pointer;
	border-radius: 4px;
	overflow: visible;
	padding: 2px 2px;
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	transition:
		padding 0.35s ease,
		background-color 0.3s ease;
	align-self: flex-start;
	white-space: nowrap;
	margin-top: 0;
	box-sizing: border-box;
}

/* The + icon */
.encw-btn-more__icon {
	flex-shrink: 0;
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1;
	display: inline-block;
}

/* Text label — hidden by default, overflow on the label itself */
.encw-btn-more__label {
	display: inline-block;
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	transition:
		max-width 0.35s ease,
		opacity 0.25s ease 0.05s,
		margin-left 0.35s ease;
	margin-left: 0;
}

/* --------------------------------------------------------------------------
   Button hover — trigger: button (default)
   Applies when the widget has class encw-btn-trigger-button OR no class set
   -------------------------------------------------------------------------- */
.encw-btn-trigger-button .encw-btn-more:hover,
.encw-btn-more:hover {
	background-color: #2563eb;
	padding: 8px 12px;
}

.encw-btn-trigger-button .encw-btn-more:hover .encw-btn-more__label,
.encw-btn-more:hover .encw-btn-more__label {
	max-width: 160px;
	opacity: 1;
	margin-left: 6px;
}

/* --------------------------------------------------------------------------
   Button hover — trigger: card
   Expands the button whenever the user hovers anywhere on the card
   -------------------------------------------------------------------------- */
.encw-btn-trigger-card .encw-card:hover .encw-btn-more {
	background-color: #2563eb;
	padding: 8px 12px;
}

.encw-btn-trigger-card .encw-card:hover .encw-btn-more .encw-btn-more__label {
	max-width: 160px;
	opacity: 1;
	margin-left: 6px;
}

/* In card-trigger mode, disable the button-only hover so they don't conflict */
.encw-btn-trigger-card .encw-btn-more:hover {
	background-color: transparent;
	padding: 2px 2px;
}

.encw-btn-trigger-card .encw-btn-more:hover .encw-btn-more__label {
	max-width: 0;
	opacity: 0;
	margin-left: 0;
}

.encw-btn-more:focus-visible {
	outline: 2px solid rgba(255, 255, 255, 0.8);
	outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Navigation arrows
   -------------------------------------------------------------------------- */
.encw-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 10;
	background: rgba(255, 255, 255, 0.9);
	border: none;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: background 0.2s ease, box-shadow 0.2s ease;
	color: #1e293b;
	padding: 0;
}

.encw-arrow svg {
	width: 18px;
	height: 18px;
}

.encw-arrow:hover {
	background: #ffffff;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.encw-arrow--prev {
	left: -16px;
}

.encw-arrow--next {
	right: -16px;
}

.encw-arrow.encw-disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Dots
   -------------------------------------------------------------------------- */
.encw-dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 20px;
}

.encw-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #cbd5e1;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: background 0.25s ease, transform 0.25s ease;
}

.encw-dot.encw-dot--active {
	background: #2563eb;
	transform: scale(1.35);
}

/* --------------------------------------------------------------------------
   Responsive helpers (supplemental to JS breakpoints)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.encw-arrow--prev { left: -8px; }
	.encw-arrow--next { right: -8px; }
}

@media (max-width: 767px) {
	.encw-arrow--prev { left: 0; }
	.encw-arrow--next { right: 0; }
	.encw-card__image { height: 180px; }
}

/* ==========================================================================
   Grid mode
   ========================================================================== */

/* --------------------------------------------------------------------------
   Grid wrapper
   -------------------------------------------------------------------------- */
.encw-grid-wrapper {
	position: relative;
	width: 100%;
}

/* --------------------------------------------------------------------------
   Grid container — CSS custom-property driven columns
   -------------------------------------------------------------------------- */
.encw-grid-container {
	display: grid;
	grid-template-columns: repeat( var(--encw-cols-desktop, 3), 1fr );
	gap: var(--encw-grid-gap, 24px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}

@media (max-width: 1024px) {
	.encw-grid-container {
		grid-template-columns: repeat( var(--encw-cols-tablet, 2), 1fr );
	}
}

@media (max-width: 767px) {
	.encw-grid-container {
		grid-template-columns: repeat( var(--encw-cols-mobile, 1), 1fr );
	}
}

/* Grid items fill the card height fully */
.encw-grid-item {
	display: flex;
	flex-direction: column;
}

.encw-grid-item .encw-card {
	flex: 1 1 auto;
}

/* Empty state */
.encw-no-posts {
	color: #64748b;
	font-size: 1rem;
	padding: 24px 0;
	text-align: center;
	grid-column: 1 / -1;
}

/* --------------------------------------------------------------------------
   Loading overlay
   -------------------------------------------------------------------------- */
.encw-grid-loading {
	display: none;
	position: absolute;
	inset: 0;
	z-index: 20;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.55);
	border-radius: inherit;
	pointer-events: none;
}

.encw-grid-loading--active {
	display: flex;
}

.encw-grid-loading__spinner {
	width: 40px;
	height: 40px;
	border: 3px solid rgba(37, 99, 235, 0.2);
	border-top-color: #2563eb;
	border-radius: 50%;
	animation: encw-spin 0.7s linear infinite;
}

@keyframes encw-spin {
	to { transform: rotate(360deg); }
}

/* ==========================================================================
   Featured post card
   ========================================================================== */

.encw-featured-block {
	margin-bottom: var(--encw-grid-gap, 24px);
}

/* --------------------------------------------------------------------------
   Featured badge (star ribbon overlay)
   -------------------------------------------------------------------------- */
.encw-featured-badge {
	position: absolute;
	top: 12px;
	right: 12px;
	background-color: #e63946;
	color: #ffffff;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 4px;
	z-index: 4;
	pointer-events: none;
	line-height: 1.4;
}

/* --------------------------------------------------------------------------
   Full-width featured card (same card structure, full grid width)
   -------------------------------------------------------------------------- */
.encw-featured-card--full {
	min-height: 460px;
}

/* --------------------------------------------------------------------------
   Horizontal featured card (image left, text right)
   -------------------------------------------------------------------------- */
.encw-featured-card--horizontal {
	display: flex;
	border-radius: 8px;
	overflow: hidden;
	background: #1e293b;
	min-height: 320px;
}

.encw-featured-card__image-col {
	flex: 0 0 50%;
	max-width: 50%;
	position: relative;
	overflow: hidden;
}

.encw-featured-card__image-col a,
.encw-featured-card__image-col a img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.55s ease;
}

.encw-featured-card--horizontal:hover .encw-featured-card__image-col img {
	transform: scale(1.05);
}

.encw-featured-card__content-col {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 28px 32px;
	background-color: #1e293b;
	position: relative;
}

/* Badge inside horizontal layout */
.encw-featured-card--horizontal .encw-featured-badge {
	position: static;
	display: inline-block;
	margin-bottom: 14px;
	align-self: flex-start;
}

/* Inline date badge (horizontal layout — not positioned absolute) */
.encw-date-badge--inline {
	position: static;
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 4px;
	margin-bottom: 12px;
	align-self: flex-start;
}

.encw-date-badge--inline .encw-date-badge__day {
	font-size: 1rem;
}

.encw-date-badge--inline .encw-date-badge__month-year {
	font-size: 0.75rem;
	margin-top: 0;
}

/* Featured title size boost */
.encw-card__title--featured {
	font-size: 1.35rem;
}

@media (max-width: 767px) {
	.encw-featured-card--horizontal {
		flex-direction: column;
	}

	.encw-featured-card__image-col {
		flex: 0 0 auto;
		max-width: 100%;
		height: 220px;
	}

	.encw-featured-card__content-col {
		padding: 20px 18px;
	}
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.encw-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 36px;
}

/* --------------------------------------------------------------------------
   Page number buttons
   -------------------------------------------------------------------------- */
.encw-page-btn,
.encw-page-nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 8px;
	background-color: #f1f5f9;
	color: #475569;
	border: none;
	border-radius: 6px;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
	text-decoration: none;
}

.encw-page-btn:hover:not(.encw-page-btn--active),
.encw-page-nav:not(.encw-page-btn--disabled):hover {
	background-color: #e2e8f0;
}

.encw-page-btn--active {
	background-color: #2563eb;
	color: #ffffff;
	font-weight: 700;
	transform: scale(1.05);
	cursor: default;
}

.encw-page-btn--disabled,
.encw-page-nav:disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

.encw-page-btn:focus-visible,
.encw-page-nav:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
}

/* Prev / next arrows */
.encw-page-nav svg {
	width: 16px;
	height: 16px;
}

/* Ellipsis */
.encw-page-ellipsis {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	color: #94a3b8;
	font-size: 0.875rem;
	cursor: default;
	pointer-events: none;
}

