@font-face {
  font-family: 'Alexandria ElMofid';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/elmofid/alexandria-arabic.woff2) format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+102E0-102FB, U+10E60-10E7E, U+10EC2-10EC7, U+10EC9-10EEE, U+10EF0-10EFF, U+1EE00-1EE03, U+1EE05-1EE1F, U+1EE21-1EE22, U+1EE24, U+1EE27, U+1EE29-1EE32, U+1EE34-1EE37, U+1EE39, U+1EE3B, U+1EE42, U+1EE47, U+1EE49, U+1EE4B, U+1EE4D-1EE4F, U+1EE51-1EE52, U+1EE54, U+1EE57, U+1EE59, U+1EE5B, U+1EE5D, U+1EE5F, U+1EE61-1EE62, U+1EE64, U+1EE67-1EE6A, U+1EE6C-1EE72, U+1EE74-1EE77, U+1EE79-1EE7C, U+1EE7E, U+1EE80-1EE89, U+1EE8B-1EE9B, U+1EEA1-1EEA3, U+1EEA5-1EEA9, U+1EEAB-1EEBB, U+1EEF0-1EEF1;
}

@font-face {
  font-family: 'Alexandria ElMofid';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/elmofid/alexandria-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Alexandria ElMofid';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/elmofid/alexandria-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

#theme-header.elmofid-header {
	--elmofid-red: #b71c31;
	--elmofid-deep-red: #821727;
	--elmofid-paper: #fff;
	--elmofid-ink: #182535;
	--elmofid-line: #e1e6eb;
	--elmofid-font: "Alexandria ElMofid", Tahoma, Arial, sans-serif;
	font-family: var(--elmofid-font);
}

.elmofid-header .elmofid-edition {
	background: #f0f3f6;
	color: var(--elmofid-ink);
	border-block-end: 1px solid var(--elmofid-line);
	font-size: 12px;
}

.elmofid-header .elmofid-edition-inner,
.elmofid-header .elmofid-edition-meta,
.elmofid-header .elmofid-edition-links {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .3rem 1rem;
}

.elmofid-header .elmofid-edition-inner {
	justify-content: space-between;
	max-width: 1200px;
	min-height: 34px;
	margin-inline: auto;
	padding: .25rem 1rem;
}

.elmofid-header .elmofid-edition-brand {
	font-weight: 700;
}

.elmofid-header .elmofid-edition-brand::before,
.elmofid-header .elmofid-latest li::before {
	content: "";
	display: inline-block;
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: var(--elmofid-red);
	margin-inline-end: .5rem;
	vertical-align: middle;
}

.elmofid-header .elmofid-edition-links a,
.elmofid-header .elmofid-latest a {
	color: inherit;
}

.elmofid-header .elmofid-edition-links a:hover,
.elmofid-header .elmofid-latest a:hover {
	color: var(--elmofid-red);
	text-decoration: underline;
}

#theme-header.elmofid-header .header-container {
	background: #fff;
	color: var(--elmofid-ink);
}

.elmofid-header .elmofid-masthead-credit {
	display: grid;
	gap: .18rem;
	align-content: center;
	flex: 0 0 auto;
	padding-inline-start: .8rem;
	border-inline-start: 2px solid var(--elmofid-red);
	color: var(--elmofid-ink);
	line-height: 1.3;
}

.elmofid-header .elmofid-masthead-credit span {
	font-size: 10px;
}

.elmofid-header .elmofid-masthead-credit strong {
	font-size: clamp(14px, 1.3vw, 19px);
	font-weight: 700;
	white-space: nowrap;
}

.elmofid-header .elmofid-masthead-actions {
	display: none;
}

