/* ==========================================================================
   MLPA blog redesign — scoped styles (enqueued only on blog surfaces:
   single posts, category/tag archives, and the posts index).

   Everything is namespaced under .mlpa-blog (content) or blog body-classes
   (the page banner) so it can't leak into, or be clobbered by, the petsitter
   parent theme. Design language mirrors css/home.css: Nunito display + Inter
   body, warm brand palette, rounded cards, soft shadows.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page banner (rendered by page-header.php, OUTSIDE .mlpa-blog).
   The parent sets html{font-size:62.5%} (a 10px root), so use px here — rem
   would resolve against 10px. Scoped to blog body-classes only; other pages'
   banners are untouched. Overrides the fixed background image + parent height.
   The yellowpencil !important rule already darkens .page-heading h1 to #3a3a3c,
   which reads well on this light banner, so we don't fight it.
   -------------------------------------------------------------------------- */
body.single-post .page-heading,
body.category .page-heading,
body.tag .page-heading,
body.blog .page-heading {
	background: linear-gradient(180deg, #f8f6f2 0%, #ffffff 100%) !important;
	box-shadow: inset 0 -1px 0 #ece6dd;
	min-height: 0 !important;
	padding: 40px 0 30px !important;
	text-align: left !important;
}

body.single-post .page-heading .container,
body.category .page-heading .container,
body.tag .page-heading .container,
body.blog .page-heading .container {
	max-width: 820px;
}

body.single-post .page-heading h1,
body.category .page-heading h1,
body.tag .page-heading h1,
body.blog .page-heading h1 {
	font-family: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
	font-weight: 800;
	letter-spacing: -0.015em;
	line-height: 1.12;
	text-transform: none;
	font-size: clamp(27px, 4.4vw, 42px);
	margin: 0;
}

/* The category/tag banner prefixes a small-caps label span ("Category
   Archives:") — tame it into a quiet eyebrow above the term name. */
body.category .page-heading h1 span,
body.tag .page-heading h1 span {
	font-weight: 800;
}

body.single-post .page-heading .taxonomy-description,
body.category .page-heading .taxonomy-description,
body.tag .page-heading .taxonomy-description,
body.blog .page-heading .taxonomy-description {
	margin-top: 10px;
	max-width: 60ch;
	color: #6c655e;
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 15px;
	line-height: 1.55;
}

/* --------------------------------------------------------------------------
   2. .mlpa-blog base — re-establish a real 16px base (the parent's 62.5% root
   would otherwise shrink every em) and size everything below in em, matching
   css/home.css. Tokens are local so they can't collide.
   -------------------------------------------------------------------------- */
.mlpa-blog {
	--green:      #7ab02f;
	--orange:     #e89145;
	--red:        #e0432a;
	--ink:        #211d1a;
	--muted:      #6c655e;
	--paper:      #ffffff;
	--paper-2:    #f8f6f2;
	--line:       #ece6dd;

	--f-disp: "Nunito", ui-rounded, "Segoe UI", system-ui, sans-serif;
	--f-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;

	--r-lg: 22px;
	--r-md: 16px;
	--r-sm: 10px;

	--shadow-sm: 0 2px 10px rgba(40, 30, 20, .06);
	--shadow-md: 0 14px 34px -18px rgba(40, 30, 20, .28);

	font-size: 16px;
	font-family: var(--f-body);
	color: var(--ink);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

.mlpa-blog *,
.mlpa-blog *::before,
.mlpa-blog *::after { box-sizing: border-box; }

.mlpa-blog__wrap {
	max-width: 760px;
	margin: 0 auto;
	padding: 30px 20px 72px;
}

.mlpa-blog--archive .mlpa-blog__wrap {
	max-width: 1180px;
	padding-top: 34px;
}

.mlpa-dot { color: #c9c1b6; margin: 0 2px; }

/* Shared category chip ---------------------------------------------------- */
.mlpa-blog .mlpa-chip {
	display: inline-block;
	font-family: var(--f-disp);
	font-weight: 800;
	font-size: 0.72em;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: #6a8f24;
	background: #eef6e1;
	padding: 0.45em 0.8em;
	border-radius: 999px;
	transition: background .15s ease, color .15s ease;
}
.mlpa-blog .mlpa-chip:hover { background: #7ab02f; color: #fff; }

/* --------------------------------------------------------------------------
   3. Breadcrumb (reuses the .mlpa-breadcrumbs base rules in style.css) — just
   add spacing when it sits at the top of the content column.
   -------------------------------------------------------------------------- */
.mlpa-blog .mlpa-breadcrumbs { margin-bottom: 22px; }

/* --------------------------------------------------------------------------
   4. Single post
   -------------------------------------------------------------------------- */
.mlpa-post__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	font-size: 0.9em;
	color: var(--muted);
	margin-bottom: 22px;
}
.mlpa-post__meta .mlpa-chip { margin-right: 4px; }

.mlpa-post__hero {
	margin: 0 0 34px;
	border-radius: var(--r-lg);
	overflow: hidden;
	box-shadow: var(--shadow-md);
	background: var(--paper-2);
}
.mlpa-post__hero img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* Article body typography — comfortable reading measure and rhythm. */
.mlpa-post__body {
	font-size: 1.075em;
	line-height: 1.75;
	color: #2b2622;
}
.mlpa-post__body > * { margin: 0 0 1.15em; }
.mlpa-post__body > *:last-child { margin-bottom: 0; }

.mlpa-post__body h2,
.mlpa-post__body h3,
.mlpa-post__body h4 {
	font-family: var(--f-disp);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.2;
	color: var(--ink);
	margin: 1.7em 0 0.6em;
}
.mlpa-post__body h2 { font-size: 1.55em; }
.mlpa-post__body h3 { font-size: 1.25em; }
.mlpa-post__body h4 { font-size: 1.08em; }

.mlpa-post__body a {
	color: #c1351f;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}
.mlpa-post__body a:hover { color: #8f2415; }

.mlpa-post__body ul,
.mlpa-post__body ol { padding-left: 1.4em; }
.mlpa-post__body li { margin-bottom: 0.5em; }

.mlpa-post__body img,
.mlpa-post__body iframe {
	max-width: 100%;
	height: auto;
	border-radius: var(--r-md);
}

.mlpa-post__body blockquote {
	margin: 1.6em 0;
	padding: 0.4em 0 0.4em 1.2em;
	border-left: 4px solid var(--green);
	background: var(--paper-2);
	border-radius: 0 var(--r-sm) var(--r-sm) 0;
	font-size: 1.08em;
	color: #3a332d;
}
.mlpa-post__body blockquote p:last-child { margin-bottom: 0; }

.mlpa-post__body table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95em;
}
.mlpa-post__body th,
.mlpa-post__body td {
	border: 1px solid var(--line);
	padding: 0.6em 0.75em;
	text-align: left;
}
.mlpa-post__body th { background: var(--paper-2); font-weight: 700; }

.mlpa-post__body code {
	background: var(--paper-2);
	padding: 0.15em 0.4em;
	border-radius: 6px;
	font-size: 0.92em;
}

/* Tag chips footer -------------------------------------------------------- */
.mlpa-post__footer {
	margin-top: 40px;
	padding-top: 24px;
	border-top: 1px solid var(--line);
}
.mlpa-tags {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.mlpa-tags a {
	display: inline-block;
	font-size: 0.82em;
	font-weight: 600;
	color: var(--muted);
	text-decoration: none;
	background: var(--paper-2);
	border: 1px solid var(--line);
	padding: 0.35em 0.8em;
	border-radius: 999px;
	transition: color .15s ease, border-color .15s ease;
}
.mlpa-tags a:hover { color: var(--ink); border-color: #d9d0c4; }

/* --------------------------------------------------------------------------
   5. Card grid (archives + related)
   -------------------------------------------------------------------------- */
.mlpa-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 26px;
}

.mlpa-card {
	display: flex;
	flex-direction: column;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.mlpa-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-md);
	border-color: #e4dccf;
}

.mlpa-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--paper-2);
	overflow: hidden;
}
.mlpa-card__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .3s ease;
}
.mlpa-card:hover .mlpa-card__media img { transform: scale(1.04); }

/* Branded fallback when a post has no featured image (concentric "signal"). */
.mlpa-card__ph {
	display: block;
	width: 100%;
	height: 100%;
	background:
		radial-gradient(circle at 50% 60%, rgba(122,176,47,.16) 0 22%, transparent 22.5%),
		radial-gradient(circle at 50% 60%, rgba(232,145,69,.14) 0 40%, transparent 40.5%),
		linear-gradient(180deg, #f4efe6 0%, #eef6e1 100%);
}

.mlpa-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
	padding: 20px 20px 22px;
	flex: 1 1 auto;
}

.mlpa-card__title {
	font-family: var(--f-disp);
	font-weight: 800;
	letter-spacing: -0.01em;
	line-height: 1.22;
	font-size: 1.2em;
	margin: 0;
}
.mlpa-card__title a { color: var(--ink); text-decoration: none; }
.mlpa-card__title a:hover { color: #c1351f; }

.mlpa-card__excerpt {
	margin: 0;
	color: var(--muted);
	font-size: 0.95em;
	line-height: 1.55;
}

.mlpa-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.82em;
	color: #8a837b;
	margin-top: auto;
	padding-top: 4px;
}

.mlpa-card__more {
	font-family: var(--f-disp);
	font-weight: 800;
	font-size: 0.9em;
	color: #6a8f24;
}
.mlpa-card:hover .mlpa-card__more { color: #c1351f; }

/* Related section --------------------------------------------------------- */
.mlpa-related {
	margin-top: 56px;
	padding-top: 34px;
	border-top: 1px solid var(--line);
}
.mlpa-related__title {
	font-family: var(--f-disp);
	font-weight: 800;
	letter-spacing: -0.01em;
	font-size: 1.5em;
	margin: 0 0 22px;
	color: var(--ink);
}
/* Related cards sit in a narrower column — keep them comfortably sized. */
.mlpa-related .mlpa-cards {
	grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
	gap: 20px;
}

/* --------------------------------------------------------------------------
   6. Pagination (the_posts_pagination outputs nav.pagination > .nav-links)
   -------------------------------------------------------------------------- */
.mlpa-blog .pagination { margin-top: 44px; }
.mlpa-blog .pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
}
.mlpa-blog .pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 12px;
	background: var(--paper);
	color: var(--ink);
	font-weight: 700;
	font-size: 0.95em;
	text-decoration: none;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.mlpa-blog .pagination .page-numbers:hover {
	border-color: #d9d0c4;
	background: var(--paper-2);
}
.mlpa-blog .pagination .page-numbers.current {
	background: #241f1b;
	border-color: #241f1b;
	color: #fff;
}
.mlpa-blog .pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
}

.mlpa-blog__empty {
	text-align: center;
	color: var(--muted);
	font-size: 1.05em;
	padding: 40px 0;
}

/* --------------------------------------------------------------------------
   7. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
	.mlpa-blog__wrap { padding: 22px 16px 56px; }
	.mlpa-post__body { font-size: 1.03em; }
	.mlpa-cards { grid-template-columns: 1fr; gap: 20px; }
	.mlpa-related { margin-top: 44px; }
}
