/*
 * Global styles that theme.json can't express. Block-specific CSS lives
 * alongside each block in /blocks/<name>/style.css.
 */

/* ---------- Header ----------
 * Logo left, pill menu centred, "Talk to Roland" right (after Quod).
 * Desktop: the navy bar and logo scroll away with the page, while the pill and
 * button are pinned to the top of the window (they get a shadow once the page
 * moves under them: .is-floating, set by header.js). Mobile: sticky bar.
 */
/* Sticky goes on WordPress's template-part wrapper: a sticky child can't
   outlive its parent, and the wrapper is exactly the header's height. */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 10;
}
.admin-bar .wp-site-blocks > header.wp-block-template-part { top: var(--wp-admin--admin-bar--height, 0); }

.c-header {
	background: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--base);
	padding-block: var(--wp--preset--spacing--20);
}


.c-header__inner {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}
.c-header__inner > * { margin: 0 !important; }
.c-header__inner > .c-logo { justify-self: start; }
.c-header__inner > .c-header__cta { justify-self: end; }

.c-logo { display: block; line-height: 0; }
.c-logo img { display: block; width: auto; height: 76px; }


/* The pill */
.c-nav { font-size: var(--wp--preset--font-size--small); font-weight: 500; }
.c-nav a { text-decoration: none; }
@media (min-width: 900px) {
	.c-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container {
		gap: 0.25rem;
		padding: 0.3rem;
		background: var(--wp--preset--color--base);
		border-radius: 999px; /* The one rounded element: the menu reads as a single object. */
		box-shadow: 0 0 0 1px rgb(19 19 22 / 0.06);
		transition: box-shadow 0.3s;
	}
	/* Each item (link + any chevron) is its own pill, highlighted as one. */
	.c-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item {
		padding: 0.5rem 1rem;
		color: var(--wp--preset--color--contrast);
		border-radius: 999px;
		transition: background-color 0.15s;
	}
	.c-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:hover,
	.c-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item:focus-within {
		background: var(--wp--preset--color--surface);
	}
	.c-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content { color: inherit; }
	.c-nav .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation__submenu-icon { color: inherit; }

	/* Larger menu on desktop */
	.c-nav { font-size: var(--wp--preset--font-size--medium); }
	.c-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container { padding: 0.35rem; }
	.c-nav .wp-block-navigation__responsive-container:not(.is-menu-open) .wp-block-navigation__container > .wp-block-navigation-item { padding: 0.65rem 1.3rem; }
	.c-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { font-size: var(--wp--preset--font-size--medium); padding: 0.55rem 1.1rem; }

	/* The bar scrolls away; the pill and button are pinned in exactly the spot
	   they occupy in the bar (8px padding + centred in the 76px logo row), so
	   nothing jumps. Fixed positions are measured against the window. */
	.wp-site-blocks > header.wp-block-template-part { position: static; }
	.c-header__inner > .c-nav,
	.c-header__inner > .c-header__cta {
		position: fixed;
		z-index: 20;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--preset--spacing--20));
		height: 76px;
		display: flex;
		align-items: center;
	}
	.c-header__inner > .c-nav { left: 50%; transform: translateX(-50%); }
	.c-header__inner > .c-header__cta { right: max(var(--wp--style--root--padding-right, 24px), calc((100% - var(--wp--style--global--wide-size)) / 2)); }

	/* Once the page moves under them, a soft shadow lifts them off it. */
	.c-header.is-floating .c-nav .wp-block-navigation__container,
	.c-header.is-floating .c-hcontact__button { box-shadow: 0 10px 30px rgb(19 19 22 / 0.18); }
}

/* "Contact" menu item for the mobile/tablet menu only; desktop has "Talk to Roland" beside the pill. */
@media (min-width: 900px) {
	.c-nav .c-nav-mobile-only { display: none !important; }
}

/* Dropdown: white panel with dark text, dropped clear of the pill. */
.c-nav .wp-block-navigation__submenu-container {
	color: var(--wp--preset--color--contrast) !important;
	background: var(--wp--preset--color--base) !important;
	border: 0 !important;
	border-radius: var(--wp--custom--radius);
	box-shadow: 0 12px 32px rgb(19 19 22 / 0.18);
	padding: 0.5rem 0;
	min-width: 280px !important;
	margin-top: 0.6rem;
}
/* Invisible bridge over the gap above the dropdown, so it stays open while the
   pointer travels down from the menu item. */
.c-nav .wp-block-navigation__submenu-container::before {
	content: "";
	position: absolute;
	inset: -1.2rem 0 100% 0;
}
.c-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content { padding: 0.45rem 1rem; font-weight: 400; }
.c-nav .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover { color: var(--wp--preset--color--brand); background: var(--wp--preset--color--surface); }

