/*
 * Global chrome: header, mega menu, mobile nav, footer, base utility
 * classes. Block-specific styling lives alongside each block (see
 * blocks/*\/style.css) so pages that don't use a block don't load its CSS.
 */

/* ---------------------------------------------------------------- */
/* Reset-ish base                                                     */
/* ---------------------------------------------------------------- */

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

body.ggc-no-scroll {
	overflow: hidden;
}

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

.ggc-skip-link {
	position: fixed;
	top: -100px;
	left: 1rem;
	z-index: 10000;
	background: var( --wp--preset--color--primary );
	color: var( --wp--preset--color--surface );
	padding: 0.75rem 1.25rem;
	transition: top 0.2s ease;
}

.ggc-skip-link:focus {
	top: 1rem;
	width: auto;
	height: auto;
	clip: auto;
}

.ggc-main {
	display: block;
}

/* ---------------------------------------------------------------- */
/* Buttons (shared shape; theme.json owns the default button style)  */
/* ---------------------------------------------------------------- */

.ggc-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 1rem 2rem;
	font-family: var( --wp--preset--font-family--body );
	font-weight: 700;
	font-size: var( --wp--preset--font-size--small );
	letter-spacing: 0.03em;
	text-transform: uppercase;
	text-decoration: none;
	border: 1px solid transparent;
	border-radius: 2px;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
	white-space: nowrap;
}

.ggc-button--solid {
	background: var( --wp--preset--color--primary );
	color: var( --wp--preset--color--surface );
}

.ggc-button--solid:hover {
	background: var( --wp--preset--color--accent );
	color: var( --wp--preset--color--surface );
}

.ggc-button--ghost {
	background: transparent;
	border-color: currentColor;
	color: inherit;
}

.ggc-button--ghost:hover {
	background: var( --wp--preset--color--accent );
	border-color: var( --wp--preset--color--accent );
	color: var( --wp--preset--color--surface );
}

/* Restrained hover affordance: a short arrow that slides in from the left
   of the label, shared by every .ggc-button across the site (hero, featured
   project, CTA section, mega-menu panel). One motion idiom, not a different
   trick per component. */
.ggc-button::after {
	content: "";
	display: inline-block;
	width: 0;
	margin-left: 0;
	height: 1px;
	background: currentColor;
	opacity: 0;
	transition: width 0.25s ease, margin-left 0.25s ease, opacity 0.25s ease;
}

.ggc-button:hover::after,
.ggc-button:focus-visible::after {
	width: 1.1rem;
	margin-left: 0.6rem;
	opacity: 1;
}

@media ( prefers-reduced-motion: reduce ) {
	.ggc-button::after {
		transition: none;
	}
}

/* ---------------------------------------------------------------- */
/* Global focus-visible                                              */
/* ---------------------------------------------------------------- */

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

/* ---------------------------------------------------------------- */
/* Header                                                             */
/* ---------------------------------------------------------------- */

.ggc-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 1000;
}

.ggc-header__bar {
	position: relative;
	z-index: 2;
	background: transparent;
	color: var( --wp--preset--color--surface );
	transition: background-color 0.35s ease, box-shadow 0.35s ease, color 0.35s ease;
}

.ggc-header.is-scrolled .ggc-header__bar,
.ggc-header.has-open-menu .ggc-header__bar {
	background: var( --wp--preset--color--primary );
	box-shadow: 0 1px 0 rgba( 255, 255, 255, 0.08 );
}

/* Page-dimming scrim behind an open mega-menu panel. Sits above page
   content but below the header bar/panel (z-index 1, bar is 2). Opacity/
   visibility transition rather than display so it can be animated and so
   a screen reader never has to deal with it (aria-hidden, no interactive
   role — the click-to-close handler is a bonus for mouse users only). */
