/* ==========================================================================
   Header & Footer Styles
   Generations Outdoor Design
   ========================================================================== */

/*  Site header  */
.site-header {
	color: var(--wp--preset--color--white);
	background-color: var(--wp--preset--color--primary);
	position: sticky;
	top: 0;
	z-index: 1000;
	padding: 1.438rem 1rem;
	transition: padding 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

.site-header.is-sticky {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

.site-header .container {
	--wp--style--global--content-size: 120rem;
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 16px;
	padding: 0;
}

.header-logo {
	flex: 0 1 18rem;
	display: flex;
}

/*  Logo  */
.header-logo {
	align-items: center;
}

.header-icon {
	display: flex;
	align-items: center;
}

a.header-icon:hover, div.header-icon>a:hover {
	color: var(--link-hover-color);
}

/* ── Phone / email contacts in header ───────────────────────────────────── */
.header-icon--phone,
.header-icon--email {
	gap: 6px;
	font-family: var(--wp--preset--font-family--pistara);
	letter-spacing: 0.1em;
	white-space: nowrap;
}

.header-logo a {
	display: block;
}

.header-logo {
	transition: all 0.3s ease;
}

.header-logo .site-title {
	margin: 0;
}

/*  Navigation  */
.main-navigation {
	font-family: var(--wp--preset--font-family--pistara);
	text-transform: uppercase;
	line-height: 1.08;
	letter-spacing: 1.28px;
}

.main-navigation ul {
	list-style: none;
}

.main-navigation a {
	transition: color 0.2s;
}

.main-navigation a:hover, .main-navigation a:hover~.sub-menu-toggle, .main-navigation .current_page_item>a, .main-navigation .current-menu-parent>a, .main-navigation .current-menu-parent>.sub-menu-toggle,
.site-header.is-sticky .main-navigation a:hover, .site-header.is-sticky .main-navigation .current_page_item>a, .site-header.is-sticky a.header-icon:hover, .site-header.is-sticky div.header-icon>a:hover,
#nav-drawer .main-navigation a:hover, #nav-drawer .main-navigation .current_page_item>a {
	color: var(--wp--preset--color--black);
}

/*  Equal-width desktop nav items  */
/* #site-navigation fills the row; the ul then has a defined  */
/* width for flex: 1 1 0 to divide equally across all items.  */
#site-navigation {
	display: flex;
	align-items: center;
}

#site-navigation ul:not(.sub-menu) {
	display: flex;
	gap: 1.438rem;
	width: 100%;
}

/* ── Sub-menu toggle button ───────────────────────────────────────────────── */
.sub-menu-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: transparent;
	border: none;
	cursor: pointer;
	color: inherit;
	padding: 0 8px 4px;
	transition: color 0.2s ease;
}

.sub-menu-toggle:hover,
.sub-menu-toggle:focus-visible {
	color: var( --wp--preset--color--primary );
	outline: none;
}

/* CSS-drawn chevron — consistent with accordion + TOC chevrons */
.sub-menu-toggle-icon {
	display: block;
	width: 0;
	height: 0;
	border-style: solid;
    border-width: 0px 5px 5px 5px;
    border-color: transparent transparent currentColor transparent;
	transform: rotate( 180deg );
	transition: transform 0.2s ease;
}

.sub-menu-toggle[aria-expanded="true"] .sub-menu-toggle-icon {
	transform: rotate( -135deg );
	margin-bottom: -2px;
}

/* ── Desktop nav items ────────────────────────────────────────────────────── */
#site-navigation .menu>li {
	flex: 1 1 0;
	position: relative; /* anchor for the absolute dropdown */
}

/* Items with children become flex rows: link takes remaining width, toggle button appended */
#site-navigation .menu>.menu-item-has-children {
	display: flex;
	justify-content: center;
}

#site-navigation a {
	display: block;
	text-align: center;
	padding-left: 12px;
	padding-right: 12px;
	white-space: nowrap;
}

/* ── Desktop dropdown submenu ─────────────────────────────────────────────── */
#site-navigation li.menu-item-has-children > a {
	padding-right: 0;
}

#site-navigation .sub-menu {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 175px;
	list-style: none;
	padding: 1.5rem 1rem;
	margin: 0;
	background: var( --wp--preset--color--white );
	border: 1px solid var( --wp--preset--color--primary );
	border-radius: 4px;
	box-shadow: 0 6px 20px rgba( 0, 0, 0, 0.12 );
	opacity: 0;
	visibility: hidden;
	transform: translateY( -4px );
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	z-index: 999;
	margin-top: 50px
}

