/**
 * agenX — Estilos del frontend del portafolio.
 * Paleta neutra: negro, blanco y off-white.
 * Personalizable desde los controles de estilo de cada widget de Elementor.
 */

.agenx-scope,
:root {
	--agenx-teal: #141414;
	--agenx-deep: #171717;
	--agenx-light: #f5f4f1;
	--agenx-ink: #1a1a1a;
	--agenx-muted: #6e6e6e;
	--agenx-border: #e7e4de;
	--agenx-radius: 16px;
	--agenx-pill: 999px;
	--agenx-cols: 3;
}

.agenx-widget-ph {
	padding: 16px;
	border: 1px dashed #d8d4cc;
	border-radius: 10px;
	color: var(--agenx-muted);
	text-align: center;
	background: var(--agenx-light);
	font-size: 14px;
}
.agenx-empty { color: var(--agenx-muted); }

/* ============================== Grid ================================= */
.agenx-grid {
	display: grid;
	grid-template-columns: repeat(var(--agenx-cols, 3), 1fr);
	gap: 24px;
}

/* ============================== Tarjeta ============================== */
.agenx-card { position: relative; }
.agenx-card__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: var(--agenx-radius);
	aspect-ratio: 4 / 3;
	background: var(--agenx-light);
	text-decoration: none;
}
.agenx-card__media img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}
.agenx-card:hover .agenx-card__media img { transform: scale(1.06); }

