/**
 * Estilos públicos de CdH — Gestor de Publicaciones.
 * Namespace cdh-* (regla 3, §9). Transiciones suaves 200-400 ms, ease-out (§7.3).
 */

/* Grid de tarjetas */
.cdh-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px 24px;
	margin: 0 0 24px;
}

@media (min-width: 600px) {
	.cdh-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 960px) {
	.cdh-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.cdh-grid--lista {
	grid-template-columns: 1fr;
}

.cdh-card {
	display: flex;
	flex-direction: column;
}

.cdh-card__link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.cdh-card__thumb {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #f1f0ed;
	border-radius: 12px;
	margin: 0 0 12px;
}

.cdh-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease-out;
}

.cdh-card:hover .cdh-card__img {
	transform: scale(1.02);
}

.cdh-card__title {
	font-size: 1.15rem;
	line-height: 1.35;
	font-weight: 600;
	margin: 0 0 8px;
}

.cdh-card__cat {
	margin: 0 0 8px;
}

.cdh-card__meta {
	color: #6e7278;
	font-size: 0.85rem;
}

/* Chips de categoría */
.cdh-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.cdh-chip {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 12px;
	border-radius: 999px;
	background: #f1f0ed;
	color: #14161a;
	font-size: 0.8rem;
	line-height: 1.5;
	text-decoration: none;
	transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.cdh-chip:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cdh-chip__icono {
	line-height: 1;
}

/* Fachada lazy de video (§6.5) */
.cdh-facade {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
	margin: 0;
}

.cdh-facade__btn {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}

.cdh-facade__thumb {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.92;
	transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.cdh-facade:hover .cdh-facade__thumb {
	opacity: 1;
	transform: scale(1.015);
}

.cdh-facade__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
	color: #fff;
	transition: transform 0.2s ease-out, background-color 0.2s ease-out;
}

.cdh-facade:hover .cdh-facade__play {
	transform: translate(-50%, -50%) scale(1.06);
}

.cdh-facade__btn:focus-visible {
	outline: 3px solid #A90101;
	outline-offset: -3px;
}

.cdh-facade__iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* Aislamiento del video dentro del contenido */
.cdh-video {
	max-width: 720px;
	margin: 24px 0;
}

.cdh-video--izquierda {
	margin-left: 0;
	margin-right: auto;
}

.cdh-video--centro {
	margin-left: auto;
	margin-right: auto;
}

.cdh-video--derecha {
	margin-left: auto;
	margin-right: 0;
}

/* Paginación y estado vacío */
.cdh-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 24px 0 8px;
}

.cdh-pagination__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 8px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid #e2e0da;
	color: #14161a;
	text-decoration: none;
}

.cdh-pagination__item:hover {
	border-color: #14161a;
}

.cdh-pagination__item--current {
	background: #14161a;
	border-color: #14161a;
	color: #fff;
}

.cdh-empty {
	color: #6e7278;
	padding: 24px 0;
}

/* Hero de portada ([cdh_hero]) */
.cdh-hero {
	margin: 0 0 32px;
}

.cdh-hero__link {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

@media (min-width: 768px) {
	.cdh-hero__link {
		grid-template-columns: 1.3fr 1fr;
	}
}

.cdh-hero__media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #14161a;
	border-radius: 14px;
}

.cdh-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease-out;
}

.cdh-hero:hover .cdh-hero__img {
	transform: scale(1.015);
}

.cdh-hero__body {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cdh-hero__title {
	font-size: clamp(1.6rem, 3.2vw, 2.4rem);
	line-height: 1.2;
	font-weight: 600;
	margin: 0;
}

.cdh-hero__meta {
	color: #6e7278;
	font-size: 0.9rem;
}

.cdh-hero__cta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	width: fit-content;
	padding: 8px 18px;
	border-radius: 999px;
	background: #14161a;
	color: #fff;
	font-size: 0.9rem;
	font-weight: 600;
	transition: background-color 0.2s ease-out, transform 0.2s ease-out;
}

.cdh-hero:hover .cdh-hero__cta {
	transform: translateY(-1px);
}

.cdh-hero__cta::after {
	content: "→";
}

/* Slider del hero ([cdh_hero]) — ADR-19 */
.cdh-hero-slider {
	position: relative;
	margin: 0 0 32px;
}

.cdh-hero-slider__track {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.cdh-hero-slider__track::-webkit-scrollbar {
	display: none;
}

.cdh-hero-slider__track > * {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 0;
	scroll-snap-align: start;
}

.cdh-hero-slider .cdh-hero__link,
.cdh-hero-slider .cdh-hero__media,
.cdh-hero-slider .cdh-hero__body {
	min-width: 0;
}

.cdh-hero-slider img {
	max-width: 100%;
}

.cdh-hero__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(20, 22, 26, 0.55);
	color: #fff;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease-out;
}

.cdh-hero__arrow:hover {
	background: rgba(20, 22, 26, 0.82);
}

.cdh-hero__arrow:focus-visible {
	outline: 3px solid #A90101;
	outline-offset: 2px;
}

.cdh-hero__arrow--prev {
	left: 14px;
}

.cdh-hero__arrow--next {
	right: 14px;
}

/* Modo amplio: solo la imagen a lo ancho */
.cdh-hero--amplio .cdh-hero__link {
	display: block;
}

.cdh-hero--amplio .cdh-hero__media {
	aspect-ratio: 16 / 9;
	border-radius: 14px;
}

@media (min-width: 900px) {
	.cdh-hero--amplio .cdh-hero__media {
		aspect-ratio: 21 / 9;
	}
}

/* Pestañas por categoría ([cdh_categorias_tabs]) — ADR-20 */
.cdh-tabs {
	margin: 0 0 32px;
}

.cdh-tabs__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 24px;
}

.cdh-tabs__tab {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 18px;
	border: 1px solid #e2e0da;
	border-radius: 999px;
	background: #fff;
	color: #14161a;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
	transition: border-color 0.2s ease-out, background-color 0.2s ease-out, color 0.2s ease-out;
}

.cdh-tabs__tab:hover {
	border-color: var( --cdh-cat-color, #14161a );
}

.cdh-tabs__tab.is-active {
	background: var( --cdh-cat-color, #14161a );
	border-color: var( --cdh-cat-color, #14161a );
	color: #fff;
}

.cdh-tabs__tab:focus-visible {
	outline: 3px solid #A90101;
	outline-offset: 2px;
}

.cdh-tabs__icono {
	line-height: 1;
}

.cdh-tabs__panel {
	display: none;
}

.cdh-tabs__panel.is-active {
	display: block;
}

.cdh-tabs__mas {
	text-align: center;
	margin: 22px 0 0;
}

.cdh-tabs__vermas {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 26px;
	border-radius: 999px;
	border: 1px solid #A90101;
	color: #A90101;
	background: transparent;
	font-weight: 700;
	font-size: 0.9rem;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.cdh-tabs__vermas:hover {
	background: #A90101;
	color: #fff;
}

.cdh-tabs__vermas[data-cargando] {
	opacity: 0.6;
	pointer-events: none;
}
