/*
Theme Name: توفل بالعربي (ToeflBilArabi)
Theme URI: https://toeflbilarabi.com
Author: محمد أمين أياب
Description: قالب عربي خفيف وسريع لموقع «توفل بالعربي»: تصميم من اليمين إلى اليسار، خط Cairo مستضاف محليًا، جدول محتويات تلقائي، صندوق الكاتب، مقالات ذات صلة، ودعم Yoast SEO وGoogle AdSense.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: toeflbilarabi
Tags: rtl-language-support, education, blog, one-column, custom-logo, custom-menu
*/

@font-face {
	font-family: "Cairo";
	src: url("assets/fonts/cairo.woff2") format("woff2");
	font-weight: 200 1000;
	font-style: normal;
	font-display: swap;
}

:root {
	--navy: #14213d;
	--ink: #1f2937;
	--muted: #5b6472;
	--teal: #0e9f8e;
	--teal-d: #0b7f72;
	--teal-l: #e3f6f3;
	--amber: #f2a541;
	--amber-l: #fef3e2;
	--red: #c73e3e;
	--red-l: #fdecec;
	--green: #1b8a4f;
	--green-l: #e6f6ec;
	--paper: #fbfaf7;
	--card: #ffffff;
	--line: #e5e2da;
	--radius: 14px;
	--shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 6px 20px rgba(20, 33, 61, .06);
	--wrap: 1160px;
	--narrow: 780px;
	--font: "Cairo", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font);
	font-size: 18px;
	line-height: 1.9;
	text-rendering: optimizeLegibility;
}

img, svg, video { max-width: 100%; height: auto; }

a { color: var(--teal-d); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

h1, h2, h3, h4 { color: var(--navy); line-height: 1.45; font-weight: 800; }

[lang="en"], [dir="ltr"] { unicode-bidi: isolate; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

.tba-skip {
	position: absolute;
	inset-inline-start: 1rem;
	top: -100px;
	background: var(--navy);
	color: #fff;
	padding: .5rem 1rem;
	border-radius: 8px;
	z-index: 100;
}
.tba-skip:focus { top: 1rem; }

.tba-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.tba-wrap--narrow { max-width: var(--narrow); }
.tba-wrap--tool { max-width: 940px; }

/* ---------- Header ---------- */
.tba-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .94);
	backdrop-filter: saturate(1.4) blur(8px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .tba-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tba-header { top: 0; position: relative; } }

.tba-header__inner { display: flex; align-items: center; gap: 1.5rem; min-height: 68px; }

.tba-brand { display: inline-flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--navy); }
.tba-brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.tba-brand__name { font-weight: 900; font-size: 1.28rem; }
.tba-brand__latin { font-size: .72rem; font-weight: 700; color: var(--muted); letter-spacing: .03em; text-align: right; }
.tba-brand__img { max-height: 48px; width: auto; }

.tba-nav { display: flex; align-items: center; gap: 1rem; margin-inline-start: auto; }
.tba-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: .2rem; flex-wrap: wrap; }
.tba-nav__list a {
	display: block;
	padding: .4rem .8rem;
	border-radius: 10px;
	text-decoration: none;
	color: var(--ink);
	font-weight: 700;
	font-size: .96rem;
}
.tba-nav__list a:hover,
.tba-nav__list .current-menu-item > a,
.tba-nav__list .current-menu-ancestor > a { background: var(--teal-l); color: var(--teal-d); }
.tba-nav__list .sub-menu {
	display: none;
	position: absolute;
	list-style: none;
	margin: 0;
	padding: .4rem;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 12px;
	box-shadow: var(--shadow);
	min-width: 240px;
}
.tba-nav__list li { position: relative; }
.tba-nav__list li:hover > .sub-menu,
.tba-nav__list li:focus-within > .sub-menu { display: block; }

.tba-nav__search input {
	font: inherit;
	font-size: .92rem;
	width: 150px;
	padding: .35rem .8rem;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--paper);
}

