/* Estructura de tarjetas del índice de categorías, sin depender de su plugin.
 * visual-refresh.css y palette-12.27.css aportan el mismo acabado compartido.
 * Este archivo se carga en Herramientas, Aprender a tejer, Retos y Suscripción.
 */
.ct-resource-hub {
	font-family: Nunito, system-ui, sans-serif;
	margin: 0 auto 30px;
	width: 100%;
}
.ctac-directory__grid {
	display: grid;
	gap: 14px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}
.ctac-directory-card {
	background: #fff;
	color: inherit;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	text-decoration: none;
	transition: border-color .2s ease;
}
.ctac-directory-card__main {
	color: inherit;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	text-decoration: none;
}
.ctac-directory-card__main:hover { color: inherit; }
/* El correo abre un diálogo; conserva el mismo aspecto que las tarjetas enlazadas. */
.ct-resource-hub button.ctac-directory-card__main {
	appearance: none;
	background: transparent !important;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	color: inherit !important;
	cursor: pointer;
	font: inherit;
	margin: 0;
	padding: 0;
	text-align: left;
	text-transform: none;
	width: 100%;
}
.ct-subscription__home,
.ct-resource-hub-home {
	margin: 0 0 20px;
	text-align: center;
}

.ctac-directory-card__main:focus-visible {
	outline: 3px solid var(--ctejidas-brand, #F45A8E);
	outline-offset: -3px;
}
.ctac-directory-card__media {
	background: var(--ctejidas-soft);
	display: block;
	height: 150px;
	overflow: hidden;
	position: relative;
}
.ctac-directory-card__media img {
	display: block;
	height: 100%;
	max-width: none;
	object-fit: cover;
	width: 100%;
}
.ctac-directory-card__placeholder {
	align-items: center;
	display: flex;
	height: 100%;
	justify-content: center;
	width: 100%;
}
.ctac-directory-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
	padding: 13px 14px 12px;
}
.ctac-directory-card__title-row {
	align-items: start;
	display: flex;
	gap: 10px;
	justify-content: space-between;
}
.ct-resource-hub .ctac-directory-card__title-row :is(h2, .ctac-directory-card__title) {
	color: var(--ctejidas-title, #000);
	font-family: "League Spartan", Nunito, sans-serif;
	font-size: 21px;
	font-weight: 800;
	letter-spacing: -.025em;
	line-height: 1;
	margin: 0;
	overflow-wrap: anywhere;
}
.ctac-directory-card__arrow {
	align-items: center;
	display: inline-flex;
	font-size: 16px;
	font-weight: 900;
	justify-content: center;
}
.ctac-directory-card__footer {
	border-top: 1px solid var(--ctejidas-line);
	display: flex;
	flex-direction: column;
	margin-top: 8px;
	min-width: 0;
	padding-top: 8px;
}
@media (max-width: 980px) {
	.ctac-directory__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.ctac-directory__grid { gap: 12px; grid-template-columns: 1fr; }
	.ctac-directory-card__main {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		min-height: 0;
	}
	.ct-resource-hub .ctac-directory-card__title-row :is(h2, .ctac-directory-card__title) { font-size: 18px; line-height: 1.08; }
}
@media (max-width: 390px) {
	.ct-resource-hub .ctac-directory-card__title-row :is(h2, .ctac-directory-card__title) { font-size: 16px; }
}

/* Cabeceras compactas, con el mismo tamaño de título que Patrones y tutoriales. */
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page, .ctejidas-subscription-page) .site-content {
	padding-top: 12px;
}
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-learning__header {
	margin: 0 0 18px;
	max-width: none;
	text-align: left;
}
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-learning__eyebrow {
	font-size: 11px;
	line-height: 1.2;
	margin-bottom: 4px;
}
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-learning__title,
body.ctejidas-subscription-page .ct-subscription__title {
	font-size: clamp(28px, 3vw, 36px);
	line-height: 1;
	margin: 0;
	max-width: none;
}
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-learning__intro,
body.ctejidas-subscription-page .ct-subscription__intro {
	font-size: 14px;
	line-height: 1.5;
	margin: 8px 0 0;
	max-width: none;
}
body.ctejidas-subscription-page .ct-subscription__hero {
	background: transparent;
	border: 0;
}
body.ctejidas-subscription-page .ct-subscription__hero-copy {
	padding: 0;
	text-align: left;
}
body.ctejidas-subscription-page .ct-subscription__section {
	margin-top: 18px;
}
@media (max-width: 640px) {
	body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page, .ctejidas-subscription-page) .site-content {
		padding-top: 8px;
	}
	body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-learning__title,
	body.ctejidas-subscription-page .ct-subscription__title {
		font-size: 28px;
	}
}

/* Las destacadas de Aprender a tejer y Herramientas se recortan siempre a 16:9. */
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-resource-hub .ctac-directory-card__media {
	aspect-ratio: 16 / 9;
	height: auto;
}
body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-resource-hub .ctac-directory-card__media img {
	height: 100%;
	object-fit: cover;
	object-position: center;
	transform: scale(1.19) !important;
	transform-origin: center;
	width: 100%;
}

/* v12.70.102 · Portada de Retos: el plugin conserva sus datos y enlaces.
 * Solo se adapta el catálogo; las pantallas de cada reto mantienen su diseño.
 */
