/* Header, main menu, phone bottom bar, footer (inc/layout.php). */

/* Top bar */
.jw-topbar {
	background: var(--jw-red-dark);
	color: #fff;
	font-size: .8rem;
}

.jw-topbar-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: .3rem 20px;
}

.jw-topbar ul {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	list-style: none;
	margin: 0;
}

.jw-topbar a {
	color: #fff;
	text-decoration: none;
	opacity: .9;
}

.jw-topbar a:hover,
.jw-topbar a:focus {
	color: #fff;
	opacity: 1;
	text-decoration: underline;
}

/* Header band with logo */
.site-header .inside-header {
	padding-top: 10px;
	padding-bottom: 10px;
}

.jw-logo {
	margin: 0;
	line-height: 0;
}

.jw-logo img {
	display: block;
	width: auto;
	height: 46px;
}

/* Main menu: white bar under the red header */
.main-navigation,
.main-navigation ul ul {
	background: var(--jw-bg);
}

.main-navigation {
	border-bottom: 1px solid var(--jw-border);
	box-shadow: 0 1px 3px rgba(0, 0, 0, .04);
}

.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items {
	color: var(--jw-text);
	font-weight: 500;
	font-size: .9rem;
	line-height: 44px;
}

/* Desktop: the slim menu bar stays on top while scrolling */
@media (min-width: 769px) {
	.main-navigation {
		position: sticky;
		top: 0;
		z-index: 40;
	}
	.admin-bar .main-navigation {
		top: 32px;
	}
}

.main-navigation .main-nav ul li:not([class*="current-menu-"]):hover > a,
.main-navigation .main-nav ul li:not([class*="current-menu-"]):focus > a,
.main-navigation .main-nav ul li.sfHover:not([class*="current-menu-"]) > a {
	color: var(--jw-red);
	background: transparent;
}

.main-navigation .main-nav ul li[class*="current-menu-"] > a {
	color: var(--jw-red);
	font-weight: 600;
	box-shadow: inset 0 -2px 0 var(--jw-red);
}

.main-navigation .main-nav ul li:not([class*="current-menu-"]) > a:hover {
	box-shadow: inset 0 -2px 0 rgb(181 18 27 / .35);
}

/* The header toggle sits on red */
.site-header .menu-toggle,
.site-header .mobile-menu-control-wrapper .menu-toggle,
.site-header .mobile-menu-control-wrapper .menu-bar-items a {
	color: #fff;
	background: transparent;
}

/* Phone bottom bar (hidden on wide screens) */
.jw-bottom-bar {
	display: none;
}

@media (max-width: 768px) {
	.jw-topbar time { display: none; }
	.jw-topbar ul:not(.jw-socials) { gap: .75rem; overflow-x: auto; scrollbar-width: none; }
	.jw-topbar-inner { justify-content: center; padding-inline: 12px; }
	.jw-logo img { height: 40px; }

	/* Sticky, not fixed: on phones (iOS Safari, Firefox) a fixed bar can float
	   above a blank strip on first load until the toolbar settles after a scroll.
	   It is the last element in <body>, so sticky keeps it on the screen's edge
	   and it needs no padding reserved under the footer. */
	.jw-bottom-bar {
		display: block;
		position: -webkit-sticky;
		position: sticky;
		bottom: 0;
		z-index: 100;
		background: var(--jw-bg);
		border-top: 1px solid var(--jw-border);
		box-shadow: 0 -2px 8px rgba(0, 0, 0, .06);
		/* No env(safe-area-inset-bottom) here: the page doesn't use viewport-fit=cover,
		   and Chrome on Android still reported the system nav bar's height while the
		   address bar showed, leaving a white strip under the bar until a scroll. */
	}

	.jw-bottom-bar ul {
		display: grid;
		grid-template-columns: repeat(6, 1fr);
		list-style: none;
		margin: 0;
		padding: 0;
	}

	.jw-bottom-bar a {
		display: flex;
		flex-direction: column;
		align-items: center;
		gap: 2px;
		padding: 6px 0 4px;
		color: var(--jw-text-muted);
		font-size: .7rem;
		line-height: 1.4;
		text-decoration: none;
	}

	.jw-bottom-bar a[aria-current="page"] {
		color: var(--jw-red);
		font-weight: 700;
	}
}

/* Footer */
.jw-footer {
	background: #1f2937;
	color: #d1d5db;
	margin-top: 2rem;
}

.jw-footer-inner {
	display: grid;
	gap: 2rem;
	grid-template-columns: 2fr repeat(3, 1fr);
	padding: 2.5rem 20px;
}

.jw-footer-brand img {
	height: 56px;
	width: auto;
	margin-bottom: .75rem;
}

