/* ============================================================
   Mad Rose — Blog templates (home.php, category.php, tag.php,
   single-post.php)
   ------------------------------------------------------------
   Only enqueued by those templates (see inc/mrm-blog.php), so it
   never loads on regular Pages. Every selector is scoped under
   .mrb, which gives enough specificity (0,2,x) to beat Elementor
   Kit globals like ".elementor-kit-5 h2" without !important.
   !important is used only where we deliberately adjust an existing
   .ppm-* rule that is itself declared !important.

   Tokens come from the Figma file (Chris Chui – Mobile Design):
   green #465441, cream #EAE4D8, ink #353535 / #2C2C2C,
   forest #26332D, beige #96938B, Newsreader + Poppins.
   ============================================================ */

.mrb {
	--mrb-green: #465441;
	--mrb-cream: #E9E4D8;
	--mrb-cream-hi: #EAE4D8;
	--mrb-ink: #353535;
	--mrb-ink-2: #2C2C2C;
	--mrb-forest: #26332D;
	--mrb-beige: #96938B;
	--mrb-muted: #7C7867;
	--mrb-rule: #A9AD9F;
	--mrb-tint: #DDD6C7;
	--mrb-serif: 'Newsreader', Georgia, 'Times New Roman', serif;
	--mrb-sans: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
	background-color: var(--mrb-cream);
	color: var(--mrb-ink);
}

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

.mrb .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.mrb .mrb-sep {
	display: inline-block;
	margin: 0 0.55em;
	opacity: 0.7;
}

/* ------------------------------------------------------------
   Hero additions (base styles come from .ppm-hero-banner)
------------------------------------------------------------ */
.mrb .mrb-hero-eyebrow {
	margin: 0;
	font-family: var(--mrb-sans);
	font-size: 0.8rem;
	font-weight: 400;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mrb-cream-hi);
}
.mrb .mrb-hero-eyebrow a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid rgba(234, 228, 216, 0.5);
	padding-bottom: 2px;
	transition: border-color 0.15s ease;
}
.mrb .mrb-hero-eyebrow a:hover {
	color: inherit;
	border-bottom-color: var(--mrb-cream-hi);
}
.mrb .mrb-hero-meta {
	margin: 0;
	font-family: var(--mrb-sans);
	font-size: 0.9rem;
	font-weight: 300;
	letter-spacing: 0.02em;
	color: var(--mrb-cream-hi);
	opacity: 0.9;
}
.mrb-single .ppm-hero-banner-heading {
	max-width: 22ch;
}

/* ------------------------------------------------------------
   Layout tweaks inside the shared .ppm-page-wrap grid
------------------------------------------------------------ */
@media (min-width: 861px) {
	.mrb .ppm-sidebar {
		position: sticky;
		top: calc(2rem + var(--wp-admin--admin-bar--height, 0px));
	}
}
.mrb .ppm-main {
	min-width: 0;
}

/* ------------------------------------------------------------
   Post list + cards (Figma "Featured Services" row)
------------------------------------------------------------ */
.mrb .mrb-list {
	display: flex;
	flex-direction: column;
	gap: 4.25rem; /* 68px between rows */
}

.mrb .mrb-card {
	position: relative;
	margin: 0;
	padding: 0;
	background: transparent;
}

.mrb .mrb-card--standard {
	display: grid;
	grid-template-columns: minmax(0, 44%) minmax(0, 1fr);
	column-gap: 2.25rem;
	align-items: start;
	overflow: hidden; /* clips the hairline rule at the card edge */
}

.mrb .mrb-card__media {
	position: relative;
	display: block;
	text-decoration: none;
	color: inherit;
}
.mrb .mrb-card__frame {
	display: block;
	position: relative;
	overflow: hidden;
	aspect-ratio: 366 / 241;
	background-color: var(--mrb-tint);
}
.mrb .mrb-card__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.mrb .mrb-card:hover .mrb-card__img {
	transform: scale(1.035);
}

/* Hairline that runs from the image's lower edge off to the right */
.mrb .mrb-card--standard .mrb-card__media::after {
	content: '';
	position: absolute;
	left: calc(100% - 10px);
	bottom: 26px;
	width: 200vw;
	height: 1px;
	background-color: var(--mrb-rule);
	z-index: 1;
	pointer-events: none;
}

.mrb .mrb-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5rem;
	text-align: center;
	font-family: var(--mrb-serif);
	font-style: italic;
	font-weight: 300;
	font-size: 1.35rem;
	letter-spacing: 0.05em;
	color: var(--mrb-green);
	opacity: 0.7;
}

.mrb .mrb-card__body {
	padding-top: 1.125rem; /* title sits 18px below image top in Figma */
}