body.ctejidas-retos-hub-page .site-content {
	box-sizing: border-box;
	display: block;
	margin: 0 auto;
	max-width: 1170px;
	padding: 12px 20px 58px;
	width: 100%;
}
body.ctejidas-retos-hub-page .featured-image {
	display: none;
}
body.ctejidas-retos-hub-page .ctr-page {
	padding: 0;
	width: 100%;
}
body.ctejidas-retos-hub-page .ctr-wrap {
	font-family: Nunito, system-ui, sans-serif;
	font-size: 16px;
	margin: 0 auto;
	max-width: 1120px;
}
/* El catálogo usa la plantilla del plugin, sin el margen de .inside-article.
 * Conserva 16 px laterales aunque las reglas generales móviles retiren el padding. */
@media (max-width: 768px) {
	body.ctejidas-retos-hub-page #page #content.site-content {
		padding-left: 16px !important;
		padding-right: 16px !important;
	}
}
body.ctejidas-retos-hub-page .ctr-heading {
	margin: 0 0 18px;
	max-width: none;
	text-align: left;
}
body.ctejidas-retos-hub-page .ctr-heading .ctr-eyebrow {
	color: var(--ctejidas-brand, #F45A8E);
	font-size: 11px;
	line-height: 1.2;
	margin: 0 0 4px;
}
body.ctejidas-retos-hub-page .ctr-heading h1 {
	font-size: clamp(28px, 3vw, 36px);
	font-weight: 600;
	letter-spacing: -.045em;
	line-height: 1;
	margin: 0;
}
body.ctejidas-retos-hub-page .ctr-heading > p:not(.ctr-eyebrow) {
	color: var(--ctejidas-text-secondary, #676b72);
	font-size: 14px;
	line-height: 1.5;
	margin: 8px 0 0;
}
body.ctejidas-retos-hub-page .ctr-catalog {
	gap: 14px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-bottom: 30px;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card {
	border-bottom: 1px solid var(--ctejidas-line, #ecdfe5) !important;
	overflow: hidden;
	transition: border-color .2s ease;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card:is(:hover, :focus-within) {
	border-bottom-color: var(--ctejidas-brand, #F45A8E) !important;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-link {
	background: transparent;
	gap: 0;
	min-width: 0;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-link:focus-visible {
	outline: 3px solid var(--ctejidas-brand, #F45A8E);
	outline-offset: -3px;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-image {
	aspect-ratio: 16 / 9;
	height: auto;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-image img {
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-body {
	gap: 0;
	padding: 13px 14px 12px;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-title {
	gap: 10px;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-title h2 {
	font-size: 21px;
	font-weight: 600;
	line-height: 1.08;
	margin: 0;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-title > span {
	color: var(--ctejidas-brand, #F45A8E);
	flex-shrink: 0;
	font-size: 16px;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-desc {
	border-top: 1px solid var(--ctejidas-line, #ecdfe5);
	color: var(--ctejidas-text, #676b72);
	display: -webkit-box;
	font-size: 14px;
	line-height: 1.32;
	margin: 8px 0 0;
	overflow: hidden;
	padding-top: 8px;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-meta {
	color: var(--ctejidas-text-secondary, #676b72);
	font-size: 12px;
	line-height: 1.2;
	margin-top: 8px;
}
body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-cta {
	color: var(--ctejidas-brand, #F45A8E);
	font-size: 13px;
	line-height: 1.2;
	margin-top: 10px;
	text-underline-offset: 3px;
}
@media (max-width: 980px) {
	body.ctejidas-retos-hub-page .ctr-catalog {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (max-width: 640px) {
	body.ctejidas-retos-hub-page .site-content { padding-top: 8px; }
	body.ctejidas-retos-hub-page .ctr-heading h1 { font-size: 28px; }
	body.ctejidas-retos-hub-page .ctr-catalog { gap: 12px; grid-template-columns: 1fr; }
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-link {
		align-items: stretch;
		aspect-ratio: 32 / 9;
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		grid-template-rows: minmax(0, 1fr);
		height: auto;
		min-height: 0;
		overflow: hidden;
		width: 100%;
	}
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-image { height: 100%; min-height: 0; }
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-body {
		min-height: 0;
		overflow: hidden;
		padding: 0 8px;
	}
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-title { flex-shrink: 0; gap: 6px; }
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-title h2 {
		display: -webkit-box;
		font-size: 18px;
		max-height: 2.16em;
		min-width: 0;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-clamp: 2;
	}
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-desc {
		border: 0;
		font-size: 13px;
		line-height: 1.2;
		margin-top: 3px;
		max-height: 2.4em;
		padding: 0;
	}
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-meta {
		flex-shrink: 0;
		font-size: 11px;
		margin-top: 3px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	/* La flecha y el enlace de toda la tarjeta ya permiten abrir el reto. */
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-cta { display: none; }
}
@media (max-width: 390px) {
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-title h2 { font-size: 16px; }
	body.ctejidas-retos-hub-page .ctr-catalog .ctr-card-desc {
		max-height: 1.2em;
		-webkit-line-clamp: 1;
		line-clamp: 1;
	}
}
@media (max-width: 640px) {
	body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-resource-hub .ctac-directory-card__main {
		aspect-ratio: 32 / 9;
	}
	body:is(.ctejidas-learning-hub-page, .ctejidas-tools-hub-page) .ct-resource-hub .ctac-directory-card__media {
		height: 100%;
	}
}