.jw-footer-brand p {
	margin: 0;
	font-size: .9rem;
}

.jw-footer-col h2 {
	color: #fff;
	font-size: 1rem;
	margin: 0 0 .75rem;
}

.jw-footer-col ul {
	list-style: none;
	margin: 0;
	display: grid;
	gap: .35rem;
}

.jw-footer a {
	color: #d1d5db;
	text-decoration: none;
	font-size: .9rem;
}

.jw-footer a:hover,
.jw-footer a:focus {
	color: #fff;
	text-decoration: underline;
}

.site-info {
	background: #111827;
	color: #9ca3af;
	font-size: .8rem;
}

@media (max-width: 900px) {
	.jw-footer-inner { grid-template-columns: 1fr 1fr; }
	.jw-footer-brand { grid-column: 1 / -1; }
}

/* Phones: centred and stacked like the app's footer (logo, line, socials, then
   each group's links in a centred row, then the copyright). */
@media (max-width: 768px) {
	.jw-footer-inner {
		grid-template-columns: 1fr;
		gap: 0;
		padding: 1.5rem 16px .5rem;
		text-align: center;
	}
	.jw-footer-brand { padding-bottom: 1rem; }
	.jw-footer-brand img { display: block; height: 44px; margin: 0 auto .4rem; }
	.jw-footer-brand p { font-size: .85rem; }
	.jw-footer-brand ul.jw-socials { justify-content: center; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
	.jw-footer-col {
		padding: .85rem 0;
		border-top: 1px solid rgba(255, 255, 255, .12);
	}
	.jw-footer-col h2 { font-size: .9rem; margin-bottom: .5rem; }
	.jw-footer-col ul {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		gap: .15rem 1rem;
		padding: 0;
	}
	.jw-footer-col a {
		display: inline-block;
		padding: .3rem 0;
		font-size: .85rem;
	}
	.site-info,
	.site-info .inside-site-info {
		text-align: center;
		justify-content: center;
	}
}

/* Keyboard focus */
.jw-topbar a:focus-visible,
.jw-bottom-bar a:focus-visible,
.jw-footer a:focus-visible,
.main-navigation a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Header search */
.site-header .inside-header {
	position: relative;
}

.jw-search {
	margin-inline-start: auto;
}

/* Menu items for phones only (a service the bottom bar has no room for). */
@media (min-width: 769px) {
	.main-navigation .jw-menu-phone { display: none; }
}

/* Computers: services beside search in the red band (inc/layout.php). */
.jw-head-services {
	margin-inline-start: auto;
}
.jw-head-services + .jw-search {
	margin-inline-start: .5rem;
}
.jw-head-services ul {
	display: flex;
	gap: .25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.jw-head-services a {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .4rem .8rem;
	border-radius: var(--jw-radius-pill);
	color: #fff;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: none;
}
.jw-head-services svg {
	width: 20px;
	height: 20px;
}
.jw-head-services a:hover,
.jw-head-services a:focus,
.jw-head-services a[aria-current="page"] {
	background: rgba(255, 255, 255, .15);
	color: #fff;
	box-shadow: none;
	text-decoration: none;
}
.jw-head-services a:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
@media (max-width: 1000px) {
	.jw-head-services a { padding-inline: .55rem; font-size: .85rem; }
}
@media (max-width: 768px) {
	.jw-head-services { display: none; }
	.jw-head-services + .jw-search { margin-inline-start: auto; }
}

.jw-search summary {
	list-style: none;
	cursor: pointer;
	color: #fff;
	padding: 8px;
	line-height: 0;
	border-radius: var(--jw-radius-pill);
}

.jw-search summary::-webkit-details-marker {
	display: none;
}

.jw-search summary:hover,
.jw-search[open] summary {
	background: rgba(255, 255, 255, .15);
}

.jw-search form {
	position: absolute;
	inset-inline: 20px;
	top: 100%;
	z-index: 50;
	display: flex;
	gap: .5rem;
	padding: .75rem;
	background: var(--jw-bg);
	border: 1px solid var(--jw-border);
	border-radius: 0 0 var(--jw-radius) var(--jw-radius);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .12);
}

.jw-search input[type="search"] {
	flex: 1;
	min-width: 0;
	border-radius: var(--jw-radius);
}

.jw-search button {
	background: var(--jw-red);
	color: #fff;
	border-radius: var(--jw-radius);
}

.main-navigation .main-nav ul li a {
	padding-inline: 12px;
}

/* Phones: logo and search on one row; the menu button sits in the white bar */
.site-header .mobile-menu-control-wrapper {
	display: none !important;
}

@media (max-width: 768px) {
	.site-header .inside-header {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding-inline: 12px;
	}
	.site-header .site-branding-container,
	.site-header .site-branding,
	.site-header .site-logo {
		margin: 0;
	}
	.jw-search {
		margin-inline-start: auto;
	}
	.jw-search form {
		inset-inline: 12px;
	}
	.main-navigation .menu-toggle {
		line-height: 48px;
	}
}

/* Social icon buttons (top bar and footer) */
.jw-topbar nav {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 1rem;
	min-width: 0;
}

.jw-topbar ul {
	flex-wrap: nowrap;
	white-space: nowrap;
}

ul.jw-socials {
	display: flex;
	gap: .35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jw-social {
	display: inline-grid;
	place-items: center;
	width: 26px;
	height: 26px;
	border-radius: var(--jw-radius-pill);
	background: rgba(255, 255, 255, .14);
	color: #fff;
	opacity: 1;
}

.jw-topbar .jw-social:hover,
.jw-topbar .jw-social:focus,
.jw-footer .jw-social:hover,
.jw-footer .jw-social:focus {
	background: #fff;
	color: var(--jw-red);
	text-decoration: none;
}

.jw-footer-brand ul.jw-socials {
	margin-top: 1rem;
}

.jw-footer .jw-social {
	width: 34px;
	height: 34px;
}

.jw-footer .jw-social svg {
	width: 18px;
	height: 18px;
}

/* Back to top */
.jw-to-top {
	position: fixed;
	inset-inline-end: 20px;
	bottom: 24px;
	z-index: 99;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--jw-red);
	color: #fff;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .2s, transform .2s, visibility .2s;
}

.jw-to-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.jw-to-top:hover,
.jw-to-top:focus-visible {
	background: var(--jw-red-dark, #8f0e15);
	color: #fff;
}

.jw-to-top:focus-visible {
	outline: 2px solid var(--jw-text, #111);
	outline-offset: 2px;
}

@media (max-width: 768px) {
	.jw-to-top {
		inset-inline-end: 12px;
		bottom: 68px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.jw-to-top { transition: none; }
}

/* "حمّل التطبيق" bar (phones and tablets, inc/app-banner.php) */
.jw-app-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	background: var(--jw-bg);
	border-bottom: 1px solid var(--jw-border);
	color: var(--jw-text);
}

.jw-app-bar[hidden] {
	display: none;
}

.jw-app-bar img {
	flex: none;
	border-radius: 10px;
}

.jw-app-bar p {
	flex: 1;
	min-width: 0;
	margin: 0;
	line-height: 1.35;
	font-size: .85rem;
}

.jw-app-bar p strong,
.jw-app-bar p span {
	display: block;
}

.jw-app-bar p span {
	color: var(--jw-text-muted);
	font-size: .8rem;
}

.jw-app-bar-get {
	flex: none;
	padding: 6px 16px;
	border-radius: var(--jw-radius-pill);
	background: var(--jw-red);
	color: #fff;
	font-weight: 700;
	font-size: .85rem;
	text-decoration: none;
}

.jw-app-bar-get:hover,
.jw-app-bar-get:focus {
	background: var(--jw-red-dark);
	color: #fff;
}

.jw-app-bar-close {
	flex: none;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--jw-text-muted);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
}

.jw-app-bar-close:hover,
.jw-app-bar-close:focus-visible {
	background: var(--jw-surface);
	color: var(--jw-text);
}

/* Computers: keep back-to-top clear of the OneSignal bell (same corner). */
body:has(#onesignal-bell-container) .jw-to-top {
	bottom: 80px;
}

/* Phones: menu button in the red band beside search; the white menu bar shows only when opened. */
.jw-menu-btn {
	display: none;
	padding: 8px;
	line-height: 0;
	color: #fff;
	background: transparent;
	border-radius: var(--jw-radius-pill);
}
.jw-menu-btn:hover,
.jw-menu-btn:focus,
.jw-menu-btn[aria-expanded="true"] {
	color: #fff;
	background: rgba(255, 255, 255, .15);
}
.jw-menu-btn:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}
.jw-menu-btn .jw-menu-close,
.jw-menu-btn[aria-expanded="true"] .jw-menu-open {
	display: none;
}
.jw-menu-btn[aria-expanded="true"] .jw-menu-close {
	display: block;
}
@media (max-width: 768px) {
	.jw-menu-in-header .jw-menu-btn {
		display: block;
		margin-inline-start: 4px;
	}
	.jw-menu-in-header #site-navigation:not(.toggled) {
		display: none;
	}
	.jw-menu-in-header #site-navigation .menu-toggle {
		display: none;
	}
}
