/* =========================================================================
   BLOG PRO — Archivo del blog | Animal Friend
   Carga única en is_home / is_category / is_tag (ver inc/blog-pro.php).

   Tokens de marca tomados del header propio del sitio:
   verde #00bc49 · naranja #ee7200 · verde oscuro #0f382c
   superficie #f6f8f7 · tipografías Outfit (texto) + Quicksand (titulares)
   ========================================================================= */

/* ---------------------------------------------------------------------
   1. Layout: eliminar el sidebar vacío y centrar el contenido
   --------------------------------------------------------------------- */

body.blog .site-content {
	background: #ffffff;
}

/* Red de seguridad por si el filtro PHP de astra_page_layout no corre */
body.blog #secondary,
body.blog .sidebar-main {
	display: none;
}

/* Astra comparte el contenedor de 1240px con el header propio del sitio
   (logo en x=332): no lo tocamos para que las tarjetas alineen con el menu.
   Lo que si hace falta es que #primary ocupe todo el ancho ahora que el
   sidebar de 360px desaparece. */
body.blog #primary {
	width: 100%;
	float: none;
}

/* ---------------------------------------------------------------------
   2. Hero del archivo
   --------------------------------------------------------------------- */

.af-blog-hero {
	position: relative;
	overflow: hidden;
	margin: 0 0 40px;
	padding: 46px 48px;
	border-radius: 20px;
	/* Solo tonos de la paleta: el radial verde saturated sobre el fondo
	   oscuro generaba un verde medio fuera de marca. Se usa el naranja
	   #ee7200 como acento calido y de baja intensidad. */
	background:
		radial-gradient(760px 340px at 92% 8%, rgba(238, 114, 0, .22), transparent 64%),
		linear-gradient(120deg, #0f382c 0%, #124a38 55%, #0d3b2d 100%);
	box-shadow: 0 10px 34px rgba(15, 56, 44, .16);
	/* Columna de texto + columna de datos: sin esto la mitad derecha
	   queda vacia y el bloque se ve desequilibrado. */
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 44px;
}

.af-blog-hero__body {
	min-width: 0;
}

.af-blog-hero__stats {
	display: flex;
	gap: 14px;
	flex-shrink: 0;
}

.af-blog-hero__stat {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 132px;
	padding: 18px 20px;
	border-radius: 16px;
	background: rgba(255, 255, 255, .1);
	border: 1px solid rgba(255, 255, 255, .18);
	text-align: center;
}

.af-blog-hero__num {
	font: 800 32px/1 'Quicksand', sans-serif;
	color: #ffffff;
	letter-spacing: -.02em;
}

.af-blog-hero__lbl {
	margin-top: 6px;
	font: 500 12px/1.3 'Outfit', sans-serif;
	color: rgba(255, 255, 255, .76);
	letter-spacing: .04em;
	text-transform: uppercase;
}

.af-blog-hero__crumbs {
	display: flex;
	align-items: center;
	gap: 8px;
	font: 500 12.5px/1.4 'Outfit', sans-serif;
	color: rgba(255, 255, 255, .7);
	letter-spacing: .02em;
}

.af-blog-hero__crumbs a {
	color: rgba(255, 255, 255, .82);
	text-decoration: none;
	transition: color .2s ease;
}

.af-blog-hero__crumbs a:hover {
	color: #ffffff;
}

.af-blog-hero__crumbs i {
	font-style: normal;
	color: rgba(255, 255, 255, .42);
}

.af-blog-hero__title {
	margin: 16px 0 0;
	font: 800 42px/1.12 'Quicksand', sans-serif;
	color: #ffffff;
	letter-spacing: -.015em;
}

.af-blog-hero__sub {
	max-width: 60ch;
	margin: 14px 0 0;
	font: 400 15.5px/1.68 'Outfit', sans-serif;
	color: rgba(255, 255, 255, .84);
}

/* ---------------------------------------------------------------------
   3. Grid de tarjetas
   --------------------------------------------------------------------- */

/* El contenedor real de las tarjetas NO es .hfeed: ese elemento es
   <div class="hfeed site" id="page"> y envuelve toda la pagina (header,
   contenido y footer). Ademas Astra impone #page{display:block}, que con
   especificidad (1,0,0) le gana a cualquier selector de clase sobre
   .hfeed. Los posts viven en main#main > div.ast-row. */
body.blog main.site-main .ast-row {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
	align-items: stretch;
}

body.blog main.site-main .ast-row > article.post {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	/* Astra aplica padding: 5em 6.25em al card del blog, lo que con una
	   tarjeta de 380px deja solo 179px utiles. Se anula aqui y el aire
	   interior se resuelve en .post-content. */
	padding: 0;
	background: #ffffff;
	border: 1px solid #e7eeea;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(15, 56, 44, .05), 0 6px 18px rgba(15, 56, 44, .05);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

body.blog main.site-main .ast-row > article.post:hover {
	transform: translateY(-5px);
	border-color: #b6dfc9;
	box-shadow: 0 2px 4px rgba(15, 56, 44, .06), 0 18px 40px rgba(15, 56, 44, .1);
}

body.blog main.site-main .ast-row > article.post .post-content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	padding: 0;
	margin: 0;
}

/* Reordena: imagen → título → meta → extracto → leer más */
body.blog .ast-blog-featured-section { order: 1; }
body.blog .entry-title { order: 2; }
body.blog .entry-header { order: 3; }
body.blog .ast-excerpt-container { order: 4; }
body.blog .read-more { order: 5; margin-top: auto; }

/* Astra deja un .entry-content vacío; ocupa espacio sin aportar nada */
body.blog main.site-main .ast-row > article.post .entry-content.clear {
	display: none;
}

/* ---------------------------------------------------------------------
   4. Imagen destacada: relación de aspecto fija
   --------------------------------------------------------------------- */

/* Este es el fix de las alturas dispares (427 / 480 / 640 / 958 px) */
body.blog .post-thumb-img-content {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	background: #f6f8f7;
}

body.blog .post-thumb-img-content .ast-blog-single-element,
body.blog .post-thumb-img-content a,
body.blog .post-thumb-img-content picture,
body.blog .post-thumb-img-content img {
	display: block;
	width: 100%;
	height: 100%;
}

body.blog .post-thumb-img-content img {
	object-fit: cover;
	transition: transform .5s ease;
}

body.blog main.site-main .ast-row > article.post:hover .post-thumb-img-content img {
	transform: scale(1.05);
}

/* Artículos sin imagen destacada: placeholder con la marca */
body.blog main.site-main .ast-row > article.post:not(:has(.ast-blog-featured-section)) .post-content::before {
	content: '';
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	background:
		radial-gradient(600px 240px at 30% 0%, rgba(0, 188, 73, .10), transparent 60%),
		linear-gradient(135deg, #f2f7f4, #e4efe9);
}

/* ---------------------------------------------------------------------
   5. Título
   --------------------------------------------------------------------- */

body.blog .entry-title {
	margin: 22px 24px 0;
	font: 700 20px/1.32 'Outfit', sans-serif;
	color: #0f382c;
	letter-spacing: -.01em;
	/* 3 lineas en lugar de 2: los titulos largos del sitio salian con
	   "..." en las 9 de 9 tarjetas y se leia como un error de maquetado.
	   "Leer más" ya se ancla abajo con margin-top:auto, asi que las
	   tarjetas mantienen la misma altura. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-wrap: pretty;
}

body.blog .entry-title a {
	color: inherit;
	text-decoration: none;
	transition: color .2s ease;
}

body.blog main.site-main .ast-row > article.post:hover .entry-title a {
	color: #0b7a37;
}

/* ---------------------------------------------------------------------
   6. Meta: fecha, categoría, autor
   --------------------------------------------------------------------- */

body.blog .entry-header {
	margin: 12px 24px 0;
}

body.blog .entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	/* font-size:0 neutraliza las "/" sueltas que Astra imprime como nodos
	   de texto entre los <span>; los hijos recuperan su tamaño abajo. */
	font-size: 0;
}

body.blog .entry-meta > * {
	font-size: 12.5px;
}

/* "Deja un comentario" es demasiado largo para una tarjeta compacta */
body.blog .entry-meta .comments-link {
	display: none;
}

body.blog .entry-meta .posted-on {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font: 500 12.5px/1 'Outfit', sans-serif;
	color: #6b7c75;
}

body.blog .entry-meta .posted-on::before {
	content: '';
	width: 13px;
	height: 13px;
	background: #6b7c75;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2H7zm12 8v9H5v-9h14zM7 9h5v5H7V9z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 2v2H5a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-2V2h-2v2H9V2H7zm12 8v9H5v-9h14zM7 9h5v5H7V9z'/%3E%3C/svg%3E") center / contain no-repeat;
}

body.blog .entry-meta .ast-taxonomy-container.cat-links a {
	display: inline-block;
	padding: 5px 11px;
	border-radius: 999px;
	background: #ee7200;
	color: #ffffff;
	font: 700 10.5px/1 'Outfit', sans-serif;
	text-transform: uppercase;
	letter-spacing: .06em;
	text-decoration: none;
	transition: background .2s ease;
}

body.blog .entry-meta .ast-taxonomy-container.cat-links a:hover {
	background: #d96600;
	color: #ffffff;
}

body.blog .entry-meta .posted-by a {
	color: #6b7c75;
	text-decoration: none;
	font-weight: 500;
	transition: color .2s ease;
}

body.blog .entry-meta .posted-by a:hover {
	color: #00bc49;
}

/* ---------------------------------------------------------------------
   7. Extracto
   --------------------------------------------------------------------- */

/* El recorte real ya lo hace el PHP (24 palabras). El line-clamp queda como
   red de seguridad y se aplica al contenedor y al <p> porque Astra decide
   cuál de los dos envuelve el extracto. */
body.blog .ast-excerpt-container,
body.blog .ast-excerpt-container p {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-wrap: pretty;
}

body.blog .ast-excerpt-container {
	margin: 14px 24px 0;
}

body.blog .ast-excerpt-container p {
	margin: 0;
	font: 400 14.5px/1.62 'Outfit', sans-serif;
	color: #4d5d56;
}

/* ---------------------------------------------------------------------
   8. Leer más
   --------------------------------------------------------------------- */

body.blog .read-more {
	margin: 18px 24px 24px;
}

body.blog .read-more a {
	font: 700 13px/1 'Outfit', sans-serif;
	color: #00bc49;
	text-decoration: none;
	transition: color .2s ease;
}

body.blog .read-more a:hover {
	color: #ee7200;
}

body.blog .read-more .screen-reader-text {
	display: none;
}

/* ---------------------------------------------------------------------
   9. Paginación
   --------------------------------------------------------------------- */

body.blog .ast-pagination,
body.blog .navigation.pagination {
	margin: 48px 0 0;
}

body.blog .ast-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}

body.blog .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid #e2eae6;
	border-radius: 10px;
	background: #ffffff;
	color: #3c4c45;
	font: 600 14px/1 'Outfit', sans-serif;
	text-decoration: none;
	transition: all .2s ease;
}

