/* Gedara UX refresh — loaded after Additional CSS by mu-plugins/gedara-ux.php */

:root {
	--g-red: #980a0a;
	--g-red-dark: #7a0808;
	--g-ink: #252525;
	--g-text: #3d3d3d;
	--g-muted: #6b6b6b;
	--g-line: #e6e6e6;
	--g-bg-soft: #f6f5f3;
}

/* ---------- Arabic font (Tajawal) ----------
   Bundled with this plugin so a Lawman update can't remove it: the font used to live in
   themes/lawman/fonts/ with an @font-face added to the theme's style.css, and both were
   overwritten by the theme update. Only downloaded on pages that use it (the Arabic site). */
@font-face {
	font-family: Tajawal;
	src: url(fonts/Tajawal-Regular.ttf) format("truetype");
	font-weight: 400;
	font-display: swap;
}
@font-face {
	font-family: Tajawal;
	src: url(fonts/Tajawal-Medium.ttf) format("truetype");
	font-weight: 500;
	font-display: swap;
}
@font-face {
	font-family: Tajawal;
	src: url(fonts/Tajawal-Bold.ttf) format("truetype");
	font-weight: 700;
	font-display: swap;
}
@font-face {
	font-family: Tajawal;
	src: url(fonts/Tajawal-ExtraBold.ttf) format("truetype");
	font-weight: 800;
	font-display: swap;
}
.rtl body,
body.rtl,
.rtl button,
.rtl input,
.rtl select,
.rtl textarea,
.rtl .section-title,
.rtl h1,
.rtl h2,
.rtl h3,
.rtl h4,
.rtl h5,
.rtl h6,
.rtl .main-navigation a,
.rtl .btn {
	font-family: Tajawal, "Segoe UI", Tahoma, sans-serif;
}

/* ---------- Readability ---------- */
body,
button,
input,
select,
textarea {
	color: var(--g-text);
}
.entry-content p,
p {
	text-align: start; /* justified text left uneven gaps; "start" stays right-aligned on /ar/ */
	line-height: 1.75;
}
.entry-content a:not(.btn):not(.wp-block-button__link) {
	color: var(--g-red);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Visible keyboard focus everywhere */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
	outline: 2px solid var(--g-red);
	outline-offset: 2px;
}

/* ---------- Top bar ---------- */
#top-bar .contact-info span,
#top-bar .contact-info a {
	color: #c9ccd1;
}

/* ---------- Header: solid light bar so the logo is legible ---------- */
#header-menu {
	position: relative !important;
	z-index: 3000;
}
#masthead,
#masthead.site-header {
	background-color: #fff !important;
	background-image: none !important; /* Arabic theme mods set a dark header image */
	box-shadow: 0 1px 0 var(--g-line), 0 6px 18px rgba(0, 0, 0, 0.06);
}
#masthead .wrapper {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
}
#masthead .wrapper::after,
#masthead .wrapper::before {
	display: none;
}
.site-branding {
	float: none;
	min-height: 0;
	padding: 10px 0;
}
.site-logo img,
.custom-logo {
	max-height: 92px !important;
	width: auto !important;
}
#site-navigation {
	float: none;
}
.main-navigation a,
.main-navigation ul.nav-menu > li > a,
.main-navigation ul#primary-menu > li > a {
	color: var(--g-ink) !important;
	font-weight: 500;
}
.main-navigation ul#primary-menu > li.current-menu-item > a,
.main-navigation ul#primary-menu > li > a:hover,
.main-navigation ul#primary-menu > li > a:focus {
	color: var(--g-red) !important;
}
.menu-toggle svg {
	fill: var(--g-ink);
}

@media screen and (max-width: 1024px) {
	#masthead {
		background-color: #fff !important;
	}
	.site-logo img,
	.custom-logo {
		max-height: 64px !important;
	}
	.menu-toggle {
		height: 64px;
		width: 64px;
		padding: 16px;
	}
	.main-navigation ul#primary-menu {
		box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	}
	.main-navigation ul#primary-menu li a {
		color: var(--g-ink) !important;
	}
	.main-navigation ul#primary-menu li.current-menu-item > a {
		color: var(--g-red) !important;
	}
}