.mrb .mrb-card__meta {
	margin: 0 0 0.75rem;
	font-family: var(--mrb-sans);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mrb-muted);
}

.mrb .mrb-card__title {
	margin: 0 0 1rem;
	font-family: var(--mrb-serif);
	font-style: normal;
	font-weight: 300;
	font-size: clamp(1.5rem, 1.3rem + 0.6vw, 1.75rem); /* 28px max */
	line-height: 1.15;
	letter-spacing: 0.07em; /* 2px @ 28px */
	color: var(--mrb-green);
}
.mrb .mrb-card__title a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-size: 0 1px;
	background-position: 0 100%;
	background-repeat: no-repeat;
	transition: background-size 0.3s ease;
}
.mrb .mrb-card__title a:hover,
.mrb .mrb-card__title a:focus-visible {
	color: inherit;
	background-size: 100% 1px;
}
.mrb .mrb-diag {
	display: inline-block;
	margin-left: 0.35em;
	vertical-align: 0.1em;
	transition: transform 0.2s ease;
}
.mrb .mrb-card:hover .mrb-diag {
	transform: translate(2px, -2px);
}

.mrb .mrb-card__excerpt {
	margin: 0;
	max-width: 46ch;
	font-family: var(--mrb-sans);
	font-size: 0.9375rem; /* 15px */
	font-weight: 300;
	line-height: 1.5;
	color: var(--mrb-ink-2);
}

/* Featured (first post, page 1): stacked, wider image, bigger title */
.mrb .mrb-card--featured {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	padding-bottom: 3rem;
	border-bottom: 1px solid var(--mrb-rule);
}
.mrb .mrb-card--featured .mrb-card__frame {
	aspect-ratio: 780 / 368;
}
.mrb .mrb-card--featured .mrb-card__body {
	padding-top: 0;
}
.mrb .mrb-card--featured .mrb-card__title {
	font-size: clamp(1.8rem, 1.4rem + 1.4vw, 2.5rem);
	letter-spacing: 0.05em;
	line-height: 1.15;
}
.mrb .mrb-card--featured .mrb-card__excerpt {
	max-width: 62ch;
	font-size: 1rem;
}

/* Compact (related posts) */
.mrb .mrb-card--compact {
	display: flex;
	flex-direction: column;
	gap: 1.1rem;
}
.mrb .mrb-card--compact .mrb-card__frame {
	aspect-ratio: 3 / 2;
}
.mrb .mrb-card--compact .mrb-card__body {
	padding-top: 0;
}
.mrb .mrb-card--compact .mrb-card__title {
	font-size: clamp(1.25rem, 1.15rem + 0.4vw, 1.4rem);
	letter-spacing: 0.05em;
	margin: 0;
}

/* ------------------------------------------------------------
   Pagination
------------------------------------------------------------ */
.mrb .mrb-pagination {
	margin-top: 4.5rem;
}
.mrb .mrb-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}
.mrb .mrb-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	height: 46px;
	padding: 0 1rem;
	border: 1px solid var(--mrb-green);
	border-radius: 50px;
	font-family: var(--mrb-sans);
	font-size: 0.95rem;
	font-weight: 300;
	line-height: 1;
	color: var(--mrb-green);
	text-decoration: none;
	background-color: transparent;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.mrb .mrb-pagination a.page-numbers:hover,
.mrb .mrb-pagination .page-numbers.current {
	background-color: var(--mrb-green);
	color: var(--mrb-cream-hi);
}
.mrb .mrb-pagination .page-numbers.dots {
	border-color: transparent;
	min-width: auto;
	padding: 0 0.25rem;
}

/* ------------------------------------------------------------
   Empty state
------------------------------------------------------------ */
.mrb .mrb-empty {
	padding: 3rem 0;
	font-family: var(--mrb-sans);
	font-weight: 300;
}
.mrb .mrb-empty__title {
	margin: 0 0 0.75rem;
	font-family: var(--mrb-serif);
	font-style: italic;
	font-weight: 300;
	font-size: 2rem;
	color: var(--mrb-green);
}
.mrb .mrb-empty p {
	margin: 0 0 1.75rem;
}

/* ------------------------------------------------------------
   Single post — article body
   .ppm-content already supplies the H1–H6 scale, body size and
   colour. These only add what long-form posts need.
------------------------------------------------------------ */
.mrb .mrb-article .ppm-content {
	max-width: 780px !important; /* Figma "Blog Main Content" width */
}
.mrb .ppm-content > *:first-child {
	margin-top: 0 !important;
}
.mrb .ppm-content > h2:not(:first-child),
.mrb .ppm-content > h3:not(:first-child) {
	margin-top: 2.2em !important;
}
.mrb .ppm-content p {
	margin: 0 0 1.25rem;
}
.mrb .ppm-content ul,
.mrb .ppm-content ol {
	margin: 0 0 1.5rem;
	padding-left: 1.4rem;
}
.mrb .ppm-content li {
	margin-bottom: 0.35rem;
}
.mrb .ppm-content li::marker {
	color: var(--mrb-green);
}
.mrb .ppm-content a:not(.wp-block-button__link):not(.ppm-btn) {
	color: var(--mrb-green);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}
