/*
Theme Name:   BFJ Construction
Description:  Custom theme built from the BFJ Construction mockup. 1200px content width with full-width backgrounds, sticky header, Barlow Condensed and Barlow Semi Condensed type.
Version:      1.2.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain:  bfj
*/

/* ------------------------------------------------------------------
 * Design tokens (sampled from mockup1.png)
 * ------------------------------------------------------------------ */
:root {
	--bfj-green: #54b948;          /* menu active / hover, logo */
	--bfj-green-soft: #84c578;     /* "Contact Us" button */
	--bfj-gold: #d8ad62;           /* "View Projects" button, icons */
	--bfj-gold-dark: #d39325;      /* Plan Room link */

	--bfj-ink: #38393e;            /* body text, headings */
	--bfj-muted: #777879;          /* card text */

	--bfj-charcoal: #2e2f33;       /* top bar / strips, outer */
	--bfj-charcoal-in: #38393e;    /* top bar / strips, inside 1200px */
	--bfj-footer: #414348;         /* footer, outer */
	--bfj-footer-in: #4b4d53;      /* footer, inside 1200px */
	--bfj-footer-head: #d2d3d4;
	--bfj-footer-text: #a0a0a3;

	--bfj-sand: #d6d3c7;           /* hero, outer */
	--bfj-sand-in: #e1dfd6;        /* hero, inside 1200px */
	--bfj-page: #f7f6f3;           /* page background, outer */
	--bfj-card: #f0efea;           /* service cards */

	--bfj-font-head: "Barlow Condensed", "Arial Narrow", sans-serif;
	--bfj-font-body: "Barlow Semi Condensed", "Arial Narrow", sans-serif;

	--bfj-width: 1200px;
	--bfj-pad: 30px;
}

/* ------------------------------------------------------------------
 * Base
 * ------------------------------------------------------------------ */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-padding-top: 130px; /* keep anchors clear of the sticky header */
}

body {
	margin: 0;
	background: var(--bfj-page);
	color: var(--bfj-ink);
	font-family: var(--bfj-font-body);
	font-size: 17px;
	line-height: 1.3;
	-webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 0.5em;
	font-family: var(--bfj-font-head);
	font-weight: 600;
	line-height: 1.1;
	color: var(--bfj-ink);
}

h1 { font-size: 42px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }

p { margin: 0 0 1em; }

a { color: var(--bfj-ink); }
a:hover { color: var(--bfj-green); }

img { max-width: 100%; height: auto; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 8px;
	left: 8px;
	z-index: 1000;
	width: auto;
	height: auto;
	padding: 10px 16px;
	clip: auto;
	background: #fff;
	color: var(--bfj-ink);
}

/* Full-width band with a 1200px inner column. The band's background runs
   edge to edge; .container can carry a slightly different inner shade. */
.container {
	width: 100%;
	max-width: var(--bfj-width);
	margin: 0 auto;
}

/* ------------------------------------------------------------------
 * Sticky header: top bar + white menu bar
 * ------------------------------------------------------------------ */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
}

.admin-bar .site-header {
	top: 32px;
}

@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}

@media (max-width: 600px) {
	/* The admin bar stops being fixed at this width. */
	.admin-bar .site-header { top: 0; }
}

.top-bar {
	background: var(--bfj-charcoal);
	color: #d8d8d8;
	font-family: var(--bfj-font-head);
	font-size: 14px;
	font-weight: 500;
}

.top-bar .container {
	display: flex;
	justify-content: flex-end;
	align-items: stretch;
	min-height: 29px;
	background: var(--bfj-charcoal-in);
}

