/* ==========================================================================
   ANATO Capacita: base compartida por las vistas con diseño propio
   (home y módulos por nivel). Todo bajo .ach / prefijo ach- para no chocar
   con Eduma ni Bootstrap. Cada vista añade su propio archivo anato-*.css.

   1. Tokens y base
   2. Utilidades (container, eyebrow, botones, badge, secciones, calificación, migas de pan)
   3. Header
   4. Footer
   5. Animación de entrada
   6. Responsive
   ========================================================================== */

/* 1. Tokens y base
   ========================================================================== */
/* Tokens: también para el visor de cápsulas (body.ach-player), que usa la plantilla de LearnPress. */
.ach,
.ach-player {
	--ach-blue: #075ca8;
	--ach-blue-dark: #064f90;
	--ach-navy: #07365f;
	--ach-teal: #00afa6;
	--ach-teal-dark: #087d78;
	--ach-teal-soft: #eaf8f7;
	--ach-ink: #11283d;
	--ach-muted: #607386;
	--ach-line: #dce8ef;
	--ach-soft: #f4f9fc;
	--ach-white: #fff;
	--ach-star: #f2a900;
	--ach-shadow: 0 18px 60px rgba(7, 54, 95, .12);
	--ach-max: 1220px;
	--ach-header-h: 82px;
}

.ach {
	font-family: 'Montserrat', Arial, sans-serif;
	font-size: 16px;
	color: var(--ach-ink);
	line-height: 1.6;
	background: var(--ach-white);
	overflow-x: clip;
}

.ach-body {
	margin: 0;
	background: var(--ach-white);
}

/* Eduma pone overflow-x: hidden en html y body; eso convierte al body en contenedor de scroll y
   rompe el header sticky (no se fija y, con la barra de admin, se desplaza de más y tapa la miga de pan).
   El desborde horizontal lo controla .ach con overflow-x: clip. */
html:has(body.ach-body),
body.ach-body {
	overflow: visible;
}

html:has(.ach) {
	scroll-behavior: smooth;
}

.ach *,
.ach *::before,
.ach *::after {
	box-sizing: border-box;
}

.ach h1,
.ach h2,
.ach h3,
.ach h4 {
	font-family: inherit;
	color: inherit;
	font-weight: 700;
	text-transform: none;
}

.ach p {
	margin: 0 0 1em;
}

.ach a,
.ach a:hover,
.ach a:focus {
	color: inherit;
	text-decoration: none;
}

.ach a:focus-visible,
.ach button:focus-visible {
	outline: 3px solid var(--ach-teal);
	outline-offset: 3px;
}

.ach img {
	display: block;
	max-width: 100%;
	height: auto;
}

.ach button {
	font: inherit;
}

.ach [id] {
	scroll-margin-top: calc(var(--ach-header-h) + 16px);
}

.ach-skip {
	position: absolute;
	left: 16px;
	top: -100px;
	z-index: 100;
	padding: 10px 16px;
	border-radius: 10px;
	background: var(--ach-navy);
	color: #fff !important;
	font-weight: 700;
}

.ach-skip:focus {
	top: 16px;
}

.ach-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* 2. Utilidades
   ========================================================================== */
.ach-container {
	width: min(var(--ach-max), calc(100% - 40px));
	margin: 0 auto;
}

.ach-section {
	padding: 96px 0;
}

.ach-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: var(--ach-teal-soft);
	color: var(--ach-teal-dark);
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	line-height: 1.2;
}

.ach-eyebrow::before {
	content: '';
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ach-teal);
}

.ach-section-head {
	display: flex;
	justify-content: space-between;
	align-items: end;
	gap: 32px;
	margin-bottom: 36px;
}

.ach .ach-section-head h2 {
	margin: 12px 0 0;
	font-size: clamp(30px, 4vw, 52px);
	line-height: 1.05;
	letter-spacing: -.035em;
}

.ach-section-head p {
	max-width: 580px;
	margin: 0;
	color: var(--ach-muted);
}

.ach-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 48px;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: 14px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1.2;
	cursor: pointer;
	transition: transform .25s ease, background-color .25s ease, border-color .25s ease, box-shadow .25s ease;
}

