/* =================================================================
   blog.css — Estilos para blog, archives y listados de posts

   Tokens: usa --wp--preset--* (theme.json) directamente.
   BEM: blog-layout, post-card, sidebar, blog-pagination
   ================================================================= */

/* -----------------------------------------------------------------
   Layout: Content + Sidebar
   ----------------------------------------------------------------- */
.blog-layout {
	align-items: flex-start;
}

.blog-layout__sidebar {
	align-self: flex-start !important;
	position: sticky;
	top: var(--wp--preset--spacing--32);
}

/* Archive header */
.archive__title {
	font-size: var(--wp--preset--font-size--36);
	margin-bottom: var(--wp--preset--spacing--16) !important;
	position: relative;
	padding-bottom: var(--wp--preset--spacing--20);
}

.archive__title::after {
	content: "";
	position: absolute;
	bottom: 0;
	left: 0;
	width: 2.5rem;
	height: 1px;
	background-color: var(--wp--preset--color--primary);
}

.archive__description {
	color: var(--wp--preset--color--text-muted);
	margin-bottom: var(--wp--preset--spacing--48) !important;
}

/* -----------------------------------------------------------------
   Archive list — editorial strip
   ----------------------------------------------------------------- */
.archive__list {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
	border-top: 1px solid var(--wp--preset--color--border);
}

/* -----------------------------------------------------------------
   Post Card
   ----------------------------------------------------------------- */
.post-card--blog {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--10);
	padding: 0 0 var(--wp--preset--spacing--40);
	border-radius: 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	background: transparent;
	box-shadow: none;
	overflow: visible;
	transition: none;
}

.post-card--blog:hover {
	box-shadow: none;
	transform: none;
}

/* Date / Meta */
.post-card__meta,
.post-card__date {
	font-size: var(--wp--preset--font-size--11) !important;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--text-muted);
	margin: 0 !important;
	padding-top: 0 !important;
}

/* Category badge */
.post-card__category {
	font-size: var(--wp--preset--font-size--11) !important;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--primary);
	margin: 0;
}

.post-card__category a {
	color: inherit;
	text-decoration: none;
}

.post-card__category a:hover {
	color: var(--wp--preset--color--primary-dark);
}

/* Title */
.post-card__title {
	font-size: var(--wp--preset--font-size--18) !important;
	line-height: 1.2;
	margin: 0 !important;
	color: var(--wp--preset--color--text-heading);
}

.post-card__title a {
	color: inherit;
	text-decoration: none;
	display: inline-flex;
	align-items: baseline;
	gap: 0.5em;
	transition: color var(--wp--custom--motion--duration--fast) ease;
}

.post-card__title a::after {
	content: "→";
	font-size: 0.8em;
	font-weight: 300;
	opacity: 0;
	transform: translateX(-8px);
	transition:
		opacity var(--wp--custom--motion--duration--base) ease,
		transform var(--wp--custom--motion--duration--base) ease;
}

.post-card--blog:hover .post-card__title a {
	color: var(--wp--preset--color--primary);
}

.post-card--blog:hover .post-card__title a::after {
	opacity: 1;
	transform: translateX(0);
}

/* Excerpt */
.post-card__excerpt {
	margin: 0;
}

.post-card__excerpt p,
.wp-block-post-excerpt__excerpt {
	font-size: var(--wp--preset--font-size--14);
	color: var(--wp--preset--color--text-body);
	line-height: 1.7;
	margin: 0;
	overflow: hidden;
}

.post-card__excerpt .wp-block-post-excerpt__more-text {
	display: none;
}

/* Body — wrapper opcional cuando existe en el template */
.post-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--10);
	flex: 1;
}

/* Image — wrapper opcional cuando existe en el template */
.post-card__image {
	margin: 0 !important;
	overflow: hidden;
}

.post-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--wp--custom--motion--duration--base) ease;
}

.post-card--blog:hover .post-card__image img {
	transform: scale(1.03);
}

/* -----------------------------------------------------------------
   Pagination
   ----------------------------------------------------------------- */
.blog-pagination {
	margin-top: var(--wp--preset--spacing--64) !important;
	gap: var(--wp--preset--spacing--8) !important;
}

.blog-pagination .page-numbers,
.blog-pagination a,
.blog-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 var(--wp--preset--spacing--8);
	border-radius: 0;
	font-size: var(--wp--preset--font-size--14);
	font-weight: 400;
	letter-spacing: 0.03em;
	color: var(--wp--preset--color--text-muted);
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition:
		color var(--wp--custom--motion--duration--fast) ease,
		border-color var(--wp--custom--motion--duration--fast) ease;
}

.blog-pagination a:hover {
	background: transparent;
	color: var(--wp--preset--color--text-heading);
	border-bottom-color: var(--wp--preset--color--border);
}

.blog-pagination .current {
	background: transparent;
	color: var(--wp--preset--color--primary);
	font-weight: 600;
	border-bottom-color: var(--wp--preset--color--primary);
}

