/**
 * TareaBox Blog Styles
 *
 * Blog listing, archive, and single-post layout & typography.
 * Loaded conditionally via inc/blog-enqueue.php on blog views.
 *
 * Design tokens come from theme.json:
 *   Colors  → var(--wp--preset--color--*)
 *   Radii   → var(--wp--custom--radius--*)
 *   Fonts   → elements.heading / elements.h1 in theme.json
 *
 * Only ONE !important in the entire file — the mobile grid
 * override that must fight WP's inline grid-template-columns.
 *
 * @package TareaBox
 * @version 2.1
 */

/* ========================================================================
   Blog Hero  (listing + archive pages)
   ======================================================================== */

.blog-hero {
	text-align: center;
	padding: 8rem 2rem 2rem;
}

/* Pill label — layout & decoration only; color via textColor="cyan" */
.blog-pill {
	display: inline-block;
	border: 1px solid rgba(57, 228, 228, 0.4); /* cyan @ 40 % */
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	padding: 0.4rem 1.2rem;
	border-radius: 20px;
	margin-bottom: 1.25rem;
}

/* Subtitle — width constraint; color via textColor="text-muted" */
.blog-subtitle {
	max-width: 560px;
	margin-inline: auto;
}

/* Gradient divider */
.blog-divider {
	height: 2px;
	max-width: 300px;
	margin: 0 auto;
	background: linear-gradient(
		90deg,
		transparent,
		var(--wp--preset--color--cyan),
		var(--wp--preset--color--pink),
		var(--wp--preset--color--cyan),
		transparent
	);
	border-radius: 2px;
}

/* Override WP separator defaults (border + opacity) */
.blog-divider.wp-block-separator {
	border: none;
	opacity: 1;
}

/* ========================================================================
   Blog Grid  (wp:group wrapper around wp:query)
   wp:query does NOT render a wrapper div, so we wrap it in wp:group
   with className="blog-grid". The group block renders the <div>.
   Grid columns & gap are handled by the post-template's layout attribute.
   ======================================================================== */

.blog-grid {
	max-width: 1140px;
	margin-inline: auto;
	padding: 3rem 2rem 4rem;
}

/* ---- Cards -------------------------------------------------------------- */

ul.blog-card .wp-block-post {
	background: var(--wp--preset--color--bg-card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--md);
	overflow: hidden;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

ul.blog-card .wp-block-post:hover {
	transform: translateY(-3px);
	box-shadow: 0 0 30px rgba(57, 228, 228, 0.08); /* cyan glow */
}

ul.blog-card .wp-block-post a {
	text-decoration: none;
}

/* ---- Featured Image ----------------------------------------------------- */
/* No aspectRatio set on the block → no inline style to fight.              */

ul.blog-card .wp-block-post-featured-image {
	margin: 0;
	overflow: hidden;
}

ul.blog-card .wp-block-post-featured-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	height: auto;
	object-fit: cover;
	display: block;
	border-radius: 0;
}

/* ---- Card Body ---------------------------------------------------------- */

ul.blog-card .blog-card-body {
	padding: 1.5rem 1.5rem 1.75rem;
}

/* ---- Post Title --------------------------------------------------------- */
/* font-family & color inherit from theme.json elements.heading             */

ul.blog-card .wp-block-post-title {
	font-size: 1.2rem;
	line-height: 1.3;
	letter-spacing: -0.01em;
	margin: 0.75rem 0 0.6rem;
	transition: color 0.2s;
}

ul.blog-card .wp-block-post-title a {
	color: var(--wp--preset--color--text);
	text-decoration: none;
	transition: color 0.2s;
}

ul.blog-card .wp-block-post:hover .wp-block-post-title a {
	color: var(--wp--preset--color--cyan);
}

/* ---- Excerpt ------------------------------------------------------------ */
/* Base color via textColor="text-muted" on the block                       */

