/* ===== NIYAPRESS HEADER — Magazine Layout ===== */

.site-header.site-header--magazine {
	background: #001D83;
	color: #fff;
	position: fixed;
	top: 0; left: 0; right: 0;
	z-index: 1000;
	box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.site-header.site-header--magazine .container {
	padding-inline: clamp(14px, 3vw, 20px);
}
.site-header.site-header--magazine ul,
.site-header.site-header--magazine li {
	list-style: none; margin: 0; padding: 0;
}

/* Top bar */
.site-header.site-header--magazine .header-top-bar {
	background: linear-gradient(180deg, #0026A8 0%, #001D83 60%, #001570 100%);
	border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-top-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 16px; min-height: 68px; padding-block: 8px; direction: rtl;
	max-width: 1280px; margin: 0 auto; width: 100%;
}

/* Branding */
.site-branding {
	flex: 0 1 auto; min-width: 0; max-width: min(260px, 44vw);
}
.site-branding .custom-logo-link {
	display: inline-block; line-height: 0;
}
.site-branding img, .site-branding svg {
	display: block; max-height: 60px; width: auto; object-fit: contain;
	filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}
.site-branding .custom-logo-link--adaptive .custom-logo--white,
.site-branding .custom-logo-link--adaptive .custom-logo--dark-only,
.custom-logo-link--white-only .custom-logo--white { display: none !important; }
body.dark-mode .custom-logo-link--adaptive .custom-logo--default { display: none !important; }
body.dark-mode .custom-logo-link--adaptive .custom-logo--white,
body.dark-mode .custom-logo-link--adaptive .custom-logo--dark-only,
body.dark-mode .custom-logo-link--white-only .custom-logo--white { display: block !important; }
.site-title { display: inline-flex; align-items: baseline; gap: 2px; font-size: 24px; font-weight: 900; color: #fff; text-decoration: none; }
.site-title .logo-number { color: #FAA31B; }

/* Leaderboard ad */
.header-top-ad-leaderboard {
	flex: 1 1 auto; display: flex; justify-content: center; align-items: center; padding: 0 12px;
	text-align: center;
}
.header-leaderboard-img { max-width: 100%; height: auto; border-radius: 3px; }

/* Top tools */
.header-top-tools {
	display: flex; align-items: center; gap: 8px; flex: 0 0 auto;
}
.top-links-pill {
	display: flex; align-items: center;
	background: rgba(255,255,255,0.12); backdrop-filter: blur(6px);
	border: 1px solid rgba(255,255,255,0.18); border-radius: 6px;
	padding: 3px 6px; max-width: min(500px, 58vw);
	overflow-x: auto; scrollbar-width: none;
}
.top-links-pill::-webkit-scrollbar { display: none; }
.top-links-menu { display: flex; gap: 2px; flex-wrap: nowrap; }
.top-links-menu a {
	display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
	font-size: 0.75rem; font-weight: 700; color: rgba(255,255,255,0.85); text-decoration: none;
	border-radius: 4px; white-space: nowrap; transition: background 0.2s;
}
.top-links-menu a:hover { background: rgba(255,255,255,0.15); color: #fff; }

/* Icon buttons */
.header-icon-btn, .menu-toggle {
	width: 36px; height: 36px; padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2);
	border-radius: 6px; color: #fff; cursor: pointer; flex-shrink: 0;
	transition: background 0.2s;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.2); }
.menu-toggle { display: none; flex-direction: column; gap: 4px; }
.menu-toggle-bar { width: 18px; height: 2px; background: #fff; border-radius: 1px; }

/* Dark mode icons */
.dark-mode-icon--moon { display: none; }
body.dark-mode .dark-mode-icon--sun { display: none; }
body.dark-mode .dark-mode-icon--moon { display: inline-flex; }

/* Nav bar */
.header-nav-bar {
	background: rgba(0,0,0,0.12); border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-nav-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 12px; padding-block: 0; direction: rtl;
	max-width: 1280px; margin: 0 auto; width: 100%;
}
.main-navigation {
	flex: 1 1 auto; min-width: 0; overflow-x: auto; overflow-y: hidden;
	background: transparent; scrollbar-width: none;
}
.main-navigation::-webkit-scrollbar { display: none; }
.primary-menu { display: flex; gap: 2px; flex-wrap: nowrap; min-width: max-content; }
.primary-menu li { flex: 0 0 auto; }
.primary-menu a {
	display: inline-flex; align-items: center; justify-content: center;
	height: 40px; padding: 0 14px;
	font-size: 0.875rem; font-weight: 700; color: rgba(255,255,255,0.85);
	text-decoration: none; border-radius: 6px; white-space: nowrap;
	transition: background 0.2s, color 0.2s;
}
.primary-menu a:hover { background: rgba(255,255,255,0.12); color: #fff; }
.primary-menu .current-menu-item > a,
.primary-menu .current_page_item > a {
	background: rgba(255,255,255,0.18); color: #fff; font-weight: 800;
}

/* Nav aside */
.header-nav-aside { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.header-search { position: relative; width: 200px; }
.header-search__field {
	width: 100%; height: 34px; padding-inline: 34px 10px;
	border: 1px solid rgba(255,255,255,0.15); border-radius: 6px;
	background: rgba(255,255,255,0.08); color: #fff; font-size: 0.8125rem; direction: rtl;
}
.header-search__field::placeholder { color: rgba(255,255,255,0.35); }
.header-search__field:focus { outline: none; border-color: rgba(255,255,255,0.3); }
.header-search__submit {
	position: absolute; inset-inline-start: 8px; top: 50%; transform: translateY(-50%);
	background: none; border: none; color: rgba(255,255,255,0.5); cursor: pointer; padding: 4px;
}
.header-search__submit:hover { color: #fff; }
.header-social .social-icons { display: flex; gap: 4px; }
.header-social .social-icons a {
	display: inline-flex; align-items: center; justify-content: center;
	width: 32px; height: 32px; border-radius: 6px;
	background: rgba(255,255,255,0.1); color: rgba(255,255,255,0.7);
	border: 1px solid rgba(255,255,255,0.12); transition: background 0.2s;
}
.header-social .social-icons a:hover { background: rgba(255,255,255,0.2); color: #fff; }

/* Accent line */
.header-accent { height: 2px; background: #FAA31B; }

/* Hide legacy */
.site-header .header-brand-bar,
.site-header .header-collapse:not(.header-nav-bar),
.site-header .search-overlay,
.site-header .search-toggle,
.site-header .container.header-inner { display: none !important; }

/* Dark mode */
body.dark-mode .site-header--magazine { background: #0a0a0a; }
body.dark-mode .header-top-bar { background: linear-gradient(180deg, #1a1a1a 0%, #0a0a0a 100%); }
body.dark-mode .header-nav-bar { background: rgba(255,255,255,0.02); }

/* Responsive */
@media (min-width: 769px) { .menu-toggle { display: none; } .header-nav-bar { display: block; } }
@media (max-width: 1024px) { .header-social { display: none; } .header-search { width: 160px; } }
@media (max-width: 900px) { .header-top-ad-leaderboard { display: none; } }
@media (max-width: 768px) {
	.header-top-inner { min-height: 56px; }
	.site-branding { max-width: min(160px, 46vw); }
	.site-branding img, .site-branding svg { max-height: 44px; }
	.top-links-pill { display: none; }
	.menu-toggle { display: inline-flex; }
	.header-nav-bar { display: none; }
	.header-nav-bar.is-open { display: block; }
	.header-nav-inner { flex-direction: column; align-items: stretch; padding: 12px; gap: 10px; }
	.primary-menu { flex-direction: column; min-width: 0; }
	.primary-menu a { width: 100%; justify-content: flex-start; height: 44px; }
	.header-nav-aside { width: 100%; flex-direction: column; }
	.header-search { width: 100%; }
	.header-social { display: block; }
}
@media (max-width: 480px) {
	.site-branding { max-width: min(140px, 44vw); }
	.site-branding img, .site-branding svg { max-height: 36px; }
}