.site-header.is-sticky #site-navigation .sub-menu {
	margin-top: 40px
}

#site-navigation .sub-menu:before {
	content: '';
	width: 0; height: 0;
	border-style: solid;
	border-width: 0px 9px 9px 9px;
	border-color: transparent transparent var(--wp--preset--color--primary) transparent;
	transform: rotate(0deg);
	position: absolute;
	top: -9px;
}

#site-navigation .menu-item-has-children:hover>.sub-menu,
#site-navigation .menu-item-has-children.is-open>.sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY( 0 );
}

#site-navigation .sub-menu li {
	flex: none; /* reset equal-width layout inherited from top-level */
	min-width: 0;
}

#site-navigation .sub-menu a {
	display: block;
	text-align: left;
	text-transform: none;
	white-space: nowrap;
	font-size: 1.125rem;
	padding-top: 5px;
	padding-bottom: 5px;
}

#site-navigation .sub-menu a:hover,
#site-navigation .sub-menu .current-menu-item>a {
	color: var( --link-hover-color );
}

/* Quote button mobile icon — hidden on desktop, shown on mobile */
.btn-quote .btn-icon-mobile {
	display: none;
}

/*  Social icons  */
.header-social {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 14px;
}

.social-accounts {
	list-style: none;
	display: flex;
	align-items: center;
	gap: var(--sa-gap);
	padding-left: 0;
}

/* Base — shared by all layouts */
.social-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Layout 1 — light bg: primary icon on primary/20% rounded button */
.social-accounts--layout-1 .social-link {
	width: var(--sa-size, 40px);
	height: var(--sa-size, 40px);
	border-radius: 6.72px;
	color: var(--wp--preset--color--primary);
	background-color: rgba(252, 132, 34, 0.2);
}

.social-accounts--layout-1 .social-link:hover {
	background-color: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
}

/* Layout 2 — dark bg: primary icon on grey/20% rounded button */
.social-accounts--layout-2 .social-link {
	width: var(--sa-size, 40px);
	height: var(--sa-size, 40px);
	border-radius: 6.72px;
	color: var(--wp--preset--color--primary);
	background-color: rgba(169, 171, 174, 0.2);
}

.social-accounts--layout-2 .social-link:hover {
	color: var(--wp--preset--color--white);
	background-color: var(--wp--preset--color--primary);
}

.social-link svg {
	fill: currentColor;
}

/* ==========================================================================
   Overlay header — used on pages with banner-media.php or banner-default.php
   ========================================================================== */

.site-header-overlay {
	width: 100%;
	box-shadow: none;
	position: fixed;
	background-color: transparent
}

.site-header-overlay.is-sticky {
	background-color: var(--wp--preset--color--primary);
}

.site-header-overlay:not(.is-sticky) #site-navigation .menu > li > a,
.site-header-overlay:not(.is-sticky) #site-navigation .sub-menu-toggle {
	color: var(--wp--preset--color--white);
}

.site-header-overlay:not(.is-sticky) #site-navigation .menu > li > a:hover,
.site-header-overlay:not(.is-sticky) #site-navigation .menu > li > a:hover ~ .sub-menu-toggle,
.site-header-overlay:not(.is-sticky) #site-navigation .menu > .current_page_item > a,
.site-header-overlay:not(.is-sticky) #site-navigation .menu > .current-menu-parent > a,
.site-header-overlay:not(.is-sticky) #site-navigation .menu > .current-menu-parent > .sub-menu-toggle {
	color: var(--wp--preset--color--primary);
}

/*  Hamburger button — hidden on desktop  */
#nav-toggle {
	padding: 5px;
	display: none;
}

/*  Desktop (≥ 1200px)  */
@media (min-width: 1200px) {
	.site-header {
		padding-left: 1.5rem;
		padding-right: 1.5rem;
	}

	.header-icon--email {
		font-size: 1.1rem
	}
}

@media (min-width: 1440px) {
	.site-header {
		padding-left: 2.938rem;
		padding-right: 2.938rem;
	}

	#site-navigation .menu>li {
		min-width: 155px;
	}
}

/*  Tablet (≤ 1199px)  */
@media (min-width:1023px) and (max-width: 1199px){

	.social-accounts.header-social {
		--sa-gap: 1rem !important;
	}

}