/* Below 900px: bar stays, menu collapses to the menu button, menu button white.
   WordPress switches to its desktop menu at 600px, too early for this menu:
   between 600 and 899px it would wrap onto several lines, so keep the button. */
.c-nav .wp-block-navigation__responsive-container-open { color: var(--wp--preset--color--base); }
@media (max-width: 899px) {
	.c-header__inner { grid-template-columns: 1fr auto auto; }
	.c-header__inner > .c-nav { order: 3; }
}
@media (min-width: 600px) and (max-width: 899px) {
	.c-nav .wp-block-navigation__responsive-container-open:not(.always-shown) { display: flex; }
	.c-nav .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) { display: none; }
}
@media (max-width: 599px) {
	.c-logo img { height: 56px; }
}

@media (prefers-reduced-motion: reduce) {
	.c-header, .c-logo, .c-nav .wp-block-navigation__container { transition: none; }
}

/* ---------- Layout ---------- */
/* Padding sits inside an element's width, so padded panels line up with
   everything else at the same max-width (WordPress doesn't set this). */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }
:where(section[id]) { scroll-margin-top: 90px; }
.c-main { padding-bottom: var(--wp--preset--spacing--60); overflow-x: clip; }
/* The navy hero sits flush under the navy header. */
.wp-site-blocks > .c-main { margin-block-start: 0; }
.c-main > .c-hero:first-child, .c-main > .wp-block-post-content > .c-hero:first-child { margin-block-start: 0; }
.c-footer { margin-top: 0; }
/* The main area's bottom padding sets the gap above the footer; drop WordPress's extra block gap. */
.wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }
/* Footer bands sit flush against each other. */
.c-footer > * { margin-block: 0; }

/* ---------- Shared components ---------- */
.c-eyebrow {
	margin: 0 0 var(--wp--preset--spacing--20);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--wp--preset--color--brand);
}

.c-section-head { margin-bottom: var(--wp--preset--spacing--50); max-width: 60ch; }
.c-section-head h2 { margin: 0; }
.c-section-head p { margin: var(--wp--preset--spacing--30) 0 0; color: var(--wp--preset--color--muted); }

.c-prose > :first-child { margin-top: 0; }
.c-prose > :last-child { margin-bottom: 0; }

.c-actions { display: flex; flex-wrap: wrap; gap: var(--wp--preset--spacing--30); margin: var(--wp--preset--spacing--40) 0 0; }

.c-button {
	display: inline-block;
	padding: 0.75rem 1.25rem;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none;
	border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	border: 1px solid var(--wp--preset--color--accent);
	cursor: pointer;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.c-button:hover { background: var(--wp--preset--color--brand); border-color: var(--wp--preset--color--brand); color: var(--wp--preset--color--base); }
.c-button--secondary { background: transparent; color: var(--wp--preset--color--contrast); border-color: var(--wp--preset--color--contrast); }
/* On navy/night backgrounds: same Signal button, white on hover. */
.c-button--inverse:hover { background: var(--wp--preset--color--base); border-color: var(--wp--preset--color--base); color: var(--wp--preset--color--brand); }

.c-image { display: block; width: 100%; height: auto; border-radius: var(--wp--custom--radius); }

/* A frame on every content photo (heroes, About Roland, case study cards, image blocks), in the
   palette's light tint so it reads on navy and on white. Logo and avatars are separate classes. */
.c-image,
.wp-block-image img { border: 6px solid var(--wp--preset--color--tint); }

/* Wireframe image placeholder: grey box with a cross. */
.c-placeholder {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	background:
		linear-gradient(to top right, transparent calc(50% - 0.5px), var(--wp--preset--color--line) 50%, transparent calc(50% + 0.5px)),
		linear-gradient(to top left, transparent calc(50% - 0.5px), var(--wp--preset--color--line) 50%, transparent calc(50% + 0.5px)),
		var(--wp--preset--color--surface);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
}
.c-placeholder span {
	padding: 0.2rem 0.6rem;
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--muted);
	background: var(--wp--preset--color--surface);
	border-radius: var(--wp--custom--radius);
}

.c-empty {
	padding: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--muted);
	border: 1px dashed var(--wp--preset--color--line);
	border-radius: var(--wp--custom--radius);
}

