/*
 * ASAP Privado — diseño "moderno" (5.1.0-privado.13).
 * Se carga solo si el ajuste `asap_diseno_moderno` está activado, después del
 * CSS del tema y antes del CSS adicional de la web (que sigue mandando).
 * Los colores salen de los ajustes de cada web (variables --am-*, ver inc/moderno.php).
 * No toca la portada ni las categorías de PuntaHome ni la cabecera.
 */

:root {
	--am-suave: color-mix(in srgb, var(--am-acento) 9%, var(--am-fondo));
	--am-suave-2: color-mix(in srgb, var(--am-acento) 16%, var(--am-fondo));
	--am-borde: color-mix(in srgb, var(--am-texto) 13%, var(--am-fondo));
	--am-tenue: color-mix(in srgb, var(--am-texto) 68%, var(--am-fondo));
	--am-tarjeta: color-mix(in srgb, #fff 55%, var(--am-fondo));
	--am-radio: 14px;
	--am-radio-chico: 8px;
	--am-sombra: 0 1px 2px rgb(0 0 0 / 4%), 0 8px 24px rgb(0 0 0 / 6%);
}

/* ---------- Estructura: columna de lectura + barra lateral ---------- */

.content-single {
	padding-inline: 20px;
	box-sizing: border-box;
}

@media (min-width: 1050px) {
	/*
	 * Grilla, no "flex": dentro de .content-single puede haber más cosas que el
	 * artículo y la barra lateral (por ejemplo el anuncio de arriba). Todo lo
	 * que no sea artículo o barra ocupa el ancho completo en su propia fila.
	 */
	.content-single {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		justify-content: space-between;
		align-items: start;
		column-gap: 56px;
		padding-top: 12px;
	}
	.content-single:has(> .primary-sidebar) {
		grid-template-columns: minmax(0, 780px) 300px;
	}
	.content-single > * {
		grid-column: 1 / -1;
		min-width: 0;
	}
	.content-single > .content-thin,
	.content-single > article {
		grid-column: 1;
		width: auto;
		max-width: 780px;
		padding: 0;
		margin: 0;
	}
	.content-single > .primary-sidebar {
		grid-column: 2;
		align-self: stretch; /* tan alta como el artículo: sin esto lo "fijo" no tiene recorrido */
		width: 300px;
		margin: 8px 0 0;
		padding: 0;
	}

	/*
	 * Barra lateral fija (opción "Barra lateral fija" del tema): el anuncio de
	 * arriba se va con la página, los artículos recomendados quedan a la vista
	 * durante todo el artículo y el anuncio de abajo aparece al llegar al final.
	 */
	.primary-sidebar > .sticky:not(.ads-asap) {
		position: static;
		display: flex;
		flex-direction: column;
		height: 100%;
	}
	.primary-sidebar .asap-lateral-recorrido {
		flex: 1 1 auto;
		margin: 0;
	}
	.primary-sidebar .asap-lateral-fijo {
		position: sticky;
		top: var(--am-arriba, 82px);
		margin: 0;
	}
	/* Dentro de la caja fija, recomendados más compactos para dejar lugar al anuncio. */
	.primary-sidebar .asap-lateral-fijo .last-post-sidebar {
		margin-bottom: 16px !important;
	}
	.primary-sidebar .asap-lateral-fijo .last-post-sidebar .article-loop a {
		grid-template-columns: 76px 1fr;
		gap: 12px;
		padding: 9px 0;
	}
	.primary-sidebar .asap-lateral-fijo .last-post-sidebar .article-loop:first-child a {
		padding-top: 0;
	}
	.primary-sidebar .asap-lateral-fijo .last-post-sidebar p.entry-title {
		font-size: 14px !important;
		-webkit-line-clamp: 2;
	}
	/* El anuncio de abajo: pegado a los recomendados, sin "fijo" propio. */
	.primary-sidebar .asap-lateral-fijo .ads-asap {
		position: static;
		margin: 0 auto;
	}
	/* Línea entre los recomendados y el anuncio, igual a la que separa cada recomendado. */
	.primary-sidebar .asap-lateral-fijo .ads-asap:not(:first-child) {
		padding-top: 16px;
		border-top: 1px solid var(--am-borde);
	}
}

/* ---------- Migas de pan ---------- */

.breadcrumb {
	font-size: 13px;
	line-height: 1.5;
	color: var(--am-tenue);
	margin: 8px 0 14px;
}
.breadcrumb li,
.breadcrumb a,
.breadcrumb span {
	font-size: 13px;
}
article .breadcrumb .trail-end {
	display: none;
}
article .breadcrumb li:nth-last-child(2)::after {
	content: none;
}

/* ---------- Título, autor y portada ---------- */

.content-single h1 {
	font-size: clamp(30px, 3.1vw, 42px);
	line-height: 1.16;
	letter-spacing: -0.015em;
	margin: 0 0 18px;
	text-wrap: balance;
}

.content-author {
	margin: 0 0 22px;
	gap: 12px;
}
.author-image {
	height: 40px;
	width: 40px;
	flex: 0 0 40px;
}
.author-image img {
	border-radius: 50%;
	display: block;
	background: var(--am-suave-2);
}
.author-desc {
	margin: 0;
	width: auto;
}
.author-desc p,
.show-date p {
	font-size: 14px;
	color: var(--am-tenue);
}
.author-desc p:first-child a {
	font-weight: 700;
	color: var(--am-texto);
	text-decoration: none;
}
.author-desc p:first-child a:hover {
	color: var(--am-acento);
}

.post-thumbnail {
	margin: 0 0 28px !important;
}
.post-thumbnail img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--am-radio);
}