/* ---------- Home hero ---------- */
#featured-slider article {
	padding: 0 !important;
	min-height: clamp(440px, 70vh, 660px);
	display: flex !important;
	align-items: center;
}
#featured-slider article .overlay {
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.2) 100%);
	opacity: 1;
}
.rtl #featured-slider article .overlay {
	background: linear-gradient(270deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.45) 55%, rgba(0, 0, 0, 0.2) 100%);
}
#featured-slider .wrapper {
	width: 100%;
	position: relative;
	z-index: 1;
}
.featured-content-wrapper {
	position: static !important;
	transform: none !important;
	max-width: 640px;
	padding: 56px 0;
}
.featured-content-wrapper .entry-title {
	margin: 0 0 18px;
	font-size: clamp(28px, 4.2vw, 46px) !important;
	line-height: 1.2;
}
.featured-content-wrapper .entry-title a {
	display: inline !important;
	color: #fff;
}
.featured-content-wrapper .entry-title::after {
	content: "";
	display: block;
	width: 64px;
	height: 3px;
	margin-top: 18px;
	background-color: var(--g-red);
}
.featured-content-wrapper .entry-content p {
	color: rgba(255, 255, 255, 0.92);
	font-size: clamp(16px, 1.4vw, 18px);
	text-align: start;
}
.featured-content-wrapper .read-more {
	margin-top: 26px;
}

/* ---------- Buttons ---------- */
.btn,
a.btn,
div.wpforms-container-full button[type=submit] {
	background-color: var(--g-red) !important;
	color: #fff !important;
	border: 0;
	border-radius: 2px;
	padding: 14px 30px !important;
	letter-spacing: 0.06em;
	transition: background-color 0.2s ease, transform 0.2s ease;
}
.btn:hover,
a.btn:hover,
.btn:focus-visible,
div.wpforms-container-full button[type=submit]:hover {
	background-color: var(--g-red-dark) !important;
	transform: translateY(-1px);
}

/* ---------- Inner page header: shorter, with the page title shown ---------- */
#page-site-header {
	padding: 84px 0 !important;
}
#page-site-header .overlay {
	background: rgba(0, 0, 0, 0.55);
	opacity: 1;
}
#page-site-header .wrapper {
	left: auto !important;
	position: relative;
	z-index: 1;
	text-align: start !important;
}
#page-site-header .page-title {
	display: block !important;
	color: #fff;
	margin: 0;
	font-size: clamp(28px, 4vw, 42px);
}
#page-site-header .page-title::after {
	content: "";
	display: block;
	width: 56px;
	height: 3px;
	margin-top: 14px;
	background-color: var(--g-red);
}

/* ---------- Senior Partners ---------- */
#team {
	background-color: var(--g-ink) !important;
}
#team .team-wrapper {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 28px;
}
#team .section-header-wrapper .section-header {
	text-align: center;
	width: 100%; /* Arabic Additional CSS floats it at 50%, which squeezed the cards beside it */
	float: none;
}
#team .section-title::after {
	left: 0;
	right: 0;
	margin-left: auto;
	margin-right: auto;
}
#team .team-wrapper::after,
#team .team-wrapper::before {
	display: none;
}
#team .team-wrapper article {
	float: none;
}
/* Tablets and up: all partners in one row, as on desktop. The theme's 50% tablet width plus
   the gap wrapped them, which showed the Arabic page's reversed order (Al-Flaieh first). */
@media screen and (min-width: 768px) {
	#team .team-wrapper article {
		width: auto !important;
		flex: 0 1 calc((100% - 56px) / 3) !important;
		max-width: 300px;
	}
}
#team .team-item-wrapper {
	transition: transform 0.25s ease;
}
/* Sit each photo on its name box (photos have different proportions, which left gaps on tablets) */
#team .featured-image {
	background-position: 50% 100% !important;
}
#team .team-item-wrapper:hover {
	transform: translateY(-4px);
}
#team .team-wrapper .entry-container {
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
}
/* Card turns brand red on hover (Lawman 1.1.0 defaults to gold #b79156; the Arabic site's
   lost theme edit used red), with white text. */
#team .team-wrapper article:hover .entry-container {
	background-color: var(--g-red);
}
#team .team-wrapper article:hover .entry-container .entry-title a,
#team .team-wrapper .entry-title a:hover {
	color: #fff;
}

/* ---------- Partner bio popover (home page, tablet, laptop and desktop) ----------
   Built by gedara-ux-core.php from each partner page: role, first paragraph clamped to
   two lines, and a "Read more" link. Opens below the name card (above it when the window is
   too short) on mouse hover, on keyboard focus, or on tap (touch: the script adds .g-bio-open).
   --g-shift (set by the script) slides it sideways to stay inside the screen on narrow tablets;
   the arrow moves the other way so it still points at the card. Phones (< 768px) don't show it. */