.top-bar__item {
	display: flex;
	align-items: center;
	gap: 6px;
	padding: 0 10px;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.top-bar__item svg {
	width: 14px;
	height: 14px;
	flex: none;
}

.top-bar__phone svg { fill: var(--bfj-green); }

.top-bar a.top-bar__item:hover { color: #fff; }

.top-bar__plan {
	margin-left: 4px;
	padding: 0 14px;
	border-left: 1px solid var(--bfj-charcoal);
	color: var(--bfj-gold-dark);
}

.top-bar__plan svg { fill: var(--bfj-gold-dark); }

.top-bar a.top-bar__plan:hover { color: var(--bfj-gold); }

.masthead {
	background: #fff;
	border-bottom: 1px solid #eceae5;
}

.masthead .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 30px;
	min-height: 80px;
	padding: 0 14px 0 20px;
}

.site-logo {
	display: block;
	flex: none;
	line-height: 0;
}

.site-logo img {
	width: 190px;
	height: auto;
}

/* Primary menu */
.main-nav ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 25px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.main-nav a {
	display: block;
	padding: 6px 0;
	font-family: var(--bfj-font-head);
	font-size: 20px;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--bfj-ink);
	/* Underline drawn with a border so it never shifts the layout. */
	border-bottom: 2px solid transparent;
	transition: color 0.15s, border-color 0.15s;
}

.main-nav a:hover,
.main-nav a:focus-visible {
	color: var(--bfj-green);
	border-bottom-color: var(--bfj-green);
}

.main-nav .current-menu-item > a,
.main-nav .current_page_item > a,
.main-nav .current-menu-ancestor > a,
.main-nav .current_page_ancestor > a {
	color: var(--bfj-green);
}

/* Sub-menus */
.main-nav li { position: relative; }

.main-nav ul ul {
	position: absolute;
	top: 100%;
	left: -16px;
	z-index: 10;
	display: none;
	flex-direction: column;
	gap: 0;
	min-width: 220px;
	padding: 8px 16px;
	background: #fff;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.main-nav li:hover > ul,
.main-nav li:focus-within > ul {
	display: flex;
}

.main-nav ul ul a { font-size: 17px; }

.menu-toggle {
	display: none;
	padding: 8px 10px;
	border: 0;
	background: none;
	color: var(--bfj-ink);
	cursor: pointer;
}

.menu-toggle svg {
	display: block;
	width: 28px;
	height: 28px;
	fill: currentColor;
}

/* ------------------------------------------------------------------
 * Hero (front page)
 * ------------------------------------------------------------------ */
/* The photo fills the content width (max 1200px); the text sits on top of
   it, on a sand-coloured wash that fades out to the right. Outside 1200px
   the hero keeps its plain sand background. */
.hero {
	background: var(--bfj-sand);
}

.hero .container {
	position: relative;
	overflow: hidden;
	min-height: 260px;
	background: var(--bfj-sand-in);
}

.hero__text {
	position: relative;
	z-index: 2;
	max-width: 519px;
	padding: 42px 30px 18px 123px;
}

/* Readability wash behind the text, from the left edge of the content area. */
.hero .container::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(
		90deg,
		rgba(225, 223, 214, 0.92) 0,
		rgba(225, 223, 214, 0.88) 480px,
		rgba(225, 223, 214, 0) 740px
	);
	pointer-events: none;
}

.hero__mark {
	position: absolute;
	top: 18px;
	left: 72px;
	width: 95px;
	height: auto;
	fill: var(--bfj-green);
	opacity: 0.32;
	pointer-events: none;
}

.hero__title {
	position: relative;
	margin: 0 0 14px;
	font-size: 48px;
	font-weight: 700;
	line-height: 0.98;
	text-transform: uppercase;
}

.hero__lead {
	position: relative;
	max-width: 320px;
	margin: 0 0 18px;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.25;
}

.hero__actions {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	gap: 19px;
	margin-left: -39px;
}

.hero__media {
	position: absolute;
	inset: 0;
	background-color: #ccc;
	background-position: center;
	background-size: cover;
}

.band-strip {
	height: 15px;
	background: var(--bfj-charcoal);
}

.band-strip .container {
	height: 100%;
	background: var(--bfj-charcoal-in);
}