/* ---------- Texto del artículo ---------- */

.the-content p,
.the-content ul li,
.the-content ol li {
	line-height: 1.75;
}
.the-content p {
	margin-bottom: 1.35em;
}
.the-content > p:first-of-type {
	font-size: 20px;
	line-height: 1.65;
	color: color-mix(in srgb, var(--am-texto) 88%, var(--am-fondo));
}

.the-content h2 {
	font-size: clamp(25px, 2.3vw, 31px);
	line-height: 1.22;
	letter-spacing: -0.01em;
	margin-top: 2.1em;
	margin-bottom: 0.6em;
	text-wrap: balance;
}
.the-content h3 {
	font-size: clamp(20px, 1.8vw, 23px);
	line-height: 1.3;
	margin-top: 1.8em !important;
	margin-bottom: 0.5em !important;
}
.the-content h4 {
	font-size: 18px;
	line-height: 1.35;
	margin-top: 1.6em;
	margin-bottom: 0.4em;
}

.the-content a:not([class]) {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
	transition: text-decoration-color 0.15s;
}
.the-content a:not([class]):hover {
	text-decoration-color: currentColor;
}

.the-content img {
	border-radius: var(--am-radio);
	height: auto;
}

.the-content hr {
	border: 0;
	border-top: 1px solid var(--am-borde);
	margin: 2.4em 0;
}

/* Listas */
.the-content ul:not(#index-table),
.the-content ol:not(.post-index ol) {
	margin-bottom: 1.5em;
	padding-left: 0;
}
.the-content ul:not(#index-table) > li {
	margin-left: 1.4em;
	padding-left: 0.2em;
	margin-bottom: 0.55em;
}
.the-content ul:not(#index-table) li::marker {
	color: var(--am-acento);
}
.the-content ol:not(.post-index ol) > li {
	padding: 0 0 0 2.4em;
	margin: 0 0 0.75em !important;
	text-shadow: none;
}
.the-content ol:not(.post-index ol) > li::before {
	position: absolute;
	left: 0;
	top: 0.2em;
	height: 1.7em;
	min-width: 1.7em;
	padding: 0;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--am-suave-2);
	color: var(--am-titulo);
	font-size: 0.78em;
	font-weight: 700;
	line-height: 1;
}