ul.blog-card .wp-block-post-excerpt {
	font-size: 0.88rem;
	line-height: 1.6;
	margin: 0 0 1rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

ul.blog-card .wp-block-post-excerpt p {
	margin: 0;
}

ul.blog-card .wp-block-post-excerpt__more-link {
	display: none;
}

/* ---- Date --------------------------------------------------------------- */
/* Color via textColor="text-dim" on the block                              */

ul.blog-card .wp-block-post-date {
	font-size: 0.8rem;
}

/* ---- Category Pills ----------------------------------------------------- */

ul.blog-card .wp-block-post-terms {
	font-size: 0.7rem;
}

ul.blog-card .wp-block-post-terms a {
	background: rgba(57, 228, 228, 0.1); /* cyan @ 10 % */
	color: var(--wp--preset--color--cyan);
	padding: 0.25rem 0.75rem;
	border-radius: 20px;
	text-decoration: none;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* ---- Featured first post ------------------------------------------------ */

ul.blog-card .wp-block-post:first-child {
	grid-column: 1 / -1;
}

ul.blog-card .wp-block-post:first-child .wp-block-post-featured-image img {
	aspect-ratio: 4 / 3;
}

ul.blog-card .wp-block-post:first-child .wp-block-post-title {
	font-size: 1.5rem;
	letter-spacing: -0.02em;
}

ul.blog-card .wp-block-post:first-child .blog-card-body {
	padding: 1.75rem 2rem 2rem;
}

/* ---- Pagination --------------------------------------------------------- */

.blog-grid .wp-block-query-pagination {
	padding: 2rem 0;
}

.blog-grid .wp-block-query-pagination a {
	color: var(--wp--preset--color--cyan);
}

.blog-grid .wp-block-query-pagination-numbers .page-numbers {
	color: var(--wp--preset--color--text-muted);
	padding: 0.25rem 0.5rem;
}

.blog-grid .wp-block-query-pagination-numbers .page-numbers.current {
	color: var(--wp--preset--color--cyan);
	font-weight: 700;
}

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

.single-hero {
	padding: 8rem 2rem 0;
	max-width: 800px;
	margin: 0 auto;
}

.single-hero .wp-block-post-terms a {
	background: rgba(57, 228, 228, 0.1); /* cyan @ 10 % */
	color: var(--wp--preset--color--cyan);
	padding: 0.3rem 0.85rem;
	border-radius: 20px;
	text-decoration: none;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* font-family inherits from theme.json elements.heading */
.single-hero .wp-block-post-title {
	line-height: 1.15;
	margin: 1rem 0 0.75rem;
}

.single-featured {
	max-width: 900px;
	margin: 2rem auto;
	padding: 0 2rem;
}

.single-featured img {
	width: 100%;
	border-radius: var(--wp--custom--radius--md);
	max-height: 450px;
	object-fit: cover;
}

/* ---- Post Content ------------------------------------------------------- */

.single-content {
	max-width: 740px;
	margin: 0 auto;
	padding: 2rem 2rem 4rem;
	font-size: 1.05rem;
	line-height: 1.75;
	color: var(--wp--preset--color--text);
}

/* Headings inherit font-family & weight from theme.json */
.single-content h2 {
	font-size: 1.5rem;
	margin: 2.5rem 0 1rem;
}

.single-content h3 {
	font-size: 1.25rem;
	margin: 2rem 0 0.75rem;
}

.single-content p {
	margin: 0 0 1.25rem;
	color: #C9D1D9; /* between --text and --text-muted */
}

.single-content a {
	color: var(--wp--preset--color--cyan);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.single-content a:hover {
	color: #4cf0f0;
}

.single-content blockquote {
	border-left: 3px solid var(--wp--preset--color--cyan);
	padding: 0.75rem 1.25rem;
	margin: 1.5rem 0;
	background: rgba(57, 228, 228, 0.03); /* cyan @ 3 % */
	border-radius: 0 var(--wp--custom--radius--sm) var(--wp--custom--radius--sm) 0;
}

.single-content ul,
.single-content ol {
	padding-left: 1.5rem;
	margin: 0 0 1.25rem;
}

.single-content li {
	margin-bottom: 0.5rem;
	color: #C9D1D9;
}

.single-content img {
	border-radius: var(--wp--custom--radius--md);
	margin: 1.5rem 0;
}

.single-content code {
	background: var(--wp--preset--color--bg-card);
	padding: 0.15rem 0.4rem;
	border-radius: 4px;
	font-size: 0.9em;
	color: var(--wp--preset--color--cyan);
}

.single-content pre {
	background: var(--wp--preset--color--bg-card);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: var(--wp--custom--radius--sm);
	padding: 1.25rem;
	margin: 1.5rem 0;
	overflow-x: auto;
}

.single-content pre code {
	background: none;
	padding: 0;
	font-size: 0.85em;
	line-height: 1.6;
}

/* ========================================================================
   Responsive
   ======================================================================== */

@media (max-width: 768px) {
	.blog-hero {
		padding: 7rem 1.25rem 1.5rem;
	}

	.blog-grid {
		padding: 2rem 1.25rem 3rem;
	}

	/* Override WP inline grid-template-columns from block layout attribute */
	ul.blog-card.wp-block-post-template {
		grid-template-columns: 1fr !important;
		gap: 1.5rem;
	}

	ul.blog-card .wp-block-post-featured-image img {
		aspect-ratio: 4 / 3;
	}

	ul.blog-card .wp-block-post:first-child .wp-block-post-featured-image img {
		aspect-ratio: 4 / 3;
	}

	ul.blog-card .wp-block-post:first-child .wp-block-post-title {
		font-size: 1.2rem;
	}

	ul.blog-card .blog-card-body {
		padding: 1.25rem;
	}

	.single-hero {
		padding: 7rem 1.25rem 0;
	}

	.single-featured {
		padding: 0 1.25rem;
	}

	.single-content {
		padding: 1.5rem 1.25rem 3rem;
		font-size: 1rem;
	}
}
