/* ==========================================================================
   PWP Print Studio – Header shortcode  [pwpps_header]
   Design source: Figma [D]-Home (1440 px desktop)
   ========================================================================== */

.pwpps-header {
	box-sizing: border-box;
	width: 100%;
	max-width: 1280px;
	margin-left: auto;
	margin-right: auto;
	font-family: 'Inter', Arial, Helvetica, sans-serif;
	display: flex;
	flex-direction: column;
	align-items: center;
	min-height: 184px;
	padding: 20px 120px;
	gap: 12px;
	background: #fff;
	color: #111;
	text-align: center;
}

.pwpps-header *,
.pwpps-header *::before,
.pwpps-header *::after {
	box-sizing: inherit;
}

/* Brand (logo + text) */

.pwpps-header__brand {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	line-height: 1;
	text-decoration: none;
}

/* Logo mark – CSS circle fallback */

span.pwpps-header__mark {
	display: block;
	width: 96px;
	height: 96px;
	background: #111;
}

/* Logo mark – WP custom logo <img> */

img.pwpps-header__mark {
	display: block;
	width: 96px;
	height: 96px;
	object-fit: cover;
}

/* Navigation bar */

.pwpps-header__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	width: min(100%, 1200px);
	height: 40px;
	margin: 0 auto;
}

/* Nav link (button-like) */

.pwpps-header__nav-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	height: 40px;
	padding: 12px 24px;
	color: #8C8C8C;
	font-family: 'Inter', Arial, Helvetica, sans-serif;
	font-size: var(--font-size-13);
	font-weight: var(--font-weight-label);
	letter-spacing: 1.5px;
	line-height: 16px;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
	transition: color 160ms ease;
}

.pwpps-header__nav-link:hover,
.pwpps-header__nav-link:focus-visible,
.pwpps-header__nav-link.is-active,
.pwpps-header__nav-link.active {
	color: #111;
}

/* WP Nav Menu integration */

.pwpps-header__menu {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pwpps-header__menu li {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 0;
	height: 100%;
}

/* Hamburger + mobile overlay — hidden on desktop */

.pwpps-header__hamburger,
.pwpps-header__overlay {
	display: none;
}

/* ---------- Responsive (mobile-only, <1024px) ---------- */

@media (max-width: 1023px) {
	.pwpps-header {
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		min-height: 0;
		padding: 16px;
		gap: 0;
	}

	.pwpps-header__brand {
		flex-direction: row;
		gap: 0;
	}

	span.pwpps-header__mark,
	img.pwpps-header__mark {
		width: 40px;
		height: 40px;
	}

	/* Hide the inline desktop nav on mobile */
	.pwpps-header__nav {
		display: none;
	}

	/* Show hamburger */
	.pwpps-header__hamburger {
		display: inline-flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 5px;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--color-primary-black);
		cursor: pointer;
	}

	.pwpps-header__hamburger:focus-visible {
		outline: 2px solid var(--color-primary-black);
		outline-offset: 2px;
	}

	/* Hamburger bars */
	.pwpps-header__bar {
		display: block;
		width: 22px;
		height: 2px;
		background: currentColor;
		border-radius: 1px;
		transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1),
		            opacity 200ms ease;
		transform-origin: center center;
	}

	/* Bars → X when open */
	.pwpps-header__hamburger.is-open .pwpps-header__bar:nth-child(1) {
		transform: translateY(7px) rotate(45deg);
	}
	.pwpps-header__hamburger.is-open .pwpps-header__bar:nth-child(2) {
		transform: scaleX(0);
		opacity: 0;
	}
	.pwpps-header__hamburger.is-open .pwpps-header__bar:nth-child(3) {
		transform: translateY(-7px) rotate(-45deg);
	}

	/* Full-screen overlay menu */
	.pwpps-header__overlay {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 1000;
		background: var(--color-bg-card);
		padding: 16px;
	}

	.pwpps-header__overlay[hidden] {
		display: none;
	}

	/* Slide-down open / slide-up close */
	@keyframes pwpps-menu-in {
		from { transform: translateY(-100%); }
		to   { transform: translateY(0); }
	}

	@keyframes pwpps-menu-out {
		from { transform: translateY(0); }
		to   { transform: translateY(-100%); }
	}

	.pwpps-header__overlay.is-entering {
		animation: pwpps-menu-in 320ms cubic-bezier(0.4, 0, 0.2, 1);
	}

	.pwpps-header__overlay.is-leaving {
		animation: pwpps-menu-out 260ms cubic-bezier(0.4, 0, 1, 1) forwards;
	}

	.pwpps-header__overlay-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		position: absolute;
		top: 16px;
		right: 16px;
		width: 40px;
		height: 40px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--color-primary-black);
		cursor: pointer;
		-webkit-tap-highlight-color: transparent;
	}

	/* Offset close button when WP admin bar is visible (32px desktop, 46px mobile) */
	.admin-bar .pwpps-header__overlay-close {
		top: calc(16px + 32px);
	}

	.pwpps-header__overlay-close:focus-visible {
		outline: 2px solid var(--color-primary-black);
		outline-offset: 2px;
	}

	.pwpps-header__overlay-nav {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: var(--space-8);
		min-height: 100%;
		padding: var(--space-12) 0;
	}

	.pwpps-header__overlay-link {
		color: var(--color-neutral-500);
		font-family: 'Inter', Arial, Helvetica, sans-serif;
		font-size: var(--font-size-mobile-body);
		font-weight: var(--font-weight-label);
		letter-spacing: 1.5px;
		line-height: 20px;
		text-decoration: none;
		text-transform: uppercase;
		transition: color 160ms ease;
	}

	.pwpps-header__overlay-link:hover,
	.pwpps-header__overlay-link:focus-visible,
	.pwpps-header__overlay-link.is-active {
		color: var(--color-primary-black);
	}
}

/* WP admin bar on mobile is 46px tall (vs 32px on wider screens) */
@media (max-width: 782px) {
	.admin-bar .pwpps-header__overlay-close {
		top: calc(16px + 46px);
	}
}

@media (max-width: 1023px) and (prefers-reduced-motion: reduce) {
	.pwpps-header__bar {
		transition-duration: 0.01ms;
	}
	.pwpps-header__overlay.is-entering,
	.pwpps-header__overlay.is-leaving {
		animation-duration: 0.01ms;
	}
}
