/*
Theme Name: Blackdown Test
Theme URI: https://blackdownsolutions.com
Author: Blackdown
Description: TEST COPY of Blackdown for trying page builders. Installs alongside Blackdown and keeps its own settings. A dark, single page block theme for Blackdown, an independent creative technology and technical consultancy. Self-hosted fonts, no tracking and no required plugins.
Version: 1.0.0-test
Requires at least: 6.5
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: blackdown-test
*/

/* ------------------------------------------------------------------
   Layout helpers
   Content is centred to 1360px using padding, so full width sections
   can carry their own background while the text stays left aligned.
------------------------------------------------------------------- */
:root {
	--bd-gutter: var(--wp--custom--gutter, clamp(20px, 4vw, 56px));
	--bd-pad-x: max(var(--bd-gutter), calc((100% - 1360px) / 2 + var(--bd-gutter)));
}

html { scroll-behavior: smooth; scroll-padding-top: 24px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

img, svg { max-width: 100%; }

:where(a, button, input, textarea):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------
   Header
------------------------------------------------------------------- */
.bd-header {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	align-items: center;
	justify-content: space-between;
	padding: 24px var(--bd-pad-x);
	position: relative;
	z-index: 20;
}
/* On the home page the header sits over the hero photo. */
body.home .bd-header-wrap {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 20;
}
.bd-logo { display: block; line-height: 0; text-decoration: none; }
.bd-logo svg { display: block; width: 220px; height: auto; }
@media (max-width: 600px) { .bd-logo svg { width: 170px; } }

.bd-header .wp-block-navigation a {
	text-decoration: none;
	padding: 12px 0;
	display: inline-block;
}
.bd-header .wp-block-navigation__container { gap: 0 28px; }
.bd-header .wp-block-navigation a:hover { color: var(--wp--preset--color--accent); }

/* ------------------------------------------------------------------
   Hero
------------------------------------------------------------------- */
.bd-hero {
	position: relative;
	min-height: 860px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	overflow: hidden;
	padding: 190px var(--bd-pad-x) 120px;
	background:
		linear-gradient(0deg, #0B0B0C 0%, rgba(11, 11, 12, 0) 100%) bottom / 100% 200px no-repeat,
		linear-gradient(90deg, rgba(11, 11, 12, 0.94) 0%, rgba(11, 11, 12, 0.82) 48%, rgba(11, 11, 12, 0.3) 100%),
		var(--bd-hero-image, url("assets/images/wind-tunnel.jpg")) 50% 62% / cover no-repeat,
		#0B0B0C;
}
.bd-hero h1 { margin: 0 0 28px; max-width: 760px; }
.bd-accent { color: var(--wp--preset--color--accent); }
.bd-hero-sub { margin: 0 0 36px; max-width: 520px; font-size: 20px; color: var(--wp--preset--color--soft); }
.bd-hero .wp-block-buttons { gap: 12px 16px; }
.bd-hero-caption {
	position: absolute;
	right: var(--bd-gutter);
	bottom: 28px;
	max-width: 360px;
	margin: 0;
	padding: 10px 14px;
	background: rgba(11, 11, 12, 0.78);
	font-size: 12px;
	line-height: 1.5;
	color: var(--wp--preset--color--soft);
}
@media (max-width: 700px) {
	.bd-hero { min-height: 0; padding-top: 150px; padding-bottom: 150px; }
	.bd-hero-caption { left: var(--bd-gutter); right: var(--bd-gutter); max-width: none; }
}

/* Buttons: the outline variant used next to the main call to action */
.wp-block-button.is-style-outline .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1px solid #8A867F;
	padding: 15px 27px;
}
.wp-block-button.is-style-outline .wp-block-button__link:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
	background: transparent;
}

/* ------------------------------------------------------------------
   Sections
------------------------------------------------------------------- */
.bd-section { padding: 96px var(--bd-pad-x); }
.bd-section--intro { padding-bottom: 80px; }
.bd-section--tight { padding-top: 40px; }
.bd-section--alt { background: var(--wp--preset--color--surface-alt); }

.bd-eyebrow {
	display: flex;
	align-items: center;
	gap: 14px;
	margin: 0 0 36px;
	font-size: 14px;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}
.bd-eyebrow::before {
	content: "";
	display: inline-block;
	width: 32px;
	height: 1px;
	background: currentColor;
}

.bd-statement {
	margin: 0 0 32px;
	max-width: 980px;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: clamp(26px, 3vw, 40px);
	line-height: 1.25;
	font-weight: 500;
	letter-spacing: -0.02em;
}
.bd-lede { margin: 0; max-width: 760px; font-size: 19px; color: var(--wp--preset--color--muted); }

