/**
 * Conocimiento — archive (home.php) + single (single.php). Rediseño «Minimal
 * refinado» (Ola 2, Tanda B — 2026-06-15). SOLO lo específico: hero verde,
 * filtros como chips, tarjetas de artículo con thumb texturizado, cuerpo
 * editorial y relacionados. Los fondos (paper/mint/cream) y el newsletter
 * usan primitivos globales. Tokens en main.css.
 *
 * Depende de main.css + components.css.
 * @package Datamorfosis
 */

/* Container 1140px scoped (como la Home). */
.dm-con-hero .container,
.dm-con-list .container,
.dm-con-newsletter .container,
.dm-post-hero .container,
.dm-post-related .container {
	max-width: 1140px;
	padding-left: 28px;
	padding-right: 28px;
}

/* ================================================
   HERO (verde profundo, textura de puntos) — archive
   ================================================ */
.dm-con-hero {
	position: relative;
	margin-top: 72px;
	color: #eaf1ef;
	background:
		radial-gradient(820px 420px at 82% -10%, rgba(255, 122, 91, 0.18), transparent 60%),
		radial-gradient(680px 460px at 4% 18%, rgba(90, 120, 114, 0.30), transparent 55%),
		linear-gradient(165deg, #1f3b38, #15302d);
	overflow: hidden;
	padding: clamp(56px, 7vw, 92px) 0 clamp(52px, 6vw, 80px);
}

.dm-con-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
	background-size: 26px 26px;
	-webkit-mask-image: radial-gradient(72% 70% at 50% 30%, #000, transparent);
	mask-image: radial-gradient(72% 70% at 50% 30%, #000, transparent);
	pointer-events: none;
}

.dm-con-hero .container {
	position: relative;
}

.dm-con-hero__title {
	font-size: clamp(32px, 4.4vw, 50px);
	line-height: 1.07;
	letter-spacing: -0.03em;
	font-weight: 900;
	color: #fff;
	margin: 16px 0 0;
	max-width: 20ch;
}

.dm-con-hero__sub {
	font-size: clamp(16px, 1.6vw, 19px);
	color: #c0d6d0;
	margin: 20px 0 0;
	max-width: 62ch;
	line-height: 1.6;
}

/* ================================================
   FILTROS (chips refinados, enlaces de URL nativa)
   ================================================ */
.dm-con-filters {
	display: flex;
	flex-direction: column;
	gap: 22px;
	margin-bottom: clamp(32px, 4vw, 48px);
	padding-bottom: 28px;
	border-bottom: 1px solid var(--line);
}

.dm-con-filters__group {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.dm-con-filters__label {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 800;
	color: var(--coral-600);
}

.dm-con-filters__options {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
}

.dm-con-filter {
	border: 1.5px solid var(--line-2);
	background: var(--paper);
	color: var(--teal-700);
	font-size: 14px;
	font-weight: 800;
	padding: 9px 18px;
	border-radius: var(--r-pill);
	text-decoration: none;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.dm-con-filter:hover {
	border-color: var(--teal-300);
	color: var(--teal-700);
	transform: translateY(-1px);
}

.dm-con-filter.is-active {
	background: var(--filter-color, var(--teal-700));
	border-color: var(--filter-color, var(--teal-700));
	color: #fff;
}

.dm-con-filter--tipo.is-active {
	background: var(--teal-500);
	border-color: var(--teal-500);
}

/* ================================================
   GRID DE ARTÍCULOS (tarjeta con thumb texturizado)
   ================================================ */
.dm-con-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 26px;
}

.dm-acard {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	overflow: hidden;
	box-shadow: var(--shadow-layer-sm);
	transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.dm-acard:hover {
	transform: translateY(-6px);
	box-shadow: var(--shadow-layer-lg);
	border-color: transparent;
}

.dm-acard__thumb {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	position: relative;
}

.dm-acard__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Placeholder texturizado (gradiente verde + puntos) hasta que llegue la
   imagen destacada real. Swap-in automático: si hay <img>, no se ve. */
.dm-acard__thumb-tex {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(rgba(255, 255, 255, 0.10) 1px, transparent 1px),
		linear-gradient(140deg, var(--teal-700), var(--teal-900));
	background-size: 16px 16px, cover;
}

.dm-acard__body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 22px 24px;
	flex: 1;
}

.dm-acard__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.dm-acard__tag {
	display: inline-block;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	padding: 5px 11px;
	border-radius: var(--r-pill);
}

.dm-acard__title {
	font-size: 19px;
	line-height: 1.32;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0;
}

.dm-acard__title a {
	color: var(--teal-700);
	text-decoration: none;
	transition: color 0.2s ease;
}

.dm-acard__title a:hover {
	color: var(--coral-600);
}

.dm-acard__meta {
	margin-top: auto;
	font-size: 13.5px;
	color: var(--muted);
	font-weight: 600;
}

.dm-acard__sep {
	margin: 0 7px;
}

/* ================================================
   NEWSLETTER (banda cream, primitivo dm-bg-cream)
   ================================================ */
.dm-con-newsletter__inner {
	max-width: 620px;
	margin: 0 auto;
	text-align: center;
}

.dm-con-newsletter__title {
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--teal-700);
	margin: 14px 0 0;
}

.dm-con-newsletter__text {
	color: var(--muted);
	font-size: 16.5px;
	line-height: 1.6;
	margin: 12px 0 26px;
}

.dm-con-newsletter__embed {
	text-align: center;
}

/* ================================================
   SINGLE — HERO compacto
   ================================================ */
.dm-post-hero {
	position: relative;
	margin-top: 72px;
	color: #eaf1ef;
	background:
		radial-gradient(820px 420px at 82% -10%, rgba(255, 122, 91, 0.16), transparent 60%),
		radial-gradient(680px 460px at 4% 18%, rgba(90, 120, 114, 0.28), transparent 55%),
		linear-gradient(165deg, #1f3b38, #15302d);
	overflow: hidden;
	padding: clamp(44px, 5.5vw, 72px) 0 clamp(40px, 5vw, 60px);
}

.dm-post-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: radial-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px);
	background-size: 26px 26px;
	-webkit-mask-image: radial-gradient(72% 70% at 50% 30%, #000, transparent);
	mask-image: radial-gradient(72% 70% at 50% 30%, #000, transparent);
	pointer-events: none;
}

.dm-post-hero .container {
	position: relative;
	max-width: 820px;
}

.dm-post-hero__back {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	color: #a9c2bc;
	font-weight: 800;
	font-size: 14px;
	text-decoration: none;
	margin-bottom: 20px;
	transition: gap 0.18s ease, color 0.2s ease;
}

.dm-post-hero__back svg {
	width: 16px;
	height: 16px;
}

.dm-post-hero__back:hover {
	color: #ff9d85;
	gap: 10px;
}

.dm-post-hero__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	margin-bottom: 18px;
}

.dm-post-hero__title {
	font-size: clamp(28px, 3.8vw, 44px);
	line-height: 1.12;
	letter-spacing: -0.025em;
	font-weight: 900;
	color: #fff;
	margin: 0;
	max-width: 26ch;
}

.dm-post-hero__author {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 26px;
}

.dm-post-hero__author-photo {
	border-radius: 50%;
	width: 48px;
	height: 48px;
	flex: none;
}

.dm-post-hero__author-meta {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.dm-post-hero__author-name {
	font-weight: 800;
	color: #fff;
	font-size: 15px;
}

.dm-post-hero__author-date {
	font-size: 13px;
	color: #a9c2bc;
	margin-top: 2px;
}

/* ================================================
   SINGLE — CUERPO editorial
   ================================================ */
.dm-post-body {
	max-width: 700px;
	padding-left: 28px;
	padding-right: 28px;
}

.dm-post-featured {
	border-radius: var(--r-md);
	overflow: hidden;
	margin-bottom: clamp(28px, 4vw, 44px);
	box-shadow: var(--shadow-layer-md);
}

.dm-post-featured img {
	width: 100%;
	height: auto;
	display: block;
}

.dm-post-content {
	max-width: 700px;
	font-size: 17.5px;
	line-height: 1.8;
	color: var(--ink);
}

.dm-post-content p {
	margin: 0 0 22px;
	text-wrap: pretty;
}

/* Lead: primer párrafo destacado (entradilla). */
.dm-post-content > p:first-of-type {
	font-size: 20px;
	line-height: 1.65;
	color: var(--teal-700);
	font-weight: 500;
	text-wrap: pretty;
}

.dm-post-content h2 {
	font-size: clamp(24px, 2.8vw, 30px);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--teal-700);
	margin: 40px 0 14px;
	line-height: 1.25;
	text-wrap: balance;
}

.dm-post-content h3 {
	font-size: clamp(20px, 2.2vw, 24px);
	font-weight: 800;
	color: var(--teal-700);
	margin: 32px 0 12px;
	text-wrap: balance;
}

.dm-post-content a {
	color: var(--coral-600);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.dm-post-content a:hover {
	color: var(--coral);
}

.dm-post-content ul,
.dm-post-content ol {
	margin: 0 0 22px;
	padding-left: 1.4em;
}

.dm-post-content li {
	margin-bottom: 8px;
}

.dm-post-content blockquote {
	font-family: var(--font-serif);
	font-size: clamp(20px, 2.2vw, 24px);
	line-height: 1.5;
	font-style: italic;
	color: var(--teal-700);
	border-left: 3px solid var(--coral);
	margin: 32px 0;
	padding: 6px 0 6px 26px;
}

.dm-post-content blockquote p {
	margin: 0;
}

.dm-post-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--r-md);
}

.dm-post-content figure {
	margin: 28px 0;
}

.dm-post-content figcaption {
	text-align: center;
	color: var(--muted);
	font-size: 13.5px;
	margin-top: 10px;
	line-height: 1.5;
}

/* ================================================
   SINGLE — RELACIONADOS (banda mint)
   ================================================ */
.dm-post-related__grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 36px;
}

