/**
 * Block style presets — Phase 2 (Group, Details, Table).
 * Long-report study posts (Malachi-style). Aligned with br-study-article movement cards.
 * Loaded after br-ministry-skin.css.
 */

/* ── Anchor scroll offset for TOC jumps ── */
.single-post .wp-block-heading[id] {
	scroll-margin-top: 5rem;
}

/* ── Cancel ministry-skin cream patches inside study blocks ── */
.wp-block-details.is-style-br-verse :where(p, li, td, th, dd, dt, .wp-block-paragraph),
.wp-block-group.is-style-br-callout :where(p, li, .wp-block-paragraph),
.wp-block-group.br-study-toc :where(p, li) {
	background: transparent !important;
}

/* ── TOC pill nav (white card on cream — matches .movement) ── */
.wp-block-group.br-study-toc {
	background: #fff !important;
	border: 1px solid rgba(17, 55, 42, 0.18);
	border-radius: 14px;
	padding: 16px 18px 12px;
	margin-bottom: 1.25em;
	box-shadow: 0 2px 12px rgba(17, 55, 42, 0.06);
}

.wp-block-group.br-study-toc .wp-block-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	padding-left: 0;
	margin: 0.5em 0 0;
}

.wp-block-group.br-study-toc .wp-block-list li {
	margin: 0;
}

