/**
 * Responsive Header - Hillegom Online
 * Hybride aanpak met alle elementen
 * Mobile-First Responsive Design
 *
 * @package Hillegom_Online
 */

/* ============================================
   CSS CUSTOM PROPERTIES
   ============================================ */
:root {
	/* Breakpoints */
	--bp-sm: 480px;
	--bp-md: 768px;
	--bp-lg: 992px;
	--bp-xl: 1200px;
	--bp-2xl: 1920px;
	
	/* Colors */
	--header-bg: #ffffff;
	--header-border: #e0e0e0;
	--text-primary: #1a1a1a;
	--text-secondary: #4a4a4a;
	--link-color: #1C7FC3;
	--link-hover: #155a8a;
	--accent-yellow: #FDFE00;
	
	/* Transitions */
	--transition: 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   MOBILE BASE (320px - 479px)
   ============================================ */

.site-header {
	width: 100%;
	position: sticky;
	top: 0;
	z-index: 1000;
	background-color: var(--header-bg);
	border-bottom: 1px solid var(--header-border);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: all var(--transition);
}

/* Non-sticky header via customizer */
body.no-sticky-header .site-header {
	position: relative !important;
	top: auto !important;
}

/* Adjust for WordPress admin bar when logged in */
body.admin-bar .site-header {
	top: 32px;
}

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

.site-header .container {
	width: 100%;
	max-width: 320px;
	padding: 0 10px;
	margin: 0 auto;
}

.header-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	align-content: flex-start;
	justify-content: flex-start;
	min-height: 56px;
	padding: 8px 0;
	gap: 4px;
}

/* ============================================
   SOCIAL MEDIA
   ============================================ */

.header-social {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 1 auto;
	margin-top: 4px;
}

.header-social a {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-width: 28px;
	min-height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	background: var(--link-color);
	color: #fff;
	transition: all var(--transition);
	text-decoration: none;
}

.header-social a:hover {
	background: var(--link-hover);
	transform: scale(1.1);
}

.header-social a:focus {
	outline: 2px solid var(--link-color);
	outline-offset: 2px;
}

.header-social svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* ============================================
   LOGO
   ============================================ */

.header-logo {
	flex-shrink: 0;
	order: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 4px;
	background: #ffffff;
	padding: 12px;
	border-radius: 8px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
	min-height: 100px;
	flex: 0 1 auto;
}

.logo-link {
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	transition: opacity var(--transition);
}

.logo-link:hover {
	opacity: 0.85;
}

.logo-link:focus {
	outline: 2px solid var(--link-color);
	outline-offset: 2px;
	border-radius: 4px;
}