/*  Mobile (≤ 768px)  */
@media (min-width: 601px) {
	.site-header {
		top: var(--wp-admin--admin-bar--height, 0)
	}
}

@media (max-width: 1023px) {

	#site-navigation {
		display: none;
	}

	.site-header .container {
		gap: 5px;
	}

	/* Center column = logo */
	.header-logo {
		justify-self: center;
		width: 30%;
		margin: auto;
		flex-basis: auto;
	}

	/* Show quote icon on mobile */
	.btn-quote .btn-icon-mobile {
		display: block;
	}

	/* Show hamburger — left column, colors from .btn-primary */
	#nav-toggle {
		display: flex;
		margin: auto 159px auto 0;
	}

	.nav-toggle {
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		padding: 0;
		grid-column: 1;
		justify-self: start;
		align-self: start;
	}
}

/*  Offcanvas overlay  */
#nav-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 1100;
	opacity: 0;
	transition: opacity 0.3s ease;
}

body.nav-open #nav-overlay {
	display: block;
	opacity: 1;
}

/*  Offcanvas drawer  */
#nav-drawer {
	position: fixed;
	top: 0;
	left: 0;
	bottom: 0;
	width: min(280px, 100vw);
	background-color: var(--wp--preset--color--primary); /* gold */
	z-index: 1200;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	display: flex;
	flex-direction: column;
	padding: 20px;
	overflow-y: auto;
	color: var(--wp--preset--color--white);
}

#primary-menu, #mobile-primary-menu {
	padding-left: 0;
}

/* ── Drawer contact links (phone + email) ─────────────────────────────────── */
.drawer-contacts {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-top: 24px;
}

.drawer-contacts .header-email__address {
	color: inherit;
}

body.nav-open #nav-drawer {
	transform: translateX(0);
}

/* Close button inside drawer */
.nav-drawer-close {
	align-self: flex-end;
	background: transparent;
	border: none;
	color: #ffffff;
	cursor: pointer;
	padding: 4px;
	margin-bottom: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s ease;
}

.nav-drawer-close:hover {
	color: #000000;
}

/* Drawer nav — vertical stack */
#nav-drawer .main-navigation ul:not(.sub-menu) {
	flex-direction: column;
	gap: 0;
}

#nav-drawer .main-navigation a {
	display: block;
	padding: 12px 0;
	font-size: 1rem;
	color: #ffffff;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.12 );
	transition: color 0.2s ease;
}

/* ── Drawer: items with children ──────────────────────────────────────────── */
/* Flex row so the link and toggle chevron sit on the same line */
#nav-drawer .menu-item-has-children {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.12 );
}

/* The link fills the row; remove its own border (the LI carries it now) */
#nav-drawer .menu-item-has-children>a {
	flex: 1;
	border-bottom: none;
}

#nav-drawer .menu-item-has-children>.sub-menu-toggle {
	color: #ffffff;
	padding: 12px 4px 12px 8px;
	transition: color 0.2s ease;
}

#nav-drawer .menu-item-has-children>.sub-menu-toggle:hover {
	color: #000000;
}

/* Collapsible submenu — lives on its own row via flex-basis: 100% */
#nav-drawer .sub-menu {
	flex-basis: 100%;
	list-style: none;
	padding-left: 1rem;
	border-left: 2px solid rgba( 255, 255, 255, 0.5 );
	margin: 0 0 4px;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

#nav-drawer .menu-item-has-children.is-open>.sub-menu {
	max-height: 600px;
}

#nav-drawer .sub-menu a {
	padding: 8px 0;
	font-size: 0.9rem;
	color: #ffffff;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
	transition: color 0.2s ease;
}

#nav-drawer .sub-menu a:hover {
	color: #000000;
}

#nav-drawer .sub-menu li:last-child a {
	border-bottom: none;
}

/* Social icons inside drawer */
.drawer-social {
	list-style: none;
	display: flex;
	gap: 18px;
	margin-top: 28px;
}

/*  Site footer  */
.site-footer .menu .current_page_item>a, .footer-contact__item a:hover{
	color: var(--wp--preset--color--primary);
}

/* Footer area — 5-column responsive grid */
#footer-area {
	font-weight: 500;
	display: flex;
	gap: 2rem 1rem;
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--40);
	align-items: flex-start;
	justify-content: space-between;
}