.dm-post-related__heading {
	font-size: clamp(20px, 2.4vw, 26px);
	font-weight: 800;
	letter-spacing: -0.02em;
	color: var(--teal-700);
	margin: 12px 0 20px;
}

.dm-post-related__all {
	margin-top: 16px;
}

.dm-post-related__entry a {
	text-decoration: none;
	display: block;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	padding: 24px 26px;
	box-shadow: var(--shadow-layer-sm);
	transition: transform 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
}

.dm-post-related__entry a:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-layer-lg);
	border-color: transparent;
}

.dm-post-related__entry-title {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0 0 8px;
	color: var(--teal-700);
	line-height: 1.3;
}

.dm-post-related__entry-date {
	font-size: 13.5px;
	color: var(--muted);
	font-weight: 600;
}

/* ================================================
   FASE 3 — STAT-CHIPS (hero del listado y single)
   Copia scoped desde archive-driver.css (base + num/label) y
   single-driver.css (variante --facts con íconos). No promover a global.
   ================================================ */
.dm-stat-chips {
	list-style: none;
	margin: 28px 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.dm-stat-chip {
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	background: var(--ondark-surface);
	border: 1px solid var(--ondark-line);
	border-radius: var(--r-pill);
	padding: 8px 16px;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.dm-stat-chip__num {
	color: #fff;
	font-weight: 900;
	font-size: 15px;
}

.dm-stat-chip__label {
	color: var(--ondark-text);
	font-size: 13px;
	font-weight: 700;
}

/* Variante --facts: chips con ícono, alineados al centro (single). */
.dm-stat-chips--facts {
	margin: 0 0 18px;
}

.dm-stat-chips--facts .dm-stat-chip {
	align-items: center;
	gap: 8px;
}

.dm-stat-chips--facts .dm-stat-chip__ic {
	display: inline-flex;
	color: #ff9d85;
}

.dm-stat-chips--facts .dm-stat-chip__ic svg {
	width: 16px;
	height: 16px;
}

/* ================================================
   FASE 3 — BARRA DE FILTROS STICKY (lenguaje de dm-filter-bar, sin JS)
   ================================================ */
.dm-con-filter-bar {
	position: sticky;
	top: var(--sticky-top);
	z-index: 20;
	background: rgba(255, 255, 255, 0.92);
	-webkit-backdrop-filter: saturate(1.1) blur(6px);
	backdrop-filter: saturate(1.1) blur(6px);
	border: 1px solid var(--line);
	border-radius: var(--r-md);
	box-shadow: var(--shadow-layer-sm);
	padding: 18px 20px;
	margin-bottom: clamp(28px, 3.5vw, 44px);
}

.dm-con-filter-bar .dm-con-filters {
	margin-bottom: 0;
	padding-bottom: 0;
	border-bottom: 0;
}

.dm-con-filter-bar__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

.dm-con-filter-bar__count {
	margin: 0;
	font-size: 13.5px;
	font-weight: 700;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.dm-con-filter-bar__count b {
	color: var(--teal-700);
	font-weight: 900;
}

.dm-con-filter-bar__clear {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.dm-con-filter-bar__clear svg {
	width: 13px;
	height: 13px;
}

.dm-con-filter:focus-visible {
	outline: 3px solid var(--coral);
	outline-offset: 2px;
}

.dm-con-grid {
	scroll-margin-top: var(--sticky-top);
}

/* ================================================
   FASE 3 — ARTÍCULO DESTACADO (dm-acard--feature) + dek
   ================================================ */
.dm-acard__dek {
	margin: 0;
	font-size: 14.5px;
	line-height: 1.55;
	color: var(--muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.dm-acard__meta {
	font-variant-numeric: tabular-nums;
}

@media (min-width: 760px) {
	.dm-acard--feature {
		flex-direction: row;
		align-items: stretch;
		margin-bottom: 26px;
		grid-column: 1 / -1;
	}

	.dm-acard--feature .dm-acard__thumb {
		flex: 0 0 45%;
		aspect-ratio: auto;
	}

	.dm-acard--feature .dm-acard__body {
		padding: clamp(26px, 3vw, 40px);
		justify-content: center;
	}

	.dm-acard--feature .dm-acard__title {
		font-size: clamp(22px, 2.4vw, 28px);
	}
}

/* ================================================
   FASE 3 — EMPTY-STATE (copia scoped de archive-driver.css, SIN [hidden])
   ================================================ */
.dm-empty-state {
	text-align: center;
	max-width: 520px;
	margin: 48px auto 0;
	padding: 40px 28px;
	background: var(--mint-50);
	border: 1px dashed var(--line-2);
	border-radius: var(--r-lg);
}

.dm-empty-state__icon {
	display: grid;
	place-items: center;
	width: 56px;
	height: 56px;
	margin: 0 auto 18px;
	border-radius: 16px;
	background: var(--paper);
	border: 1px solid var(--line);
}

.dm-empty-state__icon svg {
	width: 26px;
	height: 26px;
	stroke: var(--teal-300);
}

.dm-empty-state__title {
	font-size: 20px;
	font-weight: 800;
	color: var(--teal-700);
	margin: 0 0 8px;
}

.dm-empty-state__text {
	font-size: 15px;
	color: var(--muted);
	line-height: 1.6;
	margin: 0 0 22px;
}

.dm-empty-state__actions {
	display: flex;
	gap: 12px;
	justify-content: center;
	flex-wrap: wrap;
}

/* ================================================
   FASE 3 — PAGINACIÓN
   ================================================ */
.dm-con-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0;
	margin-top: clamp(36px, 4vw, 52px);
}

.dm-con-list .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	margin: 4px;
	border: 1.5px solid var(--line-2);
	border-radius: var(--r-pill);
	background: var(--paper);
	color: var(--teal-700);
	font-size: 14px;
	font-weight: 800;
	text-decoration: none;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.18s ease, transform 0.18s ease;
}

.dm-con-list a.page-numbers:hover {
	border-color: var(--teal-300);
	transform: translateY(-1px);
}

.dm-con-list .page-numbers.current {
	background: var(--teal-700);
	border-color: var(--teal-700);
	color: #fff;
}

.dm-con-list .page-numbers.dots {
	border: 0;
	background: transparent;
}

/* ================================================
   FASE 3 — SINGLE: fila meta + compartir (no sticky)
   ================================================ */
.dm-con-share {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 14px;
	margin-bottom: clamp(24px, 3vw, 36px);
	padding-bottom: 18px;
	border-bottom: 1px solid var(--line);
}

.dm-con-share__by {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.dm-con-share__photo {
	border-radius: 50%;
	width: 36px;
	height: 36px;
	flex: none;
}

.dm-con-share__byline {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}

.dm-con-share__actions {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.dm-con-share__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1.5px solid var(--line-2);
	background: var(--paper);
	color: var(--teal-700);
	border-radius: var(--r-pill);
	padding: 8px 14px;
	cursor: pointer;
	font-family: var(--font-sans);
	font-size: 13px;
	font-weight: 800;
	text-decoration: none;
	transition: border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dm-con-share__btn svg {
	width: 16px;
	height: 16px;
}

.dm-con-share__btn:hover {
	border-color: var(--teal-300);
	transform: translateY(-1px);
}

.dm-con-share__btn:focus-visible {
	outline: 3px solid var(--coral);
	outline-offset: 2px;
}

.dm-con-share__feedback {
	font-size: 13px;
	font-weight: 700;
	color: var(--teal-700);
	flex-basis: 100%;
	min-height: 1em;
}

@media (min-width: 768px) {
	.dm-con-filters {
		flex-direction: row;
		gap: 56px;
	}
	.dm-post-related__grid {
		grid-template-columns: 1fr 1fr;
	}
}

/* ================================================
   FASE 3 — RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
	.dm-con-filter-bar {
		top: 72px;
	}

	.dm-con-filters__options {
		flex-wrap: nowrap;
		overflow-x: auto;
		scroll-snap-type: x proximity;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 4px;
	}

	.dm-con-filters__options > .dm-con-filter {
		scroll-snap-align: start;
		flex: none;
	}
}

/* Botones de compartir solo-ícono en pantallas muy estrechas. */
@media (max-width: 480px) {
	.dm-con-share__btn .dm-con-share__label {
		position: absolute;
		width: 1px;
		height: 1px;
		padding: 0;
		margin: -1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
		border: 0;
	}
}

/* ================================================
   FASE 3 — prefers-reduced-motion
   ================================================ */
@media (prefers-reduced-motion: reduce) {
	.dm-acard,
	.dm-con-filter,
	.dm-con-share__btn,
	.dm-con-list a.page-numbers {
		transition: none;
	}

	.dm-acard:hover,
	.dm-con-filter:hover,
	.dm-con-share__btn:hover {
		transform: none;
	}
}

/* ================================================
   Footer: tanto el archive como el single cierran en banda cream (newsletter).
   functions.php añade la body-class is-conocimiento a ambos → fundir el footer
   para no dejar la banda blanca del margin-top global.
   El single ahora cierra en CTA verde (.dm-cta) → el merge sigue aplicando.
   ================================================ */
body.is-conocimiento .site-footer {
	margin-top: 0;
}