.ach-btn svg {
	width: 18px;
	height: 18px;
}

.ach .ach-btn--primary {
	background: var(--ach-blue);
	color: #fff;
	box-shadow: 0 10px 28px rgba(7, 92, 168, .24);
}

.ach .ach-btn--primary:hover {
	transform: translateY(-2px);
	background: var(--ach-blue-dark);
	color: #fff;
	box-shadow: 0 14px 30px rgba(7, 92, 168, .30);
}

.ach .ach-btn--light {
	background: #fff;
	color: var(--ach-blue);
	border-color: #d7e6f1;
}

.ach .ach-btn--light:hover {
	transform: translateY(-2px);
	color: var(--ach-blue);
	border-color: #9fc7df;
}

.ach .ach-link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--ach-blue);
	font-size: 14px;
	font-weight: 800;
}

.ach-link-arrow span {
	transition: transform .2s;
}

.ach-badge {
	display: inline-flex;
	width: max-content;
	margin-bottom: 12px;
	padding: 6px 9px;
	border-radius: 999px;
	background: var(--ach-teal-soft);
	color: var(--ach-teal-dark);
	font-size: 10px;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.ach-badge--nivel-directivo {
	background: #edf1fb;
	color: #315999;
}

/* 2a. Calificación con estrellas (tarjetas de módulos y opiniones)
   ========================================================================== */
.ach-rating {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 16px;
	font-size: 13px;
	color: var(--ach-muted);
}

/* Estrellas con relleno parcial según --rating (0–5). */
.ach-rating__stars {
	--fill: calc(var(--rating) / 5 * 100%);
	font-size: 16px;
	line-height: 1;
	letter-spacing: 1px;
	background: linear-gradient(90deg, var(--ach-star) var(--fill), var(--ach-line) var(--fill));
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

.ach .ach-rating strong {
	color: var(--ach-ink);
	font-size: 14px;
}

/* 2b. Migas de pan
   ========================================================================== */
.ach-crumbbar {
	background: #fff;
	border-bottom: 1px solid var(--ach-line);
}

.ach .ach-crumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 9px;
	min-height: 54px;
	margin: 0 auto;
	padding: 0;
	list-style: none;
	font-size: 12px;
	font-weight: 600;
	color: #718394;
}

.ach-crumb li {
	display: flex;
	align-items: center;
	gap: 9px;
	margin: 0;
}

.ach .ach-crumb a:hover {
	color: var(--ach-blue);
}

.ach-crumb b {
	color: #27475f;
}

.ach-crumb svg {
	width: 13px;
	height: 13px;
	opacity: .55;
}

/* 3. Header
   ========================================================================== */
.ach-topline {
	height: 5px;
	background: linear-gradient(90deg, var(--ach-blue), var(--ach-teal), #80e3d9);
}

.ach-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: rgba(255, 255, 255, .92);
	backdrop-filter: blur(16px);
	border-bottom: 1px solid rgba(216, 231, 240, .85);
}

.ach-nav {
	height: var(--ach-header-h);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.ach-brand img {
	width: 250px;
	max-height: 58px;
	object-fit: contain;
}

.ach-navlinks {
	display: flex;
	align-items: center;
	gap: 26px;
	font-size: 13px;
	font-weight: 800;
	color: #24435b;
}

.ach-navlinks > a:not(.ach-btn),
.ach-dropbtn {
	position: relative;
	padding: 10px 0;
}

.ach-navlinks > a:not(.ach-btn)::after {
	content: '';
	position: absolute;
	left: 0;
	bottom: 4px;
	width: 0;
	height: 2px;
	background: var(--ach-teal);
	transition: width .25s;
}

.ach-navlinks > a:not(.ach-btn):hover::after {
	width: 100%;
}

.ach-dropdown {
	position: relative;
}

.ach .ach-dropbtn {
	display: flex;
	align-items: center;
	gap: 7px;
	border: 0;
	background: none;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	cursor: pointer;
}

.ach-menu {
	position: absolute;
	top: 44px;
	left: -18px;
	min-width: 220px;
	padding: 10px;
	background: #fff;
	border: 1px solid var(--ach-line);
	border-radius: 18px;
	box-shadow: var(--ach-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s, transform .2s, visibility .2s;
}

.ach-dropdown:hover .ach-menu,
.ach-dropdown:focus-within .ach-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.ach-menu a {
	display: block;
	padding: 11px 13px;
	border-radius: 10px;
	font-size: 12px;
}

.ach-menu a:hover {
	background: var(--ach-soft);
}

.ach .ach-hamb {
	display: none;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 12px;
	background: var(--ach-soft);
	color: var(--ach-ink);
	align-items: center;
	justify-content: center;
	padding: 0;
	cursor: pointer;
}

.ach .ach-hamb svg {
	display: block;
	width: 22px;
	height: 22px;
	stroke: currentColor;
}

.ach-mobile-menu {
	display: none;
	padding: 12px 0 22px;
	border-top: 1px solid var(--ach-line);
}

.ach-mobile-menu a {
	display: block;
	padding: 12px 4px;
	font-weight: 700;
}

/* 4. Footer
   ========================================================================== */
.ach-footer {
	padding: 58px 0 22px;
	background: #072f51;
	color: #d9eaf4;
}

.ach-foot-grid {
	display: grid;
	grid-template-columns: 1.3fr .8fr .9fr;
	gap: 46px;
}

.ach .ach-foot-brand img {
	width: 245px;
	margin-bottom: 20px;
	filter: brightness(0) invert(1);
	opacity: .96;
}

.ach-foot-brand p {
	max-width: 420px;
	font-size: 13px;
	color: #aac2d2;
}

.ach .ach-foot-col h4 {
	margin: 0 0 16px;
	font-size: 13px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #fff;
}

.ach .ach-foot-col a,
.ach .ach-foot-col p {
	display: block;
	margin: 9px 0;
	font-size: 13px;
	color: #b9cfdd;
}

.ach .ach-foot-col a:hover {
	color: #fff;
}

.ach-foot-bottom {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 20px;
	margin-top: 42px;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: 11px;
	color: #91adbe;
}

/* 5. Animación de entrada (solo si el navegador la soporta, ver anato-base.js)
   ========================================================================== */
.ach-anim .ach-reveal {
	opacity: 0;
	transform: translateY(18px);
	transition: opacity .7s ease, transform .7s ease;
}

.ach-anim .ach-reveal.is-in {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	html:has(.ach) {
		scroll-behavior: auto;
	}

	.ach *,
	.ach *::before,
	.ach *::after {
		animation: none !important;
		transition: none !important;
	}

	.ach-anim .ach-reveal {
		opacity: 1;
		transform: none;
	}
}
/* 6. Responsive
   ========================================================================== */
@media (max-width: 1050px) {
	.ach-navlinks { display: none; }
	.ach .ach-hamb { display: flex; }
	.ach-mobile-menu.is-open { display: block; }

	.ach-foot-grid { grid-template-columns: 1fr 1fr; }
	.ach-foot-brand { grid-column: 1 / -1; }
}

/* En pantallas pequeñas la barra de admin de WordPress no es fija: el header se pega al borde. */
@media (max-width: 600px) {
	.ach-header { top: 0; }
}

@media (max-width: 680px) {
	.ach {
		--ach-header-h: 72px;
		--ach-gutter: 16px;
	}
	.ach-container { width: calc(100% - var(--ach-gutter) * 2); }
	.ach-section { padding: 64px 0; }
	.ach-brand img { width: 190px; }

	.ach-section-head { display: block; margin-bottom: 28px; }
	.ach-section-head p { margin-top: 16px; }

	.ach-badge { font-size: 11px; }
	.ach .ach-crumb { flex-wrap: nowrap; min-height: 48px; white-space: nowrap; }
	.ach-crumb li:last-child { min-width: 0; }
	.ach-crumb li:last-child b { overflow: hidden; text-overflow: ellipsis; }

	.ach-footer { padding-top: 48px; }
	.ach-foot-grid { grid-template-columns: 1fr; gap: 30px; }
	.ach-foot-brand { grid-column: auto; }
	.ach .ach-foot-brand img { width: 200px; }
	.ach .ach-foot-col a { margin: 0; padding: 10px 0; }
	.ach-foot-bottom { flex-direction: column; gap: 6px; margin-top: 30px; }
}