/* Page hero (Contact and "Hero banner" templates): compact, no image.
   Full width #D6D3C7, centre 1200px #E1DFD6. */
.hero--page { background: #d6d3c7; }

.hero--page .container {
	display: flex;
	align-items: center;
	gap: 30px;
	min-height: 0;
	background: #e1dfd6;
}

.hero--page .container::before { content: none; }

.hero--page .hero__mark {
	top: 16px;
	width: 80px;
}

.hero--page .hero__text {
	flex: 0 1 auto;
	box-sizing: border-box;
	max-width: 860px;
	padding: 34px 30px 28px 123px;
}

.hero--page .hero__lead {
	max-width: 620px;
	margin-bottom: 0;
	font-size: 17px;
}

/* Contact: title on the left, Email Us / Phone columns on the right. */
.hero--contact .hero__text {
	flex: 0 0 auto;
	width: 440px;
	padding-right: 0;
}

.hero--contact .hero__lead {
	max-width: 300px;
	font-size: 15px;
}

.hero--contact .bfj-contact-info {
	position: relative;
	z-index: 2;
	flex: 1 1 auto;
	gap: 30px;
	margin: 0;
	padding: 24px 30px 24px 0;
}

/* Columns sit straight on the sand: no box, border or shadow. */
.hero--contact .bfj-contact-info__col {
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
}

.hero--contact .bfj-contact-info__icon {
	width: 44px;
	height: 44px;
	margin-bottom: 6px;
}

.hero--contact .bfj-contact-info__icon svg {
	width: 22px;
	height: 22px;
}

.hero--contact .bfj-contact-info h2 {
	margin-bottom: 8px;
	font-size: 22px;
}

.hero--contact .bfj-contact-info li {
	padding: 4px 0;
	border: 0;
}

/* Buttons */
.button,
.wp-block-button__link {
	display: inline-block;
	min-width: 141px;
	padding: 9px 22px;
	border: 0;
	border-radius: 4px;
	background: var(--bfj-gold);
	color: #fff;
	font-family: var(--bfj-font-head);
	font-size: 19px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: filter 0.15s;
}

.button:hover,
.wp-block-button__link:hover {
	color: #fff;
	filter: brightness(0.92);
}

.button--green { background: var(--bfj-green-soft); }

/* ------------------------------------------------------------------
 * Main content: white 1200px column, 30px padding
 * ------------------------------------------------------------------ */
/* Short pages: stretch the content so the footer sits at the bottom. */
body {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.admin-bar {
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 32px));
}

.site-main {
	display: flex;
	flex: 1 0 auto;
	background: var(--bfj-page);
}

.site-main > .container {
	min-height: 300px;
	padding: var(--bfj-pad);
	background: #fff;
}

.entry-title {
	margin-bottom: 20px;
	font-size: 36px;
}

.entry-content > *:last-child { margin-bottom: 0; }

.entry-content h2 { font-size: 26px; }

.post-list article + article {
	margin-top: 40px;
	padding-top: 30px;
	border-top: 1px solid var(--bfj-card);
}

.post-meta {
	margin: -10px 0 14px;
	color: var(--bfj-muted);
	font-size: 15px;
}

.pagination {
	display: flex;
	gap: 16px;
	margin-top: 30px;
}

/* Service cards (built with Columns blocks; each column has the
   "service-card" class). */
.wp-block-columns.service-grid:first-child {
	margin-top: 48px;
}

.wp-block-columns.service-grid {
	gap: 30px;
	margin: 0 0 30px;
	padding: 0 10px;
}

.wp-block-column.service-card {
	padding: 22px 25px 30px;
	min-height: 223px;
	border-radius: 8px;
	background: var(--bfj-card);
	color: var(--bfj-muted);
	font-size: 16px;
	line-height: 1.22;
}

.service-card > * { margin: 0; }

.service-card .service-icon {
	margin-bottom: 10px;
	line-height: 0;
	text-align: center;
}