.ggc-header__backdrop {
	position: fixed;
	inset: 0;
	z-index: 1;
	background: var( --wp--preset--color--primary );
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.ggc-header__backdrop.is-active {
	opacity: 0.55;
	visibility: visible;
}

@media ( prefers-reduced-motion: reduce ) {
	.ggc-header__backdrop {
		transition: none;
	}
}

.ggc-header__inner {
	max-width: var( --wp--style--global--wide-size, 1280px );
	margin: 0 auto;
	padding: 1rem 1.5rem;
	display: flex;
	align-items: center;
	gap: 2rem;
}

.ggc-header__logo {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.ggc-header__logo img {
	height: 48px;
	width: auto;
	display: block;
}

.ggc-header__wordmark {
	font-family: var( --wp--preset--font-family--heading );
	font-size: var( --wp--preset--font-size--large );
	color: currentColor;
}

.ggc-header__actions {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	margin-left: auto;
}

.ggc-header__phone {
	color: currentColor;
	text-decoration: none;
	font-weight: 700;
	white-space: nowrap;
}

.ggc-header__cta {
	border-color: currentColor;
}

@media ( max-width: 900px ) {
	.ggc-header__phone,
	.ggc-header__cta {
		display: none;
	}
}

/* ---------------------------------------------------------------- */
/* Desktop mega menu                                                  */
/* ---------------------------------------------------------------- */

.ggc-mega-menu {
	flex-grow: 1;
}

.ggc-mega-menu__list {
	list-style: none;
	display: flex;
	align-items: center;
	gap: 1.75rem;
	margin: 0;
	padding: 0;
}

.ggc-mega-menu__item {
	position: relative;
}

.ggc-mega-menu__link {
	position: relative;
	display: inline-block;
	padding: 0.5rem 0;
	color: currentColor;
	text-decoration: none;
	font-size: var( --wp--preset--font-size--small );
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* Underline-grow instead of a color-only hover — restrained, no glow/scale. */
.ggc-mega-menu__link-text {
	position: relative;
	display: inline-block;
}

.ggc-mega-menu__link-text::after {
	content: "";
	position: absolute;
	left: 0;
	right: 100%;
	bottom: -2px;
	height: 1px;
	background: currentColor;
	transition: right 0.3s cubic-bezier( 0.16, 1, 0.3, 1 );
}

.ggc-mega-menu__link:hover .ggc-mega-menu__link-text::after,
.ggc-mega-menu__item.is-open .ggc-mega-menu__link-text::after {
	right: 0;
}

.ggc-mega-menu__link:hover,
.ggc-mega-menu__item.is-open .ggc-mega-menu__link {
	color: var( --wp--preset--color--accent );
}

.ggc-mega-menu__panel {
	position: absolute;
	top: 100%;
	left: 50%;
	transform: translate( -50%, 10px );
	z-index: 2;
	width: min( 680px, 90vw );
	background: var( --wp--preset--color--surface );
	color: var( --wp--preset--color--text );
	border-top: 2px solid var( --wp--preset--color--accent );
	box-shadow: 0 32px 64px rgba( 20, 18, 15, 0.22 );
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.3s ease, transform 0.3s cubic-bezier( 0.16, 1, 0.3, 1 ), visibility 0.3s ease;
}

.ggc-mega-menu__item.is-open .ggc-mega-menu__panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translate( -50%, 0 );
}

.ggc-mega-menu__panel-inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	padding: 2rem;
}

.ggc-mega-menu__panel-inner.has-media {
	grid-template-columns: minmax( 180px, 240px ) 1fr;
	gap: 2rem;
}

.ggc-mega-menu__panel-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: 3 / 4;
}

.ggc-mega-menu__panel-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale( 1.06 );
	transition: transform 0.6s cubic-bezier( 0.16, 1, 0.3, 1 );
}

.ggc-mega-menu__item.is-open .ggc-mega-menu__panel-media img {
	transform: scale( 1 );
}

.ggc-mega-menu__panel-media-label {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 0.75rem 0.9rem;
	font-family: var( --wp--preset--font-family--body );
	font-size: var( --wp--preset--font-size--small );
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --wp--preset--color--surface );
	background: linear-gradient( to top, rgba( 20, 18, 15, 0.75 ), rgba( 20, 18, 15, 0 ) );
}

.ggc-mega-menu__columns {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat( 2, minmax( 160px, 1fr ) );
	gap: 0.15rem 2rem;
	align-content: start;
}

.ggc-mega-menu__panel-inner:not( .has-media ) .ggc-mega-menu__columns {
	grid-template-columns: repeat( 2, minmax( 180px, 1fr ) );
}