.g-bio {
	display: none;
}
@media screen and (min-width: 768px) {
	#team .team-wrapper article.has-bio {
		position: relative;
	}
	#team .team-wrapper article.has-bio:focus-within,
	#team .team-wrapper article.g-bio-open {
		z-index: 5;
	}
	.g-bio {
		display: block;
		position: absolute;
		top: calc(100% + 14px);
		left: 50%;
		width: 320px;
		max-width: calc(100vw - 32px);
		padding: 16px 18px 14px;
		background: #fff;
		color: var(--g-text);
		border-top: 3px solid var(--g-red);
		border-radius: 2px;
		box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
		text-align: start;
		opacity: 0;
		visibility: hidden;
		transform: translate(calc(-50% + var(--g-shift, 0px)), 6px);
		transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
		z-index: 10;
	}
	/* Arrow pointing up at the name card */
	.g-bio::before {
		content: "";
		position: absolute;
		top: -11px;
		left: calc(50% - var(--g-shift, 0px));
		margin-left: -8px;
		border: 8px solid transparent;
		border-top: 0;
		border-bottom-color: var(--g-red);
	}
	/* Invisible bridge over the gap so the pointer can move from the card to the link */
	.g-bio::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		top: -18px;
		height: 18px;
	}
	/* Not enough room below (short window): open above the card, arrow pointing down */
	#team article.g-bio-up .g-bio {
		top: auto;
		bottom: calc(100% + 14px);
		border-top: 0;
		border-bottom: 3px solid var(--g-red);
		transform: translate(calc(-50% + var(--g-shift, 0px)), -6px);
	}
	#team article.g-bio-up .g-bio::before {
		top: auto;
		bottom: -11px;
		border-bottom: 0;
		border-top: 8px solid var(--g-red);
	}
	#team article.g-bio-up .g-bio::after {
		top: auto;
		bottom: -18px;
	}
	#team article.has-bio:focus-within .g-bio,
	#team article.g-bio-open .g-bio {
		opacity: 1;
		visibility: visible;
		transform: translate(calc(-50% + var(--g-shift, 0px)), 0);
		transition-delay: 0s;
	}
	.g-bio p {
		margin: 0;
		text-align: start;
	}
	.g-bio__role {
		font-size: 13px;
		font-weight: 700;
		line-height: 1.4 !important;
		color: var(--g-red);
		margin-bottom: 6px !important;
	}
	.g-bio__text {
		font-size: 14px;
		line-height: 1.6 !important;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		line-clamp: 2;
		overflow: hidden;
	}
	.g-bio__more {
		display: inline-block;
		margin-top: 10px;
		padding: 4px 0; /* bigger tap target */
		font-size: 13px;
		font-weight: 700;
		color: var(--g-red) !important;
		text-decoration: none;
	}
	.g-bio__more::after {
		content: " →";
	}
	.rtl .g-bio__more::after {
		content: " ←";
	}
	.g-bio__more:hover,
	.g-bio__more:focus-visible {
		text-decoration: underline;
		text-underline-offset: 3px;
	}
}
/* Mouse hover opens it too. Kept to real hover devices: on touch screens a tap would
   otherwise leave a "stuck" hover that can't be closed. */
@media screen and (min-width: 768px) and (hover: hover) {
	#team .team-wrapper article.has-bio:hover {
		z-index: 5;
	}
	#team article.has-bio:hover .g-bio {
		opacity: 1;
		visibility: visible;
		transform: translate(calc(-50% + var(--g-shift, 0px)), 0);
		transition-delay: 0s;
	}
}
@media (prefers-reduced-motion: reduce) {
	.g-bio,
	#team article.g-bio-up .g-bio {
		transform: translate(calc(-50% + var(--g-shift, 0px)), 0) !important;
	}
}

/* ---------- Practice Areas: floating section menu ----------
   Built by gedara-ux-core.php (gedara_ux_section_menu_script) from the page's h2 headings. */