.service-card .service-icon .dashicons {
	width: 48px;
	height: 48px;
	font-size: 48px;
	color: var(--bfj-gold);
}

.service-card h3 {
	margin-bottom: 14px;
	font-size: 22px;
	font-weight: 600;
	text-transform: uppercase;
}

.client-list {
	margin-top: 70px;
	margin-bottom: 50px;
}

.client-list h2 {
	margin-bottom: 14px;
	font-size: 26px;
}

.client-list p { font-size: 16px; }

.client-list .logo-carousel {
	margin-top: 36px;
}

/* ------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------ */
.site-footer {
	background: var(--bfj-footer);
	color: var(--bfj-footer-text);
	font-size: 15px;
	line-height: 1.25;
}

.site-footer .container {
	background: var(--bfj-footer-in);
}

/* Two columns: logo (1/3) and info (2/3). The info column holds three equal columns. */
.footer-widgets {
	display: grid;
	grid-template-columns: 1fr 2fr;
	gap: 30px;
	padding: 30px var(--bfj-pad) 32px;
}

.footer-brand {
	display: flex;
	align-items: center;
	justify-content: center;
}

.footer-brand a { display: block; }

.footer-brand img {
	display: block;
	width: 200px;
	max-width: 100%;
	height: auto;
}

.footer-info {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 30px;
}

@media (max-width: 960px) {
	.footer-widgets { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
	.footer-info { grid-template-columns: 1fr; }
}

.footer-col h2 {
	margin: 0 0 4px;
	color: var(--bfj-footer-head);
	font-family: var(--bfj-font-head);
	font-size: 19px;
	font-weight: 600;
}

.footer-col p { margin: 0; }

.footer-col ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer a {
	color: var(--bfj-footer-text);
}

.site-footer a:hover {
	color: var(--bfj-green);
}

.site-info {
	background: var(--bfj-charcoal);
	color: #d9d9da;
	font-size: 15px;
	text-align: center;
}

.site-info .container {
	padding: 8px var(--bfj-pad);
	background: var(--bfj-charcoal-in);
}

/* ------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------ */
@media (max-width: 1100px) {
	.main-nav ul { gap: 4px 18px; }
	.main-nav a { font-size: 18px; }
}

@media (max-width: 960px) {
	.masthead .container { flex-wrap: wrap; padding: 10px 16px; min-height: 70px; }

	.menu-toggle { display: block; }

	.main-nav {
		display: none;
		flex-basis: 100%;
		padding-bottom: 10px;
	}

	.main-nav.is-open { display: block; }

	.main-nav ul { flex-direction: column; gap: 0; }

	.main-nav a { align-self: flex-start; display: inline-block; }

	.main-nav ul ul {
		position: static;
		display: flex;
		padding: 0 0 0 16px;
		box-shadow: none;
	}

	/* Text spans the width here, so wash the whole photo. */
	.hero .container::before { background: rgba(225, 223, 214, 0.85); }
	.hero__text { max-width: none; }
	.hero--page .container { flex-direction: column; align-items: stretch; gap: 0; }
	.hero--contact .hero__text { width: auto; padding-bottom: 6px; }
	.hero--contact .bfj-contact-info { padding: 14px 30px 26px; }

	.wp-block-columns.service-grid { flex-wrap: wrap !important; padding: 0; }
	.wp-block-columns.service-grid > .service-card { flex-basis: calc(50% - 15px) !important; }
}

@media (max-width: 700px) {
	.top-bar__address { display: none; }

	.hero__text { padding: 34px 20px 28px 60px; }
	.hero__mark { left: 20px; }
	.hero__actions { margin-left: -40px; }
	.hero__title { font-size: 40px; }

	.wp-block-columns.service-grid:first-child { margin-top: 0; }

	.wp-block-columns.service-grid > .service-card { flex-basis: 100% !important; min-height: 0; }
}
