/* ==========================================================================
   Cédula Profesional en Línea — Diseño adaptable (ordenador, tablet y móvil)
   Versión 1.0 · 29-11-2026
   Capa de CSS sobre AsapTheme. No modifica el tema padre ni el logotipo.
   Reversible: basta con borrar este CSS (o desactivar el plugin que lo carga).
   Puntos de corte del tema: 480 px · 768 px · 1050 px
   ========================================================================== */

:root {
	--cpl-verde: #166b69;          /* color de la cabecera actual */
	--cpl-verde-oscuro: #0f4f4d;
	--cpl-verde-claro: #e8f3f2;
	--cpl-texto: #1f2328;
	--cpl-texto-suave: #4a4f55;
	--cpl-borde: #d9e2e1;
	--cpl-fondo-suave: #f6f8f8;
	--cpl-radio: 10px;
	--cpl-lectura: 720px;          /* ancho máximo de lectura (~70 caracteres) */
}

/* ---------- 1. Base tipográfica y legibilidad (todas las pantallas) ---------- */

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

.the-content,
.the-content p,
.the-content li {
	color: var(--cpl-texto);
	font-size: clamp(1rem, 0.96rem + 0.25vw, 1.125rem);   /* 16 → 18 px */
	line-height: 1.7;
}

.the-content p { margin-bottom: 1.1em; }

.content-single h1,
.content-page h1 {
	font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.375rem);    /* 26 → 38 px */
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.the-content h2 {
	font-size: clamp(1.35rem, 1.1rem + 1vw, 1.875rem);     /* 22 → 30 px */
	line-height: 1.25;
	margin-top: 2em;
	margin-bottom: 0.6em;
}

.the-content h3 {
	font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);       /* 18 → 24 px */
	line-height: 1.3;
	margin-top: 1.6em;
	margin-bottom: 0.5em;
}

.the-content ul,
.the-content ol { padding-left: 1.3em; }
.the-content li { margin-bottom: 0.45em; }

.the-content a {
	color: var(--cpl-verde-oscuro);
	text-decoration: underline;
	text-underline-offset: 2px;
	overflow-wrap: anywhere;                 /* URLs largas de gob.mx no desbordan */
}

/* Foco visible para teclado */
a:focus-visible,
button:focus-visible,
input:focus-visible,
label:focus-visible {
	outline: 3px solid #f0b429;
	outline-offset: 2px;
}

/* ---------- 2. Imágenes, tablas, vídeos y anuncios sin desbordes ---------- */

.the-content img,
.the-content figure,
.the-content iframe,
.the-content video {
	max-width: 100%;
	height: auto;
}

.the-content figure { margin: 1.5em 0; }

.the-content table {
	display: block;
	width: 100%;
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border-collapse: collapse;
	font-size: 0.95em;
}

.the-content th,
.the-content td {
	border: 1px solid var(--cpl-borde);
	padding: 0.6em 0.75em;
	vertical-align: top;
	min-width: 120px;
}

.the-content th { background: var(--cpl-verde-claro); text-align: left; }

/* Los anuncios automáticos nunca deben provocar scroll horizontal */
.google-auto-placed,
ins.adsbygoogle {
	max-width: 100% !important;
	overflow: hidden;
}
.the-content .google-auto-placed { margin: 1.75em auto !important; }

/* ---------- 3. Índice de contenidos (Easy Table of Contents) ---------- */

#ez-toc-container {
	width: 100% !important;
	max-width: var(--cpl-lectura);
	box-sizing: border-box;
	background: var(--cpl-fondo-suave) !important;
	border: 1px solid var(--cpl-borde) !important;
	border-radius: var(--cpl-radio);
	padding: 1rem 1.25rem !important;
	margin: 1.5em 0 !important;
	box-shadow: none !important;
}

#ez-toc-container a {
	display: inline-block;
	padding: 0.25em 0;                    /* objetivo táctil más cómodo */
	text-decoration: none;
	color: var(--cpl-verde-oscuro);
}

/* ---------- 4. Artículos relacionados como tarjetas ---------- */

.related-posts {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 1rem;
}

.related-posts .article-loop {
	width: auto !important;
	max-width: none !important;          /* el tema fija 50 % y estrecha las tarjetas */
	flex: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: #fff;
	border: 1px solid var(--cpl-borde);
	border-radius: var(--cpl-radio);
	overflow: hidden;
	transition: border-color .15s ease;
}

.related-posts .article-loop:hover { border-color: var(--cpl-verde); }

.related-posts .article-loop > a { display: block; height: 100%; text-decoration: none; }
.related-posts .article-content { margin: 0 !important; height: auto !important; }
.related-posts .article-loop { height: auto !important; }

.related-posts .article-image { height: 130px !important; background-size: cover; background-position: center; }

.related-posts p,
.related-posts .entry-title {
	font-size: 0.98rem !important;
	line-height: 1.35 !important;
	text-align: left !important;
	padding: 0.75rem 0.9rem 0.9rem !important;
	margin: 0 !important;
	color: var(--cpl-texto);
}

