/*
 * Chennai Home Guide — Blog archive (templates/page-blog.html,
 * templates/home.html) and Blog article (templates/single.html). Loaded
 * on the Blog page (chg_is_blog_archive()), is_home() and
 * is_singular('post') — see inc/enqueue.php.
 *
 * Card geometry/hover/grid columns come from components/card.css's
 * shared .chg-guide-grid/.chg-guide-card rules (already anticipated
 * there before this slice) — this file only adds what's specific to
 * Blog content: the featured-image treatment, category/date/reading-
 * time meta, article header/body typography, and the Callout block
 * style. See CLAUDE.md, "CSS Architecture."
 */

.chg-blog-archive__intro {
	max-width: 42rem;
	margin: 0.5rem 0 var(--wp--preset--spacing--md);
	color: var(--wp--preset--color--muted);
}

/* ---------- Empty state (templates/page-blog.html's query-no-results) ----------
 * Shown only while no Post is published; the query loop replaces it
 * automatically once one is. Builds on base.css's shared .chg-empty-panel
 * (recessed surface panel, centred, muted) and only adds the heading,
 * readable line length and the action buttons. */

.chg-blog-empty {
	padding: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--md);
}

.chg-blog-empty__title {
	margin: 0 0 var(--wp--preset--spacing--xs);
	color: var(--wp--preset--color--foreground);
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.3;
}

.chg-blog-empty__text {
	max-width: 36rem;
	margin-inline: auto;
	font-size: var(--wp--preset--font-size--medium);
}

.chg-blog-empty__actions {
	gap: var(--wp--preset--spacing--xs);
	margin-block: var(--wp--preset--spacing--md);
}

.chg-blog-empty .wp-block-button__link {
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.625rem 1.25rem;
	border: 1px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--sm);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.2;
}

.chg-blog-empty .is-style-outline .wp-block-button__link {
	background-color: var(--wp--preset--color--background);
	color: var(--wp--preset--color--accent-dark);
}

.chg-blog-empty .is-style-outline .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--accent-tint);
}

.chg-blog-empty__contact a {
	color: var(--wp--preset--color--accent-dark);
}

/* ---------- Archive card (templates/home.html, templates/single.html's Related Articles) ---------- */

.chg-guide-card__image {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--wp--custom--radius--sm);
	margin-bottom: var(--wp--preset--spacing--xs);
}

.chg-guide-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
}

/* post-terms renders a plain comma-separated link list by default —
 * restyled here as a single small pill-like label. A post with more
 * than one category still reads fine (WordPress's own ", " separator
 * between links), just not pill-boxed per term. */
.chg-guide-card__category {
	display: block;
	margin: 0 0 0.375rem;
	color: var(--wp--preset--color--accent-dark);
	font-size: var(--wp--preset--font-size--xs);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

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

.chg-guide-card__category a:hover {
	text-decoration: underline;
}

.chg-guide-card__desc {
	flex: 1 1 auto;
	margin: 0 0 var(--wp--preset--spacing--xs);
}

.chg-guide-card__meta {
	gap: 0.625rem;
	margin-top: auto;
	padding-top: 0.5rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--xs);
}

.chg-guide-card__date,
.chg-reading-time {
	color: inherit;
	font-size: inherit;
}

/* A visible separator between date and reading time, without a literal
 * "·" character in the markup (keeps each block's own text the whole
 * accessible content, no decorative punctuation read aloud twice). */
.chg-guide-card__meta > * + *::before {
	content: "·";
	margin-right: 0.625rem;
	color: var(--wp--preset--color--border);
}

/* ---------- Blog article (templates/single.html) ---------- */

.chg-blog-article__header {
	max-width: 42rem;
	margin-inline: auto;
}

.chg-blog-article__category {
	margin-bottom: 0.75rem;
}

.chg-blog-article__title {
	margin: 0 0 0.75rem;
}

.chg-blog-article__meta {
	gap: 0.625rem;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.chg-blog-article__meta > * + *::before {
	content: "·";
	margin-right: 0.625rem;
	color: var(--wp--preset--color--border);
}

.chg-blog-article__image {
	display: block;
	width: 100%;
	max-height: 28rem;
	object-fit: cover;
	margin: var(--wp--preset--spacing--md) 0;
	border-radius: var(--wp--custom--radius--md);
}

/* Readable measure for long-form content — narrower than the page's
 * default 60rem contentSize, matching the block attribute's own
 * 42rem contentSize set in templates/single.html. Typography here is
 * deliberately restrained: normal Gutenberg blocks (headings, lists,
 * tables, images, quotes) styled to read well in a long article,
 * nothing bespoke required per article. */
.chg-blog-article__content {
	line-height: 1.7;
}

.chg-blog-article__content > * {
	max-width: 42rem;
	margin-inline: auto;
}

.chg-blog-article__content h2 {
	margin-top: var(--wp--preset--spacing--lg);
}

.chg-blog-article__content h3 {
	margin-top: var(--wp--preset--spacing--md);
}

.chg-blog-article__content img {
	border-radius: var(--wp--custom--radius--md);
	height: auto;
}

.chg-blog-article__content table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small);
}

.chg-blog-article__content th,
.chg-blog-article__content td {
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--wp--preset--color--border);
	text-align: left;
}

.chg-blog-article__content th {
	background-color: var(--wp--preset--color--surface);
}

/* "Callout" — a core/group block style variation (registered in
 * inc/theme-setup.php via register_block_style()), the normal-Gutenberg
 * way to let an editor highlight a note/warning without any custom
 * block. One-click from the block toolbar's Styles panel. */
.chg-blog-article__content .is-style-callout {
	padding: var(--wp--preset--spacing--sm) var(--wp--preset--spacing--md);
	border-left: 3px solid var(--wp--preset--color--accent);
	border-radius: var(--wp--custom--radius--sm);
	background-color: var(--wp--preset--color--accent-tint);
}

.chg-blog-article__content .is-style-callout > *:last-child {
	margin-bottom: 0;
}

.chg-blog-article__content .is-style-callout > *:first-child {
	margin-top: 0;
}

/* ---------- Reusable article patterns (theme patterns/*.php) ----------
 * Only "CHG: Explore Matching Homes CTA" needs its own styling — Quick
 * Summary reuses .is-style-callout (already styled above), Pros & Cons/
 * Comparison Table/FAQ use core/columns, core/table, and core/details
 * with no extra classes, and Related Projects reuses the existing
 * .chg-project-card component from components/project-card.css. */
.chg-pattern-cta {
	padding: var(--wp--preset--spacing--md);
	border-radius: var(--wp--custom--radius--md);
	background-color: var(--wp--preset--color--surface);
	text-align: center;
}

.chg-pattern-cta .wp-block-buttons {
	justify-content: center;
}

/* ---------- Related Articles (templates/single.html) ---------- */

.chg-blog-article__related {
	max-width: none;
}