#footer-area .footer-nav,
#footer-area .footer-contact,
#footer-area .footer-form {
	font-family: var(--wp--preset--font-family--pistara);
	font-size: 0.813rem;
	letter-spacing: 1.04px;
	line-height: 1.81;
	text-transform: uppercase;
	-webkit-text-stroke-width: 0.3px;
	-webkit-text-stroke-color: currentColor;
}

#footer-area .footer-brand  { flex: 0 1 460px }
#footer-area .footer-contact { flex: 0 1 215px; }
#footer-area .footer-form { flex: 0 1 268px; }

/* Column 1: Brand */
.footer-logo img {
	max-width: 374px;
	margin-bottom: var(--wp--preset--spacing--24);
}

.footer-logo-caption {
	font-size: 0.875rem;
	font-weight: 400;
	margin-bottom: 0;
}

/* Column heading shared by all footer columns */
.footer-col-title {
	color: var(--wp--preset--color--primary);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1;
	text-transform: uppercase;
	margin-bottom: var(--wp--preset--spacing--20);
	letter-spacing: 1.28px;
	-webkit-text-stroke-width: 1px;
	-webkit-text-stroke-color: currentColor;
}

/* Columns 2–4: Nav menus */
.footer-nav ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-nav li, .footer-contact__item {
	margin-bottom: 0.5rem;
}

.footer-nav a:hover {
	color: var(--wp--preset--color--primary);
}

/* Column 5: Contact */
.footer-contact__item {
	display: flex;
	align-items: flex-start;
	gap: 0.625rem;
	font-style: normal;
}

.footer-contact__item svg {
	flex-shrink: 0;
	margin-top: 0.2em;
	color: var(--wp--preset--color--primary);
}

.footer-contact .social-accounts {
	margin-top: var(--wp--preset--spacing--20)
}

/* Colophon bar */
#colophon {
	font-size: 0.75rem;
	line-height: 1.66;
	text-align: center;
	text-transform: uppercase;
	padding-top: var(--wp--preset--spacing--20);
}

#colophon > .container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0 1rem;
}

#colophon ul, #colophon p {
	margin: 0 auto 1rem;
}

#copyright, #colophon a:hover {
	color: var(--wp--preset--color--primary);
}

#copyright {
	flex: auto;
}

#copyright a:hover {
	color: var(--wp--preset--color--black);
}

#colophon ul {
	list-style: none;
	display: inline-block;
	padding: 0;
	white-space: nowrap;
}

#colophon li {
	flex: 1 0;
}

@media (max-width: 1279px) {
	#footer-area .footer-brand {
		flex-basis: 280px;
	}
}

@media (max-width: 1053px) {
	#footer-area .footer-brand {
		flex-basis: 200px;
	}
}

@media (max-width: 1024px) {
	#footer-area {
		flex-wrap: wrap;
		justify-content: center;
	}

	#footer-area .footer-brand {
		flex: 1 0 60%;
        display: flex;
        flex-direction: column;
	}

	.footer-logo-caption {
		max-width: 500px;
	}

	#footer-area .footer-nav {
		flex: auto
	}
}

@media (min-width:768px) and (max-width: 1024px) {
	#footer-area .footer-brand, #footer-area .footer-form {
		order: -1
	}
}

@media (max-width: 767px) {
	#footer-area {
		--wp--style--global--content-size: 500px;
	}

	#footer-area .footer-brand {
		text-align: center;
        align-items: center;
	}

	#footer-area .footer-nav,
	#footer-area .footer-contact,
	#footer-area .footer-form { flex: 1 0 100%; text-align: center }

	.footer-contact__item, .footer-contact .social-accounts {
		justify-content: center;
	}

	.footer-form .gform_wrapper {
		margin: auto;
	}

	#colophon ul, #colophon p {
		flex: 1 0 100%;
	}
}

@media (max-width: 640px) {
	.header-logo {
		flex: 1;
		display: flex;
		justify-content: center;
		margin: 0;
		width: auto;
		max-width: none;
	}

	.header-logo a img {
		max-width: 280px;
	}

	#nav-toggle {
		margin-right: 0;
	}

	.header-icons {
		flex: 0 0 36px;
	}

	a.header-icon:hover, div.header-icon>a:hover {
		color: var(--wp--preset--color--black);
	}

	#masthead .header-icon--phone,
	#masthead .header-icon--email {
		display: none;
	}

	#footer-area {
		font-size: 0.75rem;
		gap: 2rem;
	}
}