/* Cita */
.the-content blockquote,
blockquote {
	margin: 1.8em 0;
	padding: 1.1em 1.4em;
	border: 0;
	border-left: 4px solid var(--am-acento);
	border-radius: 0 var(--am-radio) var(--am-radio) 0;
	background: var(--am-suave);
	color: var(--am-texto);
}
.the-content blockquote p {
	font-size: 1.08em;
	line-height: 1.6;
	margin: 0;
}

/* Tabla */
.the-content table {
	table-layout: auto;
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	border: 1px solid var(--am-borde);
	border-radius: var(--am-radio);
	overflow: hidden;
	margin: 1.8em 0;
	font-size: 16px;
	background: var(--am-tarjeta);
}
.the-content table th,
.the-content table td {
	padding: 0.75em 1em;
	border: 0;
	border-top: 1px solid var(--am-borde);
	text-align: left;
	vertical-align: top;
	line-height: 1.5;
}
.the-content table thead th {
	border-top: 0;
	border-bottom: 0;
	background: var(--am-suave-2);
	color: var(--am-titulo);
	font-weight: 700;
}
.the-content table tbody tr:nth-child(even) td {
	background: color-mix(in srgb, var(--am-acento) 4%, transparent);
}
@media (max-width: 600px) {
	.the-content table {
		display: block;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
}

/* ---------- Índice ---------- */

.the-content .post-index {
	background: var(--am-suave) !important;
	border: 1px solid var(--am-borde);
	border-top: 1px solid var(--am-borde);
	border-radius: var(--am-radio);
	box-shadow: none;
	padding: 16px 20px;
	margin-top: 28px !important;
	margin-bottom: 32px;
}
.the-content .post-index > span {
	font-weight: 700;
	color: var(--am-titulo);
	letter-spacing: 0.01em;
}
.the-content .post-index #index-table {
	margin-top: 12px;
}
.the-content .post-index li {
	margin-left: 0 !important;
	margin-bottom: 4px !important;
	list-style: none;
}
.the-content .post-index li li {
	margin-left: 18px !important;
}
.the-content .post-index a {
	display: block;
	padding: 4px 0;
	font-size: 16px;
	line-height: 1.45;
	text-decoration: none;
	color: var(--am-texto);
}
.the-content .post-index li li a {
	font-size: 15px;
	color: var(--am-tenue);
}
.the-content .post-index a:hover {
	color: var(--am-acento);
}

/* ---------- Preguntas frecuentes ---------- */

.the-content .faq-section {
	margin: 2.4em 0;
}
.the-content .faq-item {
	border: 1px solid var(--am-borde);
	border-radius: var(--am-radio);
	background: var(--am-tarjeta);
	padding: 2px 20px;
	margin-bottom: 10px;
}
.the-content .faq-question h3 {
	font-size: 18px;
	line-height: 1.4;
	margin: 14px 0 !important;
}
.the-content .faq-answer p {
	margin-bottom: 14px;
}
.the-content .faq-answer i {
	font-style: normal;
}

/* ---------- Caja del autor ---------- */

.author-box {
	display: flex;
	gap: 18px;
	align-items: flex-start;
	border: 1px solid var(--am-borde);
	border-radius: var(--am-radio);
	background: var(--am-tarjeta);
	box-shadow: none;
	padding: 22px;
	margin: 40px 0 0;
}
.author-box-avatar {
	margin: 0;
	width: 64px;
	flex: 0 0 64px;
}
.author-box-avatar .avatar {
	display: block;
	width: 64px;
	height: 64px;
	background: var(--am-suave-2);
}
.author-box-info {
	width: auto;
	flex: 1 1 0;
	min-width: 0;
}
.author-box p.author-box-name {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}
.author-box p.author-box-name a {
	color: var(--am-texto);
	text-decoration: none;
}
.author-box p.author-box-desc {
	font-size: 15px;
	line-height: 1.6;
	color: var(--am-tenue);
	margin-top: 6px;
}

/* ---------- Relacionados ---------- */