.blog-pagination .wp-block-query-pagination-previous,
.blog-pagination .wp-block-query-pagination-next {
	font-size: var(--wp--preset--font-size--12);
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--text-body);
	min-width: auto;
	padding: 0 var(--wp--preset--spacing--12);
}

.blog-pagination .wp-block-query-pagination-previous:hover,
.blog-pagination .wp-block-query-pagination-next:hover {
	background: transparent;
	color: var(--wp--preset--color--primary);
	border-bottom-color: transparent;
}

/* -----------------------------------------------------------------
   No Results
   ----------------------------------------------------------------- */
.blog-no-results {
	padding: var(--wp--preset--spacing--64) 0;
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--18);
}

/* -----------------------------------------------------------------
   Sidebar
   ----------------------------------------------------------------- */
.sidebar {
	padding: 0 !important;
}

.sidebar__heading {
	color: var(--wp--preset--color--text-muted) !important;
	font-weight: 500 !important;
	margin-bottom: var(--wp--preset--spacing--16) !important;
	font-size: var(--wp--preset--font-size--11) !important;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* Sidebar CTA */
.sidebar__cta {
	background: var(--wp--preset--color--bg-secondary);
	border: 1px solid var(--wp--preset--color--border);
	border-top: 2px solid var(--wp--preset--color--primary);
	border-radius: 0 0 var(--wp--custom--radius--4) var(--wp--custom--radius--4);
	text-align: center;
	margin-bottom: var(--wp--preset--spacing--32) !important;
}

.sidebar__cta-title {
	font-family: var(--wp--preset--font-family--secondary) !important;
	font-size: var(--wp--preset--font-size--17) !important;
	color: var(--wp--preset--color--text-heading) !important;
	margin-bottom: var(--wp--preset--spacing--16) !important;
	text-transform: none !important;
	letter-spacing: -0.01em !important;
	font-weight: 500 !important;
	line-height: 1.4;
	text-wrap: balance;
}

.sidebar__cta-text {
	font-size: var(--wp--preset--font-size--15);
	color: var(--wp--preset--color--text-muted);
	line-height: 1.6;
	margin-bottom: var(--wp--preset--spacing--20) !important;
}

.sidebar__cta-btn .wp-block-button__link {
	display: inline-block;
	font-size: var(--wp--preset--font-size--14);
	border-radius: 0;
	border: none;
}

.sidebar__cta-btn .wp-block-button__link:hover {
	background: var(--wp--preset--color--primary-dark);
	color: var(--wp--preset--color--white);
	text-decoration: none;
}

.sidebar__section {
	padding: var(--wp--preset--spacing--24);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 0;
	max-width: none;
}

/* Sidebar form */
.sidebar__cta {
	max-width: none;
}

.sidebar__cta .gfield_consent_label {
	font-size: var(--wp--preset--font-size--12);
}

.sidebar__cta .gfield_consent_label .gfield_required {
	margin-left: var(--wp--preset--spacing--4);
}

/* Categories list */
.categories {
	margin-block-start: 0;
}

.categories ul {
	list-style: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

.categories li {
	margin: 0 !important;
	padding: 0 !important;
	list-style-type: square;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.categories li::marker {
	color: var(--wp--preset--color--primary);
}

.categories li:last-child {
	border-bottom: none;
}

.categories a {
	color: var(--wp--preset--color--text-body);
	text-decoration: none;
	font-size: var(--wp--preset--font-size--15);
	line-height: 1.4;
	transition: all var(--wp--custom--motion--duration--fast) ease;
	display: inline-flex;
	justify-content: space-between;
	align-items: center;
	padding: var(--wp--preset--spacing--10) 0;
}

.categories a:hover {
	color: var(--wp--preset--color--primary);
	padding-left: var(--wp--preset--spacing--8);
}

/* Post count badge from WP categories widget */
.categories .wp-block-categories__count,
.categories .cat-count {
	font-size: var(--wp--preset--font-size--12);
	color: var(--wp--preset--color--text-muted);
	background: transparent;
	border-radius: 0;
	padding: 0;
	min-width: auto;
	text-align: right;
}

/* -----------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------- */

/* Mobile: sidebar below content */
@media (max-width: 768px) {
	.blog-layout {
		flex-direction: column !important;
	}

	.blog-layout__content,
	.blog-layout__sidebar {
		flex-basis: 100% !important;
	}

	.blog-layout__sidebar {
		position: static;
		margin-top: var(--wp--preset--spacing--48);
	}

	.post-card--blog {
		padding: var(--wp--preset--spacing--32) 0;
	}

	.post-card__title {
		font-size: var(--wp--preset--font-size--20) !important;
	}
}

/* =================================================================
   Single Post
   ================================================================= */

/* Pageheader */
body.single-post .is-style-minimal.pageheader--align-center {
	margin-bottom: var(--wp--preset--spacing--24) !important;
}

body.single-post .is-style-minimal.pageheader--align-center .pageheader__inner {
	text-align: center;
}

body.single-post
	.is-style-minimal.pageheader--align-center
	.pageheader__inner
	.pageheader__body {
	color: var(--wp--preset--color--text-muted);
	font-size: var(--wp--preset--font-size--14);
	text-transform: none;
}

/* Hero image */
.post-single__hero.wp-block-post-featured-image {
	display: block;
	max-height: 28rem;
	overflow: hidden;
}

.post-single__hero.wp-block-post-featured-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

/* Post content: editorial typography */
.post-single__content {
	padding-top: var(--wp--preset--spacing--48);
}

.post-single .wp-block-post-content p,
.post-single .wp-block-post-content li {
	line-height: var(--lh-relaxed);
	color: var(--wp--preset--color--text-body);
}

.single-post .wp-block-post-content h1,
.post-single .wp-block-post-content h1 {
	font-size: var(--wp--preset--font-size--40);
	margin-top: var(--wp--preset--spacing--40);
	margin-block-end: var(--wp--preset--spacing--16) !important;
	line-height: 1.6;
}

.single-post .wp-block-post-content h2,
.post-single .wp-block-post-content h2 {
	font-size: var(--wp--preset--font-size--30);
	margin-top: var(--wp--preset--spacing--40);
	margin-block-end: var(--wp--preset--spacing--14) !important;
	line-height: 1.6;
}

.single-post .wp-block-post-content h3,
.post-single .wp-block-post-content h3 {
	font-size: var(--wp--preset--font-size--24);
	margin-top: 2rem;
	margin-block-end: var(--wp--preset--spacing--12) !important;
	line-height: 1.5;
}

.single-post .wp-block-post-content h4,
.post-single .wp-block-post-content h4 {
	font-size: var(--wp--preset--font-size--24);
	margin-top: 2rem;
	margin-bottom: var(--wp--preset--spacing--12);
	line-height: 1.4;
}

.post-single .wp-block-post-content blockquote {
	border-left: 3px solid var(--wp--preset--color--primary);
	padding-left: var(--wp--preset--spacing--20);
	margin-inline: 0;
	color: var(--wp--preset--color--text-muted);
	font-style: italic;
}

.post-single .wp-block-post-content figure {
	margin-block-end: var(--wp--preset--spacing--32) !important;
}

.post-single .wp-block-post-content img {
	border-radius: var(--wp--custom--radius--4, 0.25rem);
	max-height: 40rem;
	object-fit: cover;
}

/* Tags footer */
.post-single__footer {
	border-top: 1px solid var(--wp--preset--color--border);
}

.post-single__tags.wp-block-post-terms a {
	display: inline-flex;
	padding: var(--wp--preset--spacing--4) var(--wp--preset--spacing--14);
	background-color: var(--wp--preset--color--bg-secondary);
	border-radius: 2rem;
	font-size: var(--wp--preset--font-size--12);
	font-weight: 500;
	color: var(--wp--preset--color--text-muted);
	text-decoration: none;
	transition:
		background-color 0.2s ease,
		color 0.2s ease;
}

.post-single__tags.wp-block-post-terms a:hover {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* Nav: Previous / Next */
.post-navigation-link-previous.wp-block-post-navigation-link a,
.post-navigation-link-next.wp-block-post-navigation-link a {
	color: var(--wp--preset--color--text-muted);
}

/* More posts */
.more-posts__item {
	border-top: none;
}

.more-posts__item:first-child {
	border-top: 1px solid var(--wp--preset--color--border) !important;
}

.more-posts__thumb.wp-block-post-featured-image {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	overflow: hidden;
	border-radius: var(--wp--custom--radius--2, 0.25rem);
}

.more-posts__thumb.wp-block-post-featured-image a {
	display: block;
	width: 100%;
	height: 100%;
}

.more-posts__thumb.wp-block-post-featured-image img {
	width: 100%;
	height: 100% !important;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}

.more-posts__item:hover .more-posts__thumb.wp-block-post-featured-image img {
	transform: scale(1.05);
}

.more-posts__item .wp-block-post-title a {
	color: var(--wp--preset--color--text-heading);
	text-decoration: none;
	transition: color 0.2s ease;
}

.more-posts__item:hover .wp-block-post-title a {
	color: var(--wp--preset--color--primary);
}

.more-posts__item .wp-block-post-date {
	color: var(--wp--preset--color--text-muted);
}

/* More posts heading style */
.post-single .wp-block-heading {
	color: var(--wp--preset--color--text-muted);
	text-transform: none;
	letter-spacing: 0;
}

.post-single li.wp-block-post .wp-block-post-title a {
	color: var(--wp--preset--color--text-heading);
}

/* Responsive */
@media (max-width: 768px) {
	.post-single__hero.wp-block-post-featured-image {
		max-height: 18rem;
	}
}