/* Staggered reveal: each column link fades/rises in slightly after the one
   before it, driven purely by --ggc-ci (set inline per <li> in header.php)
   and gated on the same .is-open state the panel itself uses — no separate
   JS timing logic needed. */
.ggc-mega-menu__column-item {
	opacity: 0;
	transform: translateY( 6px );
	transition: opacity 0.3s ease, transform 0.3s ease;
	transition-delay: calc( var( --ggc-ci, 0 ) * 0.035s );
}

.ggc-mega-menu__item.is-open .ggc-mega-menu__column-item {
	opacity: 1;
	transform: translateY( 0 );
}

.ggc-mega-menu__column-item a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.55rem 0;
	color: var( --wp--preset--color--text );
	text-decoration: none;
	font-size: var( --wp--preset--font-size--medium );
	border-bottom: 1px solid var( --wp--preset--color--border );
}

.ggc-mega-menu__column-link-text {
	transition: transform 0.25s ease;
}

.ggc-mega-menu__column-arrow {
	display: inline-block;
	width: 0.9em;
	height: 0.9em;
	flex-shrink: 0;
	opacity: 0;
	transform: translateX( -4px );
	transition: opacity 0.25s ease, transform 0.25s ease;
}

.ggc-mega-menu__column-arrow::before {
	content: "";
	display: block;
	width: 100%;
	height: 100%;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E") center / contain no-repeat;
}

.ggc-mega-menu__column-item a:hover,
.ggc-mega-menu__column-item a:focus-visible {
	color: var( --wp--preset--color--accent );
}

.ggc-mega-menu__column-item a:hover .ggc-mega-menu__column-link-text,
.ggc-mega-menu__column-item a:focus-visible .ggc-mega-menu__column-link-text {
	transform: translateX( 4px );
}

.ggc-mega-menu__column-item a:hover .ggc-mega-menu__column-arrow,
.ggc-mega-menu__column-item a:focus-visible .ggc-mega-menu__column-arrow {
	opacity: 1;
	transform: translateX( 0 );
}

.ggc-mega-menu__panel-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	border-top: 1px solid var( --wp--preset--color--border );
	padding: 1.25rem 2rem;
	background: var( --wp--preset--color--background );
}

.ggc-mega-menu__panel-cta-label {
	font-family: var( --wp--preset--font-family--heading );
	font-size: var( --wp--preset--font-size--medium );
	color: var( --wp--preset--color--muted );
}

@media ( max-width: 1080px ) {
	.ggc-mega-menu {
		display: none;
	}

	.ggc-header__backdrop {
		display: none;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.ggc-mega-menu__panel,
	.ggc-mega-menu__panel-media img,
	.ggc-mega-menu__column-item,
	.ggc-mega-menu__link-text::after {
		transition: none;
	}
}

/* ---------------------------------------------------------------- */
/* Mobile toggle + full-screen nav                                    */
/* ---------------------------------------------------------------- */

.ggc-mobile-toggle {
	display: none;
	position: relative;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
}

.ggc-mobile-toggle__bar {
	display: block;
	height: 2px;
	width: 100%;
	background: currentColor;
	transition: transform 0.3s cubic-bezier( 0.16, 1, 0.3, 1 ), opacity 0.2s ease;
}

/* Hamburger → X, driven purely by the aria-expanded state header.js already
   sets — no extra class needed. */
.ggc-mobile-toggle[aria-expanded="true"] .ggc-mobile-toggle__bar:nth-child( 2 ) {
	transform: translateY( 7px ) rotate( 45deg );
}

.ggc-mobile-toggle[aria-expanded="true"] .ggc-mobile-toggle__bar:nth-child( 3 ) {
	opacity: 0;
}

.ggc-mobile-toggle[aria-expanded="true"] .ggc-mobile-toggle__bar:nth-child( 4 ) {
	transform: translateY( -7px ) rotate( -45deg );
}

@media ( prefers-reduced-motion: reduce ) {
	.ggc-mobile-toggle__bar {
		transition: none;
	}
}

@media ( max-width: 1080px ) {
	.ggc-mobile-toggle {
		display: flex;
		color: var( --wp--preset--color--surface );
	}

	.ggc-header.is-scrolled .ggc-mobile-toggle {
		color: var( --wp--preset--color--surface );
	}
}

.ggc-mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: var( --wp--preset--color--primary );
	color: var( --wp--preset--color--surface );
	overflow-y: auto;
	padding-top: 96px;
}

