/*
Theme Name: Synergy Media Group
Theme URI: https://synmediagroup.com
Author: Synergy Media Group
Description: Custom block theme for Synergy Media Group — Pittsburgh AV / IT-Telecom / Security design-build firm. Light, modern, mobile-first; single orange accent drawn from the SMG logo.
Version: 2.0.0
Requires at least: 6.5
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: smg
*/

/* Smooth-motion defaults used across the design */
:root {
	--smg-ease: cubic-bezier(0.25, 0.1, 0.25, 1);
	--smg-radius: 18px;
	--smg-shadow-soft: 0 4px 22px rgba(0, 0, 0, 0.06);
	--smg-shadow-lift: 0 18px 44px rgba(0, 0, 0, 0.12);
}

/* ---------- Header: frosted light glass ----------
   The blur lives on a ::before pseudo-element: backdrop-filter on the header
   itself would make it the containing block for position:fixed descendants,
   trapping the mobile menu overlay inside the 60px bar. */
.smg-header {
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	z-index: 100;
}
.smg-header::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: rgba(255, 255, 255, 0.72);
	-webkit-backdrop-filter: saturate(180%) blur(20px);
	backdrop-filter: saturate(180%) blur(20px);
}
.smg-header a,
.smg-footer a {
	color: inherit;
	text-decoration: none;
}
.smg-header .wp-block-navigation a {
	transition: color 0.25s var(--smg-ease), opacity 0.25s var(--smg-ease);
}
.smg-header .wp-block-navigation a:hover,
.smg-header .wp-block-navigation a:focus-visible {
	color: var(--wp--preset--color--accent);
}
.smg-logo img {
	height: 40px;
	width: auto;
}
/* Dropdowns: white floating card */
.smg-header .wp-block-navigation .wp-block-navigation__submenu-container {
	background: rgba(255, 255, 255, 0.96);
	-webkit-backdrop-filter: blur(20px);
	backdrop-filter: blur(20px);
	border: 1px solid rgba(0, 0, 0, 0.06);
	border-radius: 14px;
	box-shadow: var(--smg-shadow-lift);
	padding: 0.35rem;
}
.smg-header .wp-block-navigation .wp-block-navigation__submenu-container a {
	padding: 0.55rem 0.9rem;
	border-radius: 9px;
	color: var(--wp--preset--color--contrast);
}
.smg-header .wp-block-navigation .wp-block-navigation__submenu-container a:hover {
	background: var(--wp--preset--color--mist);
	color: var(--wp--preset--color--accent);
}
/* Mobile overlay menu: clean white sheet with comfortable tap targets */
.smg-header .wp-block-navigation__responsive-container.has-modal-open {
	background: #ffffff !important;
	color: var(--wp--preset--color--contrast);
	padding: 1.5rem;
}
/* Left-align the overlay menu regardless of desktop justification */
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation__responsive-container-content,
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation__container,
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation__submenu-container,
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation-item {
	align-items: flex-start !important;
	justify-content: flex-start !important;
	text-align: left;
}
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation-item {
	width: 100%;
}
/* Submenus flatten to indented lists inside the overlay (no floating cards) */
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation__submenu-container {
	background: transparent;
	border: 0;
	box-shadow: none;
	border-radius: 0;
	padding: 0 0 0 1.25rem;
	-webkit-backdrop-filter: none;
	backdrop-filter: none;
}
.smg-header .wp-block-navigation__responsive-container.has-modal-open
	.wp-block-navigation__responsive-container-content {
	padding-top: 2.5rem;
}
.smg-header .wp-block-navigation__responsive-container.has-modal-open a {
	font-size: 1.25rem;
	padding: 0.55rem 0;
	display: inline-block;
}
.smg-header .wp-block-navigation__responsive-container-close {
	padding: 0.75rem;
}

/* ---------- Cards ---------- */
.smg-card {
	border-radius: var(--smg-radius);
	overflow: hidden;
	box-shadow: var(--smg-shadow-soft);
	transition: transform 0.35s var(--smg-ease), box-shadow 0.35s var(--smg-ease);
}
.smg-card:hover {
	transform: translateY(-6px) scale(1.01);
	box-shadow: var(--smg-shadow-lift);
}
.smg-card img {
	border-radius: var(--smg-radius);
	display: block;
	transition: transform 0.6s var(--smg-ease);
}

