/*
 * BB Ledger — shared styles v1.1
 * Loaded by both Agentic AI page templates (front end + editor).
 * Scoped to .bba-* (Variant A) and .bbb-* (Variant B) prefixes.
 *
 * v1.1 — fix wp-block-image figure wrapper interference with grid layout
 */

/* ── Tokens ── */
:root {
	--bb-serif: 'Lora', Georgia, serif;
	--bb-sans:  'DM Sans', system-ui, sans-serif;
	--bb-ink:   #1a1a18;
	--bb-muted: #5c5c58;
	--bb-faint: #9a9a94;
	--bb-rule:  #e4e3de;
	--bb-surf:  #f5f4ef;
	--bb-max:   980px;
}

/* ════════════════════════════════════════
   SHARED COMPONENTS (both variants)
   ════════════════════════════════════════ */

.bba-page,
.bbb-page {
	font-family: var(--bb-sans);
	color: var(--bb-ink);
	max-width: var(--bb-max);
	margin: 0 auto;
	padding: 0 32px;
}

.bba-page *,
.bbb-page * { box-sizing: border-box; }

.bba-page p,  .bba-page h1,  .bba-page h2,
.bbb-page p,  .bbb-page h1,  .bbb-page h2 { margin: 0; }

/* Hero */
.bba-hero,
.bbb-hero {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 56px;
	padding: 72px 0 64px;
	border-bottom: 1px solid var(--bb-rule);
	align-items: start;
}

.bba-kicker,
.bbb-kicker {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--bb-faint);
	margin: 0 0 18px !important;
}

.bba-headline,
.bbb-headline {
	font-family: var(--bb-serif);
	font-size: 40px;
	font-weight: 600;
	line-height: 1.1;
	color: var(--bb-ink);
}

.bba-lead,
.bbb-lead {
	font-size: 16px;
	line-height: 1.75;
	color: var(--bb-muted);
	margin: 0 0 28px !important;
}

.bba-btn,
.bbb-btn {
	display: inline-block;
	padding: 13px 26px;
	background: var(--bb-ink);
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 500;
	transition: opacity 0.15s;
}
.bba-btn:hover,
.bbb-btn:hover { opacity: 0.82; }

/* Phase shared */
.bba-phase,
.bbb-phase {
	border-bottom: 1px solid var(--bb-rule);
	min-height: 0;
}
.bba-phase:last-of-type,
.bbb-phase:last-of-type { border-bottom: none; }

.bba-phase-num,
.bbb-phase-num {
	font-family: var(--bb-serif);
	font-size: 52px;
	font-weight: 600;
	line-height: 1;
	color: var(--bb-rule);
	margin: 0 0 8px !important;
}

.bba-phase-label,
.bbb-phase-label {
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--bb-faint);
}

.bba-phase-title,
.bbb-phase-title {
	font-family: var(--bb-serif);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--bb-ink);
	margin: 0 0 14px !important;
}

.bba-phase-body,
.bbb-phase-body {
	font-size: 15px;
	line-height: 1.8;
	color: var(--bb-muted);
}

/* Chips */
.bba-chips,
.bbb-chips {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
	align-items: flex-start;
}

.bba-chip,
.bbb-chip {
	background: var(--bb-surf);
	border-radius: 4px;
	padding: 6px 12px;
	font-size: 12px;
	color: var(--bb-muted);
	display: inline-block;
	white-space: nowrap;
	margin: 0 !important;
	line-height: 1.5;
}
.bba-chip strong,
.bbb-chip strong {
	color: var(--bb-ink);
	font-weight: 500;
	margin-right: 3px;
}

.bba-pullquote,
.bbb-pullquote {
	font-family: var(--bb-serif);
	font-style: italic;
	font-size: 18px;
	line-height: 1.55;
	color: var(--bb-ink);
	border-top: 1px solid var(--bb-rule);
	border-bottom: 1px solid var(--bb-rule);
	padding: 18px 0;
	margin: 22px 0 0 !important;
}

/* CTA band */
.bba-cta,
.bbb-cta {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 56px;
	padding: 64px 0 72px;
	align-items: center;
}

.bba-cta-inner,
.bbb-cta-inner {
	display: flex;
	align-items: center;
	gap: 32px;
}

/* Headshot — target both the figure wrapper Gutenberg adds AND the img itself */
.bba-headshot,
.bbb-headshot {
	width: 88px !important;
	height: 88px !important;
	border-radius: 50% !important;
	overflow: hidden;
	flex-shrink: 0;
	margin: 0 !important;
}
.bba-headshot img,
.bbb-headshot img {
	width: 88px !important;
	height: 88px !important;
	object-fit: cover;
	border-radius: 50% !important;
	display: block;
	filter: grayscale(100%);
	margin: 0 !important;
}

