/*
 * Blog views only: /blog/, /blog/<slug>/, /blog/category/<cat>/ (enqueued from
 * functions.php when is_home() || is_singular('post') || is_category() || is_tag()).
 * Bump the ver in functions.php when this file changes — it is version-cached.
 * Cormorant Garamond 300 display over Montserrat; ink / platinum / silver.
 * Dark mode follows the site's data-bs-theme attribute.
 */
.bmg-blog {
	--bb-ink: #0A0A0A;
	--bb-body: #2A2A2A;
	--bb-muted: #5A5A5A;
	--bb-card: #FFFFFF;
	--bb-line: rgba(10, 10, 10, 0.10);
	--bb-line-strong: rgba(10, 10, 10, 0.20);
	--bb-ph: #E5E4E2;
	--bb-soft: #EFEFEE;
	--bb-silver: #a8a9ad;
	--bb-btn-bg: #0A0A0A;
	--bb-btn-fg: #FAFAFA;
	--bb-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
	--bb-sans: Montserrat, system-ui, -apple-system, "Segoe UI", sans-serif;
	color: var(--bb-ink);
	font-family: var(--bb-sans);
	display: flex;
	flex-direction: column;
	gap: 40px;
	padding: 24px 0 56px;
}
[data-bs-theme="dark"] .bmg-blog {
	--bb-ink: #FFFFFF;
	--bb-body: #E5E4E2;
	--bb-muted: #A8A9AD;
	--bb-card: #1C1C1C;
	--bb-line: rgba(255, 255, 255, 0.10);
	--bb-line-strong: rgba(255, 255, 255, 0.22);
	--bb-ph: #2A2A2A;
	--bb-soft: #1C1C1C;
	--bb-btn-bg: #E5E4E2;
	--bb-btn-fg: #0A0A0A;
}

.bmg-blog a { color: var(--bb-ink); }
.bmg-blog a:hover, .bmg-blog a:focus-visible { color: var(--bb-muted); }
.bmg-blog a:focus-visible { outline: 2px solid var(--bb-silver); outline-offset: 3px; }

.bmg-eyebrow {
	margin: 0;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .15em;
	text-transform: uppercase;
	color: var(--bb-muted);
}
.bmg-eyebrow a { color: var(--bb-muted); text-decoration: none; }
.bmg-eyebrow a:hover { color: var(--bb-ink); }

/* ---- Index / category intro ------------------------------------------ */
.bmg-blog__intro { display: flex; flex-direction: column; gap: 14px; max-width: 760px; }
.bmg-blog__intro .silver-rule { margin: 0; }
.bmg-blog__title {
	margin: 0;
	font-family: var(--bb-display);
	font-weight: 300;
	font-size: clamp(40px, 8vw, 56px);
	letter-spacing: .02em;
	line-height: 1.05;
	color: var(--bb-ink);
}
.bmg-blog__lede { margin: 0; color: var(--bb-body); line-height: 1.7; font-size: 17px; }
.bmg-blog__empty { margin: 0; color: var(--bb-muted); font-size: 16px; }

/* ---- Category chips --------------------------------------------------- */
.bmg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.bmg-blog .bmg-chip {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1px solid var(--bb-line-strong);
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
	color: var(--bb-ink);
	background: transparent;
}
.bmg-blog .bmg-chip:hover { border-color: var(--bb-silver); color: var(--bb-ink); }
.bmg-blog .bmg-chip.is-active { background: var(--bb-btn-bg); border-color: var(--bb-btn-bg); color: var(--bb-btn-fg); }

/* ---- Cards ------------------------------------------------------------ */
.bmg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 24px; }
.bmg-card { background: var(--bb-card); border: 1px solid var(--bb-line); }
.bmg-blog .bmg-card__link { display: flex; flex-direction: column; height: 100%; color: var(--bb-ink); text-decoration: none; }
.bmg-card__media { height: 180px; overflow: hidden; background: var(--bb-soft); }
.bmg-card__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bmg-card__body { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.bmg-card__title {
	margin: 0;
	font-family: var(--bb-display);
	font-weight: 400;
	font-size: 24px;
	line-height: 1.2;
	color: var(--bb-ink);
}
.bmg-card__excerpt { margin: 0; color: var(--bb-body); line-height: 1.7; }
.bmg-card__meta { margin: 0; font-size: 13px; color: var(--bb-muted); }
.bmg-blog .bmg-card__link:hover .bmg-card__title { text-decoration: underline; text-decoration-color: var(--bb-silver); text-underline-offset: 4px; }

.bmg-card--featured { border-top: 3px solid var(--bb-silver); }
.bmg-blog .bmg-card--featured .bmg-card__link { flex-direction: row; flex-wrap: wrap; }
.bmg-card--featured .bmg-card__media { flex: 1 1 420px; height: auto; min-height: 300px; background: var(--bb-ph); }
.bmg-card--featured .bmg-card__body { flex: 1 1 420px; padding: 36px; gap: 14px; justify-content: center; }
.bmg-card--featured .bmg-card__title { font-size: clamp(28px, 5vw, 34px); line-height: 1.15; }

.bmg-ph { width: 100%; height: 100%; min-height: inherit; background: var(--bb-ph); }

/* ---- Pagination (the_posts_pagination) -------------------------------- */
.bmg-blog .bmg-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bmg-blog .bmg-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--bb-line-strong);
	font-size: 14px;
	text-decoration: none;
	color: var(--bb-ink);
}
.bmg-blog .bmg-pagination .page-numbers.current { background: var(--bb-btn-bg); border-color: var(--bb-btn-bg); color: var(--bb-btn-fg); }
.bmg-blog .bmg-pagination .page-numbers.dots { border: 0; }

