/**
 * Blog — izebuy design system.
 *
 *   • Listing (index.php / is_home) — a large featured post (image left, text
 *     right) above a responsive grid of the rest. Cards are bare (no card box):
 *     a rounded image on top, then date · title · excerpt. The whole card/feature
 *     is one click target (a stretched overlay on the title link), so a click
 *     anywhere — image, date or excerpt — opens the post. The big page heading is
 *     the Posts-page title from .page-title (never hard-coded).
 *
 *   • Single (single.php / page-tpl_blog.php) — a clean, standard blog post: one
 *     centred reading column with the featured image, the post content rendered
 *     as written, tags and comments. See includes/blog-single.php.
 *
 * Enqueued only where used (is_home / single post) by
 * classifieds_enqueue_izebuy_assets() in includes/frontend.php.
 *
 * Depends on: tokens.css, base.css (.ize-scope), components.css (.ize-pagination).
 */

/* ──────────────────────────────────────────────────────────────────────────
 * Listing
 * ────────────────────────────────────────────────────────────────────────── */

/* The page heading shown large, like a magazine masthead. It's the Posts-page
 * title rendered by .page-title — whatever the page is named — never hard-coded.
 * Scoped to the blog index. */
body.blog .page-title h1 {
	font-size: clamp(2.25rem, 6vw, 4rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.02em;
}

.ize-blog {
	background: var(--ize-surface-2);
	padding: var(--ize-5) 0 var(--ize-7);
}
.ize-blog__wrap {
	max-width: var(--ize-container);
	margin: 0 auto;
	padding: 0 var(--ize-4);
}

/* Shared media box — rounded, fixed ratio, with a gradient placeholder when a
 * post has no featured image. */
.ize-blog-feature__media,
.ize-blog-card__media {
	display: block;
	position: relative;
	overflow: hidden;
	border-radius: var(--ize-radius-lg);
	background: var(--ize-surface-3);
	aspect-ratio: 3 / 2;
}
.ize-blog-feature__img,
.ize-blog-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s var(--ize-ease, ease);
}
.ize-blog-media--empty {
	background: var(--ize-banner-gradient);
}

/* ── Featured post (image left, text right) ───────────────────────────────── */

.ize-blog-feature {
	position: relative;            /* stretched-link anchor */
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ize-5);
	align-items: center;
	margin-bottom: var(--ize-7);
}
@media (min-width: 768px) {
	.ize-blog-feature {
		grid-template-columns: 1.15fr 1fr;
		gap: var(--ize-6);
	}
}
.ize-blog-feature__body {
	min-width: 0;
}
.ize-blog-feature__date {
	display: block;
	margin-bottom: var(--ize-2);
	color: var(--ize-ink-3);
	font-size: var(--ize-fs-sm);
}
.ize-blog-feature__title {
	margin: 0 0 var(--ize-3);
	font-size: clamp(1.75rem, 3.5vw, 2.5rem);
	font-weight: 800;
	line-height: 1.12;
	letter-spacing: -0.01em;
}
.ize-blog-feature__title a {
	color: var(--ize-ink);
	text-decoration: none;
}
.ize-blog-feature__excerpt {
	margin: 0;
	color: var(--ize-ink-2);
	font-size: var(--ize-fs-md);
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Grid of the rest (bare cards) ────────────────────────────────────────── */

.ize-blog-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--ize-6) var(--ize-5);
}
@media (min-width: 600px) {
	.ize-blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 992px) {
	.ize-blog-grid { grid-template-columns: repeat(3, 1fr); }
}

.ize-blog-card {
	position: relative;            /* stretched-link anchor */
	display: flex;
	flex-direction: column;
}
.ize-blog-card__body {
	padding-top: var(--ize-3);
}
.ize-blog-card__date {
	display: block;
	margin-bottom: var(--ize-1);
	color: var(--ize-ink-3);
	font-size: var(--ize-fs-sm);
}
.ize-blog-card__title {
	margin: 0 0 var(--ize-2);
	font-size: var(--ize-fs-lg);
	font-weight: 700;
	line-height: var(--ize-lh-heading);
}
.ize-blog-card__title a {
	color: var(--ize-ink);
	text-decoration: none;
}
.ize-blog-card__excerpt {
	margin: 0;
	color: var(--ize-ink-2);
	font-size: var(--ize-fs-sm);
	line-height: 1.6;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ── Whole-card click target + focus ──────────────────────────────────────── */

/* The title link stretches over the whole card/feature, so a click anywhere
 * (image, date, excerpt) opens the post. */
.ize-blog-feature__title a::after,
.ize-blog-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}
/* base.css clears the link outline, so paint a focus ring on the whole card when
 * the (stretched) title link is focused via keyboard. */
.ize-blog-feature:focus-within,
.ize-blog-card:focus-within {
	outline: 2px solid var(--ize-brand);
	outline-offset: 6px;
	border-radius: var(--ize-radius);
}

/* ── Hover ────────────────────────────────────────────────────────────────── */

.ize-blog-feature:hover .ize-blog-feature__img,
.ize-blog-card:hover .ize-blog-card__img {
	transform: scale(1.04);
}
.ize-blog-feature:hover .ize-blog-feature__title a,
.ize-blog-card:hover .ize-blog-card__title a {
	color: var(--ize-brand);
}

/* Gradient placeholders rotate through a few tints so image-less posts still get
 * a splash of colour. */
