/* Congdy Header & Footer - Front */
body {
	padding-top: var(--chf-header-h, 0px);
	padding-bottom: var(--chf-footer-h, 0px);
}

/* Header */
.chf-header {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 99999;
	background: var(--chf-header-bg);
	color: var(--chf-header-fg);
	box-shadow: 0 6px 20px rgba(0,0,0,0.06);
}

.chf-inner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: var(--chf-header-py, 12px) 16px;
	max-width: 1200px;
	margin: 0 auto;
}

.chf-brand {
	flex: 0 0 auto;
}

.chf-site-link {
	color: var(--chf-header-fg);
	text-decoration: none;
	font-weight: 700;
	letter-spacing: -0.2px;
}

.chf-nav {
	flex: 1 1 auto;
	min-width: 0;
}


/* Nav wrapper + Mobile menu */
.chf-mobile-panel {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 10px;
}

.chf-mobile-panel .chf-nav {
	flex: 1 1 auto;
	min-width: 0;
}

.chf-search-btn--mobile { display: none !important; }

/* Always hide the mobile-only search button on desktop (extra safety against theme overrides) */
@media (min-width: 769px) {
	.chf-search-btn--mobile { display: none !important; }
}

/* Hamburger */
.chf-burger-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	border: 1px solid rgba(0,0,0,0.10);
	background: rgba(255,255,255,0.0);
	color: var(--chf-header-fg);
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}
.chf-burger-btn:hover { background: transparent; }
.chf-burger-btn:active { transform: translateY(1px); }

/* Prevent hover transparency on icons (theme overrides) */
.chf-search-btn,
.chf-search-btn:hover,
.chf-search-btn:focus,
.chf-search-btn:active,
.chf-burger-btn,
.chf-burger-btn:hover,
.chf-burger-btn:focus,
.chf-burger-btn:active {
	opacity: 1 !important;
	color: var(--chf-header-fg) !important;
	filter: none !important;
}
.chf-search-btn svg,
.chf-burger-btn svg {
	opacity: 1 !important;
}

.chf-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 10px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.chf-menu .menu-item {
	margin: 0;
	padding: 0;
}

/* If theme/plugins append a "search" menu item (e.g., GeneratePress nav search), hide it inside this plugin header
   to avoid duplicated magnifier icons on desktop. */
.chf-header li.search-item,
.chf-header .menu-bar-item.search-item,
.chf-header .menu-item.search-item {
	display: none !important;
}

.chf-menu a {
	color: var(--chf-header-fg);
	text-decoration: none;
	font-size: var(--chf-menu-font-size, 14px);
	font-weight: var(--chf-menu-font-weight, 600);
	line-height: 1.2;
	padding: 6px 8px;
	border-radius: 10px;
	transition: color .15s ease, opacity .15s ease;
	white-space: nowrap;
}

.chf-menu a:hover {
	background: transparent;
	color: var(--chf-menu-hover-color, currentColor);
}


.chf-menu-empty {
	opacity: .7;
	font-size: 13px;
	text-align: right;
}

.chf-actions {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

.chf-search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	border: 1px solid rgba(0,0,0,0.10);
	background: rgba(255,255,255,0.0);
	color: var(--chf-header-fg);
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}

.chf-search-btn:hover {
	background: transparent;
}

.chf-search-btn:active {
	transform: translateY(1px);
}

/* Searchbar */
.chf-searchbar {
	border-top: 1px solid rgba(0,0,0,0.08);
	background: var(--chf-header-bg);
	color: var(--chf-header-fg);
}

.chf-searchbar-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 10px 16px 14px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.chf-search-msg {
	flex: 0 0 auto;
	font-size: 13px;
	opacity: 0.85;
	white-space: nowrap;
}

.chf-search-form {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.chf-search-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 38px;
	border-radius: 12px;
	border: 1px solid rgba(0,0,0,0.12);
	padding: 0 12px;
	font-size: 14px;
	outline: none;
}

.chf-search-submit {
	height: 38px;
	border-radius: 0;
	border: 1px solid rgba(0,0,0,0.12);
	background: rgba(0,0,0,0.88);
	color: #fff;
	padding: 0 12px;
	cursor: pointer;
}

.chf-search-close {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 12px;
	border: 1px solid rgba(0,0,0,0.12);
	background: transparent;
	color: var(--chf-header-fg);
	cursor: pointer;
	font-size: 22px;
	line-height: 1;
}