/* ---- Single post ------------------------------------------------------ */
.bmg-post { max-width: 720px; margin: 0 auto; gap: 22px; }
.bmg-post__title {
	margin: 0;
	font-family: var(--bb-display);
	font-weight: 300;
	font-size: clamp(34px, 7vw, 50px);
	letter-spacing: .02em;
	line-height: 1.08;
	color: var(--bb-ink);
	overflow-wrap: anywhere;
}
.bmg-byline { display: flex; gap: 14px; align-items: center; }
.bmg-byline__avatar { flex: 0 0 48px; width: 48px; height: 48px; border-radius: 50%; background: var(--bb-ph); object-fit: cover; display: block; }
.bmg-byline__text { margin: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.bmg-byline__name { font-weight: 600; }
.bmg-byline__meta { color: var(--bb-muted); }
.bmg-post__media { height: clamp(200px, 45vw, 360px); overflow: hidden; background: var(--bb-ph); }
.bmg-post__img { display: block; width: 100%; height: 100%; object-fit: cover; }

.bmg-post__body { display: flex; flex-direction: column; gap: 18px; overflow-wrap: break-word; }
.bmg-post__body > * { margin: 0; }
.bmg-post__body p,
.bmg-post__body li { line-height: 1.85; color: var(--bb-body); font-size: 17px; }
.bmg-post__body > p:first-child { font-size: 18px; }
.bmg-post__body ul, .bmg-post__body ol { padding-left: 1.4em; display: flex; flex-direction: column; gap: 6px; }
.bmg-post__body h2 {
	margin-top: 12px;
	font-family: var(--bb-display);
	font-weight: 400;
	font-size: clamp(26px, 5vw, 30px);
	line-height: 1.2;
	color: var(--bb-ink);
}
.bmg-post__body strong { color: var(--bb-ink); font-weight: 600; }
.bmg-post__body sup { line-height: 0; }
.bmg-post__body sup a { text-decoration: none; padding: 0 1px; }
.bmg-post__body a { text-decoration-color: var(--bb-silver); text-underline-offset: 3px; }

/* FAQ (<section class="bmg-faq"> with <details>) */
.bmg-post__body .bmg-faq { display: flex; flex-direction: column; gap: 0; padding-top: 8px; }
.bmg-post__body .bmg-faq h2 { margin: 0 0 14px; }
.bmg-post__body details { border-top: 1px solid var(--bb-line-strong); padding: 14px 0; }
.bmg-post__body details:last-child { border-bottom: 1px solid var(--bb-line-strong); }
.bmg-post__body summary { cursor: pointer; font-weight: 500; min-height: 28px; color: var(--bb-ink); }
.bmg-post__body summary:focus-visible { outline: 2px solid var(--bb-silver); outline-offset: 3px; }
.bmg-post__body details p { margin: 10px 0 0; line-height: 1.75; }

/* Soft membership box (inserted by mu-plugins/bmg-blog.php) */
.bmg-softbox {
	background: var(--bb-card);
	border: 1px solid var(--bb-line);
	border-top: 3px solid var(--bb-silver);
	padding: 28px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.bmg-post__body .bmg-softbox__title { margin: 0; font-family: var(--bb-display); font-weight: 400; font-size: 26px; color: var(--bb-ink); }
.bmg-post__body .bmg-softbox__text { margin: 0; line-height: 1.7; }
.bmg-blog .bmg-softbox__btn {
	align-self: flex-start;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 20px;
	background: var(--bb-btn-bg);
	color: var(--bb-btn-fg);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
}
.bmg-blog .bmg-softbox__btn:hover, .bmg-blog .bmg-softbox__btn:focus-visible { color: var(--bb-btn-fg); opacity: .85; }

/* References */
.bmg-post__body .bmg-refs { display: flex; flex-direction: column; gap: 8px; }
.bmg-post__body .bmg-refs h2 {
	margin: 0 0 4px;
	font-family: var(--bb-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .15em;
	text-transform: uppercase;
	color: var(--bb-muted);
}
.bmg-post__body .bmg-refs li { font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.bmg-post__body .bmg-refs li:target { background: var(--bb-soft); }

/* Disclaimer */
.bmg-post__body .bmg-disclaimer { padding: 18px 20px; background: var(--bb-soft); font-size: 13px; line-height: 1.65; }
[data-bs-theme="dark"] .bmg-post__body .bmg-disclaimer { border: 1px solid var(--bb-line); }

.bmg-post__back { margin: 8px 0 0; font-size: 12px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
.bmg-post__back a { text-decoration: none; }

@media (max-width: 575.98px) {
	.bmg-blog { gap: 28px; padding-top: 8px; }
	.bmg-card--featured .bmg-card__media { flex-basis: 100%; min-height: 200px; }
	.bmg-card--featured .bmg-card__body { flex-basis: 100%; padding: 22px; }
	.bmg-softbox { padding: 22px; }
	.bmg-post__body p, .bmg-post__body li { font-size: 16px; }
	.bmg-post__body > p:first-child { font-size: 17px; }
}
