/* ─── Site Header ─────────────────────────────────────────────────────────── */

.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: rgba(10, 10, 10, 0.85);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid #18181b;
}

.site-header__inner {
	display: flex;
	align-items: center;
	gap: 2rem;
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 0rem;
	height: 60px;
}

/* ─── Brand ───────────────────────────────────────────────────────────────── */

.site-header__brand {
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	text-decoration: none;
	color: #fafafa;
	margin-right: auto;
	text-transform: lowercase;
	display: flex;
	align-items: center;
}

.site-header__logo {
	display: block;
	height: 36px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
}

/* ─── Nav ─────────────────────────────────────────────────────────────────── */

.site-header__nav .site-header__menu {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 1.75rem;
}

.site-header__nav .site-header__menu a {
	text-decoration: none;
	color: #52525b;
	font-size: 0.875rem;
	transition: color 0.15s;
}

.site-header__nav .site-header__menu a:hover,
.site-header__nav .site-header__menu a:focus-visible {
	color: #e4e4e7;
}

.site-header__nav .site-header__menu .current-menu-item > a {
	color: #e4e4e7;
	font-weight: 500;
}

/* ─── CTA ─────────────────────────────────────────────────────────────────── */

.site-header__cta {
	display: inline-block;
	padding: 0.4375rem 1rem;
	background: #ef4444;
	color: #fff;
	text-decoration: none;
	border-radius: 6px;
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
	transition: background 0.15s;
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
	background: #dc2626;
}

/* ─── User menu ───────────────────────────────────────────────────────────── */

.site-header__user {
	position: relative;
}

/* Group CTA + user button close together */
.site-header__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

/* Rectangle button — matches .site-header__cta exactly */
.site-header__user-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.4375rem 1rem;
	background: rgba(239, 68, 68, 0.12);
	border: 1px solid rgba(239, 68, 68, 0.3);
	border-radius: 6px;
	font-family: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	color: #ef4444;
	white-space: nowrap;
	flex-shrink: 0;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s;
}

.site-header__user-btn:hover {
	background: rgba(239, 68, 68, 0.2);
	border-color: rgba(239, 68, 68, 0.55);
}

/* Small avatar circle inside the button */
.site-header__user-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #ef4444;
	color: #fff;
	font-size: 0.625rem;
	font-weight: 700;
	line-height: 1;
	flex-shrink: 0;
	pointer-events: none;
}

/* Display name */
.site-header__user-label {
	font-size: 0.8125rem;
	font-weight: 600;
	white-space: nowrap;
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}

/* Chevron */
.site-header__user-chevron {
	flex-shrink: 0;
	opacity: 0.6;
	transition: transform 0.18s ease, opacity 0.15s;
}

.site-header__user-btn[aria-expanded="true"] .site-header__user-chevron {
	transform: rotate(180deg);
	opacity: 1;
}

/* Guest icon button — same shape, no avatar */
.site-header__user-btn--guest {
	color: #71717a;
	background: rgba(255,255,255,0.04);
	border-color: #27272a;
}

.site-header__user-btn--guest:hover {
	color: #d4d4d8;
	background: rgba(255,255,255,0.08);
	border-color: #52525b;
}

/* Dropdown card */
.site-header__user-menu {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	z-index: 200;
	width: 220px;
	background: #111113;
	border: 1px solid #27272a;
	border-radius: 12px;
	overflow: hidden;
	box-shadow: 0 8px 32px rgba(0,0,0,0.5);
	/* Hidden state */
	visibility: hidden;
	opacity: 0;
	transform: translateY(-6px) scale(0.98);
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s 0.18s;
}

.site-header__user-menu.is-open {
	visibility: visible;
	opacity: 1;
	transform: translateY(0) scale(1);
	pointer-events: auto;
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s 0s;
}

/* User info block */
.site-header__user-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.875rem 1rem;
	border-bottom: 1px solid #1e1e21;
}

.site-header__user-name {
	font-size: 0.8125rem;
	font-weight: 600;
	color: #e4e4e7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.site-header__user-email {
	font-size: 0.7rem;
	color: #52525b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Menu items section */
.site-header__user-items {
	padding: 0.375rem 0;
	border-bottom: 1px solid #1e1e21;
}

.site-header__user-footer {
	padding: 0.375rem 0;
}

.site-header__user-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.55rem 1rem;
	font-size: 0.8125rem;
	color: #a1a1aa;
	text-decoration: none;
	transition: background 0.12s, color 0.12s;
	cursor: pointer;
}

.site-header__user-item svg {
	flex-shrink: 0;
	opacity: 0.7;
}

.site-header__user-item:hover {
	background: rgba(255,255,255,0.05);
	color: #e4e4e7;
}

.site-header__user-item:hover svg { opacity: 1; }

