/**
 * AskIfra Header CSS — Topbar + Sticky Header + Search Overlay + Nav Toggle
 * @package AskIfra
 * @since 1.1.0
 */

/* ==========================================================================
   BODY OFFSET — push content below the fixed sticky wrap
   ========================================================================== */

body {
	padding-top: calc(36px + 72px); /* topbar + header */
}

/* ==========================================================================
   STICKY WRAP — topbar + header fixed together at top
   ========================================================================== */

.site-sticky-wrap {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 300;
	box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

/* ==========================================================================
   TOP BAR
   ========================================================================== */

.topbar {
	background: #2E8B73;
	color: #fff;
	font-size: 12px;
	font-weight: 500;
	padding: 0;
	width: 100%;
	height: 36px;
	display: flex;
	align-items: center;
}

.topbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	width: 100%;
	height: 100%;
}

.topbar__date {
	color: rgba(255,255,255,0.92);
	letter-spacing: 0.02em;
	white-space: nowrap;
	font-size: 12px;
}

.topbar__social-list {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-direction: row; /* MUST be row — prevent vertical stacking */
}

.topbar__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	color: rgba(255,255,255,0.85);
	border-radius: 4px;
	transition: all 0.15s;
	text-decoration: none;
}

.topbar__social-link:hover {
	color: #fff;
	background: rgba(255,255,255,0.2);
}

.topbar__social-link svg {
	display: block;
	flex-shrink: 0;
}

/* ==========================================================================
   MAIN HEADER
   ========================================================================== */

.site-header {
	background: #ffffff;
	border-bottom: 1px solid #E5E7EB;
	width: 100%;
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	height: 72px;
}

/* ── Logo ── */
.site-header__logo {
	flex-shrink: 0;
}

.site-header__logo .custom-logo-link,
.site-header__logo a {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
}

.site-header__logo .custom-logo {
	height: 48px;
	width: auto;
	display: block;
}

.site-logo__text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
	font-weight: 700;
	font-size: 20px;
	color: #2E8B73;
	text-decoration: none;
}

.site-logo__tagline {
	font-size: 11px;
	font-weight: 500;
	color: #6B7280;
	letter-spacing: 0.05em;
}

/* ── Header right actions (search + hamburger) ── */
.site-header__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
}

.site-header__search {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	color: #6B7280;
	border-radius: 8px;
	border: 1px solid transparent;
	background: none;
	cursor: pointer;
	transition: all 0.15s;
}

.site-header__search:hover {
	color: #2E8B73;
	background: #e8f5f2;
	border-color: #E5E7EB;
}

/* ==========================================================================
   NAV TOGGLE — hamburger (mobile only)
   ========================================================================== */

.nav-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 8px;
	background: #fff;
	border: 1.5px solid #E5E7EB;
	border-radius: 8px;
	cursor: pointer;
	flex-shrink: 0;
	position: relative;
	z-index: 10001;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

.nav-toggle:hover {
	background: #e8f5f2;
	border-color: #2E8B73;
}

.nav-toggle__bar {
	display: block;
	width: 20px;
	height: 2px;
	background: #374151;
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease;
	pointer-events: none;
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) {
	opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   SEARCH OVERLAY
   ========================================================================== */

.search-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15,23,42,0.65);
	z-index: 9000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding-top: 12vh;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	backdrop-filter: blur(4px);
}

.search-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

.search-overlay__inner {
	background: #fff;
	border-radius: 20px;
	padding: 40px 48px;
	width: 100%;
	max-width: 600px;
	margin: 0 16px;
	position: relative;
	box-shadow: 0 20px 60px rgba(0,0,0,0.15);
	transform: translateY(-16px);
	transition: transform 0.25s ease;
}

.search-overlay.is-active .search-overlay__inner {
	transform: translateY(0);
}

.search-overlay__close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6B7280;
	border-radius: 8px;
	background: none;
	border: none;
	cursor: pointer;
	transition: all 0.15s;
}

.search-overlay__close:hover {
	color: #1F2937;
	background: #f3f4f6;
}

.search-overlay__label {
	font-size: 18px;
	font-weight: 600;
	color: #1F2937;
	margin-bottom: 16px;
}

.search-overlay .search-form {
	display: flex;
	gap: 10px;
}

.search-overlay .search-field {
	flex: 1;
	padding: 14px 18px;
	font-size: 16px;
	border: 2px solid #E5E7EB;
	border-radius: 12px;
	background: #f9fafb;
	color: #1F2937;
	outline: none;
	transition: border-color 0.15s;
	font-family: inherit;
}

.search-overlay .search-field:focus {
	border-color: #2E8B73;
	background: #fff;
}

.search-overlay .search-submit {
	padding: 14px 24px;
	background: #2E8B73;
	color: #fff;
	border: none;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.15s;
	font-family: inherit;
}

.search-overlay .search-submit:hover {
	background: #246d5a;
}

/* ==========================================================================
   ADMIN BAR OFFSETS
   ========================================================================== */

.admin-bar body {
	padding-top: calc(36px + 72px + 32px);
}

.admin-bar .site-sticky-wrap {
	top: 32px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
	body {
		padding-top: calc(36px + 60px);
	}

	.site-header__inner {
		height: 60px;
		gap: 10px;
	}

	.nav-toggle {
		display: flex;
	}

	.search-overlay__inner {
		padding: 32px 24px;
	}

	.search-overlay .search-form {
		flex-direction: column;
	}

	.admin-bar body {
		padding-top: calc(36px + 60px + 46px);
	}

	.admin-bar .site-sticky-wrap {
		top: 46px;
	}
}

@media (max-width: 480px) {
	.topbar__date {
		font-size: 11px;
	}

	.topbar__social-link {
		width: 22px;
		height: 22px;
	}
}