.agenx-card__veil {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.82) 0%, rgba(0, 0, 0, 0.12) 55%, transparent 100%);
	opacity: 0;
	transition: opacity 0.35s ease;
}
.agenx-card__icon {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var(--agenx-teal);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transform: translateY(-6px);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
}
.agenx-card__content {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 18px 20px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	transform: translateY(8px);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
}
.agenx-card__cat { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: #e6e3dd; }
.agenx-card__title { font-size: 1.25rem; font-weight: 800; line-height: 1.15; color: #fff; }
.agenx-card__client { font-size: 0.9rem; color: rgba(255, 255, 255, 0.82); }
.agenx-card__excerpt { font-size: 0.88rem; color: rgba(255, 255, 255, 0.75); margin-top: 4px; }

/* Estado overlay: todo sobre la imagen, se revela al hover */
.agenx-card.is-overlay .agenx-card__veil { opacity: 1; }
.agenx-card.is-overlay .agenx-card__content { opacity: 1; transform: none; }
.agenx-card.is-overlay:hover .agenx-card__icon { opacity: 1; transform: none; }

/* Estado clásico: texto debajo de la imagen */
.agenx-card.is-classic .agenx-card__media { aspect-ratio: 4 / 3; }
.agenx-card.is-classic .agenx-card__veil { display: none; }
.agenx-card.is-classic .agenx-card__content {
	position: static;
	opacity: 1;
	transform: none;
	padding: 14px 2px 0;
}
.agenx-card.is-classic .agenx-card__cat { color: var(--agenx-teal); }
.agenx-card.is-classic .agenx-card__title { color: var(--agenx-deep); }
.agenx-card.is-classic .agenx-card__client { color: var(--agenx-muted); }
.agenx-card.is-classic .agenx-card__excerpt { color: var(--agenx-muted); }
.agenx-card.is-classic:hover .agenx-card__icon { opacity: 1; transform: none; }

/* Acentos del placeholder */
.agenx-card__media.accent-light, .agenx-thumb-ph { background: #f5f4f1; }
.accent-light .agenx-card__media { background: #f5f4f1; }
.accent-grey .agenx-card__media { background: #e6e3dd; }
.accent-dark .agenx-card__media { background: #262626; }
.accent-black .agenx-card__media { background: #111111; }

/* ============================== Filtro ============================== */
.agenx-filter { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 26px; }
.agenx-filter-btn {
	border: 1.5px solid var(--agenx-border);
	background: #fff;
	color: var(--agenx-deep);
	padding: 8px 18px;
	border-radius: var(--agenx-pill);
	cursor: pointer;
	text-decoration: none;
	font-size: 0.92rem;
	font-weight: 600;
	transition: all 0.15s ease;
}
.agenx-filter-btn:hover { border-color: var(--agenx-teal); }
.agenx-filter-btn.is-active { background: var(--agenx-teal); color: #fff; border-color: var(--agenx-teal); }

/* ======================= Carrusel (shortcode) ====================== */
.agenx-carousel { position: relative; }
.agenx-carousel__track {
	display: flex;
	gap: 20px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-bottom: 6px;
}
.agenx-carousel__track::-webkit-scrollbar { display: none; }
.agenx-carousel__item {
	flex: 0 0 calc((100% - 40px) / 3);
	scroll-snap-align: start;
}
.agenx-carousel__nav {
	position: absolute;
	top: 40%;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: var(--agenx-deep);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
	font-size: 22px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}
.agenx-carousel__nav.prev { left: -12px; }
.agenx-carousel__nav.next { right: -12px; }
.agenx-carousel__nav:hover { background: var(--agenx-teal); color: #fff; }

/* ======================= Carrusel (Swiper) ========================= */
.agenx-swiper { position: relative; padding-bottom: 8px; }
.agenx-swiper .swiper-slide { height: auto; }
.agenx-swiper .swiper-button-prev, .agenx-swiper .swiper-button-next { color: var(--agenx-deep); }
.agenx-swiper .swiper-pagination-bullet-active { background: var(--agenx-teal); }

/* ========================= Proyecto individual ===================== */
.agenx-title { color: var(--agenx-deep); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; }
.agenx-desc { color: var(--agenx-muted); line-height: 1.7; }

.agenx-cover { margin: 0; overflow: hidden; border-radius: var(--agenx-radius); background: var(--agenx-light); }
.agenx-cover img { display: block; width: 100%; height: auto; }
.agenx-cover.ratio-16-9 img { aspect-ratio: 16 / 9; object-fit: cover; }
.agenx-cover.ratio-4-3 img { aspect-ratio: 4 / 3; object-fit: cover; }
.agenx-cover.ratio-1-1 img { aspect-ratio: 1 / 1; object-fit: cover; }
.agenx-cover.ratio-3-2 img { aspect-ratio: 3 / 2; object-fit: cover; }

.agenx-video { position: relative; width: 100%; background: #000; border-radius: var(--agenx-radius); overflow: hidden; }
.agenx-video.ratio-169 { aspect-ratio: 16 / 9; }
.agenx-video.ratio-43 { aspect-ratio: 4 / 3; }
.agenx-video.ratio-11 { aspect-ratio: 1 / 1; }
.agenx-video.ratio-219 { aspect-ratio: 21 / 9; }
.agenx-video iframe, .agenx-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }

.agenx-gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.agenx-gallery-item { display: block; }
.agenx-gallery-grid img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 10px; }

/* Términos / chips */
.agenx-terms { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.agenx-terms.is-badges .agenx-term {
	background: #f1efea;
	color: var(--agenx-deep);
	padding: 5px 13px;
	border-radius: var(--agenx-pill);
	font-size: 0.85em;
	font-weight: 600;
	text-decoration: none;
}
.agenx-term { color: var(--agenx-deep); text-decoration: none; }
.agenx-terms-title { font-weight: 700; color: var(--agenx-ink); margin-bottom: 8px; }

/* Ficha de información */
.agenx-info { display: flex; flex-direction: column; }
.agenx-info__row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 12px 0;
	border-bottom: 1px solid var(--agenx-border);
}
.agenx-info__label { color: var(--agenx-muted); font-weight: 600; font-size: 0.85em; text-transform: uppercase; letter-spacing: 0.04em; }
.agenx-info__value { color: var(--agenx-ink); font-weight: 600; text-align: right; }
.agenx-info__value a { color: var(--agenx-teal); text-decoration: none; }

/* Enlaces / botones */
.agenx-links { display: flex; flex-wrap: wrap; gap: 12px; }
.agenx-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 11px 20px;
	border-radius: var(--agenx-pill);
	background: #fff;
	color: var(--agenx-deep);
	border: 1.5px solid var(--agenx-border);
	text-decoration: none;
	font-weight: 700;
	transition: transform 0.15s ease, border-color 0.15s ease;
}
.agenx-link-btn:hover { transform: translateY(-2px); border-color: var(--agenx-teal); }
.agenx-link-btn.is-primary { background: var(--agenx-teal); color: #fff; border-color: var(--agenx-teal); }
.agenx-link-btn svg { width: 16px; height: 16px; }

.agenx-related__title { color: var(--agenx-deep); font-weight: 800; margin: 0 0 18px; }

@media (max-width: 1024px) {
	.agenx-grid { grid-template-columns: repeat(2, 1fr); }
	.agenx-carousel__item { flex-basis: calc((100% - 20px) / 2); }
	.agenx-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.agenx-grid { grid-template-columns: 1fr; }
	.agenx-carousel__item { flex-basis: 100%; }
	.agenx-gallery-grid { grid-template-columns: 1fr; }
	.agenx-info__value { text-align: left; }
}
