/*
 * Components — site header, navigation, footer, trust strip.
 * Reusable component patterns for the BBW design system.
 */

/*--------------------------------------------------------------
# Site Header
--------------------------------------------------------------*/

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: var(--paper);
	border-bottom: 1px solid var(--rule);
	height: var(--header-height);
	display: flex;
	align-items: center;
}

.header-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-4);
	width: 100%;
}

/*--------------------------------------------------------------
# Site Branding
--------------------------------------------------------------*/

.site-branding {
	flex-shrink: 0;
}

.site-name-link {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	line-height: 1.2;
}

.site-name-link:hover,
.site-name-link:focus {
	text-decoration: none;
}

.site-name {
	font-family: 'Fraunces', Georgia, serif;
	font-size: var(--text-lg);
	font-weight: 700;
	color: var(--ink);
	letter-spacing: -0.01em;
}

.site-name-amp {
	color: var(--gold);
}

.site-tagline {
	font-family: 'Inter', sans-serif;
	font-size: var(--text-xs);
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--mute);
}

/* Custom logo when uploaded */
.custom-logo-link {
	display: inline-block;
}

.custom-logo {
	height: 44px;
	width: auto;
	max-width: 220px;
}

/*--------------------------------------------------------------
# Main Navigation
--------------------------------------------------------------*/

.main-navigation {
	flex: 1;
	display: flex;
	justify-content: center;
}

.main-navigation ul {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: var(--space-1);
}

.main-navigation ul ul {
	display: none;
	position: absolute;
	top: 100%;
	left: 0;
	background-color: var(--paper);
	border: 1px solid var(--rule);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	min-width: 200px;
	z-index: 99;
}

.main-navigation li {
	position: relative;
}

.main-navigation li:hover > ul,
.main-navigation li.focus > ul {
	display: block;
}

.main-navigation ul ul a {
	padding: var(--space-2) var(--space-4);
	font-size: var(--text-sm);
}

.main-navigation a {
	display: block;
	padding: var(--space-2) var(--space-3);
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 500;
	color: var(--ink);
	text-decoration: none;
	border-radius: 4px;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
	color: var(--wine);
	background-color: rgba(107, 31, 61, 0.05);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: var(--wine);
}

/*--------------------------------------------------------------
# Dropdown affordance — caret on parent items with children
--------------------------------------------------------------*/

.main-navigation .menu-item-has-children > a {
	padding-right: calc(var(--space-3) + 12px);
	position: relative;
}

.main-navigation .menu-item-has-children > a::after {
	content: '';
	position: absolute;
	right: var(--space-2);
	top: 50%;
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-75%) rotate(45deg);
	opacity: 0.6;
}

/* Hamburger toggle — hidden on desktop */
.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	background: transparent;
	border: none;
	padding: var(--space-2);
	cursor: pointer;
	width: 40px;
	height: 40px;
}

.menu-toggle-bar {
	display: block;
	width: 22px;
	height: 2px;
	background-color: var(--ink);
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

.main-navigation.toggled .menu-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.main-navigation.toggled .menu-toggle-bar:nth-child(2) {
	opacity: 0;
}

.main-navigation.toggled .menu-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/*--------------------------------------------------------------
# Header Actions (phone + search)
--------------------------------------------------------------*/

.header-actions {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	gap: var(--space-1);
}

.header-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-width: 44px;
	min-height: 44px;
	padding: 0 var(--space-2);
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--ink);
	background: transparent;
	border: none;
	border-radius: 4px;
	text-decoration: none;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.header-icon:visited {
	color: var(--ink);
}

.header-icon:hover,
.header-icon:focus {
	color: var(--wine);
	background-color: rgba(107, 31, 61, 0.05);
}

.header-icon svg {
	flex-shrink: 0;
}

.header-icon__label {
	font-size: var(--text-sm);
	font-weight: 600;
}

/* Search icon — mobile-only; hidden on desktop where the search lives
   on the Buy archive page and doesn't need a header shortcut. */
.header-icon--search {
	display: none;
}

@media (max-width: 860px) {
	.header-icon--search {
		display: inline-flex;
		order: 1; /* sits between hamburger (-1) and phone (default 0) */
	}

	/* Hide the phone text label on mobile — icon only */
	.header-icon--phone .header-icon__label {
		display: none;
	}

	.header-icon--phone {
		padding: 0 var(--space-2);
	}
}

/*--------------------------------------------------------------
# Header search dropdown panel
# Sits below the header, expanded via JS on the search icon click.
--------------------------------------------------------------*/

