/* ==========================================================================
   ANATO Capacita: Módulos por nivel (archive-anato-modulos.php). Requiere anato-base.css.

   1. Hero y resumen
   2. Selector de nivel
   3. Catálogo (encabezado, búsqueda, orden)
   4. Tarjeta de módulo
   5. Llamado a ingresar
   6. Responsive
   ========================================================================== */

/* 1. Hero y resumen
   ========================================================================== */
.ach-level-hero {
	position: relative;
	overflow: hidden;
	padding: 76px 0 60px;
	background: linear-gradient(180deg, #f7fbfe 0%, #fff 100%);
}

.ach-level-hero::before {
	content: '';
	position: absolute;
	width: 440px;
	height: 440px;
	right: -140px;
	top: -190px;
	border-radius: 50%;
	background: radial-gradient(circle at 40% 40%, rgba(67, 215, 203, .27), rgba(7, 92, 168, .05) 62%, transparent 72%);
}

.ach-level-hero__grid {
	position: relative;
	z-index: 2;
	display: grid;
	grid-template-columns: 1fr .72fr;
	gap: 62px;
	align-items: center;
}

.ach .ach-level-hero h1 {
	margin: 16px 0 18px;
	font-size: clamp(42px, 5.5vw, 72px);
	line-height: 1;
	letter-spacing: -.05em;
	color: var(--ach-navy);
}

.ach-level-hero h1 span {
	color: var(--ach-teal);
}

.ach .ach-level-hero p {
	max-width: 720px;
	margin: 0;
	font-size: 16px;
	color: var(--ach-muted);
}

.ach-level-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 11px;
	margin-top: 28px;
}

.ach-summary {
	position: relative;
	overflow: hidden;
	padding: 24px;
	background: #fff;
	border: 1px solid var(--ach-line);
	border-radius: 28px;
	box-shadow: var(--ach-shadow);
}

.ach-summary::after {
	content: '';
	position: absolute;
	width: 150px;
	height: 150px;
	right: -48px;
	bottom: -60px;
	border-radius: 40px;
	background: linear-gradient(135deg, rgba(0, 175, 166, .24), rgba(7, 92, 168, .08));
	transform: rotate(18deg);
}

.ach-summary__icon {
	width: 64px;
	height: 64px;
	display: grid;
	place-items: center;
	margin-bottom: 26px;
	border-radius: 20px;
	background: linear-gradient(135deg, var(--ach-navy), var(--ach-blue));
	color: #fff;
}

.ach-summary__icon svg {
	width: 31px;
	height: 31px;
}

.ach-summary__title {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #788d9d;
}

.ach-summary__number {
	margin: 5px 0;
	font-size: 56px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -.05em;
	color: var(--ach-navy);
}

.ach .ach-summary__copy {
	position: relative;
	z-index: 2;
	max-width: 280px;
	margin: 0;
	font-size: 13px;
	color: var(--ach-muted);
}

/* 2. Selector de nivel
   ========================================================================== */
.ach-level-switch-wrap {
	padding-bottom: 18px;
}

.ach-level-switch {
	display: inline-flex;
	gap: 5px;
	padding: 6px;
	background: #edf5f9;
	border: 1px solid #dbe9f0;
	border-radius: 16px;
}

.ach .ach-level-switch a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 20px;
	border-radius: 11px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .02em;
	text-transform: uppercase;
	color: #597184;
	transition: background-color .2s, color .2s;
}

.ach .ach-level-switch a:hover {
	color: var(--ach-blue);
}

.ach .ach-level-switch a[aria-current="page"] {
	background: #fff;
	color: var(--ach-blue);
	box-shadow: 0 6px 18px rgba(7, 54, 95, .1);
}

/* 3. Catálogo
   ========================================================================== */
.ach-catalog {
	padding: 34px 0 96px;
}

.ach-catalog__head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 28px;
	margin-bottom: 28px;
}

.ach .ach-catalog__head h2 {
	margin: 8px 0 0;
	font-size: clamp(30px, 4vw, 48px);
	line-height: 1.05;
	letter-spacing: -.04em;
}