body.g-has-toc #page {
	overflow-x: clip; /* the theme's overflow:hidden would stop the sidebar from sticking */
	overflow-y: visible;
}
html:has(body.g-has-toc) {
	scroll-behavior: smooth;
}
body.g-has-toc .g-toc-target {
	scroll-margin-top: 24px;
}
.g-toc ol {
	list-style: none;
	margin: 0;
	padding: 0;
}
.g-toc a {
	text-decoration: none;
}
.g-toc__title {
	margin: 0 0 12px !important;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--g-muted);
}
.rtl .g-toc__title {
	letter-spacing: 0;
}
.g-toc li a {
	display: block;
	padding: 7px 14px;
	border-inline-start: 3px solid transparent;
	color: var(--g-text);
	font-size: 14px;
	line-height: 1.4;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
.g-toc li a:hover {
	color: var(--g-red);
	background: var(--g-bg-soft);
}
.g-toc li a.is-active {
	color: var(--g-red);
	font-weight: 700;
	border-inline-start-color: var(--g-red);
	background: var(--g-bg-soft);
}
.g-toc__top {
	display: inline-block;
	margin-top: 14px;
	padding-inline-start: 14px;
	font-size: 13px;
	color: var(--g-muted) !important;
}
.g-toc__top::before {
	content: "↑ ";
}
.g-toc__top:hover {
	color: var(--g-red) !important;
}
.g-toc__close {
	display: none;
}
.g-toc-toggle {
	display: none;
}

/* Laptop and desktop: sticky sidebar beside the content (end side: right in English, left in Arabic) */
@media screen and (min-width: 1025px) {
	body.g-has-toc #inner-content-wrapper {
		display: grid;
		grid-template-columns: minmax(0, 1fr) 270px;
		gap: 56px;
		align-items: start;
	}
	body.g-has-toc #inner-content-wrapper::before,
	body.g-has-toc #inner-content-wrapper::after {
		display: none;
	}
	body.g-has-toc #primary {
		float: none;
		width: auto;
		min-width: 0;
	}
	.g-toc {
		position: sticky;
		top: 24px;
		display: flex;
		flex-direction: column;
		max-height: calc(100vh - 48px);
		padding: 22px 0 18px;
		background: #fff;
		border-top: 3px solid var(--g-red);
		box-shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
	}
	.g-toc__title,
	.g-toc__top {
		margin-inline: 18px !important;
		padding-inline-start: 0;
	}
	.g-toc ol {
		overflow-y: auto;
		overscroll-behavior: contain;
		padding-inline-end: 4px;
	}
	.g-toc li a {
		padding-inline-start: 15px;
	}
	/* Structure: menu at the top of the existing widget sidebar. The sidebar column runs the
	   full height of the content so the menu can stick all the way down; the widgets below
	   (search, business cards) scroll underneath it. */
	body.g-toc-in-sidebar #inner-content-wrapper {
		grid-template-columns: minmax(0, 1fr) 290px;
		align-items: stretch;
	}
	body.g-toc-in-sidebar #secondary {
		float: none !important;
		width: auto !important;
		min-width: 0;
		padding: 0;
	}
	body.g-toc-in-sidebar .g-toc {
		z-index: 2;
		margin-bottom: 32px;
	}
}