.wp-block-group.br-study-toc .wp-block-list a {
	display: inline-block;
	padding: 7px 14px;
	background: #fff;
	border: 1px solid rgba(17, 55, 42, 0.18);
	border-radius: 999px;
	text-decoration: none;
	font-size: 0.92em;
	font-weight: 500;
	color: var(--green-deep, #0b2a20);
	transition: border-color 0.15s ease, background 0.15s ease;
}

.wp-block-group.br-study-toc .wp-block-list a:hover {
	border-color: var(--gold, #b9892c);
	background: #fffdf8;
}

.wp-block-group.br-study-toc .wp-block-list a:focus,
.wp-block-group.br-study-toc .wp-block-list a:focus-visible {
	text-decoration: none;
	outline: 3px solid var(--gold, #b9892c);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.wp-block-group.br-study-toc .wp-block-list a {
		max-width: 100%;
		text-align: center;
	}
}

/* ── Group: BR Callout ── */
.wp-block-group.is-style-br-callout {
	border: none !important;
	border-left: 4px solid var(--gold, #b9892c) !important;
	padding: 16px 18px;
	margin-bottom: 1.25em;
	background: rgba(217, 180, 94, 0.08) !important;
	border-radius: 0 10px 10px 0;
	box-shadow: 0 1px 8px rgba(17, 55, 42, 0.06);
}

.wp-block-group.is-style-br-callout.has-border-color {
	border-style: none;
	border-left: 4px solid var(--gold, #b9892c) !important;
}

/* ── Details: BR Verse accordion (matches .movement card) ── */
.wp-block-details.is-style-br-verse {
	border: 1px solid rgba(17, 55, 42, 0.18);
	border-radius: 14px;
	margin-bottom: 0.75em;
	padding: 0;
	background: #fff;
	overflow: hidden;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.wp-block-details.is-style-br-verse:hover {
	border-color: var(--gold-soft, #d9b45e);
}

.wp-block-details.is-style-br-verse[open] {
	border-color: var(--gold, #b9892c);
	box-shadow: 0 4px 16px rgba(17, 55, 42, 0.1);
}

.wp-block-details.is-style-br-verse summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	cursor: pointer;
	font-weight: 600;
	color: var(--green-deep, #0b2a20);
	padding: 18px 44px 18px 18px;
	list-style: none;
	position: relative;
	user-select: none;
	border: none;
	background: transparent;
	transition: color 0.15s ease;
}

.wp-block-details.is-style-br-verse summary:hover {
	color: var(--gold, #b9892c);
}

.wp-block-details.is-style-br-verse summary:focus-visible {
	outline: 3px solid var(--gold, #b9892c);
	outline-offset: -3px;
}

.wp-block-details.is-style-br-verse summary::-webkit-details-marker {
	display: none;
}

/* CSS chevron — matches br-study-article .chev */
.wp-block-details.is-style-br-verse summary::after {
	content: "";
	position: absolute;
	right: 18px;
	top: 50%;
	width: 8px;
	height: 8px;
	margin-top: -2px;
	border-right: 2px solid var(--gold, #b9892c);
	border-bottom: 2px solid var(--gold, #b9892c);
	transform: translateY(-50%) rotate(45deg);
	transition: transform 0.2s ease;
}

.wp-block-details.is-style-br-verse[open] summary::after {
	transform: translateY(-25%) rotate(225deg);
}

.wp-block-details.is-style-br-verse[open] summary {
	border-bottom: 1px solid rgba(168, 191, 175, 0.45);
}

.wp-block-details.is-style-br-verse > :not(summary) {
	padding: 0 18px 16px;
}

@media (prefers-reduced-motion: no-preference) {
	.wp-block-details.is-style-br-verse[open] > :not(summary) {
		animation: br-verse-open 0.22s ease;
	}
}

@keyframes br-verse-open {
	from {
		opacity: 0;
		transform: translateY(-4px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.wp-block-details.is-style-br-verse .wp-block-quote {
	margin-top: 0.5em;
	margin-bottom: 0.75em;
}

/* Nested callout inside accordion — flatten visual weight */
.wp-block-details.is-style-br-verse .wp-block-group.is-style-br-callout {
	border-left-width: 3px;
	margin-top: 0.75em;
	box-shadow: none;
}

/* Then / Now columns */
.wp-block-details.is-style-br-verse .wp-block-columns {
	gap: 1.25em;
	margin-top: 0.5em;
}

.wp-block-details.is-style-br-verse .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column:first-child:not(:only-child) {
	border-right: 2px solid var(--gold-soft, #d9b45e);
	padding-right: 1em;
}

@media (max-width: 782px) {
	.wp-block-details.is-style-br-verse .wp-block-column:first-child:not(:only-child) {
		border-right: none;
		border-bottom: 2px solid var(--gold-soft, #d9b45e);
		padding-right: 0;
		padding-bottom: 1em;
		margin-bottom: 0.5em;
	}

	.wp-block-details.is-style-br-verse .wp-block-column:last-child {
		padding-left: 0;
		padding-top: 0.5em;
	}
}

/* ── Table: BR Timeline ── */
.wp-block-table.is-style-br-timeline {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wp-block-table.is-style-br-timeline table {
	border-collapse: separate;
	border-spacing: 0;
}

.wp-block-table.is-style-br-timeline thead th {
	background: transparent !important;
	color: var(--gold, #b9892c);
	border-bottom: 1.5px solid var(--gold, #b9892c);
}

.wp-block-table.is-style-br-timeline :where(td, th) {
	background-color: transparent !important;
}

.wp-block-table.is-style-br-timeline table td:first-child,
.wp-block-table.is-style-br-timeline table th:first-child {
	font-weight: 600;
	color: var(--green, #11372a);
	min-width: 7.5em;
}

@media (min-width: 783px) {
	.wp-block-table.is-style-br-timeline table td:first-child {
		white-space: nowrap;
		width: 28%;
	}
}

.wp-block-table.is-style-br-timeline tbody tr:nth-child(even) td {
	background: transparent !important;
}

.wp-block-table.is-style-br-timeline tbody tr:nth-child(odd) td {
	background: rgba(246, 241, 226, 0.55) !important;
}

/* ── Table: BR Bar chart ── */
.wp-block-table.is-style-br-bar-chart {
	overflow-x: auto;
	background: rgba(217, 180, 94, 0.08);
	border: 1px solid var(--gold, #b9892c);
	border-radius: 10px;
	padding: 0.5em;
}

.wp-block-table.is-style-br-bar-chart :where(td, th) {
	background-color: transparent !important;
}

.wp-block-table.is-style-br-bar-chart thead th {
	background: transparent !important;
	color: var(--gold, #b9892c);
	border-bottom: 1.5px solid var(--gold, #b9892c);
}

.wp-block-table.is-style-br-bar-chart table td:last-child {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: 0.92em;
	letter-spacing: 0.02em;
	font-variant-numeric: tabular-nums;
}

.wp-block-table.is-style-br-bar-chart table td:first-child {
	font-weight: 600;
}

.wp-block-table.is-style-br-bar-chart tbody tr:nth-child(even) td {
	background: transparent !important;
}

.wp-block-table.is-style-br-bar-chart tbody tr:hover td,
.wp-block-table.is-style-br-bar-chart tbody tr:focus-within td {
	background: rgba(246, 241, 226, 0.65) !important;
}

/* ── Table: BR Recipient comparison (7-col, wider than body) ── */
.wp-block-post-content .wp-block-table.alignwide.is-style-br-recipient-compare {
	width: min(960px, calc(100vw - 2.5rem));
	max-width: 960px;
	margin-inline: auto;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wp-block-table.is-style-br-recipient-compare table {
	min-width: 880px;
	font-size: 0.94em;
}

.wp-block-table.is-style-br-recipient-compare :where(td, th) {
	background-color: transparent !important;
	vertical-align: top;
}

.wp-block-table.is-style-br-recipient-compare thead th {
	background: transparent !important;
	color: var(--gold, #b9892c);
	border-bottom: 1.5px solid var(--gold, #b9892c);
	font-size: 0.88em;
	white-space: nowrap;
}

.wp-block-table.is-style-br-recipient-compare tbody tr:nth-child(even) td {
	background: rgba(246, 241, 226, 0.45) !important;
}

.wp-block-table.is-style-br-recipient-compare td:first-child {
	font-weight: 600;
	min-width: 9em;
}

.wp-block-table.is-style-br-recipient-compare td:nth-child(3) {
	white-space: nowrap;
}

@media (max-width: 782px) {
	.wp-block-post-content .wp-block-table.alignwide.is-style-br-recipient-compare {
		width: calc(100vw - 2rem);
		max-width: none;
		margin-inline: calc(50% - 50vw + 1rem);
	}
}

/* ── Flow GIF ── */
.wp-block-image.size-full img[src$=".gif"] {
	border-radius: 10px;
	box-shadow: 0 4px 20px rgba(17, 55, 42, 0.12);
}

/* Editor canvas parity */
.editor-styles-wrapper .wp-block-group.is-style-br-callout,
.editor-styles-wrapper .wp-block-details.is-style-br-verse,
.editor-styles-wrapper .wp-block-group.br-study-toc {
	max-width: 720px;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-details.is-style-br-verse[open] > :not(summary) {
		animation: none;
	}
}