.related-posts {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 22px;
	margin-top: 44px;
	padding-top: 32px;
	border-top: 1px solid var(--am-borde);
}
.related-posts .article-loop {
	width: 100%;
	max-width: none;
	flex: none;
	padding: 0;
	margin: 0 !important;
	display: block;
}
.related-posts .article-content {
	height: auto !important;
	aspect-ratio: 16 / 10;
	margin: 0 0 12px !important;
	border-radius: var(--am-radio);
	overflow: hidden;
}
.related-posts .article-image,
.last-post-sidebar .article-image,
.related-posts .article-image img,
.last-post-sidebar .article-image img {
	height: 100% !important;
	width: 100%;
	object-fit: cover;
	border-radius: 0;
}
.related-posts .article-image img,
.last-post-sidebar .article-image img {
	transition: transform 0.35s ease;
}
.related-posts .article-loop a:hover img,
.last-post-sidebar .article-loop a:hover img {
	transform: scale(1.04);
}
.related-posts p.entry-title {
	font-size: 16px !important;
	font-weight: 700 !important;
	line-height: 1.35;
	text-align: left;
	margin: 0;
	padding: 0;
}
@media (max-width: 700px) {
	.related-posts {
		grid-template-columns: 1fr;
		gap: 16px;
		padding-left: 0 !important;
		padding-right: 0 !important;
		margin-left: 0;
		margin-right: 0;
	}
	.related-posts .article-loop a {
		display: grid;
		grid-template-columns: 112px 1fr;
		gap: 14px;
		align-items: center;
	}
	.related-posts .article-content {
		margin: 0 !important;
		width: 100%;
		min-width: 0;
		aspect-ratio: 4 / 3;
		border-radius: var(--am-radio-chico);
	}
	.related-posts .article-loop a > * {
		min-width: 0;
	}
}

/* ---------- Barra lateral: últimos artículos ---------- */

.last-post-sidebar {
	display: block;
	margin: 0 0 24px !important;
	padding: 0 !important;
}
.last-post-sidebar .article-loop {
	display: block;
	width: 100%;
	max-width: none;
	padding: 0;
	margin: 0 !important;
	border-bottom: 1px solid var(--am-borde);
}
.last-post-sidebar .article-loop:last-child {
	border-bottom: 0;
}
.last-post-sidebar .article-loop a {
	display: grid;
	grid-template-columns: 92px 1fr;
	gap: 14px;
	align-items: center;
	padding: 14px 0;
}
.last-post-sidebar .article-loop:first-child a {
	padding-top: 0;
}
.last-post-sidebar .article-content {
	height: auto !important;
	width: 100%;
	min-width: 0;
	aspect-ratio: 4 / 3;
	margin: 0 !important;
	border-radius: var(--am-radio-chico);
	overflow: hidden;
}
.last-post-sidebar p.entry-title {
	font-size: 15px !important;
	font-weight: 700 !important;
	line-height: 1.35;
	text-align: left;
	margin: 0;
	padding: 0;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Comentarios ---------- */

.area-comentarios {
	margin-top: 44px;
	padding-top: 28px;
	border-top: 1px solid var(--am-borde);
}
.comment-respond > p:first-child {
	font-size: 22px;
	font-weight: 700;
	color: var(--am-titulo);
	border: 0;
	padding: 0;
	margin-bottom: 8px;
}
.comment-form input:not([type="submit"]):not([type="checkbox"]),
.comment-form textarea,
.search-page input[type="search"],
.search-page input[type="text"] {
	border: 1px solid var(--am-borde) !important;
	border-radius: var(--am-radio-chico) !important;
	background: var(--am-tarjeta);
	padding: 12px 14px;
	box-shadow: none;
}
.comment-form input:not([type="submit"]):focus,
.comment-form textarea:focus {
	border-color: var(--am-acento) !important;
	outline: 2px solid color-mix(in srgb, var(--am-acento) 35%, transparent);
	outline-offset: 1px;
}
.comment-form .submit,
input[type="submit"] {
	border-radius: 999px !important;
	padding: 12px 26px;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.15s;
}
.comment-form .submit:hover,
input[type="submit"]:hover {
	filter: brightness(0.94);
}

/* ---------- Compartir y navegación ---------- */

.asap-icon-single {
	border-radius: 50% !important;
}

/* ---------- "Subir" y migas del pie ---------- */

.go-top {
	box-shadow: var(--am-sombra);
}
.footer-breadcrumb {
	border-top: 1px solid var(--am-borde);
}

/* ---------- Pie ---------- */

.content-footer {
	padding-top: 44px;
}
.content-footer .widget-content-footer {
	gap: 40px;
}
.content-footer p.widget-title {
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.75;
	margin-bottom: 12px;
}
.content-footer .textwidget,
.content-footer .textwidget p,
.content-footer .textwidget a {
	font-size: 15px;
	line-height: 1.9;
}
.content-footer a {
	text-decoration: none;
}
.content-footer a:hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}
.content-footer .widget-content-footer-bottom {
	border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
	margin-top: 28px;
	padding-top: 18px;
	opacity: 0.8;
}
.content-footer .widget-content-footer-bottom p {
	font-size: 13px;
}