.mrb .ppm-content a:not(.wp-block-button__link):not(.ppm-btn):hover {
	color: var(--mrb-forest);
	text-decoration-thickness: 2px;
}
.mrb .ppm-content strong,
.mrb .ppm-content b {
	font-weight: 500;
}
.mrb .ppm-content img {
	max-width: 100%;
	height: auto;
}
.mrb .ppm-content figure,
.mrb .ppm-content .wp-block-image {
	margin: 2rem 0;
}
.mrb .ppm-content figcaption {
	margin-top: 0.6rem;
	font-family: var(--mrb-sans);
	font-size: 0.8rem;
	font-weight: 300;
	color: var(--mrb-muted);
	text-align: left;
}
.mrb .ppm-content blockquote,
.mrb .ppm-content .wp-block-quote {
	margin: 2.25rem 0;
	padding: 0.25rem 0 0.25rem 1.5rem;
	border-left: 1px solid var(--mrb-green);
}
.mrb .ppm-content blockquote p {
	font-family: var(--mrb-serif) !important;
	font-style: italic;
	font-size: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem) !important;
	line-height: 1.4 !important;
	color: var(--mrb-green) !important;
	margin-bottom: 0.5rem;
}
.mrb .ppm-content blockquote cite {
	font-family: var(--mrb-sans);
	font-style: normal;
	font-size: 0.8rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--mrb-muted);
}
.mrb .ppm-content hr,
.mrb .ppm-content .wp-block-separator {
	border: 0;
	border-top: 1px solid var(--mrb-rule);
	margin: 2.5rem 0;
}
.mrb .ppm-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5rem;
	font-size: 0.95rem;
}
.mrb .ppm-content th,
.mrb .ppm-content td {
	padding: 0.7rem 0.8rem;
	border-bottom: 1px solid var(--mrb-rule);
	text-align: left;
}
.mrb .ppm-content th {
	font-weight: 500;
	color: var(--mrb-green);
}
.mrb .ppm-content iframe,
.mrb .ppm-content video {
	max-width: 100%;
}
.mrb .mrb-page-links {
	margin-top: 2rem;
	font-family: var(--mrb-sans);
	font-size: 0.9rem;
}

/* Tags */
.mrb .mrb-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 2.5rem 0 0;
	padding: 0;
	list-style: none;
}
.mrb .mrb-tags li {
	margin: 0;
}
.mrb .mrb-tags a {
	display: inline-block;
	padding: 0.4rem 0.95rem;
	border: 1px solid var(--mrb-green);
	border-radius: 50px;
	font-family: var(--mrb-sans);
	font-size: 0.8rem;
	font-weight: 300;
	color: var(--mrb-green);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.mrb .mrb-tags a:hover {
	background-color: var(--mrb-green);
	color: var(--mrb-cream-hi);
}

/* Author bio */
.mrb .mrb-author {
	display: flex;
	gap: 1.25rem;
	align-items: flex-start;
	max-width: 780px;
	margin: 3rem 0 0;
	padding: 2rem 0 0;
	border-top: 1px solid var(--mrb-rule);
}
.mrb .mrb-author__avatar {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
}
.mrb .mrb-author__label {
	margin: 0 0 0.2rem;
	font-family: var(--mrb-sans);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--mrb-muted);
}
.mrb .mrb-author__name {
	margin: 0 0 0.5rem;
	font-family: var(--mrb-serif);
	font-style: italic;
	font-weight: 300;
	font-size: 1.45rem;
	line-height: 1.2;
	color: var(--mrb-green);
}
.mrb .mrb-author__bio {
	margin: 0;
	font-family: var(--mrb-sans);
	font-size: 0.95rem;
	font-weight: 300;
	line-height: 1.6;
	color: var(--mrb-ink);
}

/* Prev / next — same outlined-to-filled behaviour as .ppm-item */
.mrb .mrb-post-nav {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	max-width: 780px;
	margin: 3.5rem 0 0;
}
.mrb .mrb-post-nav__link {
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	padding: 1.25rem 1.35rem;
	border: 1px solid var(--mrb-green);
	color: var(--mrb-green);
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.mrb .mrb-post-nav__link--next {
	grid-column: 2;
	text-align: right;
	align-items: flex-end;
}
.mrb .mrb-post-nav__link:hover {
	background-color: var(--mrb-green);
	color: var(--mrb-cream-hi);
}
.mrb .mrb-post-nav__label {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--mrb-sans);
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	opacity: 0.8;
}
.mrb .mrb-post-nav__title {
	font-family: var(--mrb-serif);
	font-weight: 300;
	font-size: 1.15rem;
	line-height: 1.3;
	letter-spacing: 0.03em;
}

