/*==========================================================
LAYOUT — Container, Header, Footer, Structure
==========================================================*/

.container {
	width: min(100% - 2.5rem, var(--container));
	margin-inline: auto;
}

main {
	display: block;
	min-height: 60vh;
	padding-top: calc(var(--header-h) + var(--topbar-h));
}

.section-padding {
	padding: var(--space-2xl) 0;
}

.bg-light {
	background: var(--background-alt);
}

/* —— Top bar —— */
.top-bar {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: var(--topbar-h);
	background: var(--primary-dark);
	color: rgba(255, 255, 255, 0.9);
	font-size: 0.8rem;
	z-index: 1001;
	display: flex;
	align-items: center;
}

.top-bar-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	gap: 1rem;
}

.top-left {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.top-right a {
	color: rgba(255, 255, 255, 0.85);
	font-weight: 500;
}

.top-right a:hover { color: #fff; }

/* —— Header —— */
.site-header {
	position: fixed;
	top: var(--topbar-h);
	left: 0;
	right: 0;
	height: var(--header-h);
	background: rgba(255, 255, 255, 0.96);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	border-bottom: 1px solid var(--border);
	z-index: 1000;
	transition: box-shadow var(--transition);
}

.site-header.scrolled {
	box-shadow: var(--shadow-sm);
}

.navbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: var(--header-h);
	gap: 1.5rem;
}

.logo {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.logo img {
	width: 48px;
	height: 48px;
	object-fit: contain;
}

.logo-text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.logo-title {
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--primary);
}

.logo-subtitle {
	font-size: 0.7rem;
	color: var(--text-light);
	font-weight: 500;
}

.nav-menu {
	display: flex;
	align-items: center;
	gap: 0.15rem;
	list-style: none;
	padding: 0;
	margin: 0;
}

.nav-menu li { margin: 0; }

.nav-menu a {
	display: block;
	padding: 0.5rem 0.85rem;
	font-weight: 560;
	font-size: 0.92rem;
	color: var(--gray-700);
	border-radius: 8px;
	transition: background var(--transition), color var(--transition);
}

.nav-menu a:hover,
.nav-menu .current-menu-item > a {
	color: var(--primary);
	background: var(--primary-light);
}

.nav-actions {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-shrink: 0;
}

.search-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	color: var(--gray-600);
	transition: background var(--transition), color var(--transition);
}

.search-btn:hover {
	background: var(--gray-100);
	color: var(--primary);
}

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

.mobile-toggle span {
	display: block;
	height: 2px;
	width: 100%;
	background: var(--gray-800);
	border-radius: 2px;
	transition: var(--transition);
}

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

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

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

/* —— Footer —— */
.site-footer {
	background: #0B1E33;
	color: #D8E4F0;
	padding: var(--space-2xl) 0 var(--space-lg);
	margin-top: 0;
}

.footer-grid {
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
	gap: 2.5rem;
}

.footer-column h3,
.footer-column h4 {
	color: #fff;
	margin-bottom: 1.1rem;
	font-size: 1.05rem;
}

.footer-column p {
	color: #A8BDD0;
	font-size: 0.92rem;
	line-height: 1.7;
}

.footer-column ul {
	list-style: none;
	padding: 0;
	margin: 0;
}

.footer-column li {
	margin-bottom: 0.65rem;
}

.footer-column a {
	color: #A8BDD0;
	font-size: 0.92rem;
}

.footer-column a:hover {
	color: #fff;
}

.footer-social {
	display: flex;
	gap: 0.6rem;
	margin-top: 1.25rem;
}

.footer-social a {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 0.75rem;
	font-weight: 700;
	transition: background var(--transition);
}

.footer-social a:hover {
	background: var(--primary);
}

.footer-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1.5rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.1);
	font-size: 0.88rem;
	color: #8BA3B8;
}

.footer-links {
	display: flex;
	gap: 1.5rem;
}

.footer-links a {
	color: #8BA3B8;
}

.footer-links a:hover {
	color: #fff;
}

/* —— Back to top —— */
.back-to-top {
	position: fixed;
	right: 1.5rem;
	bottom: 1.5rem;
	width: 48px;
	height: 48px;
	border: none;
	border-radius: 50%;
	background: var(--primary);
	color: #fff;
	font-size: 1.25rem;
	cursor: pointer;
	box-shadow: var(--shadow-md);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity var(--transition), visibility var(--transition), transform var(--transition), background var(--transition);
	z-index: 900;
}

.back-to-top.show {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.back-to-top:hover {
	background: var(--primary-dark);
}


/* When top bar is disabled in Customizer */
body.no-topbar {
	--topbar-h: 0px;
}
body.no-topbar .site-header {
	top: 0;
}