body.blog .page-numbers:hover,
body.blog .page-numbers.current {
	border-color: #00bc49;
	background: #00bc49;
	color: #ffffff;
}

body.blog .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	color: #8b9a93;
	font-weight: 700;
	letter-spacing: .1em;
}

/* Siguiente / Anterior son links, no numeros: si comparten caja con los
   digitos se leen como un numero mas y affordance queda debil. */
body.blog .page-numbers.next,
body.blog .page-numbers.prev {
	border-color: transparent;
	background: transparent;
	color: #0f382c;
	font-weight: 600;
	padding: 0 8px;
}

body.blog .page-numbers.next:hover,
body.blog .page-numbers.prev:hover {
	color: #00bc49;
}

/* ---------------------------------------------------------------------
   10. Responsive
   --------------------------------------------------------------------- */

@media (max-width: 1100px) {
	body.blog main.site-main .ast-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}

	.af-blog-hero {
		gap: 28px;
	}

	.af-blog-hero__stat {
		min-width: 108px;
		padding: 15px 16px;
	}

	.af-blog-hero__num {
		font-size: 27px;
	}

	.af-blog-hero__title {
		font-size: 36px;
	}
}

@media (max-width: 860px) {
	/* el bloque de datos pasa debajo del texto: en una sola columna
	   el titulo y el subtitulo siguen mandando en la jerarquia */
	.af-blog-hero {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}

	.af-blog-hero__stats {
		margin-top: 4px;
	}
}

@media (max-width: 700px) {
	body.blog main.site-main .ast-row {
		grid-template-columns: minmax(0, 1fr);
	}

	.af-blog-hero {
		padding: 32px 24px;
		border-radius: 16px;
		margin-bottom: 28px;
	}

	.af-blog-hero__title {
		font-size: 30px;
	}

	.af-blog-hero__sub {
		font-size: 14.5px;
	}

	.af-blog-hero__stats {
		gap: 10px;
	}

	.af-blog-hero__stat {
		flex: 1 1 0;
		min-width: 0;
	}

	body.blog .entry-title {
		font-size: 18px;
	}

	body.blog main.site-main .ast-row > article.post:hover {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.blog main.site-main .ast-row > article.post,
	body.blog .post-thumb-img-content img,
	body.blog .entry-title a,
	body.blog .read-more a {
		transition: none;
	}

	body.blog main.site-main .ast-row > article.post:hover {
		transform: none;
	}
}