/* Image tiles that zoom softly inside their frame on hover */
.smg-tile {
	border-radius: var(--smg-radius);
	overflow: hidden;
	box-shadow: var(--smg-shadow-soft);
	transition: transform 0.35s var(--smg-ease), box-shadow 0.35s var(--smg-ease);
}
.smg-tile img {
	display: block;
	border-radius: var(--smg-radius);
	transition: transform 0.6s var(--smg-ease);
}
.smg-tile:hover {
	box-shadow: var(--smg-shadow-lift);
	transform: translateY(-4px);
}
.smg-tile:hover img {
	transform: scale(1.045);
}

/* Bento cells: white cards on the mist band */
.smg-bento {
	background: var(--wp--preset--color--base);
	border-radius: var(--smg-radius);
	box-shadow: var(--smg-shadow-soft);
	transition: transform 0.35s var(--smg-ease), box-shadow 0.35s var(--smg-ease);
}
.smg-bento:hover {
	transform: translateY(-4px);
	box-shadow: var(--smg-shadow-lift);
}

/* Numbered process steps (About) */
.smg-step-num {
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	color: var(--wp--preset--color--accent);
}

/* Award chips (About leadership): dark, rounded, logo centered */
.smg-award-chip {
	background: var(--wp--preset--color--ink);
	border-radius: var(--smg-radius);
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 170px;
	padding: 1.5rem;
	transition: transform 0.35s var(--smg-ease), box-shadow 0.35s var(--smg-ease);
}
.smg-award-chip:hover {
	transform: translateY(-4px);
	box-shadow: var(--smg-shadow-lift);
}
.smg-award-chip img {
	max-height: 130px;
	width: auto;
}

/* Portrait crop: renders a landscape source as a tall card (re-crop, same asset) */
.smg-portrait img {
	aspect-ratio: 3 / 4;
	object-fit: cover;
	width: 100%;
	height: 100%;
}
.smg-portrait,
.smg-portrait figure {
	height: 100%;
}

/* Inline eyebrow row (e.g. OUR + PROCESS side by side) */
.smg-eyebrow-row {
	display: flex;
	gap: 0.45em;
	justify-content: center;
}
.smg-eyebrow-row > * {
	margin: 0;
}

/* Case-study photo galleries: uniform 3:2 tiles (full image opens in lightbox) */
.smg-gallery .wp-block-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	width: 100%;
	height: auto;
}
/* B6: restore heading rhythm after gallery cards */
.smg-gallery {
	margin-bottom: 2.5rem;
}
/* D4: per-image crop focus fixes */
.smg-crop-top img,
img.smg-crop-top {
	object-position: top !important;
}
.smg-crop-high img,
img.smg-crop-high {
	object-position: 50% 22% !important;
}

/* B5: PROJECT STATS — one tight list component */
.smg-stats {
	list-style: none;
	padding-left: 0;
	margin: 0;
}
.smg-stats li {
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--muted);
}
.smg-stats li:last-child {
	border-bottom: 0;
}
.smg-stats li strong {
	color: var(--wp--preset--color--contrast);
}
.smg-stats.smg-cols li {
	border-bottom: 0;
	padding: 0.3rem 0;
}

/* E10: featured-project rows stack at tablet instead of orphaning a card */
@media (min-width: 600px) and (max-width: 899px) {
	.smg-featured {
		grid-template-columns: 1fr !important;
	}
}