.header-search-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 90;
	background-color: var(--paper);
	border-bottom: 1px solid var(--rule);
	box-shadow: 0 4px 12px rgba(26, 31, 36, 0.06);
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.25s ease;
}

.header-search-panel.is-open {
	max-height: 80vh;
	overflow-y: auto;
}

.header-search-panel__inner {
	max-width: var(--container-max);
	margin-inline: auto;
	padding: var(--space-5);
}

.header-search-panel__alt {
	margin: var(--space-4) 0 0;
	font-size: var(--text-sm);
	color: var(--mute);
}

.header-search-panel__alt a {
	color: var(--wine);
}

/* Constrain PropertyHive's search form inside the panel — it ships
   with grid-style layout that needs a sensible max-width here. */
.header-search-panel form,
.header-search-panel .property-search-form {
	max-width: 720px;
	margin-inline: auto;
}

/*--------------------------------------------------------------
# Mobile Navigation
--------------------------------------------------------------*/

@media (max-width: 860px) {
	.menu-toggle {
		display: flex;
		order: -1;
	}

	.main-navigation {
		justify-content: flex-start;
	}

	.main-navigation ul {
		display: none;
	}

	.main-navigation.toggled ul {
		display: flex;
		flex-direction: column;
		position: absolute;
		top: var(--header-height);
		left: 0;
		right: 0;
		background-color: var(--paper);
		border-bottom: 1px solid var(--rule);
		padding: var(--space-3) var(--space-5);
		gap: 0;
		box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
	}

	.main-navigation.toggled a {
		padding: var(--space-3) var(--space-2);
		font-size: var(--text-base);
		border-bottom: 1px solid var(--rule);
		border-radius: 0;
	}

	.main-navigation.toggled li:last-child > a {
		border-bottom: none;
	}

	/* Flat dropdown on mobile (Option 2):
	   sub-menu items render inline as siblings in the hamburger overlay. */
	.main-navigation.toggled ul ul {
		display: block;
		position: static;
		background: transparent;
		border: none;
		box-shadow: none;
		min-width: 0;
		padding: 0;
	}

	.main-navigation.toggled ul ul a {
		padding: var(--space-3) var(--space-2);
		font-size: var(--text-base);
		border-bottom: 1px solid var(--rule);
		border-radius: 0;
	}

	/* Parent dropdown trigger reads as a muted section header on mobile,
	   since its href is inert and the children are already visible below. */
	.main-navigation.toggled .menu-item-has-children > a {
		color: var(--mute);
		font-size: var(--text-xs);
		font-weight: 600;
		letter-spacing: 0.12em;
		text-transform: uppercase;
		padding-right: var(--space-2);
	}

	.main-navigation.toggled .menu-item-has-children > a::after {
		display: none;
	}
}

/*--------------------------------------------------------------
# Site Footer
--------------------------------------------------------------*/

.site-footer {
	background-color: var(--ink);
	color: var(--bone);
}

.footer-main {
	padding-top: var(--space-8);
	padding-bottom: var(--space-7);
}

.footer-grid {
	display: grid;
	grid-template-columns: 2fr 1fr 1fr;
	gap: var(--space-6);
}

/* Brand column */
.footer-brand .footer-site-name {
	font-family: 'Fraunces', Georgia, serif;
	font-size: var(--text-xl);
	font-weight: 700;
	color: var(--paper);
	margin-bottom: var(--space-2);
}

.footer-brand .footer-tagline {
	font-size: var(--text-sm);
	color: var(--gold);
	letter-spacing: 0.02em;
	margin-bottom: var(--space-3);
}

.footer-brand .footer-heritage {
	font-size: var(--text-sm);
	color: rgba(250, 247, 242, 0.6);
	line-height: 1.6;
	margin-bottom: 0;
}

/* Office columns */
.footer-office-name {
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--paper);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: var(--space-3);
}

.footer-office address {
	font-size: var(--text-sm);
	color: rgba(250, 247, 242, 0.7);
	line-height: 1.7;
	margin-bottom: var(--space-3);
}

.footer-office p {
	font-size: var(--text-sm);
	color: rgba(250, 247, 242, 0.7);
	margin-bottom: var(--space-2);
}

.footer-office a {
	color: rgba(250, 247, 242, 0.85);
	text-decoration: none;
	transition: color 0.15s ease;
}

.footer-office a:visited {
	color: rgba(250, 247, 242, 0.85);
}

.footer-office a:hover,
.footer-office a:focus {
	color: var(--gold);
}

/* Quick links column */
.footer-nav-title {
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--paper);
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: var(--space-3);
}

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

.footer-nav li {
	margin-bottom: var(--space-2);
}