.logo-img,
.logo-text {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Logo responsive visibility */
.logo-desktop,
.logo-tablet,
.logo-compact {
	display: none;
}

.logo-mobile {
	display: block;
	width: auto;
	max-height: 76px;
}

.logo-text {
	font-size: clamp(18px, 5vw, 24px);
	font-weight: 700;
	color: var(--link-color);
}

.site-tagline {
	font-size: 10px;
	font-style: italic;
	color: var(--text-secondary);
	text-align: center;
	margin: 0;
	opacity: 0.8;
}

/* ============================================
   PRIMARY NAVIGATION BAR
   ============================================ */

.primary-navigation {
	background: #ffffff;
	border-bottom: 2px solid #f0f0f0;
	position: sticky;
	top: 56px;
	z-index: 999;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Non-sticky menu via customizer */
body.no-sticky-menu .primary-navigation {
	position: relative !important;
	top: auto !important;
}

/* Adjust menu top when header is not sticky */
body.no-sticky-header .primary-navigation {
	top: 0 !important;
}

/* Adjust for WordPress admin bar when logged in */
body.admin-bar .primary-navigation {
	top: 88px; /* 32px admin bar + 56px header */
}

body.admin-bar.no-sticky-header .primary-navigation {
	top: 32px !important; /* Only admin bar height */
}

@media screen and (max-width: 782px) {
	body.admin-bar .primary-navigation {
		top: 102px; /* 46px admin bar + 56px header */
	}
	
	body.admin-bar.no-sticky-header .primary-navigation {
		top: 46px !important; /* Only admin bar height */
	}
}

/* Adjust sidebar when header is not sticky */
body.no-sticky-header .sidebar {
	top: 20px !important;
}

.primary-navigation .container {
	max-width: 1400px;
	margin: 0 auto;
	padding: 0 10px;
}

.nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 50px;
	position: relative;
}

/* Mobile Menu Wrapper */
.nav-menu-wrapper {
	display: none;
	width: 100%;
}

.nav-menu-wrapper.active {
	display: block;
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	background: #ffffff;
	border-top: 1px solid #f0f0f0;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	animation: slideDown 0.3s ease;
	z-index: 1000;
}

@keyframes slideDown {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.nav-menu {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.nav-menu li {
	border-bottom: 1px solid #f5f5f5;
}

.nav-menu li:last-child {
	border-bottom: none;
}

.nav-menu a {
	display: block;
	padding: 14px 16px;
	color: var(--text-primary);
	text-decoration: none;
	font-size: 15px;
	font-weight: 500;
	transition: all var(--transition);
}

.nav-menu a:hover,
.nav-menu a:focus {
	background-color: #f5f5f5;
	color: var(--link-color);
	padding-left: 20px;
}

.nav-menu .current-menu-item > a {
	color: var(--link-color);
	font-weight: 600;
}

/* ============================================
   WEATHER & DATE (with Social Media below)
   ============================================ */

.header-weather-date {
	display: flex;
	flex-direction: column;
	align-self: center;
	gap: 0;
	font-size: 11px;
	color: var(--text-secondary);
	order: 2;
	flex: 0 1 auto;
	min-height: 100px;
	max-height: 100px;
	justify-content: center;
}

.weather-wrap,
.date-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
}

.weather-wrap svg,
.date-wrap svg {
	width: 24px;
	height: 24px;
	min-width: 24px;
	flex-shrink: 0;
	fill: var(--accent-yellow);
}

.weather-wrap div,
.date-wrap div {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 4px;
	line-height: 1.2;
}

.weather-temp {
	font-size: 13px;
	font-weight: 600;
	color: inherit;
}

.weather-location {
	font-size: 10px;
	opacity: 0.85;
}

.date-day {
	font-size: 10px;
	text-transform: capitalize;
	opacity: 0.85;
}

.date-full {
	font-size: 11px;
	font-weight: 500;
}

/* ============================================
   HEADER ADVERTISEMENT
   ============================================ */

.header-ad {
	display: none; /* Verberg standaard op mobiel */
	order: 3;
	flex: 0 1 auto;
	max-height: 100px;
	max-width: 600px;
	overflow: hidden;
}

.header-ad:empty {
	display: none !important; /* Verberg als er geen advertentie is */
}

.header-ad img {
	max-height: 100px;
	max-width: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

.header-ad iframe,
.header-ad div {
	max-height: 100px;
	max-width: 100%;
}

/* ============================================
   HAMBURGER MENU BUTTON
   ============================================ */

.menu-toggle {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	width: 40px;
	height: 40px;
	min-width: 40px;
	gap: 4px;
	transition: all var(--transition);
	border-radius: 4px;
	margin-left: auto;
}

.menu-toggle:hover {
	background-color: #f5f5f5;
}

.menu-toggle:focus {
	outline: 2px solid var(--link-color);
	outline-offset: 2px;
}

.hamburger-line {
	display: block;
	width: 24px;
	height: 3px;
	background-color: var(--text-primary);
	border-radius: 2px;
	transition: all var(--transition);
}

.menu-toggle.active .hamburger-line:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
	opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   SM BREAKPOINT (480px - 767px)
   ============================================ */

@media (min-width: 480px) {
	.site-header .container {
		max-width: 480px;
		padding: 0 15px;
	}	
	.primary-navigation .container {
		max-width: 460px;
	}	
	.header-inner {
		min-height: 60px;
		gap: 6px;
	}
	
	.header-social {
		gap: 10px;
		padding: 10px 0;
	}
	
	.header-social a {
		width: 30px;
		height: 30px;
		min-width: 30px;
	}
	
	.header-social svg {
		width: 15px;
		height: 15px;
	}
	
	.logo-mobile {
		max-height: 36px;
	}
	
	.header-weather-date {
		font-size: 12px;
		gap: 6px;
	}
	
	.weather-wrap svg,
	.date-wrap svg {
		width: 14px;
		height: 14px;
	}
}

/* ============================================
   MD BREAKPOINT (768px - 991px)
   TABLET
   ============================================ */

@media (min-width: 768px) {
	.site-header .container {
		max-width: 738px;
		padding: 0 15px;
	}
	
	.primary-navigation .container {
		max-width: 738px;
		padding: 0 15px;
	}
	
	.header-inner {
		min-height: 64px;
		gap: 6px;
		justify-content: flex-start;
	}
	
	.header-social {
		order: 1;
		gap: 10px;
	}
	
	.logo-mobile {
		display: none;
	}
	
	.logo-tablet {
		display: block;
		max-height: 40px;
	}
	
	.header-logo {
		order: 2;
		padding: 14px 10px 14px 20px;
		min-height: 64px;
		border-radius: 10px;
	}
	
	.header-weather-date {
		order: 3;
		gap: 6px;
	}
	
	.weather-wrap svg,
	.date-wrap svg {
		width: 16px;
		height: 16px;
	}
}

/* ============================================
   LG BREAKPOINT (992px - 1199px)
   DESKTOP - HORIZONTAL MENU
   ============================================ */

@media (min-width: 992px) {
	.site-header .container {
		max-width: 960px;
		padding: 0 16px;
	}
	
	.primary-navigation .container {
		max-width: 960px;
		padding: 0 16px;
	}
	
	.header-inner {
		min-height: 70px;
		gap: 24px;
		flex-wrap: nowrap;
		justify-content: flex-start;
	}
	
	/* Logo First */
	.header-logo {
		order: 1;
		padding: 12px;
		min-height: 100px;
		border-radius: 12px;
		box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
	}
	
	.logo-tablet {
		display: none;
	}
	
	.logo-desktop {
		display: block;
		max-height: 76px;
	}
	
	/* Weather & Date Second */
	.header-weather-date {
		order: 2;
		gap: 6px;
	}
	
	/* Social Left */
	.header-social {
		gap: 12px;
		margin-top: 8px;
	}
	
	.header-social a {
		width: 32px;
		height: 32px;
	}
	
	/* Header Ad Third */
	.header-ad {
		display: flex;
		align-items: center;
		justify-content: center;
		order: 3;
		max-width: 600px;
	}
	
	/* Navigation Bar - Desktop Layout */
	.menu-toggle {
		display: none !important;
	}
	
	.nav-menu-wrapper {
		display: block !important;
		position: static;
		width: auto;
		box-shadow: none;
	}
	
	.nav-menu {
		flex-direction: row;
		gap: 0;
		align-items: center;
		justify-content: center;
	}
	
	.nav-menu li {
		border: none;
	}
	
	.nav-menu a {
		padding: 16px;
		font-size: 15px;
		border-bottom: 3px solid transparent;
		background: none !important;
		transition: all 0.3s ease;
	}
	
	.nav-menu a:hover,
	.nav-menu a:focus {
		color: var(--link-color);
		border-bottom-color: var(--link-color);
		padding-left: 16px;
		background: none !important;
	}
	
	.nav-menu .current-menu-item > a {
		border-bottom-color: var(--link-color);
	}
}

/* ============================================
   XL BREAKPOINT (1200px - 1919px)
   LARGE DESKTOP
   ============================================ */

@media (min-width: 1200px) {
	.site-header .container {
		max-width: 1200px;
		padding: 0 20px;
	}
	
	.primary-navigation .container {
		max-width: 1200px;
		padding: 0 20px;
	}
	
	.header-inner {
		min-height: 80px;
		gap: 30px;
		justify-content: flex-start;
	}
	
	.header-logo {
		padding: 12px;
		min-height: 100px;
	}
	
	.logo-desktop {
		max-height: 76px;
	}
	
	.header-social {
		gap: 14px;
		margin-top: 10px;
	}
	
	.header-social a {
		width: 34px;
		height: 34px;
	}
	
	.header-social svg {
		width: 17px;
		height: 17px;
	}
	
	.nav-menu {
		gap: 0;
	}
	
	.nav-menu a {
		padding: 18px;
		font-size: 16px;
	}
	
	.nav-menu a:hover,
	.nav-menu a:focus {
		padding-left: 18px;
	}
	
	.header-ad {
		max-width: 600px;
	}
}

/* ============================================
   2XL BREAKPOINT (1920px+)
   FULL HD+
   ============================================ */

@media (min-width: 1920px) {
	.site-header .container {
		max-width: 1400px;
		padding: 0 30px;
	}
	
	.primary-navigation .container {
		max-width: 1400px;
		padding: 0 30px;
	}
	
	.header-inner {
		min-height: 90px;
		gap: 36px;
		justify-content: flex-start;
	}
	
	.header-logo {
		padding: 12px;
		min-height: 100px;
	}
	
	.logo-desktop {
		max-height: 76px;
	}
	
	.header-social {
		gap: 16px;
		margin-top: 12px;
	}
	
	.header-social a {
		width: 36px;
		height: 36px;
	}
	
	.nav-menu a {
		max-height: 56px;
	}
	
	.nav-menu a {
		padding: 20px;
		font-size: 17px;
	}
	
	.nav-menu a:hover,
	.nav-menu a:focus {
		padding-left: 20px;
	}
	
	.header-ad {
		max-width: 600px;
	}
}

/* ============================================
   ACCESSIBILITY & REDUCED MOTION
   ============================================ */

@media (prefers-reduced-motion: reduce) {
	* {
		animation-duration: 0.01ms !important;
		transition-duration: 0.01ms !important;
	}
}

/* Skip Link */
.skip-link {
	position: absolute;
	top: -40px;
	left: 0;
	background: var(--link-color);
	color: #fff;
	padding: 8px 16px;
	text-decoration: none;
	z-index: 10000;
	border-radius: 0 0 4px 0;
}

.skip-link:focus {
	top: 0;
	outline: 2px solid var(--accent-yellow);
}

/* Focus Visible */
.nav-menu a:focus-visible,
.header-social a:focus-visible,
.logo-link:focus-visible,
.menu-toggle:focus-visible {
	outline: 3px solid var(--link-color);
	outline-offset: 2px;
}

/* ============================================
   SCROLLED STATE
   ============================================ */

.site-header.is-scrolled {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (min-width: 992px) {
	.site-header.is-scrolled .header-inner {
		min-height: 60px;
	}
	
	.site-header.is-scrolled .logo-desktop {
		max-height: 40px;
	}
}