@media (min-width: 992px) {
	.elmofid-header .logo-row:not(:has(.stream-item-top:not(:empty))) > .logo-wrapper {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: clamp(.7rem, 2vw, 1.6rem);
		width: 100%;
		min-height: 96px;
	}

	.elmofid-header .logo-row:not(:has(.stream-item-top:not(:empty))) .stream-item-top-wrapper {
		width: 100%;
		margin: 0;
	}

	.elmofid-header .logo-row:not(:has(.stream-item-top:not(:empty))) .logo-container {
		display: flex;
		align-items: center;
		width: auto;
		min-width: 0;
	}

	.elmofid-header .logo-row:not(:has(.stream-item-top:not(:empty))) #logo {
		float: none;
		margin-block: 12px !important;
	}

	.elmofid-header .logo-container #logo img {
		max-width: min(25vw, 300px);
		max-height: 72px !important;
		width: auto;
		height: auto;
		object-fit: contain;
	}

	/* The current wide ElMofid logo already contains the editorial credit. */
	.elmofid-header .logo-wrapper:has(#logo img[src*="المفيد-لوجو-جديد.webp"]) .elmofid-masthead-credit,
	.elmofid-header .logo-wrapper:has(#logo img[src*="%D8%A7%D9%84%D9%85%D9%81%D9%8A%D8%AF-%D9%84%D9%88%D8%AC%D9%88-%D8%AC%D8%AF%D9%8A%D8%AF.webp" i]) .elmofid-masthead-credit {
		position: absolute;
		width: 1px;
		height: 1px;
		margin: -1px;
		padding: 0;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
		border: 0;
	}

	.elmofid-header .logo-row:has(.stream-item-top:not(:empty)) .elmofid-masthead-credit {
		margin: .75rem 1rem;
	}

	.elmofid-header .elmofid-masthead-actions,
	.elmofid-header .elmofid-masthead-social {
		display: flex;
		align-items: center;
		gap: .4rem;
	}

	.elmofid-header .elmofid-masthead-social {
		flex-wrap: wrap;
		margin: 0;
	}

	.elmofid-header .elmofid-masthead-search {
		position: relative;
	}

	.elmofid-header .elmofid-masthead-search summary,
	.elmofid-header .elmofid-masthead-social .social-link {
		display: grid;
		place-items: center;
		width: 34px;
		height: 34px;
	}

	.elmofid-header .elmofid-masthead-search summary {
		list-style: none;
		cursor: pointer;
		background: var(--elmofid-red);
		color: #fff;
		border-radius: 4px;
	}

	.elmofid-header .elmofid-masthead-search summary::-webkit-details-marker {
		display: none;
	}

	.elmofid-header .elmofid-masthead-social .social-link {
		border-radius: 50%;
	}

	.elmofid-header .elmofid-masthead-search-panel {
		position: absolute;
		z-index: 20;
		inset-inline-start: 0;
		inset-block-start: calc(100% + .4rem);
		width: 260px;
		padding: .65rem;
		border: 1px solid var(--elmofid-line);
		background: var(--elmofid-paper);
	}
}

.elmofid-header .elmofid-latest {
	border-block: 1px solid var(--elmofid-line);
	background: #f8fafb;
	color: var(--elmofid-ink);
	font-size: 12px;
}

.elmofid-header .elmofid-latest-inner {
	display: flex;
	align-items: stretch;
	max-width: 1200px;
	margin-inline: auto;
	padding-inline: 1rem;
}

.elmofid-header .elmofid-latest strong {
	display: grid;
	place-items: center;
	flex-shrink: 0;
	padding: .45rem .8rem;
	color: #fff;
	background: var(--elmofid-red);
}

.elmofid-header .elmofid-latest-viewport {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.elmofid-header .elmofid-latest-track {
	display: flex;
	width: max-content;
	min-width: 200%;
	direction: rtl;
	animation: elmofid-headlines 48s linear infinite;
}

.elmofid-header .elmofid-latest ul {
	display: flex;
	align-items: center;
	justify-content: space-around;
	gap: 1rem;
	flex: 1 0 auto;
	margin: 0;
	padding: .45rem .85rem;
	list-style: none;
}

.elmofid-header .elmofid-latest li {
	flex: 0 0 auto;
}

.elmofid-header .elmofid-latest :is(a, li > span) {
	display: inline-block;
	max-width: clamp(165px, 40vw, 345px);
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
	vertical-align: middle;
}

@keyframes elmofid-headlines {
	to { transform: translateX(50%); }
}

.elmofid-header .elmofid-latest-viewport:hover .elmofid-latest-track,
.elmofid-header .elmofid-latest-viewport:active .elmofid-latest-track {
	animation-play-state: paused;
}

.elmofid-header .elmofid-latest-viewport:has(a:focus-visible) {
	overflow-x: auto;
}

.elmofid-header .elmofid-latest-viewport:has(a:focus-visible) .elmofid-latest-track {
	animation: none;
	min-width: 100%;
}

.elmofid-header .elmofid-latest-viewport:has(a:focus-visible) .elmofid-latest-repeat {
	display: none;
}

/* Ticker motion follows the site setting; keyboard focus still pauses it. */
.elmofid-header #main-nav .main-menu > ul > li > a,
.elmofid-header #main-nav .sub-menu > li > a,
.elmofid-header #top-nav .top-menu a,
#tie-container > .side-aside #mobile-menu a {
	font-family: "Alexandria ElMofid", Tahoma, Arial, sans-serif;
}

