/**
 * BranchOut — component styles.
 *
 * Tokens come from theme.json. This file only holds what theme.json
 * cannot express: the branch tick, the timeline, pills, and the rules
 * that let a band invert its colours on Ink or Blue.
 */

:root {
	--bo-blue: var(--wp--preset--color--primary, #1F299C);
	--bo-orange: var(--wp--preset--color--accent, #F45929);
	--bo-ink: var(--wp--preset--color--ink, #0F1223);
	--bo-body: var(--wp--preset--color--body, #3A3D52);
	--bo-muted: var(--wp--preset--color--muted, #6B6E85);
	--bo-border: var(--wp--preset--color--border, #E4E6F2);
	--bo-wash-blue: var(--wp--preset--color--wash-blue, #EEF0FB);
	--bo-wash-orange: var(--wp--preset--color--wash-orange, #FEECE5);
	--bo-paper: var(--wp--preset--color--paper, #FAFAFC);
	--bo-radius-card: 24px;
	--bo-radius-pill: 999px;
	--bo-tick-angle: -18deg;
}

/* ---------------------------------------------------------------
   1. The branch tick — the one decorative element.
   An angled, rounded stroke lifted from the T of the wordmark.
   --------------------------------------------------------------- */

.bo-tick,
.is-style-bo-eyebrow::before,
.is-style-bo-tick li::before {
	content: "";
	display: block;
	width: 14px;
	height: 3px;
	border-radius: 2px;
	background: var(--bo-orange);
	transform: rotate(var(--bo-tick-angle));
	flex: none;
}

/* ---------------------------------------------------------------
   2. Display type — the poster voice.
   --------------------------------------------------------------- */

.is-style-bo-display {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: -0.005em;
	line-height: 0.88;
	text-wrap: balance;
}

/* Anton sits slightly high in its box; pull the optical baseline back. */
.is-style-bo-display > em,
.is-style-bo-display > strong {
	font-style: normal;
	font-weight: inherit;
	color: var(--bo-orange);
}

/* Mike's trick: a solid bar sitting behind the last line of a heading.
   Ours is orange, and it stays behind the glyphs. */
.is-style-bo-underline {
	display: inline-block;
	position: relative;
	z-index: 0;
}

.is-style-bo-underline::after {
	content: "";
	position: absolute;
	left: -0.03em;
	right: -0.03em;
	bottom: 0.05em;
	height: 0.16em;
	background: var(--bo-orange);
	border-radius: 3px;
	z-index: -1;
}

/* Body copy keeps the soft wash; only display type gets the solid bar. */
:where(p, li) > .is-style-bo-underline::after {
	background: var(--bo-wash-orange);
	height: 0.5em;
	bottom: 0;
}

/* ---------------------------------------------------------------
   3. Text roles
   --------------------------------------------------------------- */

.is-style-bo-eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--bo-blue);
	line-height: 1.4;
	max-width: none;
}

/* Directly in the hero the eyebrow has to line up with the headline, so it
   takes the band's content width instead of hugging the left edge. */
.bo-hero > .is-style-bo-eyebrow {
	display: flex;
	max-width: 1200px;
}

.is-style-bo-lede {
	font-size: var(--wp--preset--font-size--x-large);
	line-height: 1.3;
	font-weight: 500;
	color: var(--bo-ink);
	letter-spacing: -0.015em;
	max-width: 22ch;
}

.bo-prose p,
.wp-block-post-content > p {
	max-width: 62ch;
}

.is-style-bo-note {
	font-size: var(--wp--preset--font-size--small);
	color: var(--bo-muted);
	line-height: 1.55;
}

/* Inline links keep the two-jobs rule: blue text, orange rule. */
.wp-block-post-content a:where(:not(.wp-element-button)),
.bo-prose a:where(:not(.wp-element-button)),
.is-style-bo-lede a {
	text-decoration-color: var(--bo-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

/* ---------------------------------------------------------------
   4. Lists
   --------------------------------------------------------------- */

.is-style-bo-tick {
	list-style: none;
	padding-left: 0;
}

.is-style-bo-tick li {
	position: relative;
	padding-left: 26px;
	margin-bottom: 0.5rem;
}

.is-style-bo-tick li::before {
	position: absolute;
	left: 2px;
	top: 0.62em;
}

/* Mike's "recent work" rail: name left, hairline rule under each row. */
.is-style-bo-work {
	list-style: none;
	padding-left: 0;
	margin: 0;
}

.is-style-bo-work li {
	border-bottom: 1px dashed var(--bo-border);
	padding: 0.85rem 0;
	margin: 0;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	letter-spacing: 0.01em;
	transition: padding-left 0.18s ease;
}

.is-style-bo-work li:first-child {
	border-top: 1px dashed var(--bo-border);
}

.is-style-bo-work li a {
	text-decoration: none;
	color: inherit;
}

.is-style-bo-work li:hover {
	padding-left: 10px;
}

.is-style-bo-work li:hover a {
	color: var(--bo-orange);
}

/* ---------------------------------------------------------------
   5. Cards
   --------------------------------------------------------------- */

.is-style-bo-card {
	background: #fff;
	border: 1px solid var(--bo-border);
	border-radius: var(--bo-radius-card);
	padding: 28px;
	height: 100%;
}

.is-style-bo-card > :last-child {
	margin-bottom: 0;
}

.bo-invert .is-style-bo-card {
	background: rgba(255, 255, 255, 0.04);
	border-color: rgba(255, 255, 255, 0.14);
}

/* ---------------------------------------------------------------
   6. Pills and tags
   --------------------------------------------------------------- */

.bo-pill {
	display: inline-block;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	line-height: 1;
	padding: 7px 12px 6px;
	border-radius: var(--bo-radius-pill);
	background: var(--bo-wash-blue);
	color: var(--bo-blue);
	white-space: nowrap;
}

.bo-pill--accent {
	background: var(--bo-wash-orange);
	color: #C13F16;
}

.bo-invert .bo-pill {
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
}

/* Metric tile — stands in for a screenshot and says something a
   screenshot cannot: the number the project actually moved. */
.bo-metric {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	gap: 6px;
	min-height: 260px;
	padding: 40px;
	border-radius: var(--bo-radius-card);
	background: var(--bo-wash-blue);
	border: 1px solid var(--bo-border);
}

.bo-metric__value {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	text-transform: uppercase;
	line-height: 0.9;
	letter-spacing: -0.01em;
	font-size: clamp(3.5rem, 7vw, 6rem);
	color: var(--bo-blue);
}

.bo-metric__label {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	color: var(--bo-muted);
}

.bo-taglist {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* ---------------------------------------------------------------
   7. Timeline
   --------------------------------------------------------------- */

.bo-timeline {
	border-left: 1px solid var(--bo-border);
	padding-left: 28px;
	margin-left: 6px;
}

.bo-timeline__item {
	position: relative;
	padding-bottom: 1.6rem;
	display: grid;
	grid-template-columns: 62px 1fr;
	gap: 14px;
	align-items: start;
}

.bo-timeline__item:last-child {
	padding-bottom: 0;
}

.bo-timeline__item::before {
	content: "";
	position: absolute;
	left: -34px;
	top: 7px;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	background: var(--bo-orange);
	border: 2px solid var(--bo-paper);
}

.bo-timeline__year {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1;
	padding: 6px 10px;
	border-radius: var(--bo-radius-pill);
	background: var(--bo-wash-blue);
	color: var(--bo-blue);
	text-align: center;
}

.bo-timeline__body strong {
	display: block;
	color: var(--bo-ink);
	font-weight: 700;
	font-size: 0.95rem;
	margin-bottom: 2px;
}

.bo-timeline__body span {
	display: block;
	font-size: var(--wp--preset--font-size--small);
	color: var(--bo-muted);
	line-height: 1.5;
}

.bo-invert .bo-timeline {
	border-left-color: rgba(255, 255, 255, 0.18);
}

.bo-invert .bo-timeline__item::before {
	border-color: var(--bo-ink);
}

.bo-invert .bo-timeline__body strong {
	color: #fff;
}

.bo-invert .bo-timeline__body span {
	color: rgba(255, 255, 255, 0.62);
}

/* ---------------------------------------------------------------
   8. Inverted bands (Ink or Blue grounds)
   --------------------------------------------------------------- */

.bo-invert :where(h1, h2, h3, h4, h5) {
	color: inherit;
}

.bo-invert .is-style-bo-eyebrow,
.bo-invert h6 {
	color: #fff;
}

.bo-invert .is-style-bo-lede {
	color: inherit;
}

.bo-invert .is-style-bo-note {
	color: rgba(255, 255, 255, 0.6);
}

.bo-invert a:where(:not(.wp-element-button)) {
	color: inherit;
	text-decoration-color: var(--bo-orange);
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.bo-invert .is-style-bo-work li,
.bo-invert .is-style-bo-work li:first-child {
	border-color: rgba(255, 255, 255, 0.18);
}

.bo-invert mark,
.bo-invert .bo-mark {
	background: none;
	color: var(--bo-orange);
	font-weight: 700;
}

/* ---------------------------------------------------------------
   9. Buttons — variations
   --------------------------------------------------------------- */

.wp-block-button.is-style-bo-secondary .wp-block-button__link {
	background: transparent;
	color: var(--bo-blue);
	border-color: var(--bo-blue);
}

.bo-invert .wp-block-button.is-style-bo-secondary .wp-block-button__link {
	color: #fff;
	border-color: rgba(255, 255, 255, 0.5);
}

.wp-block-button.is-style-bo-accent .wp-block-button__link {
	background: var(--bo-orange);
	border-color: var(--bo-orange);
	color: #fff;
}

.wp-block-button.is-style-bo-accent .wp-block-button__link:hover {
	background: var(--bo-orange);
	border-color: var(--bo-orange);
	box-shadow: 0 8px 20px rgba(244, 89, 41, 0.3);
}

.wp-block-button.is-style-bo-ghost .wp-block-button__link {
	background: transparent;
	border-color: transparent;
	color: var(--bo-ink);
	padding-left: 0;
	padding-right: 0;
}

.bo-invert .wp-block-button.is-style-bo-ghost .wp-block-button__link {
	color: #fff;
}

.wp-block-button.is-style-bo-ghost .wp-block-button__link::after {
	content: "\2192";
	color: var(--bo-orange);
	display: inline-block;
	margin-left: 0.45em;
	transition: transform 0.18s ease;
}

.wp-block-button.is-style-bo-ghost .wp-block-button__link:hover {
	background: transparent;
	box-shadow: none;
}

.wp-block-button.is-style-bo-ghost .wp-block-button__link:hover::after {
	transform: translateX(4px);
}

/* ---------------------------------------------------------------
   10. Separators
   --------------------------------------------------------------- */

.wp-block-separator.is-style-bo-tick-rule {
	border: 0;
	height: 3px;
	max-width: 100%;
	background-image: linear-gradient(var(--bo-tick-angle), var(--bo-orange) 0 100%);
	background-size: 14px 3px;
	background-repeat: repeat-x;
	opacity: 1;
	-webkit-mask-image: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 26px);
	mask-image: repeating-linear-gradient(90deg, #000 0 14px, transparent 14px 26px);
	background: var(--bo-orange);
}

/* ---------------------------------------------------------------
   10b. Bands butt together

   The global blockGap is right for content, but it leaves a 20px strip of
   paper between full-bleed bands and around the header and footer. Colour
   bands must meet edge to edge.
   --------------------------------------------------------------- */

.wp-site-blocks > * + *,
main.wp-block-group > * + *,
main.wp-block-group > .wp-block-post-content > * + * {
	margin-block-start: 0;
}

/* ---------------------------------------------------------------
   11. Header
   --------------------------------------------------------------- */

.bo-footer {
	position: relative;
	overflow: hidden;
}

.bo-footer__sign {
	position: relative;
	z-index: 1;
}

.bo-footer .bo-graphic--branch {
	position: absolute;
	right: -55px;
	top: var(--wp--preset--spacing--40);
	width: 300px;
	max-width: 26vw;
	color: var(--bo-ink);
	opacity: 0.45;
	z-index: 0;
}

@media (max-width: 1100px) {
	.bo-footer .bo-graphic--branch {
		display: none;
	}
}

.bo-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

.bo-header .wp-block-navigation__responsive-container-open,
.bo-header .wp-block-navigation__responsive-container-close {
	color: #fff;
}

.bo-header .wp-block-navigation a {
	text-decoration: none;
	color: #fff;
	padding-bottom: 3px;
	border-bottom: 2px solid transparent;
}

.bo-header .wp-block-navigation a:hover {
	border-bottom-color: var(--bo-orange);
}

.bo-header .wp-block-navigation .current-menu-item a,
.bo-header .wp-block-navigation .current_page_item a,
.bo-header .wp-block-navigation a[aria-current="page"] {
	border-bottom-color: var(--bo-orange);
}

.bo-logo img {
	display: block;
	width: auto;
	height: 26px;
}

@media (max-width: 781px) {
	.bo-logo img {
		height: 22px;
	}
}

/* ---------------------------------------------------------------
   12. Decorative tick graphics
   --------------------------------------------------------------- */

.bo-graphic {
	display: block;
	width: 100%;
	height: auto;
	color: var(--bo-orange);
}

.bo-graphic svg {
	display: block;
	width: 100%;
	height: auto;
}

.bo-graphic--edge {
	pointer-events: none;
	user-select: none;
}

.bo-graphic--arrow {
	max-width: 190px;
}

.bo-graphic--ticks {
	max-width: 150px;
}

.bo-graphic--branch {
	max-width: 200px;
	flex: none;
	opacity: 0.9;
}

@media (max-width: 781px) {
	.bo-graphic--arrow,
	.bo-graphic--branch {
		max-width: 120px;
	}
}

/* ---------------------------------------------------------------
   13. Grids that must not collapse into a single column too early
   --------------------------------------------------------------- */

.bo-grid-3 {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.bo-grid-2 {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

/* WP's flow layout adds a block-start margin to every sibling after the first,
   which knocks the first grid cell out of line. Grid gap already spaces them. */
.wp-block-group.bo-grid-3 > *,
.wp-block-group.bo-grid-2 > * {
	margin-block: 0;
}

@media (max-width: 900px) {
	.bo-grid-3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.bo-grid-3,
	.bo-grid-2 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Services packages */
.bo-package {
	display: flex;
	flex-direction: column;
}

/* WP's constrained layout puts `margin-inline: auto` on every child. Harmless in
   flow, but in a flex column that shrinks each child to its content and centres
   it — so put the children back to full width. */
.wp-block-group.bo-package > * {
	margin-inline: 0;
	width: 100%;
}

.bo-package--featured {
	border-color: var(--bo-blue);
	box-shadow: 0 8px 30px rgba(31, 41, 156, 0.1);
}

.bo-price {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	text-transform: uppercase;
	font-size: 2rem;
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--bo-blue);
	margin-bottom: 1.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--bo-border);
}

.bo-package .is-style-bo-tick {
	flex: 1;
}

/* Contact */
.bo-contact-card__mail {
	font-size: clamp(1.4rem, 2.6vw, 2rem);
	line-height: 1.1;
	word-break: break-word;
}

.bo-contact-card__mail a {
	text-decoration: none;
	color: inherit;
	border-bottom: 3px solid var(--bo-orange);
}

.bo-contact-arrow {
	max-width: 130px;
	margin: var(--wp--preset--spacing--40) 0 0 auto;
	transform: scaleX(-1);
	opacity: 0.8;
}

/* Services on the home page: one feature card, then the rest.
   Desktop: the feature spans two columns next to one card, three below. */
.bo-svc-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30) var(--wp--preset--spacing--50);
	margin-bottom: var(--wp--preset--spacing--50);
}

.wp-block-group.bo-svc-head > * {
	margin-block: 0;
}

.bo-svc-head__note {
	max-width: 22rem;
	color: var(--bo-muted);
}

.bo-svc-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.wp-block-group.bo-svc-grid > * {
	margin-block: 0;
}

.bo-svc {
	position: relative;
	display: flex;
	flex-direction: column;
	padding: 32px 28px 28px;
	background: #fff;
	border: 1px solid var(--bo-border);
	border-radius: var(--bo-radius-card);
	transition: border-color 0.2s, transform 0.2s;
}

.bo-svc:not(.bo-svc--feature):hover {
	border-color: var(--bo-orange);
	transform: translateY(-2px);
}

/* The branch tick above each title. */
.bo-svc:not(.bo-svc--feature)::before {
	content: "";
	width: 22px;
	height: 4px;
	margin-bottom: 22px;
	border-radius: 2px;
	background: var(--bo-orange);
	transform: rotate(var(--bo-tick-angle));
}

.wp-block-group.bo-svc > * {
	margin-block: 0;
}

.bo-svc .bo-svc__title {
	margin-bottom: 10px;
	line-height: 1.2;
}

.bo-svc .bo-svc__text {
	color: var(--bo-body);
}

.bo-svc--feature {
	grid-column: span 2;
	overflow: hidden;
	padding: clamp(28px, 4vw, 48px);
	border: 0;
}

/* The card next to the feature is as tall as it: tint it and sit the text at the bottom. */
.bo-svc--feature + .bo-svc {
	background: var(--bo-wash-orange);
	border-color: transparent;
}

.bo-svc--feature + .bo-svc .bo-svc__title {
	margin-top: auto;
}

.bo-svc--feature .bo-svc__title {
	max-width: 16ch;
	margin: 14px 0 18px;
	line-height: 0.95;
}

.bo-svc--feature .bo-svc__text {
	max-width: 30rem;
	color: rgba(255, 255, 255, 0.85);
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
}

.bo-svc--feature .wp-block-buttons {
	margin-top: auto;
	padding-top: var(--wp--preset--spacing--40);
}

@media (max-width: 900px) {
	.bo-svc-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.bo-svc-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.bo-svc--feature {
		grid-column: auto;
	}
}

/* ---------------------------------------------------------------
   14. Forms
   --------------------------------------------------------------- */

.bo-form label {
	display: block;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--small);
	color: var(--bo-ink);
	margin-bottom: 6px;
}

.bo-invert .bo-form label {
	color: #fff;
}

.bo-form input[type="text"],
.bo-form input[type="email"],
.bo-form textarea {
	width: 100%;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	color: var(--bo-ink);
	background: #fff;
	border: 1px solid var(--bo-border);
	border-radius: 14px;
	padding: 12px 16px;
	margin-bottom: 1.25rem;
}

.bo-invert .bo-form input[type="text"],
.bo-invert .bo-form input[type="email"],
.bo-invert .bo-form textarea {
	background: rgba(255, 255, 255, 0.07);
	border-color: rgba(255, 255, 255, 0.18);
	color: #fff;
}

.bo-form textarea {
	min-height: 170px;
	resize: vertical;
}

.bo-form button {
	font-family: inherit;
	font-weight: 700;
	font-size: 0.95rem;
	color: #fff;
	background: var(--bo-orange);
	border: 2px solid var(--bo-orange);
	border-radius: var(--bo-radius-pill);
	padding: 0.85rem 1.65rem;
	cursor: pointer;
}

/* ---------------------------------------------------------------
   15. Motion
   --------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}

	*,
	*::before,
	*::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