/* ---------- 5. Barra lateral ---------- */

.primary-sidebar .widget-title,
.primary-sidebar p.widget-title {
	font-size: 1.05rem;
	border-bottom: 2px solid var(--cpl-verde);
	padding-bottom: 0.4rem;
}

.primary-sidebar div ul li { margin-bottom: 0 !important; }

.primary-sidebar div ul li a {
	display: block;
	padding: 0.6rem 0.25rem;
	border-bottom: 1px solid var(--cpl-borde);
	line-height: 1.35;
	text-decoration: none;
}

/* ---------- 6. Ordenador (≥ 1050 px): columna de lectura + barra lateral ---------- */

@media (min-width: 1050px) {
	.content-single,
	.content-page {
		max-width: 1140px !important;
		gap: 40px;
		flex-wrap: nowrap;
		align-items: flex-start;
	}

	.content-single > article.content-thin,
	.content-page > article.content-thin {
		flex: 1 1 auto;
		max-width: calc(var(--cpl-lectura) + 2rem);
	}

	.content-single > .primary-sidebar,
	.content-page > .primary-sidebar {
		flex: 0 0 300px;
	}
}

/* Páginas a ancho completo (portada): texto en columna legible, tarjetas a todo el ancho */
@media (min-width: 768px) {
	.article-full > h1,
	.article-full > .search-home,
	.article-full .the-content > .entry-header,
	.article-full .the-content > .entry-content,
	.article-full .the-content > p {
		max-width: 820px;
		margin-left: auto !important;
		margin-right: auto !important;
	}
}

/* ---------- 7. Tablet (768–1049 px): columna centrada, barra lateral debajo ---------- */

@media (min-width: 768px) and (max-width: 1049.98px) {
	.content-single > article.content-thin,
	.content-page > article.content-thin,
	.content-single > .primary-sidebar,
	.content-page > .primary-sidebar {
		max-width: calc(var(--cpl-lectura) + 2rem) !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	/* La barra lateral debajo del artículo, en dos columnas para no hacer una lista eterna */
	.content-single > .primary-sidebar div ul,
	.content-page > .primary-sidebar div ul {
		display: grid;
		grid-template-columns: 1fr 1fr;
		column-gap: 1.5rem;
	}

	.related-posts { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 8. Menú adaptable (≤ 1049 px: el tema muestra el icono de menú) ---------- */

@media (max-width: 1049.98px) {
	#menu ul li a {
		display: flex;
		align-items: center;
		min-height: 48px;                 /* objetivo táctil recomendado */
		padding-top: 0.5rem;
		padding-bottom: 0.5rem;
		line-height: 1.3;
	}

	#menu .sub-menu li a { padding-left: 1.5rem; font-size: 0.95rem; }

	#menu .search-responsive input {
		font-size: 16px;                  /* evita el zoom automático de iOS */
		min-height: 44px;
	}

	#nav-icon { cursor: pointer; }
}

/* ---------- 9. Móvil (< 768 px) ---------- */

@media (max-width: 767.98px) {
	.content-single,
	.content-page { padding-top: 1.5rem !important; }

	.content-single > article.content-thin,
	.content-page > article.content-thin,
	.content-single > .primary-sidebar,
	.content-page > .primary-sidebar {
		padding-left: 0.25rem !important;
		padding-right: 0.25rem !important;
	}

	.site-logo img { max-height: 56px; width: auto; }   /* mismo logo, solo escalado */

	.the-content h2 { margin-top: 1.6em; }

	#ez-toc-container { padding: 0.85rem 1rem !important; }

	.related-posts { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
	.related-posts .article-image { height: 100px !important; }
	.related-posts p,
	.related-posts .entry-title { font-size: 0.92rem !important; padding: 0.6rem 0.7rem 0.75rem !important; }

	/* Aviso de cookies más compacto: no tapa media pantalla */
	.cookiesn {
		font-size: 0.85rem !important;
		line-height: 1.4 !important;
		padding: 0.6rem 0.9rem !important;
	}

	/* Botón «subir» por encima de los anuncios anclados */
	.go-top { bottom: 90px !important; right: 12px !important; }

	/* Formularios cómodos con el dedo y sin zoom en iOS */
	input[type="text"], input[type="email"], input[type="search"], textarea, select {
		font-size: 16px !important;
		min-height: 44px;
	}

	.wpcf7 input[type="submit"] { width: 100%; min-height: 48px; }
}

/* ---------- 10. Móvil pequeño (< 480 px) ---------- */

@media (max-width: 479.98px) {
	.related-posts { grid-template-columns: 1fr; }
	.related-posts .article-loop a { display: grid; grid-template-columns: 96px 1fr; align-items: center; }
	.related-posts .article-image { height: 72px !important; }
}

/* ---------- 11. Usuarios que prefieren menos movimiento ---------- */

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}