.ggc-mobile-nav[hidden] {
	display: none;
}

.ggc-mobile-nav__inner {
	position: relative;
	max-width: 480px;
	margin: 0 auto;
	padding: 2rem 1.5rem 4rem;
}

/* Explicit close affordance ("easy back nav") in addition to the header
   toggle morphing into an X — useful once a visitor has scrolled down
   inside a long accordion panel and the fixed header toggle is out of
   easy reach. */
.ggc-mobile-nav__close {
	position: absolute;
	top: -0.5rem;
	right: 1.5rem;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: 1px solid rgba( 255, 255, 255, 0.3 );
	border-radius: 50%;
	color: inherit;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.ggc-mobile-nav__close:hover,
.ggc-mobile-nav__close:focus-visible {
	border-color: var( --wp--preset--color--accent );
	color: var( --wp--preset--color--accent );
}

.ggc-mobile-nav__list {
	list-style: none;
	margin: 0 0 2rem;
	padding: 0;
}

.ggc-mobile-nav__item {
	border-bottom: 1px solid rgba( 255, 255, 255, 0.15 );
}

.ggc-mobile-nav__item > a,
.ggc-mobile-nav__accordion-trigger {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	width: 100%;
	min-height: 44px;
	text-align: left;
	background: none;
	border: none;
	color: inherit;
	font-family: var( --wp--preset--font-family--heading );
	font-size: var( --wp--preset--font-size--x-large );
	padding: 1rem 0;
	cursor: pointer;
	text-decoration: none;
}

/* Plus → cross accordion indicator, driven off aria-expanded. */
.ggc-mobile-nav__accordion-icon {
	position: relative;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
}

.ggc-mobile-nav__accordion-icon::before,
.ggc-mobile-nav__accordion-icon::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	background: currentColor;
	transform: translate( -50%, -50% );
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.ggc-mobile-nav__accordion-icon::before {
	width: 18px;
	height: 1.5px;
}

.ggc-mobile-nav__accordion-icon::after {
	width: 1.5px;
	height: 18px;
}

.ggc-mobile-nav__accordion-trigger[aria-expanded="true"] .ggc-mobile-nav__accordion-icon::after {
	transform: translate( -50%, -50% ) rotate( 90deg );
	opacity: 0;
}

.ggc-mobile-nav__accordion-panel {
	list-style: none;
	margin: 0 0 1rem;
	padding: 0 0 0 1rem;
}

.ggc-mobile-nav__accordion-panel[hidden] {
	display: none;
}

.ggc-mobile-nav__accordion-panel a {
	display: flex;
	align-items: center;
	min-height: 44px;
	padding: 0.6rem 0;
	color: inherit;
	opacity: 0.85;
	text-decoration: none;
	font-size: var( --wp--preset--font-size--medium );
}

.ggc-mobile-nav__accordion-panel a:hover,
.ggc-mobile-nav__accordion-panel a:focus-visible {
	opacity: 1;
	color: var( --wp--preset--color--accent );
}

.ggc-mobile-nav__cta {
	width: 100%;
	margin-bottom: 1.5rem;
}

.ggc-mobile-nav__phone {
	display: block;
	text-align: center;
	color: inherit;
	text-decoration: none;
	font-weight: 700;
}

@media ( prefers-reduced-motion: no-preference ) {
	.ggc-mobile-nav {
		animation: ggc-mobile-nav-in 0.35s cubic-bezier( 0.16, 1, 0.3, 1 );
	}

	.ggc-mobile-nav__list > li,
	.ggc-mobile-nav__cta,
	.ggc-mobile-nav__phone {
		animation: ggc-fade-in 0.4s ease both;
		animation-delay: 0.1s;
	}
}

@keyframes ggc-mobile-nav-in {
	from {
		opacity: 0;
		transform: translateY( 12px );
	}

	to {
		opacity: 1;
		transform: translateY( 0 );
	}
}

@keyframes ggc-fade-in {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

/* ---------------------------------------------------------------- */
/* Front page / default page                                         */
/* ---------------------------------------------------------------- */

.ggc-front-page-placeholder {
	padding: 8rem 1.5rem;
	text-align: center;
	max-width: 640px;
	margin: 0 auto;
}

.ggc-page {
	padding-top: 7rem;
}

.ggc-page__header {
	max-width: var( --wp--style--global--content-size, 768px );
	margin: 0 auto;
	padding: 3rem 1.5rem 1rem;
}

.ggc-index {
	max-width: var( --wp--style--global--content-size, 768px );
	margin: 0 auto;
	padding: 8rem 1.5rem 4rem;
}

.ggc-index__item {
	margin-bottom: 2.5rem;
}

/* ---------------------------------------------------------------- */
/* Scroll-reveal (homepage sections below the hero)                  */
/* assets/js/scroll-reveal.js adds .ggc-reveal on init and .is-visible */
/* once a section enters the viewport. Reduced-motion visitors get full */
/* visibility unconditionally, regardless of whether the JS class ever  */
/* lands — this rule does not depend on scroll-reveal.js running.       */
/* ---------------------------------------------------------------- */

.ggc-reveal {
	opacity: 0;
	transform: translateY( 32px );
	transition: opacity 0.7s cubic-bezier( 0.16, 1, 0.3, 1 ), transform 0.7s cubic-bezier( 0.16, 1, 0.3, 1 );
}

.ggc-reveal.is-visible {
	opacity: 1;
	transform: translateY( 0 );
}

@media ( prefers-reduced-motion: reduce ) {
	.ggc-reveal {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ---------------------------------------------------------------- */
/* Footer                                                             */
/* ---------------------------------------------------------------- */

.ggc-footer {
	background: var( --wp--preset--color--primary );
	color: var( --wp--preset--color--surface );
}

.ggc-footer__top {
	max-width: var( --wp--style--global--wide-size, 1280px );
	margin: 0 auto;
	padding: 5rem 1.5rem 3rem;
	display: grid;
	grid-template-columns: minmax( 240px, 1fr ) 2fr;
	gap: 3rem;
}

.ggc-footer__brand img {
	height: 56px;
	width: auto;
	margin-bottom: 1.5rem;
}

.ggc-footer__wordmark {
	display: block;
	font-family: var( --wp--preset--font-family--heading );
	font-size: var( --wp--preset--font-size--large );
	margin-bottom: 1.5rem;
}

.ggc-footer__address {
	font-style: normal;
	opacity: 0.85;
	margin-bottom: 1rem;
	line-height: 1.6;
}

.ggc-footer__phone,
.ggc-footer__email {
	display: block;
	color: inherit;
	text-decoration: none;
	margin-bottom: 0.5rem;
	opacity: 0.9;
}

.ggc-footer__social {
	display: flex;
	gap: 0.75rem;
	margin-top: 1.5rem;
}

.ggc-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid rgba( 255, 255, 255, 0.3 );
	border-radius: 50%;
	color: inherit;
	text-decoration: none;
	font-size: 0.7rem;
	letter-spacing: 0.05em;
}

.ggc-footer__columns {
	display: grid;
	grid-template-columns: repeat( 4, 1fr );
	gap: 2rem;
}

.ggc-footer__column-heading {
	font-family: var( --wp--preset--font-family--body );
	font-size: var( --wp--preset--font-size--small );
	text-transform: uppercase;
	letter-spacing: 0.08em;
	opacity: 0.6;
	margin: 0 0 1.25rem;
}

.ggc-footer__column ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ggc-footer__column li {
	margin-bottom: 0.75rem;
}

.ggc-footer__column a {
	color: inherit;
	text-decoration: none;
	opacity: 0.85;
}

.ggc-footer__column a:hover {
	opacity: 1;
	color: var( --wp--preset--color--accent );
}

.ggc-footer__bottom {
	border-top: 1px solid rgba( 255, 255, 255, 0.12 );
	padding: 1.5rem;
	text-align: center;
	font-size: var( --wp--preset--font-size--small );
	opacity: 0.6;
}

@media ( max-width: 900px ) {
	.ggc-footer__top {
		grid-template-columns: 1fr;
	}

	.ggc-footer__columns {
		grid-template-columns: repeat( 2, 1fr );
	}
}

@media ( prefers-reduced-motion: reduce ) {
	* {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}