/* Related */
.mrb .mrb-related {
	max-width: 780px;
	margin: 4.5rem 0 0;
}
.mrb .mrb-related__heading {
	margin: 0 0 1.75rem;
	font-family: var(--mrb-serif);
	font-style: italic;
	font-weight: 300;
	font-size: clamp(1.65rem, 1.3rem + 1.5vw, 2.25rem);
	line-height: 1.15;
	color: var(--mrb-green);
}
.mrb .mrb-related__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 2rem;
}

/* ------------------------------------------------------------
   Closing CTA — Figma boxed block (0.8px forest border, beige
   italic heading, green body + pill outline button)
------------------------------------------------------------ */
.mrb .mrb-cta-wrap {
	max-width: 1350px;
	margin: 0 auto;
	padding: 1rem 1.5rem 5rem;
}
.mrb .mrb-cta {
	max-width: 1093px;
	margin: 0 auto;
	padding: clamp(2.5rem, 5vw, 3rem) clamp(1.5rem, 6vw, 5rem);
	border: 0.8px solid var(--mrb-forest);
	text-align: center;
}
.mrb .mrb-cta__heading {
	max-width: 903px;
	margin: 0 auto 1.5rem;
	font-family: var(--mrb-serif);
	font-style: italic;
	font-weight: 300;
	font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.8125rem); /* 45px max */
	line-height: 1.28;
	letter-spacing: 0.05em;
	color: var(--mrb-beige);
}
.mrb .mrb-cta__text {
	max-width: 731px;
	margin: 0 auto 2rem;
	font-family: var(--mrb-sans);
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.625;
	color: var(--mrb-green);
}
.mrb .mrb-cta__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 290px;
	min-height: 53px;
	padding: 0.9rem 1.625rem;
	border: 1px solid var(--mrb-green);
	border-radius: 50px;
	font-family: var(--mrb-sans);
	font-size: 1rem;
	font-weight: 300;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--mrb-green);
	text-decoration: none;
	background-color: transparent;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
	transition: background-color 0.15s ease, color 0.15s ease;
}
.mrb .mrb-cta__btn:hover,
.mrb .mrb-cta__btn:focus-visible {
	background-color: var(--mrb-green);
	color: var(--mrb-cream-hi);
}

/* Visible focus for keyboard users */
.mrb a:focus-visible,
.mrb button:focus-visible {
	outline: 2px solid var(--mrb-green);
	outline-offset: 3px;
}
.mrb .mrb-hero a:focus-visible {
	outline-color: var(--mrb-cream-hi);
}

/* ------------------------------------------------------------
   Mobile — matches the 860px breakpoint used by the Parent
   Page sidebar (card hides, bottom bar + drawer appears)
------------------------------------------------------------ */
@media (max-width: 860px) {
	.mrb .mrb-list {
		gap: 2.75rem;
	}
	.mrb .mrb-card--standard {
		grid-template-columns: 1fr;
		row-gap: 1.25rem;
		padding-bottom: 2.75rem;
		border-bottom: 1px solid var(--mrb-rule);
		overflow: visible;
	}
	.mrb .mrb-card--standard .mrb-card__media::after {
		content: none;
	}
	.mrb .mrb-card__body {
		padding-top: 0;
	}
	.mrb .mrb-card__excerpt {
		max-width: none;
	}
	.mrb .mrb-card--featured {
		padding-bottom: 2.75rem;
	}
	.mrb .mrb-card--featured .mrb-card__frame {
		aspect-ratio: 366 / 241;
	}
	.mrb .mrb-pagination {
		margin-top: 3rem;
	}
	.mrb .mrb-cta-wrap {
		padding: 0 1.25rem 6.5rem; /* clears the fixed bottom bar */
	}
}

@media (max-width: 640px) {
	.mrb .mrb-post-nav,
	.mrb .mrb-related__grid {
		grid-template-columns: 1fr;
	}
	.mrb .mrb-post-nav__link--next {
		grid-column: auto;
	}
	.mrb .mrb-author {
		flex-direction: column;
	}
	.mrb .mrb-cta__btn {
		min-width: 0;
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mrb .mrb-card__img,
	.mrb .mrb-diag,
	.mrb .mrb-card__title a {
		transition: none;
	}
	.mrb .mrb-card:hover .mrb-card__img {
		transform: none;
	}
}