@media (min-width: 992px) {
	#theme-header.elmofid-header #main-nav {
		--main-nav-background: #fff;
		--main-nav-main-border-color: #e1e6eb;
		--main-nav-primary-color: #b71c31;
		background: #fff;
	}

	#theme-header.elmofid-header #main-nav .main-menu-wrapper,
	#theme-header.elmofid-header #main-nav .main-menu .menu-sub-content {
		background: #fff;
	}

	#theme-header.elmofid-header #main-nav .main-menu a,
	#theme-header.elmofid-header #main-nav .components > li > a,
	#theme-header.elmofid-header #main-nav .components #search-submit,
	#theme-header.elmofid-header #main-nav .components #search-input {
		color: var(--elmofid-ink);
	}

	#theme-header.elmofid-header #main-nav .main-menu > ul > li + li > a {
		border-inline-start: 1px solid var(--elmofid-line);
	}

	#theme-header.elmofid-header #main-nav .main-menu > ul > li > a {
		border-block-end: 3px solid transparent;
		font-weight: 700;
	}

	#theme-header.elmofid-header #main-nav .main-menu > ul > li:is(.current-menu-item, .tie-current-menu) > a,
	#theme-header.elmofid-header #main-nav .main-menu > ul > li > a:is(:hover, :focus-visible) {
		background: var(--elmofid-red);
		color: #fff;
		border-block-end-color: var(--elmofid-deep-red);
	}

	#theme-header.elmofid-header #main-nav .components form#search {
		background: #f1f4f7;
	}
}

@media (max-width: 991px) {
	.elmofid-header .logo-wrapper {
		height: auto;
		display: flex;
		flex-direction: column;
	}

	.elmofid-header .elmofid-masthead-credit {
		display: flex;
		align-self: center;
		align-items: baseline;
		gap: .35rem;
		padding-inline-start: .5rem;
		margin: .25rem 0 .65rem;
	}

	.elmofid-header .logo-container #logo img {
		max-width: min(50vw, 215px);
		height: auto;
		object-fit: contain;
	}
}

.elmofid-header #main-nav .main-menu > ul > li > a {
	padding-inline: 9px;
}

.elmofid-header #main-nav .main-menu > ul > li.menu-item-has-children > a {
	padding-inline-end: 21px;
}

@media (min-width: 992px) {
	.elmofid-header #main-nav .elmofid-menu-fallback > .menu {
		flex-wrap: wrap;
	}

	.elmofid-header #main-nav .elmofid-menu-fallback > ul > li > a {
		font-size: 13px;
		padding-inline: 7px;
	}

	.elmofid-header #main-nav .elmofid-menu-fallback > ul > li.menu-item-has-children > a {
		padding-inline-end: 19px;
	}

	.elmofid-header #main-nav .components form#search {
		width: clamp(112px, 11vw, 148px);
	}

	.elmofid-header #main-nav .elmofid-menu-fallback li:focus-within > .menu-sub-content {
		display: block;
		z-index: 1;
	}

	.elmofid-header #main-nav .elmofid-menu-fallback > .menu > li:nth-last-child(-n+2) > .menu-sub-content {
		inset-inline: auto 0;
	}
}

.elmofid-header .elmofid-header-tools {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.25rem;
	padding-inline: 1rem;
	color: var(--elmofid-ink);
	background: var(--elmofid-paper);
	font: 400 13px/1.6 var(--elmofid-font);
}

.elmofid-header .elmofid-header-disclosure {
	flex: 0 0 auto;
}

.elmofid-header .elmofid-header-disclosure[open] {
	flex: 1 1 100%;
}

.elmofid-header .elmofid-header-disclosure summary {
	cursor: pointer;
	padding: .65rem .5rem;
	font-weight: 700;
}

.elmofid-header .elmofid-fallback-menu ul {
	list-style: none;
}

.elmofid-header .elmofid-fallback-menu > ul {
	display: flex;
	flex-wrap: wrap;
	gap: .75rem 1.5rem;
	padding: .5rem;
}

.elmofid-header .elmofid-fallback-menu .sub-menu {
	padding-inline-start: .75rem;
}

.elmofid-header .elmofid-fallback-menu a {
	display: inline-block;
	padding: .4rem 0;
	color: var(--elmofid-ink);
}

.elmofid-header .elmofid-fallback-menu a:hover,
.elmofid-header .elmofid-fallback-menu a:focus-visible {
	color: var(--elmofid-deep-red);
	text-decoration: underline;
}

.elmofid-header .elmofid-mobile-tool {
	display: none;
}