.ach .ach-catalog__head p {
	max-width: 620px;
	margin: 8px 0 0;
	font-size: 14px;
	color: var(--ach-muted);
}

.ach .ach-catalog__count {
	margin: 0;
	font-size: 12px;
	font-weight: 700;
	white-space: nowrap;
	color: #718394;
}

/* La búsqueda y el orden dependen de JS */
.ach-toolbar {
	display: none;
}

.ach-js .ach-toolbar {
	display: grid;
	grid-template-columns: minmax(260px, 1fr) 220px;
	gap: 12px;
	margin-bottom: 26px;
}

.ach-searchbox,
.ach-selectbox {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 54px;
	margin: 0;
	padding: 0 16px;
	background: #fff;
	border: 1px solid var(--ach-line);
	border-radius: 15px;
	transition: border-color .2s, box-shadow .2s;
}

.ach-searchbox:focus-within,
.ach-selectbox:focus-within {
	border-color: #9dc7de;
	box-shadow: 0 0 0 4px rgba(13, 118, 189, .08);
}

.ach-searchbox svg {
	flex: none;
	width: 19px;
	height: 19px;
	color: #7890a1;
}

.ach .ach-searchbox input,
.ach .ach-selectbox select {
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
	background: transparent;
	box-shadow: none;
	font: inherit;
	color: var(--ach-ink);
}

.ach .ach-searchbox input::placeholder {
	color: #8a9eac;
}

.ach .ach-selectbox select {
	font-size: 12px;
	font-weight: 700;
	color: #496276;
	cursor: pointer;
}

.ach-course-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.ach .ach-empty {
	margin: 0;
	padding: 44px;
	text-align: center;
	color: var(--ach-muted);
	background: var(--ach-soft);
	border: 1px dashed #c8dbe5;
	border-radius: 22px;
}

.ach-empty[hidden] {
	display: none;
}

/* 4. Tarjeta de módulo
   ========================================================================== */
.ach-course {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--ach-line);
	border-radius: 24px;
	transition: transform .25s, box-shadow .25s, border-color .25s;
}

.ach-course[hidden] {
	display: none;
}

.ach-course:hover {
	transform: translateY(-6px);
	box-shadow: var(--ach-shadow);
	border-color: #bfd9e6;
}

.ach-course:focus-within {
	outline: 3px solid var(--ach-teal);
	outline-offset: 3px;
}

.ach-course__cover {
	display: grid;
	place-items: center;
	aspect-ratio: 3 / 2;
	overflow: hidden;
	background: linear-gradient(135deg, #eefafa, #edf6fb);
}

.ach .ach-course__cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}

.ach-course:hover .ach-course__cover img {
	transform: scale(1.04);
}

.ach-course__icon {
	width: 60px;
	height: 60px;
	display: grid;
	place-items: center;
	border-radius: 19px;
	background: #fff;
	color: var(--ach-blue);
	box-shadow: 0 10px 25px rgba(7, 54, 95, .13);
}

.ach-course__icon svg {
	width: 29px;
	height: 29px;
}

.ach-course__body {
	flex: 1;
	display: flex;
	flex-direction: column;
	padding: 22px;
}

.ach .ach-course h3 {
	margin: 13px 0 9px;
	font-size: 17px;
	line-height: 1.34;
	letter-spacing: -.015em;
}

.ach-course__link::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.ach .ach-course:hover .ach-course__link {
	color: var(--ach-blue);
}

.ach .ach-course__link:focus-visible {
	outline: none;
}

.ach .ach-course__body p {
	margin: 0 0 18px;
	font-size: 13px;
	color: var(--ach-muted);
}

.ach-course__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin-top: auto;
	padding-top: 16px;
	border-top: 1px solid var(--ach-line);
}

.ach-course__meta {
	font-size: 11px;
	font-weight: 700;
	color: #718394;
}

.ach-course .ach-link-arrow {
	font-size: 12px;
}

.ach-course:hover .ach-link-arrow span {
	transform: translateX(4px);
}