/* Tablet and phone: floating "Sections" button that opens the list as a panel */
@media screen and (max-width: 1024px) {
	.g-toc-toggle {
		position: fixed;
		bottom: 20px;
		left: 16px; /* bottom left in both languages: the theme's back-to-top button is bottom right */
		z-index: 4000;
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 12px 18px;
		border: 0;
		border-radius: 999px;
		background: var(--g-red);
		color: #fff;
		font-size: 15px;
		font-weight: 700;
		line-height: 1;
		box-shadow: 0 8px 22px rgba(0, 0, 0, 0.3);
		cursor: pointer;
		opacity: 0;
		visibility: hidden;
		transform: translateY(12px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	}
	.g-toc-toggle.is-visible,
	body.g-toc-open .g-toc-toggle {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}
	.g-toc {
		position: fixed;
		bottom: 78px;
		left: 16px; /* bottom left in both languages: the theme's back-to-top button is bottom right */
		z-index: 4001;
		width: min(340px, calc(100vw - 32px));
		max-height: min(70vh, 560px);
		display: flex;
		flex-direction: column;
		padding: 18px 0 14px;
		background: #fff;
		border-top: 3px solid var(--g-red);
		border-radius: 4px;
		box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
		opacity: 0;
		visibility: hidden;
		transform: translateY(10px);
		transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
	}
	body.g-toc-open .g-toc {
		opacity: 1;
		visibility: visible;
		transform: none;
		transition-delay: 0s;
	}
	.g-toc__title,
	.g-toc__top {
		margin-inline: 18px !important;
		padding-inline-start: 0;
	}
	.g-toc__close {
		display: block;
		position: absolute;
		top: 8px;
		inset-inline-end: 8px;
		width: 36px;
		height: 36px;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--g-muted);
		font-size: 26px;
		line-height: 1;
		cursor: pointer;
	}
	.g-toc ol {
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	.g-toc li a {
		padding: 10px 18px; /* comfortable tap targets */
		font-size: 15px;
	}
}
@media (prefers-reduced-motion: reduce) {
	html:has(body.g-has-toc) {
		scroll-behavior: auto;
	}
}

/* ---------- Contact form ---------- */
div.wpforms-container-full .wpforms-form input[type=text],
div.wpforms-container-full .wpforms-form input[type=email],
div.wpforms-container-full .wpforms-form input[type=tel],
div.wpforms-container-full .wpforms-form textarea,
.wpforms-container .wpforms-field-medium,
.wpforms-container .wpforms-field-small {
	width: 100% !important;
	max-width: 100% !important;
	border: 1px solid #cfcfcf;
	border-radius: 2px;
}
div.wpforms-container-full .wpforms-form textarea {
	min-height: 140px;
}
div.wpforms-container-full .wpforms-form input:focus,
div.wpforms-container-full .wpforms-form textarea:focus {
	border-color: var(--g-red) !important;
	box-shadow: 0 0 0 3px rgba(152, 10, 10, 0.15) !important;
}

/* ---------- News / archive ---------- */
.archive-blog-wrapper .featured-image {
	background-color: var(--g-bg-soft);
}

/* ---------- Footer ---------- */
.site-info {
	color: var(--g-muted);
	font-size: 14px;
}
.site-info span a {
	color: var(--g-muted) !important; /* theme 1.1.0 default is gold */
}

@media screen and (max-width: 767px) {
	#team .team-wrapper article {
		width: 100%;
		max-width: 340px;
	}
	.site-info.col-2 span {
		width: 100% !important;
		float: none !important;
		display: block;
		text-align: center !important;
	}
}

/* ---------- Home page: each section fills one screen ---------- */
/* svh = height of the visible screen on phones, ignoring the browser toolbar; vh is the fallback */
.home #featured-slider article {
	min-height: calc(100vh - var(--g-head, 150px));
	min-height: calc(100svh - var(--g-head, 150px));
}
.home #team {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	align-items: center;
	padding-top: 64px;
	padding-bottom: 64px !important;
}
.home #team > .wrapper {
	width: 100%;
}
.home #team .featured-image {
	padding: clamp(87px, 15vh, 160px) 0 !important; /* larger photos so the partners fill their screen */
}
@media screen and (max-width: 767px) {
	/* compact cards so all three partners fit on one phone screen */
	.home #team {
		padding-top: 40px;
		padding-bottom: 40px !important;
	}
	.home #team .section-header-wrapper {
		margin-bottom: 20px;
	}
	.home #team .team-wrapper {
		gap: 18px;
	}
	.home #team .team-wrapper article {
		margin-bottom: 0;
		padding-bottom: 0;
	}
	.home #team .featured-image {
		padding: 60px 0 !important;
	}
	/* The Arabic page lists partners in reverse so the RTL desktop row matches English
	   left-to-right; when stacked on phones, flip it back so Dr. Nofan comes first as in English. */
	.rtl.home #team .team-wrapper {
		flex-direction: column-reverse;
		align-items: center;
	}
}
.home #colophon {
	min-height: 100vh;
	min-height: 100svh;
	display: flex;
	flex-direction: column;
}
.home #colophon .footer-widgets-area {
	flex: 1 0 auto;
	display: flex;
	align-items: center;
	padding-top: 48px;
	padding-bottom: 48px; /* theme's 80px pushed the contact screen past one screen height */
}
.home #colophon .footer-widgets-area > .wrapper {
	width: 100%;
}
.home #colophon .site-info {
	flex: 0 0 auto;
}

/* ---------- Home page: scroll snapping between sections ---------- */
/* "proximity" snaps only when you stop near a section edge, so scrolling stays free and
   sections taller than the screen (Contact on phones) can be read through. */
html.g-snap {
	scroll-snap-type: y proximity;
}
/* The theme's overflow:hidden on #page makes it a scroll container that captures the snap
   points; "clip" still hides sideways overflow without creating one. */
html.g-snap #page {
	overflow-x: clip;
	overflow-y: visible;
}
html.g-snap #header-menu,
html.g-snap #team,
html.g-snap #colophon {
	scroll-snap-align: start;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
	* {
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