.ize-blog-grid > .ize-blog-card:nth-child(4n+1) .ize-blog-media--empty { background: linear-gradient(135deg, #fbc2eb, #fda085); }
.ize-blog-grid > .ize-blog-card:nth-child(4n+2) .ize-blog-media--empty { background: linear-gradient(135deg, #a1c4fd, #c2e9fb); }
.ize-blog-grid > .ize-blog-card:nth-child(4n+3) .ize-blog-media--empty { background: linear-gradient(135deg, #84fab0, #8fd3f4); }
.ize-blog-grid > .ize-blog-card:nth-child(4n+4) .ize-blog-media--empty { background: linear-gradient(135deg, #a18cd1, #fbc2eb); }

.ize-blog__empty {
	text-align: center;
	color: var(--ize-ink-2);
	padding: var(--ize-7) 0;
}

@media (prefers-reduced-motion: reduce) {
	.ize-blog-feature__img,
	.ize-blog-card__img {
		transition: none;
	}
	.ize-blog-feature:hover .ize-blog-feature__img,
	.ize-blog-card:hover .ize-blog-card__img {
		transform: none;
	}
}

/* ══════════════════════════════════════════════════════════════════════════
 * Single post — a clean, standard reading layout (single.php / page-tpl_blog.php,
 * via includes/blog-single.php). One centred column: title + meta, the featured
 * image, then the post content rendered as written, tags and comments.
 * ══════════════════════════════════════════════════════════════════════════ */

.ize-post {
	background: var(--ize-surface);
	padding-bottom: var(--ize-7);
}
.ize-post__wrap {
	max-width: 760px;
	margin: 0 auto;
	padding: var(--ize-6) var(--ize-4) 0;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.ize-post__header {
	margin-bottom: var(--ize-5);
}
.ize-post__cat {
	display: inline-block;
	margin-bottom: var(--ize-2);
	color: var(--ize-brand);
	font-size: var(--ize-fs-xs);
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
}
.ize-post__cat:hover { text-decoration: underline; }
.ize-post__title {
	margin: 0 0 var(--ize-3);
	font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.8rem);
	line-height: 1.15;
	font-weight: 800;
	color: var(--ize-ink);
}
.ize-post__meta {
	color: var(--ize-ink-3);
	font-size: var(--ize-fs-sm);
}

/* ── Featured image ──────────────────────────────────────────────────────── */
.ize-post__hero {
	margin: 0 0 var(--ize-6);
}
.ize-post__hero-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--ize-radius-lg);
}

/* ── Content — comfortable long-form typography ──────────────────────────── */
.ize-post__content {
	font-size: var(--ize-fs-md);
	line-height: 1.75;
	color: var(--ize-ink);
}
.ize-post__content > * + * { margin-top: 1.4em; }
.ize-post__content h2 {
	font-size: 1.6em;
	line-height: 1.3;
	margin-top: 1.8em;
	font-weight: 800;
	color: var(--ize-ink);
}
.ize-post__content h3 {
	font-size: 1.3em;
	line-height: 1.35;
	margin-top: 1.6em;
	font-weight: 700;
	color: var(--ize-ink);
}
.ize-post__content h4 {
	font-size: 1.1em;
	margin-top: 1.4em;
	font-weight: 700;
	color: var(--ize-ink);
}
.ize-post__content a { color: var(--ize-brand); text-decoration: underline; }
.ize-post__content img { max-width: 100%; height: auto; border-radius: var(--ize-radius); }
.ize-post__content figure { margin: 1.6em 0; }
.ize-post__content figcaption {
	margin-top: var(--ize-1);
	font-size: var(--ize-fs-xs);
	color: var(--ize-ink-3);
	text-align: center;
}
.ize-post__content ul,
.ize-post__content ol { padding-left: 1.4em; }
.ize-post__content li + li { margin-top: 0.4em; }
.ize-post__content blockquote {
	margin: 1.6em 0;
	padding: 4px 0 4px 20px;
	border-left: 3px solid var(--ize-line);
	color: var(--ize-ink-2);
	font-style: italic;
	font-size: 1.1em;
}

/* ── Tags ────────────────────────────────────────────────────────────────── */
.ize-post__tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: var(--ize-6) 0 0;
	padding: 0;
}
.ize-post__tags li { margin: 0; }
.ize-post__tags a {
	display: inline-block;
	padding: 4px 12px;
	background: var(--ize-surface-2);
	border-radius: var(--ize-radius-pill);
	font-size: var(--ize-fs-sm);
	color: var(--ize-ink-2);
	text-decoration: none;
}
.ize-post__tags a:hover {
	background: var(--ize-surface-3);
	color: var(--ize-ink);
}

/* ── Comments ────────────────────────────────────────────────────────────── */
.ize-post .comments { margin-top: var(--ize-7); }
.ize-post .comments .media { margin-bottom: var(--ize-4); }
.ize-post .comments .media img { border-radius: 50%; }
.ize-post #commentform { margin-top: var(--ize-4); }
.ize-post #commentform input[type="text"],
.ize-post #commentform input[type="email"],
.ize-post #commentform input[type="url"],
.ize-post #commentform textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--ize-line);
	border-radius: var(--ize-radius);
	background: var(--ize-surface);
	margin-bottom: var(--ize-3);
	font-family: var(--ize-font);
}
.ize-post #commentform textarea { min-height: 140px; }
