/* =========================================
   Goshen Header Widget
   Fully responsive, accessible (IS 5568)
   ========================================= */

.goshen-header,
.goshen-header * {
	box-sizing: border-box;
}

.goshen-header {
	direction: rtl;
	width: 100%;
	position: relative;
	z-index: 1000;
	font-family: "Assistant", "Heebo", Arial, sans-serif;
}

/* Sticky */
.goshen-header.goshen-sticky {
	position: sticky;
	top: 0;
	z-index: 9999;
}

/* ─── Skip Link (a11y – IS 5568 2.4.1) ───── */

.goshen-skip-link {
	position: absolute;
	top: -100%;
	right: 0;
	background: #0099cc;
	color: #ffffff;
	padding: 12px 24px;
	z-index: 100000;
	font-size: 16px;
	font-weight: 700;
	text-decoration: none;
	border-radius: 0 0 0 8px;
	transition: top 0.15s ease;
	outline: none;
}

.goshen-skip-link:focus {
	top: 0;
}

/* Screen-reader only text */
.screen-reader-text {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* ─── Focus styles – ONLY on keyboard nav ── */
/*    Completely remove all outlines by default.
      The .goshen-keyboard-nav class is added by
      JS only when the user presses Tab.
      Removed on any mouse/touch event.          */

.goshen-header *:focus,
.goshen-header *:focus-visible {
	outline: none !important;
}

.goshen-keyboard-nav .goshen-header a:focus-visible,
.goshen-keyboard-nav .goshen-header button:focus-visible,
.goshen-keyboard-nav .goshen-header input:focus-visible {
	outline: 3px solid #e8734a !important;
	outline-offset: 2px !important;
}

/* ─── Top Bar ─────────────────────────────── */

.goshen-top-bar {
	background-color: #ffffff;
	position: relative;
	z-index: 9999;
	width: 100%;
}

.goshen-top-bar-inner {
	width: 100%;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 32px;
	gap: 20px;
}

/* Logo – right side in RTL */
.goshen-logo {
	flex-shrink: 0;
}

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

.goshen-logo a {
	display: inline-block;
	line-height: 0;
}

/* Secondary Nav – flush to the left edge in RTL */
.goshen-secondary-nav {
	flex: 1;
	min-width: 0;
	display: flex;
	justify-content: flex-end;
}

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

.goshen-secondary-menu-list li a {
	text-decoration: none;
	padding: 6px 12px;
	transition: color 0.2s ease;
	white-space: nowrap;
	display: inline-block;
}

/* Mobile toggle – hidden on desktop */
.goshen-mobile-toggle {
	display: none;
	background: none;
	border: none;
	cursor: pointer;
	padding: 8px;
	flex-direction: column;
	gap: 5px;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
}

.goshen-mobile-toggle span {
	display: block;
	width: 24px;
	height: 2px;
	background-color: #0099cc;
	transition: transform 0.3s ease, opacity 0.3s ease;
	border-radius: 2px;
}

.goshen-mobile-toggle.is-active span:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.goshen-mobile-toggle.is-active span:nth-child(2) {
	opacity: 0;
}

.goshen-mobile-toggle.is-active span:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

/* ─── Primary Bar ─────────────────────────── */

.goshen-primary-bar {
	background-color: #0099cc;
	border-radius: 25px;
	margin: 0 32px;
	position: relative;
}

.goshen-primary-bar-inner {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 4px 32px;
	gap: 12px;
}

/* Primary Nav – right side in RTL (flex-start = right) */
.goshen-primary-nav {
	flex: 1;
	min-width: 0;
}

.goshen-primary-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	flex-wrap: nowrap;
}

.goshen-menu-item {
	position: relative;
}

.goshen-menu-link {
	display: flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	color: #ffffff;
	padding: 12px 18px;
	white-space: nowrap;
	transition: background-color 0.2s ease;
	border-radius: 4px;
	min-height: 44px;
}

.goshen-menu-link:hover {
	background-color: rgba(255, 255, 255, 0.15);
}

.goshen-chevron {
	display: inline-flex;
	transition: transform 0.2s ease;
}

.goshen-has-submenu:hover .goshen-chevron,
.goshen-has-submenu.is-open .goshen-chevron {
	transform: rotate(180deg);
}

/* ─── Search Bar – always left in RTL ─────── */

.goshen-search-form {
	display: flex;
	align-items: center;
	background-color: #0088b5;
	border-radius: 20px;
	padding: 0 12px;
	width: 250px;
	flex-shrink: 0;
	height: 38px;
}

.goshen-search-input {
	flex: 1;
	/* Override Foundation's base input styles */
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	outline: none !important;
	/* Typography & spacing */
	color: #ffffff;
	font-size: 14px;
	font-family: inherit;
	padding: 0 8px !important;
	margin: 0 !important;
	/* Vertical centering — override Foundation's line-height/height */
	height: 100% !important;
	line-height: 1 !important;
	/* Layout */
	direction: rtl;
	min-width: 0;
	-webkit-appearance: none !important;
	appearance: none !important;
	align-self: center;
}

.goshen-search-input:focus,
.goshen-search-input:focus-visible,
.goshen-search-input:active {
	/* Override Foundation's [type=search]:focus rule */
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: transparent !important;
}

.goshen-search-input::placeholder {
	color: rgba(255, 255, 255, 0.7);
	line-height: 1;
}

.goshen-search-form:focus-within {
	box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.45);
}