/* E6: center bento card content vertically */
.smg-bento {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* E9: card-title links underline only on hover */
.smg-bento p a,
.smg-featured p a {
	text-decoration: none;
}
.smg-bento p a:hover,
.smg-featured p a:hover {
	text-decoration: underline;
}

/* E2: tidy footer nav wrap on phone */
@media (max-width: 600px) {
	.smg-footer .wp-block-navigation {
		gap: 0.6rem 1.1rem;
	}
}

/* D8: letterboxed wide images get a taller crop on phone */
@media (max-width: 600px) {
	main .wp-block-image.size-large.smg-card:not(.smg-certs) img {
		aspect-ratio: 3 / 2;
		object-fit: cover;
	}
}

/* Galleries of all-vertical photos keep tall 2:3 tiles instead of the 3:2 crop */
.smg-gallery-tall .wp-block-image img {
	aspect-ratio: 2 / 3;
}
@media (max-width: 600px) {
	main .smg-gallery-tall .wp-block-image.size-large.smg-card img {
		aspect-ratio: 2 / 3;
	}
}

/* D3: certifications banner stays legible on phone — swipe instead of shrink */
@media (max-width: 600px) {
	.smg-certs {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}
	.smg-certs img {
		min-width: 860px;
		aspect-ratio: auto;
	}
}

/* Multi-column lists (brand/tech rosters on case studies) */
.smg-cols {
	columns: 2;
	column-gap: 2.5rem;
}
@media (min-width: 782px) {
	.smg-cols {
		columns: 3;
	}
}
.smg-cols li {
	break-inside: avoid;
}

/* Dark rounded chip: keeps white-on-transparent logos legible on light pages */
.smg-rounded-chip {
	border-radius: var(--smg-radius);
}
.smg-rounded-chip img {
	display: block;
}

/* Large rounded media card (hero video) */
.smg-media-card video,
.smg-media-card img {
	display: block;
	width: 100%;
	border-radius: clamp(14px, 2.2vw, 26px);
	box-shadow: var(--smg-shadow-soft);
}
/* Reserve the video's box before metadata arrives — prevents layout shift */
.smg-media-card video {
	aspect-ratio: 16 / 9;
	height: auto;
	object-fit: cover;
	background: var(--wp--preset--color--ink);
}
.smg-rounded img,
img.smg-rounded {
	border-radius: var(--smg-radius);
}

/* ---------- Gentle fade-in on scroll (progressive enhancement) ---------- */
@supports (animation-timeline: view()) {
	.smg-fade {
		animation: smg-fade-in linear both;
		animation-timeline: view();
		animation-range: entry 0% entry 40%;
	}
	@media (prefers-reduced-motion: reduce) {
		.smg-fade {
			animation: none;
		}
	}
}
@keyframes smg-fade-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ---------- Forms (contact) ---------- */
main input[type="text"],
main input[type="email"],
main input[type="tel"],
main textarea {
	width: 100%;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 12px;
	padding: 0.75rem 1rem;
	font: inherit;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	transition: border-color 0.25s var(--smg-ease), box-shadow 0.25s var(--smg-ease);
}
main input:focus-visible,
main textarea:focus-visible {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 4px rgba(254, 110, 0, 0.15);
}
main input[type="submit"],
main button[type="submit"] {
	background: var(--wp--preset--color--accent);
	color: #ffffff;
	border: none;
	border-radius: 980px;
	padding: 0.75em 1.8em;
	font-weight: 600;
	font-size: 1rem;
	cursor: pointer;
	min-height: 44px;
	transition: background 0.25s var(--smg-ease), transform 0.25s var(--smg-ease);
}
main input[type="submit"]:hover,
main button[type="submit"]:hover {
	background: var(--wp--preset--color--accent-deep);
	transform: translateY(-1px);
}

/* ---------- Buttons ---------- */
.wp-block-button__link {
	min-height: 44px;
	transition: background 0.25s var(--smg-ease), transform 0.25s var(--smg-ease);
}
.wp-block-button__link:hover {
	transform: translateY(-1px);
}

/* ---------- Footer ---------- */
.smg-footer {
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}
.smg-footer a {
	transition: color 0.25s var(--smg-ease);
}
.smg-footer a:hover {
	color: var(--wp--preset--color--accent);
}

/* ---------- Misc polish ---------- */
/* No gaps between the template root sections (header / main / footer) */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}
.wp-block-cover video {
	object-fit: cover;
}
a:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
	border-radius: 4px;
}
html,
body {
	overflow-x: clip;
}
img {
	max-width: 100%;
	height: auto;
}
html {
	scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}