/* Expertise cards */
.bd-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1px;
	background: var(--wp--preset--color--line);
	border: 1px solid var(--wp--preset--color--line);
}
@media (max-width: 980px) { .bd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .bd-cards { grid-template-columns: minmax(0, 1fr); } }
.bd-card { background: var(--wp--preset--color--surface); padding: 32px; }
.bd-card-num {
	margin: 0 0 40px;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: 14px;
	color: var(--wp--preset--color--accent);
}
.bd-card h3 { margin: 0 0 12px; }
.bd-card p:last-child { margin: 0; font-size: 16px; color: var(--wp--preset--color--muted); }

/* The kind of work */
.bd-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px 48px;
	padding: 36px 0;
	border-top: 1px solid var(--wp--preset--color--line);
}
.bd-row:last-child { border-bottom: 1px solid var(--wp--preset--color--line); }
.bd-row h3 {
	flex: 1 1 320px;
	margin: 0;
	font-size: clamp(28px, 3.4vw, 48px);
	line-height: 1.1;
	letter-spacing: -0.025em;
}
.bd-row p { flex: 1 1 320px; margin: 0; max-width: 480px; color: var(--wp--preset--color--muted); }

/* Tools */
.bd-tools-text {
	margin: 0;
	max-width: 1000px;
	font-family: var(--wp--preset--font-family--space-grotesk);
	font-size: clamp(26px, 3.2vw, 42px);
	line-height: 1.25;
	font-weight: 400;
	letter-spacing: -0.02em;
}

/* Background */
.bd-section--background { padding-bottom: 64px; }
.bd-cols { display: flex; flex-wrap: wrap; gap: 24px 64px; }
.bd-cols p { flex: 1 1 360px; min-width: 0; margin: 0; font-size: 20px; }
.bd-cols p + p { color: var(--wp--preset--color--muted); }
.bd-focus { margin: 32px 0 0; max-width: 760px; font-size: 20px; }

/* Contact */
.bd-section--contact { border-top: 1px solid var(--wp--preset--color--line); }
.bd-contact-grid { display: flex; flex-wrap: wrap; gap: 40px 72px; }
.bd-contact-copy { flex: 1 1 360px; min-width: 0; max-width: 580px; }
.bd-contact-copy .bd-eyebrow { margin-bottom: 24px; color: var(--wp--preset--color--accent); }
.bd-contact-copy h2 { margin: 0 0 24px; }
.bd-contact-copy p { margin: 0 0 28px; color: var(--wp--preset--color--muted); }
.bd-contact-copy .bd-contact-links { margin: 0; color: var(--wp--preset--color--contrast); }
.bd-contact-links a { display: inline-block; padding: 12px 0; }