.site-header__user-item--logout { color: #71717a; }
.site-header__user-item--logout:hover { color: #f87171; background: rgba(239,68,68,0.06); }

/* ─── Hamburger toggle ────────────────────────────────────────────────────── */

.site-header__toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	background: none;
	border: none;
	cursor: pointer;
	color: #71717a;
}

.site-header__bar {
	display: block;
	width: 100%;
	height: 2px;
	background: currentColor;
	border-radius: 2px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}

/* Animate to × when open */
.site-header__toggle[aria-expanded="true"] .site-header__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.site-header__toggle[aria-expanded="true"] .site-header__bar:nth-child(2) {
	opacity: 0;
}

.site-header__toggle[aria-expanded="true"] .site-header__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ─── Mobile header ───────────────────────────────────────────────────────── */

@media (max-width: 768px) {
	.site-header__toggle {
		display: flex;
	}

	.site-header__actions {
		display: none;
	}
}

/* ─── Mobile menu overlay ─────────────────────────────────────────────────── */

.mobile-menu {
	display: none; /* JS will switch to flex when overlay activates */
	position: fixed;
	inset: 0;
	z-index: 300;
	align-items: flex-start;
	justify-content: flex-end;
}

.mobile-menu.is-open {
	display: flex;
}

/* Dimmed backdrop */
.mobile-menu__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	cursor: pointer;
}

/* Sliding panel */
.mobile-menu__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(320px, 88vw);
	height: 100%;
	background: #111113;
	border-left: 1px solid #27272a;
	overflow-y: auto;
	overscroll-behavior: contain;
	transform: translateX(100%);
	transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.is-open .mobile-menu__panel {
	transform: translateX(0);
}

/* Panel header row */
.mobile-menu__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 1.25rem;
	height: 60px;
	border-bottom: 1px solid #1e1e21;
	flex-shrink: 0;
}

.mobile-menu__brand {
	font-size: 0.9375rem;
	font-weight: 800;
	letter-spacing: -0.02em;
	color: #fafafa;
	text-decoration: none;
	text-transform: lowercase;
	display: flex;
	align-items: center;
}

.mobile-menu__logo {
	height: 30px;
	width: auto;
	max-width: 160px;
	object-fit: contain;
}

.mobile-menu__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	background: rgba(255,255,255,0.05);
	border: 1px solid #27272a;
	border-radius: 8px;
	color: #71717a;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
	flex-shrink: 0;
}

.mobile-menu__close:hover {
	background: rgba(255,255,255,0.1);
	color: #e4e4e7;
}

/* Primary nav links */
.mobile-menu__nav {
	padding: 0.5rem 0;
	border-bottom: 1px solid #1e1e21;
}

.mobile-menu__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mobile-menu__list li a {
	display: flex;
	align-items: center;
	padding: 0.75rem 1.5rem;
	font-size: 0.9375rem;
	font-weight: 500;
	color: #71717a;
	text-decoration: none;
	transition: color 0.15s, background 0.15s;
}

.mobile-menu__list li a:hover,
.mobile-menu__list .current-menu-item > a {
	color: #e4e4e7;
	background: rgba(255,255,255,0.04);
}

/* CTA + contact links */
.mobile-menu__links {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 1rem 1.25rem;
	border-bottom: 1px solid #1e1e21;
}

.mobile-menu__cta {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.75rem 1rem;
	background: #ef4444;
	color: #fff;
	text-decoration: none;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 700;
	transition: background 0.15s;
	justify-content: center;
}

.mobile-menu__cta:hover { background: #dc2626; }

.mobile-menu__link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.65rem 1rem;
	color: #71717a;
	text-decoration: none;
	font-size: 0.875rem;
	border-radius: 8px;
	transition: color 0.15s, background 0.15s;
}

.mobile-menu__link:hover {
	color: #e4e4e7;
	background: rgba(255,255,255,0.04);
}

/* Auth section */
.mobile-menu__auth {
	margin-top: auto;
	padding: 1.25rem;
	border-top: 1px solid #1e1e21;
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

/* Logged-in: user info row */
.mobile-menu__user-info {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 0 1rem;
	border-bottom: 1px solid #1e1e21;
	margin-bottom: 0.5rem;
}

.mobile-menu__user-avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #ef4444;
	color: #fff;
	font-size: 0.875rem;
	font-weight: 700;
	flex-shrink: 0;
}

.mobile-menu__user-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mobile-menu__user-name {
	font-size: 0.875rem;
	font-weight: 600;
	color: #e4e4e7;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mobile-menu__user-email {
	font-size: 0.72rem;
	color: #52525b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Logged-in: action links */
.mobile-menu__auth-link {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.65rem 1rem;
	color: #a1a1aa;
	text-decoration: none;
	font-size: 0.875rem;
	border-radius: 8px;
	transition: color 0.15s, background 0.15s;
}

.mobile-menu__auth-link:hover {
	color: #e4e4e7;
	background: rgba(255,255,255,0.05);
}

.mobile-menu__auth-link--logout { color: #71717a; }
.mobile-menu__auth-link--logout:hover { color: #f87171; background: rgba(239,68,68,0.06); }

/* Logged-out: login + register buttons */
.mobile-menu__auth-btns {
	display: flex;
	flex-direction: column;
	gap: 0.625rem;
}

.mobile-menu__auth-login,
.mobile-menu__auth-register {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.7rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
	font-weight: 600;
	text-decoration: none;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.mobile-menu__auth-login {
	background: rgba(255,255,255,0.05);
	border: 1px solid #27272a;
	color: #e4e4e7;
}

.mobile-menu__auth-login:hover {
	background: rgba(255,255,255,0.09);
	border-color: #52525b;
}

.mobile-menu__auth-register {
	background: #ef4444;
	color: #fff;
}

.mobile-menu__auth-register:hover { background: #dc2626; }