.bba-cta-heading,
.bbb-cta-heading {
	font-family: var(--bb-serif);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--bb-ink);
	margin: 0 0 10px !important;
}

.bba-cta-sub,
.bbb-cta-sub {
	font-size: 14px;
	line-height: 1.7;
	color: var(--bb-muted);
}

.bba-cta-right,
.bbb-cta-right {
	display: flex;
	flex-direction: column;
	gap: 8px;
	align-items: flex-end;
	min-width: 240px;
}

.bba-cta-note,
.bbb-cta-note {
	font-size: 12px;
	color: var(--bb-faint);
	text-align: right;
	margin: 0 !important;
}

/* ════════════════════════════════════════
   VARIANT A — image in number column
   ════════════════════════════════════════ */

.bba-phase {
	display: grid;
	grid-template-columns: 220px 1fr;
}

.bba-phase-left {
	border-right: 1px solid var(--bb-rule);
	display: flex;
	flex-direction: column;
}

.bba-phase-meta { padding: 36px 28px 24px 0; }

.bba-phase-img-wrap {
	flex: 1;
	overflow: hidden;
	position: relative;
	min-height: 180px;
}

/* Strip figure wrapper margins and make it fill the container */
.bba-phase-img-wrap figure,
.bba-phase-img-wrap .wp-block-image {
	margin: 0 !important;
	padding: 0;
	width: 100%;
	height: 100%;
	position: absolute;
	inset: 0;
}

.bba-phase-img-wrap img,
.bba-phase-img-wrap figure img,
.bba-phase-img-wrap .wp-block-image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	margin: 0 !important;
}

.bba-phase-right { padding: 36px 0 36px 44px; }

/* ════════════════════════════════════════
   VARIANT B — image in text column
   ════════════════════════════════════════ */

.bbb-phase {
	display: grid;
	grid-template-columns: 160px 1fr;
}

.bbb-phase-left {
	padding: 40px 28px 40px 0;
	border-right: 1px solid var(--bb-rule);
}

.bbb-phase-right { padding: 40px 0 40px 44px; }

.bbb-phase-title { margin: 0 0 20px !important; }

.bbb-phase-content {
	display: grid;
	grid-template-columns: 1fr 200px;
	gap: 24px;
	align-items: start;
}

/* Strip figure wrapper so the image sits cleanly in the 240px column */
.bbb-phase-content figure,
.bbb-phase-content .wp-block-image {
	margin: 0 !important;
	padding: 0;
	width: 100%;
	max-width: 100%;
	display: block;
}

.bbb-phase-content figure img,
.bbb-phase-content .wp-block-image img,
.bbb-phase-img,
.bbb-phase-content img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 4px;
	display: block;
	margin: 0 !important;
	max-width: 100%;
}

.bbb-phase-content figure.is-square img,
.bbb-phase-content .wp-block-image.is-square img,
.bbb-phase-img.is-square,
.bbb-phase-content img.is-square {
	aspect-ratio: 1 / 1;
}

/* ════════════════════════════════════════
   RESPONSIVE
   ════════════════════════════════════════ */

@media (max-width: 720px) {
	.bba-hero, .bba-phase, .bba-cta,
	.bbb-hero, .bbb-phase, .bbb-cta {
		grid-template-columns: 1fr;
		gap: 0;
	}

	.bba-hero,
	.bbb-hero { padding: 48px 0 36px; gap: 28px; }

	/* Variant A mobile */
	.bba-phase-left {
		border-right: none;
		border-bottom: 1px solid var(--bb-rule);
		flex-direction: row;
		align-items: stretch;
	}
	.bba-phase-meta { padding: 24px 20px 24px 0; min-width: 80px; }
	.bba-phase-img-wrap { min-height: 120px; flex: 1; }
	.bba-phase-right { padding: 28px 0 36px; }

	/* Variant B mobile */
	.bbb-phase-left {
		border-right: none;
		border-bottom: 1px solid var(--bb-rule);
		padding: 24px 0 16px;
		display: flex;
		align-items: baseline;
		gap: 16px;
	}
	.bbb-phase-right { padding: 24px 0 36px; }
	.bbb-phase-content { grid-template-columns: 1fr; }

	.bba-phase-num,
	.bbb-phase-num { font-size: 36px; }

	.bba-headline,
	.bbb-headline { font-size: 28px; }

	.bba-page,
	.bbb-page { padding: 0 20px; }

	.bba-cta,
	.bbb-cta {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.bba-cta-inner,
	.bbb-cta-inner { flex-direction: column; align-items: flex-start; }

	.bba-cta-right,
	.bbb-cta-right { align-items: flex-start; min-width: auto; }

	.bba-cta-note,
	.bbb-cta-note { text-align: left; }
}