.bd-form {
	flex: 1 1 360px;
	min-width: 0;
	max-width: 560px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.bd-form label { display: block; margin-bottom: 6px; font-size: 14px; color: var(--wp--preset--color--soft); }
.bd-form input[type="text"],
.bd-form input[type="email"],
.bd-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 14px;
	border: 1px solid var(--wp--preset--color--field);
	border-radius: 0;
	background: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--contrast);
	font: inherit;
}
.bd-form button {
	align-self: flex-start;
	min-height: 48px;
	padding: 14px 28px;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-weight: 500;
	cursor: pointer;
}
.bd-form button:hover { background: var(--wp--preset--color--accent-hover); }
.bd-form-note { margin: 0; font-size: 14px; color: var(--wp--preset--color--muted); }
.bd-form .bd-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.bd-form-status { margin: 0 0 18px; padding: 14px; border: 1px solid var(--wp--preset--color--accent); max-width: 560px; }
.bd-form-status--error { border-color: #E5897A; }

/* Contact Form 7, when its shortcode is set in Blackdown settings.
   Works with or without its automatic paragraphs. */
.bd-cf7 { display: block; }
.bd-cf7 .wpcf7-form { display: flex; flex-direction: column; gap: 18px; margin: 0; }
.bd-cf7 .wpcf7-form > p { margin: 0; }
.bd-cf7 .hidden-fields-container { display: none; }
.bd-cf7 .screen-reader-response { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
.bd-cf7 .wpcf7-form label { display: block; font-size: 14px; color: var(--wp--preset--color--soft); }
.bd-cf7 .wpcf7-form label br { display: none; }
.bd-cf7 .wpcf7-form-control-wrap { display: block; margin-top: 6px; }
.bd-cf7 input[type="text"],
.bd-cf7 input[type="email"],
.bd-cf7 input[type="tel"],
.bd-cf7 input[type="url"],
.bd-cf7 input[type="number"],
.bd-cf7 select,
.bd-cf7 textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 14px;
	border: 1px solid var(--wp--preset--color--field);
	border-radius: 0;
	background: var(--wp--preset--color--surface-alt);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	line-height: 1.5;
}
.bd-cf7 textarea { min-height: 150px; height: 150px; resize: vertical; }
.bd-cf7 .wpcf7-submit {
	min-height: 48px;
	padding: 14px 28px;
	border: 0;
	border-radius: 0;
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
	font: inherit;
	font-size: var(--wp--preset--font-size--base);
	font-weight: 500;
	cursor: pointer;
}
.bd-cf7 .wpcf7-submit:hover { background: var(--wp--preset--color--accent-hover); }
.bd-cf7 .wpcf7-submit:disabled { opacity: 0.6; cursor: wait; }
.bd-cf7 .wpcf7-spinner { margin: 0 0 0 16px; vertical-align: middle; background-color: var(--wp--preset--color--line); }
.bd-cf7 .wpcf7-form-control.wpcf7-not-valid { border-color: #E5897A; }
.bd-cf7 .wpcf7-not-valid-tip { display: block; margin-top: 6px; font-size: 14px; color: #E5897A; }
.bd-cf7 .wpcf7 form .wpcf7-response-output {
	margin: 0;
	padding: 14px;
	border: 1px solid var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	font-size: 16px;
}
.bd-cf7 .wpcf7 form.invalid .wpcf7-response-output,
.bd-cf7 .wpcf7 form.unaccepted .wpcf7-response-output,
.bd-cf7 .wpcf7 form.payment-required .wpcf7-response-output,
.bd-cf7 .wpcf7 form.failed .wpcf7-response-output,
.bd-cf7 .wpcf7 form.aborted .wpcf7-response-output,
.bd-cf7 .wpcf7 form.spam .wpcf7-response-output { border-color: #E5897A; }
.bd-cf7 .bd-form-note { margin: 0; font-size: 14px; color: var(--wp--preset--color--muted); }
.bd-cf7 iframe { max-width: 100%; }

/* ------------------------------------------------------------------
   Page builder templates
   The builder controls widths and spacing. The theme only supplies the
   header, footer, colours, fonts and default element styles.
------------------------------------------------------------------- */
.bd-builder { padding: 0; }
.bd-builder .wp-block-post-content > * { max-width: none; }
.bd-builder .wp-block-post-content { overflow-x: clip; }

/* ------------------------------------------------------------------
   Footer
------------------------------------------------------------------- */
.bd-footer {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	justify-content: space-between;
	align-items: center;
	padding: 28px var(--bd-pad-x);
	border-top: 1px solid var(--wp--preset--color--line);
	font-size: 13px;
	color: var(--wp--preset--color--muted);
}
.bd-footer p { margin: 0; }
.bd-footer-brand { display: flex; align-items: center; gap: 16px; }
.bd-footer-brand .bd-logo svg { width: 130px; }

/* ------------------------------------------------------------------
   Inner pages
------------------------------------------------------------------- */
.bd-page { padding: 56px var(--bd-pad-x) 96px; }
.bd-page .wp-block-post-title { margin: 0 0 32px; }
.bd-page > .wp-block-heading { margin: 0 0 24px; }
.bd-page .wp-block-post-title a { text-decoration: none; }
.bd-page .wp-block-post-content > * + * { margin-top: 1.2em; }
/* Pages and posts: full width blocks (such as the home page hero) can run edge
   to edge. The container has no side padding, so the title and ordinary blocks
   add their own, lined up with the logo. */
.bd-page--flush { padding-left: 0; padding-right: 0; }
.bd-page--flush .wp-block-post-title { padding: 0 var(--bd-pad-x); }
.bd-page--flush .wp-block-post-content > :not(.alignfull) {
	box-sizing: border-box;
	padding-left: var(--bd-pad-x);
	padding-right: var(--bd-pad-x);
}
.bd-page--flush .wp-block-post-content > :not(.alignfull):not(.alignwide) { max-width: calc(760px + 2 * var(--bd-pad-x)); }
.bd-page--flush .wp-block-post-content > .alignwide { max-width: none; }
/* A page that opens with the hero (the imported Home page) takes over from the
   title and lets the header sit over the photo, whichever template shows it. */
.bd-page--flush:has(.bd-hero) { padding-top: 0; }
.bd-page--flush:has(.bd-hero) > .wp-block-post-title { display: none; }
body:has(.bd-hero) .bd-header-wrap { position: absolute; top: 0; left: 0; right: 0; z-index: 20; }

/* Keep the reading column on the left, under the title, not centred. */
.bd-page .wp-block-post-content > :not(.alignwide):not(.alignfull) { margin-left: 0 !important; margin-right: auto !important; }
.bd-page .wp-block-post-template > li { padding: 28px 0; border-top: 1px solid var(--wp--preset--color--line); }
.bd-page .wp-block-post-template { list-style: none; padding: 0; margin: 0; }
.bd-page .wp-block-post-date { color: var(--wp--preset--color--muted); font-size: 14px; }