.footer-nav a {
	font-size: var(--text-sm);
	color: rgba(250, 247, 242, 0.7);
	text-decoration: none;
	transition: color 0.15s ease;
}

.footer-nav a:visited {
	color: rgba(250, 247, 242, 0.7);
}

.footer-nav a:hover,
.footer-nav a:focus {
	color: var(--gold);
}

/*--------------------------------------------------------------
# Trust Strip
--------------------------------------------------------------*/

.trust-strip {
	background-color: var(--wine-dark);
	padding: var(--space-5) 0;
	border-top: 1px solid rgba(201, 169, 97, 0.3);
}

.trust-strip-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-5);
	flex-wrap: wrap;
}

.trust-badges {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.trust-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 48px;
	padding: 8px 14px;
	background-color: var(--paper);
	border-radius: 3px;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.trust-badge img {
	display: block;
	height: 100%;
	width: auto;
	max-width: 160px;
	object-fit: contain;
}

.trust-badge:hover,
.trust-badge:focus {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.trust-text {
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	color: rgba(250, 247, 242, 0.7);
	margin: 0;
}

/*--------------------------------------------------------------
# Footer Legal Bar
--------------------------------------------------------------*/

.footer-legal {
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	padding: var(--space-4) 0;
}

.footer-legal__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-3);
	flex-wrap: wrap;
}

.footer-legal p {
	font-size: var(--text-xs);
	color: rgba(250, 247, 242, 0.7);
	margin: 0;
}

.footer-legal__credit a {
	color: rgba(250, 247, 242, 0.7);
	text-decoration: none;
	transition: color 0.15s ease;
}

.footer-legal__credit a:hover,
.footer-legal__credit a:focus {
	color: var(--gold);
}

/*--------------------------------------------------------------
# Footer — Responsive
--------------------------------------------------------------*/

@media (max-width: 900px) {
	.footer-grid {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-5);
	}

	.footer-brand {
		grid-column: 1 / -1;
	}

	.trust-strip-inner {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-3);
	}
}

@media (max-width: 600px) {
	.footer-grid {
		grid-template-columns: 1fr;
		gap: var(--space-5);
	}

	.footer-main {
		padding-top: var(--space-7);
		padding-bottom: var(--space-6);
	}
}

/*--------------------------------------------------------------
# Section Header — reusable eyebrow + title + intro pattern
--------------------------------------------------------------*/

.section-header {
	margin-bottom: var(--space-6);
}

.section-header .eyebrow {
	margin-bottom: var(--space-2);
}

.section-header h2,
.section-header h3 {
	margin-bottom: var(--space-3);
}

.section-header .lead {
	max-width: 640px;
}

.section-header--centered {
	text-align: center;
}

.section-header--centered .lead {
	margin-left: auto;
	margin-right: auto;
}

/*--------------------------------------------------------------
# Buttons
--------------------------------------------------------------*/

.btn {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2);
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	border-radius: 4px;
	padding: 0.75rem 1.5rem;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
	border: 2px solid transparent;
}

.btn--primary {
	background-color: var(--wine);
	color: var(--paper);
	border-color: var(--wine);
}

.btn--primary:visited {
	color: var(--paper);
}

.btn--primary:hover,
.btn--primary:focus {
	background-color: var(--wine-dark);
	border-color: var(--wine-dark);
	color: var(--paper);
}

.btn--outline {
	background-color: transparent;
	color: var(--wine);
	border-color: var(--wine);
}

.btn--outline:visited {
	color: var(--wine);
}

.btn--outline:hover,
.btn--outline:focus {
	background-color: var(--wine);
	color: var(--paper);
}

.btn--ghost {
	background-color: transparent;
	color: var(--ink);
	border-color: var(--rule);
}

.btn--ghost:hover,
.btn--ghost:focus {
	border-color: var(--ink);
	color: var(--ink);
}

/* Outline variant for use on dark/photo backgrounds */
.btn--outline--light {
	background-color: transparent;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.7);
}

.btn--outline--light:visited {
	color: #fff;
}

.btn--outline--light:hover,
.btn--outline--light:focus {
	background-color: rgba(255, 255, 255, 0.15);
	border-color: #fff;
	color: #fff;
}

