/**
 * Site Navigation — view styles.
 *
 * Desktop: horizontal flex list with animated underline accent.
 * Mobile (≤ 600 px): burger button + full-screen slide-over overlay.
 * Breakpoint: 600 px — matches the WP Navigation block breakpoint.
 *
 * @package RHM_Atelier_Latitude_Portfolio
 */

/* ==========================================================================
   Resets
   ========================================================================== */

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

.al-site-nav__burger,
.al-mobile-nav__close {
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: inherit;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
}

.al-site-nav__burger:focus,
.al-mobile-nav__close:focus {
	outline: none;
}

.al-site-nav__burger:focus-visible,
.al-mobile-nav__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ==========================================================================
   Desktop nav
   ========================================================================== */

.al-site-nav {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
}

.al-site-nav__desktop {
	display: flex;
	align-items: center;
	gap: var(--wp--preset--spacing--40);
}

.al-site-nav__desktop a {
	position: relative;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	transition: color 0.3s ease;
}

/* Animated underline */
.al-site-nav__desktop a::after {
	content: '';
	position: absolute;
	bottom: -2px;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--wp--preset--color--accent);
	transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.al-site-nav__desktop a:hover::after,
.al-site-nav__item.is-current a::after {
	width: 100%;
}

/* Burger hidden on desktop */
.al-site-nav__burger {
	display: none;
}

/* ==========================================================================
   Mobile (≤ 600 px)
   ========================================================================== */

@media (max-width: 600px) {
	.al-site-nav__desktop {
		display: none;
	}

	.al-site-nav__burger {
		display: flex;
	}
}

/* ==========================================================================
   Mobile overlay
   ========================================================================== */

.al-mobile-nav {
	position: fixed;
	inset: 0;
	z-index: 1000;

	background-color: var(--wp--preset--color--base);
	display: flex;
	flex-direction: column;

	/* Slide from right, hidden by default */
	opacity: 0;
	pointer-events: none;
	transform: translateX(100%);
	transition:
		opacity 0.3s ease,
		transform 0.35s cubic-bezier(0.33, 1, 0.68, 1);

	/* Exclude from View Transition page snapshot */
	view-transition-name: none;
}

.al-mobile-nav.is-open {
	opacity: 1;
	pointer-events: auto;
	transform: translateX(0);
}

/* Offset for WP Admin bar (logged-in users only). */
body.admin-bar .al-mobile-nav {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .al-mobile-nav {
		top: 46px;
	}
}

/* Top bar: brand + close button
   Padding matches the header inner group (spacing--30 top/bottom, spacing--40 sides). */
.al-mobile-nav__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	padding:
		var(--wp--preset--spacing--30)
		var(--wp--preset--spacing--40);
}

/* Logo in brand area */
.al-mobile-nav__brand .custom-logo-link {
	display: block;
	line-height: 0;
}

.al-mobile-nav__brand .custom-logo {
	width: 180px;
	height: auto;
	max-width: 100%;
}

/* Fallback: site name as text */
.al-mobile-nav__brand {
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--contrast);
}

/* ==========================================================================
   Overlay links
   ========================================================================== */

.al-mobile-nav__links {
	flex: 1;
	overflow-y: auto;
	padding:
		var(--wp--preset--spacing--50)
		var(--wp--preset--spacing--40);
}

.al-mobile-nav__links ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.al-mobile-nav__links a {
	position: relative;
	display: inline-block;
	font-family: var(--wp--preset--font-family--body);
	font-size: clamp(1.45rem, 3.5vw, 1.75rem);
	font-weight: 300;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	transition: color 0.3s ease;
}

/* Animated underline */
.al-mobile-nav__links a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0;
	height: 2px;
	background-color: var(--wp--preset--color--accent);
	transition: width 0.4s cubic-bezier(0.33, 1, 0.68, 1);
}

.al-mobile-nav__links a:hover::after,
.al-mobile-nav__links li.is-current a::after {
	width: 100%;
}

/* ==========================================================================
   Overlay footer — contact info + social links
   ========================================================================== */

.al-mobile-nav__footer {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
	padding:
		var(--wp--preset--spacing--40)
		var(--wp--preset--spacing--40)
		var(--wp--preset--spacing--50);
	border-top: 1px solid var(--wp--preset--color--border);
}

.al-mobile-nav__contact {
	display: flex;
	flex-direction: column;
	gap: 0.6em;
}

.al-mobile-nav__contact-item {
	display: flex;
	align-items: flex-start;
	gap: 0.5rem;
}

.al-mobile-nav__contact-item svg {
	flex-shrink: 0;
	margin-top: 0.2em;
	color: var(--wp--preset--color--accent);
}

.al-mobile-nav__contact a {
	display: inline;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 300;
	font-style: normal;
	letter-spacing: 0.04em;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding-bottom: 1px;
	transition: color 0.2s ease, border-color 0.2s ease;
}

.al-mobile-nav__contact a:hover {
	color: var(--wp--preset--color--accent);
	border-bottom-color: var(--wp--preset--color--accent);
}

.al-mobile-nav__social {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wp--preset--spacing--40);
}

.al-mobile-nav__social a {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	font-family: var(--wp--preset--font-family--heading);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--contrast);
	transition: color 0.3s ease;
}

.al-mobile-nav__social a:hover {
	color: var(--wp--preset--color--accent);
}