/* Footer */
.chf-footer {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99998;
	background: var(--chf-footer-bg);
	color: var(--chf-footer-fg);
	border-top: 1px solid rgba(0,0,0,0.10);
}

.chf-footer-inner {
	text-align: center;
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--chf-footer-py, 10px) 16px;
	font-size: 13px;
	opacity: 0.95;
}

/* Mobile adjustments */
@media (max-width: 768px) {
	.chf-inner {
		gap: 10px;
		padding: calc(var(--chf-header-py, 12px) - 2px) 12px;
	}
	.chf-menu a {
		font-size: 13px;
		padding: 6px 7px;
	}
	.chf-searchbar-inner {
		flex-wrap: wrap;
		align-items: stretch;
	}
	.chf-search-msg {
		width: 100%;
	}
	.chf-search-close {
		margin-left: auto;
	}
}

/* Icon centering fix */
.chf-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
}
.chf-icon svg {
	display: block;
}


/* Logo */
.chf-logo {
	display: block;
	height: 28px;
	width: auto;
	max-width: 180px;
	object-fit: contain;
}
@media (max-width: 768px) {
	.chf-logo { height: 24px; }
}

/* Search icon hover stability */
.chf-search-btn { opacity: 1 !important; }
.chf-search-btn:hover,
.chf-search-btn:focus { opacity: 1 !important; }

.chf-footer-link {
	color: var(--chf-footer-fg);
	text-decoration: none;
}
.chf-footer-link:hover {
	text-decoration: underline;
}
.chf-sep {
	opacity: 0.7;
	padding: 0 6px;
}

/* WordPress Custom Logo */
.chf-logo-wrap .custom-logo-link {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	text-decoration: none;
}
.chf-logo-wrap .custom-logo {
	display: block;
	height: var(--chf-header-logo-h, 28px);
	width: auto;
	max-width: 180px;
	object-fit: contain;
}
@media (max-width: 768px) {
	.chf-logo-wrap .custom-logo { height: calc(var(--chf-header-logo-h, 28px) - 4px); }
}


/* Plugin header logo */
.chf-logo-link {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	text-decoration: none;
}
.chf-header-logo {
	display: block;
	height: var(--chf-header-logo-h, 28px);
	width: auto;
	max-width: 180px;
	object-fit: contain;
}
@media (max-width: 768px) {
	.chf-header-logo { height: calc(var(--chf-header-logo-h, 28px) - 4px); max-width: 140px; }
}


@media (max-width: 768px) {
	/* First row layout: brand left, hamburger right */
	.chf-inner {
		flex-wrap: wrap;
		justify-content: space-between;
	}

	/* Brand spacing (admin configurable) */
	.chf-brand {
		flex: 1 1 auto;
		padding-left: var(--chf-mobile-brand-pl, 10px);
	}

	/* First row: brand + hamburger */
	.chf-actions {
		flex: 0 0 auto;
		margin-left: auto;
		padding-right: var(--chf-mobile-burger-pr, 10px);
		gap: 8px;
	}

	/* Hide desktop search on mobile, show hamburger */
	.chf-search-btn--desktop { display: none !important; }
	.chf-burger-btn { display: inline-flex; }

	/* Remove hamburger separator/outline border on mobile */
	.chf-burger-btn {
		border: 0 !important;
	}

	/* Dropdown panel */
	.chf-mobile-panel {
		flex-basis: 100%;
		width: 100%;
		display: none;
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		gap: 12px;
		padding: 10px 0 6px;
	}

	.chf-header.chf-mobile-open .chf-mobile-panel { display: flex; }

	/* Search icon inside mobile panel (only when open) */
	.chf-header.chf-mobile-open .chf-search-btn--mobile { display: inline-flex !important; }

	/* Place menu first, search icon at the very bottom */
	.chf-mobile-panel .chf-nav { order: 1; }
	.chf-mobile-panel .chf-search-btn--mobile {
		order: 2;
		align-self: center;
		margin: 2px auto 0;
	}

	/* Menu stacking + center alignment */
	.chf-mobile-panel .chf-nav { width: 100%; }
	.chf-mobile-panel .chf-menu {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 10px;
	}
	.chf-mobile-panel .chf-menu-empty { text-align: center; }
}