.tba-menu-toggle { display: none; margin-inline-start: auto; background: none; border: 0; padding: .5rem; cursor: pointer; }
.tba-menu-toggle__bars,
.tba-menu-toggle__bars::before,
.tba-menu-toggle__bars::after {
	display: block;
	width: 24px; height: 2.5px;
	background: var(--navy);
	border-radius: 2px;
	position: relative;
	transition: transform .2s;
}
.tba-menu-toggle__bars::before,
.tba-menu-toggle__bars::after { content: ""; position: absolute; }
.tba-menu-toggle__bars::before { top: -7px; }
.tba-menu-toggle__bars::after { top: 7px; }

@media (max-width: 960px) {
	.tba-menu-toggle { display: block; }
	.tba-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		background: #fff;
		border-bottom: 1px solid var(--line);
		padding: 1rem 20px 1.25rem;
		flex-direction: column;
		align-items: stretch;
		box-shadow: var(--shadow);
	}
	.tba-nav.is-open { display: flex; }
	.tba-nav__list { flex-direction: column; }
	.tba-nav__list .sub-menu { position: static; display: block; box-shadow: none; border: 0; padding: 0 1rem 0 0; }
	.tba-nav__search input { width: 100%; }
}

/* ---------- Buttons / chips ---------- */
.tba-btn {
	display: inline-block;
	font-weight: 800;
	font-size: 1rem;
	padding: .75rem 1.4rem;
	border-radius: 12px;
	text-decoration: none;
	border: 2px solid transparent;
	transition: transform .15s, background .15s;
}
.tba-btn:hover { transform: translateY(-1px); }
.tba-btn--primary { background: var(--teal); color: #fff; }
.tba-btn--primary:hover { background: var(--teal-d); color: #fff; }
.tba-btn--ghost { border-color: rgba(255, 255, 255, .5); color: #fff; }
.tba-btn--ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.tba-chip {
	display: inline-block;
	font-size: .8rem;
	font-weight: 800;
	color: var(--teal-d);
	background: var(--teal-l);
	padding: .1rem .7rem;
	border-radius: 999px;
	text-decoration: none;
}

/* ---------- Hero ---------- */
.tba-hero {
	background: radial-gradient(1200px 500px at 90% -20%, #1f3866 0%, var(--navy) 60%);
	color: #fff;
	padding: 64px 0 72px;
}
.tba-hero__grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 48px; align-items: center; }
.tba-kicker { color: var(--amber); font-weight: 800; margin: 0 0 .5rem; }
.tba-hero__title { color: #fff; font-size: clamp(1.9rem, 4vw, 2.85rem); font-weight: 900; margin: 0 0 1rem; line-height: 1.35; }
.tba-hero__title [lang="en"] { color: #7ee0d3; }
.tba-hero__lede { font-size: 1.12rem; color: rgba(255, 255, 255, .86); margin: 0 0 1.6rem; max-width: 40em; }
.tba-hero__cta { display: flex; flex-wrap: wrap; gap: .8rem; }
.tba-hero__trust { list-style: none; padding: 0; margin: 2rem 0 0; display: flex; flex-wrap: wrap; gap: 1.6rem; color: rgba(255, 255, 255, .78); font-size: .95rem; }
.tba-hero__trust strong { color: #fff; font-size: 1.35rem; margin-inline-end: .2rem; }

.tba-hero__panel {
	background: rgba(255, 255, 255, .06);
	border: 1px solid rgba(255, 255, 255, .16);
	border-radius: 20px;
	padding: 26px;
}
.tba-panel__title { margin: 0 0 1rem; font-weight: 800; color: #fff; }
.tba-panel__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.tba-panel__list li { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center; }
.tba-panel__name { font-weight: 800; color: #7ee0d3; }
.tba-panel__val { font-size: .92rem; color: rgba(255, 255, 255, .85); text-align: left; }
.tba-panel__bar { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .12); position: relative; overflow: hidden; }
.tba-panel__bar::after { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--w); background: linear-gradient(90deg, var(--amber), var(--teal)); border-radius: 99px; }
.tba-panel__foot { margin: 1.1rem 0 0; font-size: .86rem; color: rgba(255, 255, 255, .7); }
.tba-panel__foot strong { color: #fff; }

@media (max-width: 900px) {
	.tba-hero { padding: 40px 0 48px; }
	.tba-hero__grid { grid-template-columns: 1fr; gap: 28px; }
}

/* ---------- Sections / grids ---------- */
.tba-section { padding: 56px 0; }
.tba-section--tint { background: #f3f1ea; }
.tba-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.tba-section__title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); margin: 0 0 1.4rem; }
.tba-section__more { font-weight: 800; text-decoration: none; white-space: nowrap; }

.tba-grid { display: grid; gap: 20px; }
.tba-grid--3 { grid-template-columns: repeat(3, 1fr); }
.tba-grid--4 { grid-template-columns: repeat(4, 1fr); }
.tba-grid--tools { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .tba-grid--4, .tba-grid--tools { grid-template-columns: repeat(2, 1fr); } .tba-grid--3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .tba-grid--3, .tba-grid--4, .tba-grid--tools { grid-template-columns: 1fr; } }

.tba-tool {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	padding: 20px;
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	text-decoration: none;
	color: var(--ink);
	transition: border-color .15s, transform .15s, box-shadow .15s;
}
.tba-tool:hover { border-color: var(--teal); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.tba-tool__icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 12px; background: var(--teal-l); color: var(--teal-d); margin-bottom: .4rem; }
.tba-tool:nth-child(3n+2) .tba-tool__icon { background: var(--amber-l); color: #a86510; }
.tba-tool:nth-child(3n+3) .tba-tool__icon { background: #e9edf7; color: var(--navy); }
.tba-tool__name { font-weight: 800; color: var(--navy); font-size: 1.06rem; }
.tba-tool__desc { color: var(--muted); font-size: .93rem; line-height: 1.7; }

.tba-path { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; counter-reset: s; }
.tba-path__step a {
	display: flex; flex-direction: column; gap: .3rem; height: 100%;
	padding: 20px 18px;
	background: var(--card);
	border-radius: var(--radius);
	border-top: 6px solid var(--teal);
	text-decoration: none;
	color: var(--ink);
	box-shadow: var(--shadow);
}
.tba-path__step:nth-child(2) a { border-top-color: #2b7bb9; }
.tba-path__step:nth-child(3) a { border-top-color: var(--amber); }
.tba-path__step:nth-child(4) a { border-top-color: #7a5af8; }
.tba-path__step:nth-child(5) a { border-top-color: var(--green); }
.tba-path__num { font-size: 1.9rem; font-weight: 900; color: var(--navy); line-height: 1; }
.tba-path__title { font-weight: 800; color: var(--navy); }
.tba-path__desc { color: var(--muted); font-size: .9rem; line-height: 1.6; }
@media (max-width: 1000px) { .tba-path { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tba-path { grid-template-columns: 1fr; } }

.tba-skill { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.tba-skill__title { margin: 0 0 .6rem; font-size: 1.15rem; }
.tba-skill__title a { text-decoration: none; color: var(--navy); }
.tba-skill__title span { color: var(--teal-d); font-size: .85rem; font-weight: 700; }
.tba-skill__list { margin: 0; padding-inline-start: 1.1rem; font-size: .95rem; line-height: 1.75; }
.tba-skill__list li { margin-bottom: .35rem; }
.tba-skill__list a { color: var(--ink); text-decoration: none; }
.tba-skill__list a:hover { color: var(--teal-d); text-decoration: underline; }

/* ---------- Cards ---------- */
.tba-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: transform .15s, box-shadow .15s; }
.tba-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tba-card__link { display: block; text-decoration: none; color: inherit; height: 100%; }
.tba-card__img img { display: block; width: 100%; aspect-ratio: 40 / 21; object-fit: cover; }
.tba-card__body { padding: 16px 18px 18px; }
.tba-card__title { font-size: 1.07rem; margin: .5rem 0 .3rem; line-height: 1.55; }
.tba-card__meta { margin: 0; color: var(--muted); font-size: .85rem; }

/* ---------- Article ---------- */
.tba-article__head { padding: 28px 0 10px; }
.tba-breadcrumbs { font-size: .86rem; color: var(--muted); margin-bottom: .9rem; }
.tba-breadcrumbs a { color: var(--muted); text-decoration: none; }
.tba-breadcrumbs a:hover { color: var(--teal-d); }
.tba-article__title { font-size: clamp(1.7rem, 3.6vw, 2.45rem); margin: .55rem 0 .6rem; font-weight: 900; }
.tba-article__lede { font-size: 1.12rem; color: var(--muted); margin: 0; }
.tba-article__meta { display: flex; flex-wrap: wrap; gap: .45rem; color: var(--muted); font-size: .92rem; margin: 0; }
.tba-article__meta a { color: var(--navy); font-weight: 700; text-decoration: none; }
.tba-article__hero { margin-block: 18px 6px; }
.tba-article__hero img { display: block; width: 100%; border-radius: 18px; box-shadow: var(--shadow); }

.tba-content { padding-bottom: 20px; }
.tba-content > * { margin-block: 0 1.15rem; }
.tba-content h2 { font-size: 1.6rem; margin-top: 2.4rem; padding-top: .3rem; scroll-margin-top: 90px; }
.tba-content h3 { font-size: 1.25rem; margin-top: 1.8rem; scroll-margin-top: 90px; }
.tba-content p, .tba-content li { max-width: 72ch; }
.tba-content ul, .tba-content ol { padding-inline-start: 1.4rem; }
.tba-content li { margin-bottom: .45rem; }
.tba-content strong { color: var(--navy); }
.tba-content img { border-radius: 14px; display: block; margin-inline: auto; }
.tba-content figure { margin-inline: 0; }
.tba-content figure img { border: 1px solid var(--line); }

.tba-content blockquote,
.tba-content .tba-en {
	direction: ltr;
	text-align: left;
	unicode-bidi: isolate;
	margin-inline: 0;
	background: #f2f6fb;
	border-left: 5px solid #2b7bb9;
	border-right: 0;
	padding: 14px 18px;
	border-radius: 10px;
	font-size: 1.02rem;
	line-height: 1.75;
	font-family: "Segoe UI", "Helvetica Neue", Arial, var(--font);
}
.tba-content blockquote p { margin: 0 0 .6rem; max-width: none; }
.tba-content blockquote p:last-child { margin: 0; }

.tba-content .tba-ltr-list { direction: ltr; text-align: left; padding-left: 1.6rem; padding-right: 0; }
.tba-content .tba-ltr-list li { font-family: "Segoe UI", "Helvetica Neue", Arial, var(--font); }

.tba-table-wrap { overflow-x: auto; margin-block: 0 1.4rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.tba-content table { border-collapse: collapse; width: 100%; font-size: .97rem; line-height: 1.65; }
.tba-content th, .tba-content td { padding: .65rem .9rem; border-bottom: 1px solid var(--line); text-align: start; vertical-align: top; unicode-bidi: plaintext; }
.tba-content thead th { background: var(--navy); color: #fff; font-weight: 800; white-space: nowrap; }
.tba-content tbody tr:nth-child(even) { background: #faf9f5; }
.tba-content tbody tr:last-child td { border-bottom: 0; }

.tba-content .tba-faq { border-top: 1px solid var(--line); padding-top: .4rem; }
.tba-content .tba-faq h3, .tba-content .tba-faq__q { font-size: 1.08rem; margin: 1.1rem 0 .2rem; color: var(--navy); }
.tba-content .tba-faq p { margin: 0 0 .6rem; }

.tba-content .tba-sources { font-size: .93rem; background: var(--teal-l); padding: 14px 18px; border-radius: 12px; }
.tba-content .tba-disclaimer { font-size: .88rem; color: var(--muted); }

.tba-content .tba-callout { background: var(--amber-l); border-inline-start: 5px solid var(--amber); padding: 14px 18px; border-radius: 10px; }

/* Table of contents */
.tba-toc { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 6px 18px; margin-block: 1rem 1.6rem; }
.tba-toc summary { cursor: pointer; font-weight: 800; color: var(--navy); padding: 8px 0; }
.tba-toc ol { margin: 0 0 .8rem; padding-inline-start: 1.3rem; font-size: .96rem; line-height: 1.7; columns: 2; column-gap: 2rem; }
.tba-toc li { margin-bottom: .3rem; break-inside: avoid; }
.tba-toc a { color: var(--ink); text-decoration: none; }
.tba-toc a:hover { color: var(--teal-d); text-decoration: underline; }
@media (max-width: 640px) { .tba-toc ol { columns: 1; } }

.tba-ad { margin-block: 1.6rem; min-height: 90px; text-align: center; }

/* Author box */
.tba-author { display: grid; grid-template-columns: 88px 1fr; gap: 18px; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; margin: 28px 0; box-shadow: var(--shadow); }
.tba-author__photo img, .tba-author__photo svg { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; display: block; }
.tba-author__label { margin: 0; font-size: .8rem; font-weight: 800; color: var(--teal-d); }
.tba-author__name { margin: 0; font-size: 1.2rem; font-weight: 900; color: var(--navy); }
.tba-author__bio { margin: .3rem 0 .4rem; color: var(--muted); font-size: .97rem; line-height: 1.8; }
.tba-author__more { font-weight: 800; text-decoration: none; font-size: .95rem; }
@media (max-width: 520px) { .tba-author { grid-template-columns: 1fr; text-align: center; } .tba-author__photo { justify-self: center; } }

.tba-related { background: #f3f1ea; }

/* Archive */
.tba-archive-head { padding: 34px 0 0; }
.tba-pagination { margin-top: 2rem; }
.tba-pagination .nav-links { display: flex; gap: .4rem; flex-wrap: wrap; justify-content: center; }
.tba-pagination .page-numbers { padding: .3rem .8rem; border-radius: 8px; background: #fff; border: 1px solid var(--line); text-decoration: none; }
.tba-pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }

.tba-searchform { display: flex; gap: .5rem; max-width: 520px; }
.tba-searchform input { flex: 1; font: inherit; padding: .6rem 1rem; border: 1px solid var(--line); border-radius: 12px; }
.tba-searchform button { font: inherit; font-weight: 800; padding: .6rem 1.2rem; border: 0; border-radius: 12px; background: var(--teal); color: #fff; cursor: pointer; }

.tba-404 { text-align: center; }
.tba-404 .tba-searchform { margin-inline: auto; }
.tba-404__code { font-size: 5rem; font-weight: 900; color: var(--teal); margin: 0; line-height: 1; }

/* ---------- Footer ---------- */
.tba-footer { background: var(--navy); color: rgba(255, 255, 255, .78); padding: 48px 0 0; margin-top: 0; font-size: .95rem; }
.tba-footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.tba-footer a:hover { color: #fff; text-decoration: underline; }
.tba-footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.tba-footer__title { color: #fff; font-size: 1rem; margin: 0 0 .8rem; }
.tba-footer__list { list-style: none; margin: 0; padding: 0; line-height: 2.1; }
.tba-brand--footer { color: #fff; margin-bottom: .8rem; }
.tba-brand--footer .tba-brand__latin { color: rgba(255, 255, 255, .55); }
.tba-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 32px; padding-block: 18px 26px; font-size: .85rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.tba-footer__bottom p { margin: 0; }
.tba-footer__tm { color: rgba(255, 255, 255, .6); max-width: 46em; }
@media (max-width: 900px) { .tba-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tba-footer__grid { grid-template-columns: 1fr; } }

/* WordPress core alignment classes */
.alignleft { float: left; margin: .3rem 1.2rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.2rem; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: .85rem; color: var(--muted); text-align: center; margin-top: .4rem; }

@media (max-width: 640px) {
	body { font-size: 17px; }
	.tba-section { padding: 40px 0; }
	.tba-content h2 { font-size: 1.38rem; }
}

@media print {
	.tba-header, .tba-footer, .tba-related, .tba-toc, .tba-ad, .tba-skip { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.tba-content a { color: inherit; }
}

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

/* Tool screenshots inside tool pages: smaller, clearly an illustration. */
.tba-content .tba-figure--shot { max-width: 560px; margin: 1.2rem auto; }
.tba-content .tba-figure--shot img { border-radius: 14px; opacity: .92; pointer-events: none; }