/* ---------- Mobile menu overlay ---------- */
.c-nav .wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--brand) !important;
	color: var(--wp--preset--color--base) !important;
}
.c-nav .is-menu-open .wp-block-navigation-item__content { color: var(--wp--preset--color--base) !important; }
.c-nav .is-menu-open .wp-block-navigation__responsive-container-content,
.c-nav .is-menu-open .wp-block-navigation__container,
.c-nav .is-menu-open .wp-block-navigation-item {
	align-items: flex-start !important;
	width: 100%;
}
.c-nav .is-menu-open .wp-block-navigation__container { gap: 0; }
.c-nav .is-menu-open .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding-block: 0.75rem;
	font-size: var(--wp--preset--font-size--large);
}
.c-nav .is-menu-open .wp-block-navigation__submenu-container {
	background: transparent !important;
	box-shadow: none;
	border: 0 !important;
	padding: 0 0 0.5rem 1rem !important;
	min-width: 0 !important;
}
.c-nav .is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 0.35rem 0 !important;
	font-size: var(--wp--preset--font-size--medium) !important;
	opacity: 0.75;
}

/* ---------- Single service: body left-aligned under the hero ---------- */
.c-service { padding-top: var(--wp--preset--spacing--50); }

.c-service__body { max-width: 760px; }
.c-service__body > * { margin-block: 0 var(--wp--preset--spacing--30); }
.c-service__body > :where(h2, .c-scenarios, .c-faq, .c-text-media) { margin-top: var(--wp--preset--spacing--50); }
.c-service__body > :first-child { margin-top: 0; }
/* About Roland (and other Text & Media in the body): photo beside the text from
   600px; on phones it stacks, photo first, full width in a landscape crop that keeps the face in frame. */
.c-service__body > .c-text-media { padding-block: 0; }
@media (min-width: 600px) {
	.c-service__body > .c-text-media { grid-template-columns: 1fr 200px; }
}
@media (max-width: 599px) {
	.c-service__body > .c-text-media .c-text-media__media { order: -1; }
	.c-service__body > .c-text-media .c-image { aspect-ratio: 4 / 3; object-fit: cover; object-position: 50% 25%; }
}

/* ---------- Block styles ---------- */
p.is-style-callout {
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius);
}

/* Phone badge on any tel: button: a white handset in a dark circle, so call
   buttons read as "call" at a glance. White circle, navy handset on hover. */
.c-button--call {
	display: inline-flex;
	align-items: center;
	gap: 0.65em;
	padding-left: 0.6rem;
}
.c-button--call::before {
	content: "";
	flex-shrink: 0;
	width: 2em;
	height: 2em;
	border-radius: 50%;
	background: var(--wp--preset--color--contrast) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23ffffff' d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / 1.05em no-repeat;
	transition: background-color 0.15s;
}
.c-button--call:hover::before {
	background: var(--wp--preset--color--base) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23232327' d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E") center / 1.05em no-repeat;
}

/* Short supporting line beside a button, e.g. "Don't panic, don't ignore it." */
.c-button-note {
	margin: 0;
	flex-basis: 18rem;
	flex-grow: 1;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--muted);
}

/* ---------- Editorial typography (service pages and case studies) ---------- */
/* Comfortable measure (about 65 characters), no orphans, hanging quote marks. */
.c-service__body > p,
.c-service__body > ul,
.c-service__body > ol {
	max-width: 65ch;
	text-wrap: pretty;
	hanging-punctuation: first;
}

/* Drop cap on the first paragraph of the body. */
.c-service__body > p:first-of-type::first-letter {
	float: left;
	margin: 0.08em 0.1em 0 0;
	font-size: 3.6em;
	font-weight: 800;
	line-height: 0.82;
	letter-spacing: -0.02em;
	color: var(--wp--preset--color--brand);
}

/* Bold lead-ins ("Time.", "Cost.") in navy rather than black. */
.c-service__body > p > strong:first-child { color: var(--wp--preset--color--brand); }

/* Cookie banner (inc/consent.php): small night panel, bottom left; full width (16px gutter) on phones. */
.c-cookies {
	position: fixed;
	z-index: 90;
	left: 16px;
	bottom: 16px;
	display: flex;
	align-items: center;
	gap: 1rem;
	max-width: min(560px, calc(100vw - 32px));
	padding: 0.75rem 0.75rem 0.75rem 1.1rem;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--base);
	background: var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius);
	box-shadow: 0 12px 32px rgb(19 19 22 / 0.3);
}
.c-cookies[hidden] { display: none; }
.c-cookies__text { margin: 0; }
.c-cookies__text a { color: inherit; font-weight: 600; }
.c-cookies__buttons { flex: none; display: flex; gap: 0.5rem; }
.c-cookies__buttons .c-button { padding: 0.5rem 1.1rem; }
@media (max-width: 599px) {
	.c-cookies { right: 16px; flex-wrap: wrap; }
}