/* ---------- Listados del tema (etiquetas, autor, búsqueda) ---------- */

.content-area .article-loop .article-content,
.content-loop .article-loop .article-content {
	border-radius: var(--am-radio);
	overflow: hidden;
}
.content-loop .article-loop p.entry-title,
.content-area .article-loop p.entry-title {
	font-weight: 700 !important;
	line-height: 1.35;
}

/* ---------- Teclado y movimiento ---------- */

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
	outline: 2px solid var(--am-acento);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Móvil ---------- */

@media (max-width: 1049px) {
	.content-single > .primary-sidebar {
		width: 100%;
		box-sizing: border-box;
		margin-top: 40px;
		padding: 28px 0 0;
		border-top: 1px solid var(--am-borde);
	}
}
@media (max-width: 600px) {
	.content-single {
		padding-inline: 16px;
	}
	.post-thumbnail {
		margin-inline: 0 !important;
	}
	.author-box {
		padding: 18px;
	}
	.content-footer {
		padding-top: 28px;
	}
	.content-footer .widget-content-footer {
		gap: 4px;
	}
	.content-footer .widget-area,
	.content-footer .logo-footer {
		margin-top: 0;
		margin-bottom: 14px;
	}
	.content-footer .textwidget p {
		margin-bottom: 8px;
	}
}

/* ---------- Preguntas frecuentes: acordeón ---------- */

.the-content .faq-question {
	position: relative;
	padding-right: 34px;
}
.asap-faq-js .the-content .faq-question h3 {
	cursor: pointer;
}
.asap-faq-js .the-content .faq-question::after {
	content: "";
	position: absolute;
	right: 4px;
	bottom: 11px; /* desde abajo: el tema agrega un espacio invisible arriba de cada título */
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--am-acento);
	border-bottom: 2px solid var(--am-acento);
	transform: rotate(45deg);
	transition: transform 0.2s;
	pointer-events: none;
}
.asap-faq-js .the-content .faq-item.active .faq-question::after {
	transform: rotate(-135deg);
	bottom: 6px;
}
.asap-faq-js .the-content .faq-item:not(.active) .faq-answer {
	display: none;
}

/* Preguntas en <details> (artículos nuevos del generador) */
.the-content details {
	border: 1px solid var(--am-borde);
	border-radius: var(--am-radio);
	background: var(--am-tarjeta);
	padding: 2px 20px;
	margin-bottom: 10px;
}
.the-content details > summary {
	cursor: pointer;
	font-weight: 700;
	color: var(--am-titulo);
	padding: 14px 0;
	line-height: 1.4;
}
.the-content details[open] > summary {
	margin-bottom: 2px;
}

/* ---------- Anuncios ---------- */

.the-content .ads-asap {
	margin: 2em auto;
	max-width: 100%;
	overflow: hidden;
}
.primary-sidebar .ads-asap {
	margin: 0 auto 24px;
}

/* Anuncio de arriba del artículo: fila propia, centrado. */
.content-single > .ads-asap {
	margin: 0 auto 20px;
	max-width: 100%;
	overflow: hidden;
}