@media (max-width: 991px) {
	.elmofid-header .elmofid-mobile-tool {
		display: block;
	}

	.elmofid-header .elmofid-desktop-tool {
		display: none;
	}

	.elmofid-header .elmofid-edition-inner {
		gap: 0 .75rem;
		padding-inline: .75rem;
	}
}

/* Keep the masthead centered and avoid a second desktop search row. */
@media (min-width: 992px) {
  #theme-header.elmofid-header .logo-row:not(:has(.stream-item-top:not(:empty))) > .logo-wrapper {
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
    width: 100%; max-width: 1200px; margin-inline: auto; padding-inline: 16px;
  }
  #theme-header.elmofid-header .logo-wrapper > .logo-container { grid-area: 1 / 2; justify-self: center; }
  #theme-header.elmofid-header .logo-wrapper > .elmofid-masthead-credit { grid-area: 1 / 1; justify-self: start; }
  #theme-header.elmofid-header .logo-wrapper > .elmofid-masthead-actions { grid-area: 1 / 3; justify-self: end; min-width: 0; max-width: 100%; }
  #theme-header.elmofid-header .elmofid-masthead-search { flex: 0 0 auto; }
  #theme-header.elmofid-header .elmofid-masthead-social { min-width: 0; }
  #theme-header.elmofid-header:has(.elmofid-masthead-actions) #main-nav .components { display: none !important; }
  #theme-header.elmofid-header #main-nav .main-menu-wrap { float: none; width: 100%; }
  #theme-header.elmofid-header #main-nav #main-nav-menu > ul { display: flex; justify-content: center; flex-wrap: wrap; }
}
.elmofid-header .elmofid-latest :is(a, li > span) { max-width: none; overflow: visible; text-overflow: clip; }

/* Center the menu itself, and scale the full brand lockup. */
@media (min-width: 992px) {
  #theme-header.elmofid-header #main-nav .main-menu-wrapper { padding-inline: 0; }
  #theme-header.elmofid-header #main-nav .main-menu-wrap { margin-inline: 0; padding-inline: 0; }
  #theme-header.elmofid-header #main-nav #main-nav-menu { float: none !important; width: 100%; margin-inline: auto; }
  #theme-header.elmofid-header #main-nav #main-nav-menu > ul { justify-content: center; }
  #theme-header.elmofid-header .logo-container #logo img { max-width: min(31vw, 345px); max-height: 86px !important; }
  #theme-header.elmofid-header .elmofid-masthead-credit strong { font-size: clamp(16px, 1.5vw, 22px); }
}
@media (max-width: 991px) {
  #theme-header.elmofid-header #logo img { max-width: min(55vw, 235px); }
}

/* Keep keyboard/manual scrolling without a visible scrollbar in the news strip. */
#theme-header.elmofid-header .elmofid-latest-viewport { scrollbar-width: none; }
#theme-header.elmofid-header .elmofid-latest-viewport::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* A more legible, continuously moving headlines strip. */
#theme-header.elmofid-header .elmofid-latest { font-size: 14px; }
#theme-header.elmofid-header .elmofid-latest-inner,
#theme-header.elmofid-header .elmofid-latest-track { min-height: 46px; }
@media (max-width: 767px) {
  #theme-header.elmofid-header .elmofid-latest { font-size: 13px; }
  #theme-header.elmofid-header .elmofid-latest-inner,
  #theme-header.elmofid-header .elmofid-latest-track { min-height: 44px; }
}
#theme-header.elmofid-header .elmofid-latest-viewport:not(:has(a:focus-visible)) .elmofid-latest-track { animation-play-state: running; }

/* Omit the two marked channels from the masthead only. */
#theme-header .elmofid-masthead-social > li:has(a[href*="medium.com/"]),
#theme-header .elmofid-masthead-social > li:has(a[href$="/feed/"]) { display: none !important; }

/* One font step larger for the primary navigation and headlines. */
@media (min-width: 992px) {
  #theme-header.elmofid-header #main-nav #main-nav-menu > ul > li > a { font-size: 15px; }
}
#theme-header.elmofid-header .elmofid-latest { font-size: 15px; }
@media (max-width: 767px) {
  #theme-header.elmofid-header .elmofid-latest { font-size: 14px; }
}

/* Increase the brand lockup by two modest sizing steps. */
@media (min-width: 992px) {
  #theme-header.elmofid-header .logo-container #logo img { max-width: min(34vw, 385px); max-height: 102px !important; }
  #theme-header.elmofid-header .logo-row:not(:has(.stream-item-top:not(:empty))) > .logo-wrapper { min-height: 126px; }
}
@media (max-width: 991px) {
  #theme-header.elmofid-header #logo img { max-width: min(60vw, 260px); }
}