.goshen-search-icon {
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	min-width: 44px;
	min-height: 44px;
}

.goshen-search-icon svg {
	fill: currentColor;
}

/* ─── Submenu Dropdown ────────────────────── */

.goshen-submenu-dropdown {
	position: absolute;
	top: 100%;
	right: 0;
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
	padding: 16px 8px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
	z-index: 100;
	min-width: 200px;
}

.goshen-has-submenu:hover > .goshen-submenu-dropdown,
.goshen-has-submenu.is-open > .goshen-submenu-dropdown {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.goshen-submenu-columns {
	display: flex;
	gap: 0;
	direction: rtl;
}

.goshen-submenu-column {
	list-style: none;
	margin: 0;
	padding: 0;
	min-width: 180px;
}

.goshen-submenu-column + .goshen-submenu-column {
	border-right: 1px solid #eee;
	padding-right: 8px;
	margin-right: 8px;
}

.goshen-submenu-item {
	list-style: none;
}

.goshen-submenu-link {
	display: flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: #333333;
	padding: 8px 16px;
	border-radius: 6px;
	transition: background-color 0.15s ease;
	white-space: nowrap;
	min-height: 40px;
}

.goshen-submenu-link:hover {
	background-color: #e8f4f8;
}

.goshen-submenu-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: #b8d8e8;
	flex-shrink: 0;
}

/* ─── Accent Line ─────────────────────────── */

.goshen-accent-line {
	height: 3px;
	background-color: #e8734a;
	margin-top: 4px;
}

/* ─── Off-Canvas Mobile Menu ──────────────── */

.goshen-mobile-menu {
	position: fixed;
	top: 0;
	right: 0;
	width: 100vw;
	height: 100vh;
	height: 100dvh;
	background: #ffffff;
	z-index: 9998;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 20px;
	direction: rtl;

	transform: translateY(-100%);
	visibility: hidden;
	opacity: 0;
	transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
	            opacity 0.35s ease,
	            visibility 0.35s ease;
}

.goshen-mobile-menu.is-open {
	transform: translateY(0);
	visibility: visible;
	opacity: 1;
}

/* Body lock when menu is open */
body.goshen-menu-open {
	overflow: hidden;
	position: fixed;
	width: 100%;
}

/* Mobile search */
.goshen-mobile-search-form {
	margin-bottom: 20px;
}

.goshen-mobile-search-input {
	width: 100%;
	padding: 12px 16px;
	border: 2px solid #0099cc;
	border-radius: 20px;
	font-size: 16px;
	direction: rtl;
	font-family: inherit;
	min-height: 44px;
}

.goshen-mobile-search-input:focus {
	border-color: #007aa3;
	outline: none;
}

.goshen-mobile-search-input:focus-visible {
	outline: 3px solid #e8734a;
	outline-offset: 2px;
}

/* Mobile nav lists */
.goshen-mobile-menu-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.goshen-mobile-menu-list li {
	border-bottom: 1px solid #f0f0f0;
}

.goshen-mobile-menu-list li:last-child {
	border-bottom: none;
}

.goshen-mobile-menu-list li a {
	display: block;
	padding: 14px 8px;
	text-decoration: none;
	font-size: 16px;
	transition: background-color 0.15s ease;
	min-height: 44px;
}

.goshen-mobile-menu-list li a:hover {
	background-color: #f5f5f5;
}

/* Mobile submenus */
.goshen-mobile-menu-list .sub-menu {
	list-style: none;
	margin: 0;
	padding: 0 16px 0 0;
}

.goshen-mobile-menu-list .sub-menu li a {
	font-size: 15px;
	padding-right: 24px;
	color: #555;
}

.goshen-mobile-menu-list .menu-item-has-children > a {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.goshen-mobile-menu-list .menu-item-has-children > a::after {
	content: '';
	width: 8px;
	height: 8px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(-45deg);
	transition: transform 0.2s ease;
	flex-shrink: 0;
}

.goshen-mobile-menu-list .menu-item-has-children.is-open > a::after {
	transform: rotate(135deg);
}

.goshen-mobile-menu-list .sub-menu {
	display: none;
}

.goshen-mobile-menu-list .menu-item-has-children.is-open > .sub-menu {
	display: block;
}

/* Divider between primary and secondary in mobile */
.goshen-mobile-nav-secondary {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 2px solid #0099cc;
}

/* ─── Responsive ──────────────────────────── */

@media (max-width: 1024px) {
	.goshen-secondary-nav {
		display: none;
	}

	.goshen-primary-bar {
		display: none;
	}

	.goshen-mobile-toggle {
		display: flex;
	}

	.goshen-top-bar-inner {
		padding: 8px 16px;
	}
}

/* ─── Reduced Motion (a11y – IS 5568 2.3.3) ─ */

@media (prefers-reduced-motion: reduce) {
	.goshen-mobile-menu,
	.goshen-submenu-dropdown,
	.goshen-mobile-toggle span,
	.goshen-chevron,
	.goshen-menu-link,
	.goshen-submenu-link {
		transition: none !important;
	}

	.goshen-mobile-menu.is-open {
		transform: none;
	}
}

/* ─── High Contrast Mode (a11y) ──────────── */

@media (forced-colors: active) {
	.goshen-submenu-dot {
		forced-color-adjust: none;
		background-color: LinkText;
	}

	.goshen-accent-line {
		forced-color-adjust: none;
	}

	.goshen-mobile-toggle span {
		forced-color-adjust: none;
		background-color: ButtonText;
	}
}