/* 5. Llamado a ingresar
   ========================================================================== */
.ach-help {
	padding-bottom: 96px;
}

.ach-helpbox {
	position: relative;
	overflow: hidden;
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 30px;
	padding: 36px 40px;
	border-radius: 28px;
	background: linear-gradient(135deg, var(--ach-navy), var(--ach-blue));
	color: #fff;
}

.ach-helpbox::after {
	content: '';
	position: absolute;
	width: 260px;
	height: 260px;
	right: -100px;
	top: -120px;
	border-radius: 50%;
	background: rgba(67, 215, 203, .18);
}

.ach .ach-helpbox h2 {
	margin: 0 0 8px;
	font-size: 28px;
	line-height: 1.12;
	letter-spacing: -.035em;
	color: #fff;
}

.ach .ach-helpbox p {
	max-width: 700px;
	margin: 0;
	font-size: 13px;
	color: #d5eaf4;
}

.ach-helpbox .ach-btn {
	position: relative;
	z-index: 2;
}

/* 6. Responsive
   ========================================================================== */
@media (max-width: 1000px) {
	.ach-level-hero__grid { grid-template-columns: 1fr; }
	.ach-summary { max-width: 520px; }
	.ach-course-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
	.ach-level-hero { padding: 44px 0 36px; }
	.ach-level-hero__grid { gap: 28px; }
	.ach .ach-level-hero h1 { font-size: clamp(38px, 11.5vw, 47px); }
	.ach .ach-level-hero p { font-size: 15px; }
	.ach-level-hero__actions .ach-btn { width: 100%; }

	/* Resumen compacto: ícono y número en línea */
	.ach-summary {
		display: grid;
		grid-template-columns: 52px 1fr;
		column-gap: 16px;
		align-items: center;
		padding: 20px;
		border-radius: 22px;
	}
	.ach-summary__icon { grid-column: 1; grid-row: 1 / span 2; width: 52px; height: 52px; margin: 0; border-radius: 16px; }
	.ach-summary__icon svg { width: 26px; height: 26px; }
	.ach-summary__number { grid-column: 2; grid-row: 1; margin: 0; font-size: 40px; }
	.ach-summary__title { grid-column: 2; grid-row: 2; }
	.ach .ach-summary__copy { grid-column: 1 / -1; grid-row: 3; max-width: none; margin-top: 14px; }

	/* Selector a todo el ancho */
	.ach-level-switch { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; }
	.ach .ach-level-switch a { padding: 0 6px; font-size: 11px; text-align: center; }

	.ach-catalog { padding: 26px 0 64px; }
	.ach-catalog__head { display: block; margin-bottom: 20px; }
	.ach .ach-catalog__count { margin-top: 14px; }
	.ach-js .ach-toolbar { grid-template-columns: 1fr; gap: 10px; margin-bottom: 18px; }
	.ach-searchbox,
	.ach-selectbox { height: 50px; }
	.ach .ach-searchbox input { font-size: 16px; } /* evita el zoom automático en iOS */

	/* Tarjetas horizontales: imagen a la izquierda */
	.ach-course-grid { grid-template-columns: 1fr; gap: 12px; }
	.ach-course {
		display: grid;
		grid-template-columns: 112px 1fr;
		border-radius: 18px;
	}
	.ach-course:hover { transform: none; }
	.ach-course__cover { aspect-ratio: auto; height: 100%; }
	.ach-course__body { padding: 14px 14px 12px; }
	.ach .ach-course h3 { margin: 8px 0 6px; font-size: 14px; }
	.ach .ach-course__body p {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
		margin-bottom: 10px;
		font-size: 12px;
		line-height: 1.45;
	}
	.ach-course__footer { padding-top: 10px; }

	.ach-help { padding-bottom: 64px; }
	.ach-helpbox { grid-template-columns: 1fr; gap: 22px; padding: 28px 22px; border-radius: 22px; }
	.ach .ach-helpbox h2 { font-size: 24px; }
	.ach-helpbox .ach-btn { width: 100%; }
}