/* Standard WP form buttons — reset to match design system */
button,
input[type="button"],
input[type="reset"],
input[type="submit"] {
	display: inline-flex;
	align-items: center;
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 600;
	line-height: 1;
	background-color: var(--wine);
	color: var(--paper);
	border: 2px solid var(--wine);
	border-radius: 4px;
	padding: 0.75rem 1.5rem;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

button:hover,
input[type="button"]:hover,
input[type="reset"]:hover,
input[type="submit"]:hover {
	background-color: var(--wine-dark);
	border-color: var(--wine-dark);
}

/*--------------------------------------------------------------
# 404 page — error-404 component
--------------------------------------------------------------*/

.error-404 {
	padding: var(--space-9) var(--space-5) var(--space-8);
	background-color: var(--bone);
}

.error-404__inner {
	max-width: var(--prose-max);
	margin-inline: auto;
	text-align: center;
}

.error-404__eyebrow {
	display: inline-block;
	font-family: 'Fraunces', Georgia, serif;
	font-size: clamp(3rem, 8vw, 5rem);
	font-weight: 700;
	color: var(--gold);
	line-height: 1;
	margin-bottom: var(--space-4);
}

.error-404__title {
	font-family: 'Fraunces', Georgia, serif;
	font-size: clamp(var(--text-xl), 4vw, var(--text-3xl));
	font-weight: 700;
	line-height: 1.15;
	color: var(--ink);
	margin: 0 0 var(--space-5);
}

.error-404__rule {
	width: 60px;
	height: 2px;
	background-color: var(--gold);
	border: none;
	margin: 0 auto var(--space-5);
}

.error-404__lead {
	font-size: var(--text-lg);
	line-height: 1.6;
	color: var(--mute);
	margin: 0 0 var(--space-6);
}

.error-404__search {
	margin: 0 0 var(--space-6);
	text-align: left;
}

.error-404__nav {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3) var(--space-5);
	justify-content: center;
	padding-top: var(--space-5);
	border-top: 1px solid var(--rule);
}

.error-404__nav a {
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 600;
	color: var(--wine);
	text-decoration: none;
}

.error-404__nav a:hover,
.error-404__nav a:focus {
	color: var(--wine-dark);
	text-decoration: underline;
}

@media (max-width: 600px) {
	.error-404 {
		padding: var(--space-7) var(--space-4) var(--space-7);
	}
}

/*--------------------------------------------------------------
# Mobile sticky bottom bar
# Visible only at <= 860px. Two equal-width CTAs: Call + Valuation.
# Reserves bottom space so content doesn't sit under the bar.
--------------------------------------------------------------*/

.mobile-bar {
	display: none;
}

@media (max-width: 860px) {
	.mobile-bar {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 0;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 200;
		background-color: var(--paper);
		border-top: 1px solid var(--rule);
		box-shadow: 0 -2px 8px rgba(26, 31, 36, 0.06);
	}

	.mobile-bar__btn {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: var(--space-2);
		min-height: 56px;
		padding: var(--space-3);
		font-family: 'Inter', sans-serif;
		font-size: var(--text-sm);
		font-weight: 600;
		letter-spacing: 0.01em;
		text-decoration: none;
		border: none;
		transition: background-color 0.15s ease;
	}

	.mobile-bar__btn--call {
		color: var(--ink);
		background-color: var(--paper);
		border-right: 1px solid var(--rule);
	}

	.mobile-bar__btn--call:visited {
		color: var(--ink);
	}

	.mobile-bar__btn--call:hover,
	.mobile-bar__btn--call:focus {
		background-color: var(--bone);
		color: var(--ink);
	}

	.mobile-bar__btn--cta {
		color: var(--paper);
		background-color: var(--wine);
	}

	.mobile-bar__btn--cta:visited {
		color: var(--paper);
	}

	.mobile-bar__btn--cta:hover,
	.mobile-bar__btn--cta:focus {
		background-color: var(--wine-dark);
		color: var(--paper);
	}

	/* Reserve bottom space so the bar doesn't cover content */
	body {
		padding-bottom: 56px;
	}
}

/*--------------------------------------------------------------
# Form inputs
--------------------------------------------------------------*/

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
textarea,
select {
	width: 100%;
	font-family: 'Inter', sans-serif;
	font-size: var(--text-base);
	color: var(--ink);
	background-color: var(--paper);
	border: 1px solid var(--rule);
	border-radius: 4px;
	padding: 0.625rem 0.875rem;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	appearance: none;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="url"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="number"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
	outline: none;
	border-color: var(--wine);
	box-shadow: 0 0 0 3px rgba(107, 31, 61, 0.15);
}

textarea {
	resize: vertical;
	min-height: 120px;
}

label {
	display: block;
	font-family: 'Inter', sans-serif;
	font-size: var(--text-sm);
	font-weight: 500;
	color: var(--ink);
	margin-bottom: var(--space-1);
}

.form-group {
	margin-bottom: var(--space-4);
}
