/* ArbahWeb — RTL Arabic blog theme. Palette: teal/green + dark navy. */

:root {
	--navy: #0f1b2d;
	--navy-2: #16263d;
	--teal: #0e9f8a;
	--teal-dark: #0b7c6b;
	--teal-soft: #e3f4f1;
	--bg: #f6f8f9;
	--card: #ffffff;
	--text: #1c2733;
	--muted: #5b6b7b;
	--border: #e3e9ee;
	--radius: 14px;
	--shadow: 0 2px 10px rgba(15, 27, 45, .07);
	--font: 'Tajawal', 'Segoe UI', Tahoma, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
	margin: 0;
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.9;
	color: var(--text);
	background: var(--bg);
}

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

a { color: var(--teal-dark); text-decoration: none; transition: color .15s ease; }
a:hover, a:focus { color: var(--teal); }

h1, h2, h3, h4, h5, h6 { line-height: 1.5; color: var(--navy); margin: 1.4em 0 .6em; font-weight: 700; }

.container { max-width: 1140px; margin-inline: auto; padding-inline: 20px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	overflow: hidden;
	white-space: nowrap;
}
.screen-reader-text:focus {
	width: auto; height: auto; clip: auto; clip-path: none;
	background: var(--navy); color: #fff; padding: 8px 14px; z-index: 100000;
	border-radius: 6px;
}

/* ---------- Header ---------- */
.site-header {
	background: var(--navy);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
}
.header-inner {
	display: flex;
	align-items: center;
	gap: 22px;
	padding-block: 12px;
}
.site-title { margin: 0; font-size: 26px; font-weight: 800; }
.site-title a { color: #fff; }
.custom-logo-link img { max-height: 48px; width: auto; display: block; }

.main-navigation { margin-inline-start: auto; }
.main-navigation ul {
	list-style: none; margin: 0; padding: 0;
	display: flex; gap: 4px;
}
.main-navigation a {
	color: #dce6ef;
	display: block;
	padding: 8px 14px;
	border-radius: 8px;
	font-weight: 500;
}
.main-navigation a:hover, .main-navigation a:focus,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: #fff;
	background: rgba(255, 255, 255, .1);
}
.main-navigation .sub-menu { display: none; }

.nav-toggle {
	display: none;
	background: transparent;
	border: 0;
	padding: 10px;
	cursor: pointer;
}
.nav-toggle-bar { display: block; width: 24px; height: 2px; background: #fff; margin: 5px 0; border-radius: 2px; }

.header-search .search-form { display: flex; }
.header-search .search-field {
	background: var(--navy-2);
	border: 1px solid rgba(255, 255, 255, .15);
	color: #fff;
	border-radius: 8px 0 0 8px;
	padding: 7px 12px;
	width: 150px;
	font-family: inherit;
	font-size: 14px;
}
.header-search .search-field::placeholder { color: #93a5b8; }
.header-search .search-submit {
	background: var(--teal);
	color: #fff;
	border: 0;
	border-radius: 0 8px 8px 0;
	padding: 7px 14px;
	cursor: pointer;
	font-family: inherit;
	font-weight: 700;
}
.header-search .search-submit:hover { background: var(--teal-dark); }

/* ---------- Layout ---------- */
.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 32px;
	padding-block: 30px 50px;
	align-items: start;
}
.layout-narrow { grid-template-columns: 1fr; max-width: 860px; }
.site-main > .container:not(.layout) { padding-block: 30px 50px; }

.widget-area .widget {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	padding: 20px;
	margin-bottom: 22px;
	box-shadow: var(--shadow);
}
.widget-title { margin-top: 0; font-size: 19px; border-inline-start: 4px solid var(--teal); padding-inline-start: 10px; }
.widget ul { padding-inline-start: 18px; margin: 0; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
	font-size: 14px;
	color: var(--muted);
	margin-bottom: 22px;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.breadcrumbs .sep { color: #b6c2cd; }
.breadcrumbs .current { color: var(--text); font-weight: 500; }

/* ---------- Archive header ---------- */
.archive-header { margin-bottom: 26px; }
.archive-title { margin: 0 0 6px; font-size: 30px; font-weight: 800; }
.archive-title::after {
	content: "";
	display: block;
	width: 56px; height: 4px;
	background: var(--teal);
	border-radius: 2px;
	margin-top: 10px;
}
.archive-description { color: var(--muted); }

/* ---------- Cards ---------- */
.posts-grid, .related-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
	gap: 24px;
}
.card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
	display: flex;
	flex-direction: column;
	transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(15, 27, 45, .12); }
.card-thumb { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--navy-2); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-title { margin: 0; font-size: 20px; line-height: 1.6; }
.card-title a { color: var(--navy); }
.card-title a:hover { color: var(--teal-dark); }
.card-excerpt { margin: 0; color: var(--muted); font-size: 15.5px; }
.card-meta { margin-top: auto; }

/* Category badge: full name, no truncation */
.cat-badge {
	display: inline-block;
	background: var(--teal);
	color: #fff;
	font-size: 13.5px;
	font-weight: 700;
	padding: 4px 12px;
	border-radius: 999px;
	line-height: 1.7;
	align-self: flex-start;
	max-width: 100%;
	white-space: normal;
	overflow-wrap: break-word;
}
.cat-badge:hover { background: var(--teal-dark); color: #fff; }

.entry-meta {
	display: flex;
	gap: 16px;
	color: var(--muted);
	font-size: 14px;
}

/* ---------- Single ---------- */
.entry-single {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	max-width: 860px;
	margin-inline: auto;
}
.entry-cover { margin: 0; position: relative; }
.entry-cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.entry-cover .cat-badge {
	position: absolute;
	top: 16px;
	inset-inline-start: 16px;
	box-shadow: 0 2px 8px rgba(15, 27, 45, .35);
}
.entry-head { padding: 22px 32px 0; }
.entry-head .entry-title { margin: 0; font-size: 30px; font-weight: 800; }
.entry-head-plain .entry-title { margin-top: 12px; }
.entry-meta { padding: 16px 32px; border-bottom: 1px solid var(--border); }

/* Table of contents */
.toc {
	margin: 26px 32px 0;
	background: var(--teal-soft);
	border: 1px solid #bfe5df;
	border-radius: var(--radius);
	padding: 16px 22px;
}
.toc-title { color: var(--navy); }
.toc-list { margin: 8px 0 0; padding-inline-start: 22px; }
.toc-list li { margin: 4px 0; }
.toc-list a { color: var(--teal-dark); font-weight: 500; }

.entry-content { padding: 10px 32px 26px; font-size: 18px; }
.entry-content h2 { font-size: 25px; font-weight: 800; padding-inline-start: 14px; border-inline-start: 5px solid var(--teal); }
.entry-content h3 { font-size: 21px; }
.entry-content p { margin: 1em 0; }
.entry-content ul, .entry-content ol { padding-inline-start: 26px; }
.entry-content blockquote {
	margin: 1.4em 0;
	padding: 14px 22px;
	background: var(--bg);
	border-inline-start: 5px solid var(--teal);
	border-radius: 8px;
	color: var(--navy-2);
}
.entry-content table { width: 100%; min-width: 560px; border-collapse: collapse; margin: 1.4em 0; font-size: 16px; }
.entry-content th, .entry-content td { border: 1px solid var(--border); padding: 10px 14px; text-align: right; }
.entry-content th, .entry-content td { overflow-wrap: normal; word-break: normal; hyphens: none; }
.entry-content th { background: var(--navy); color: #fff; font-weight: 700; }
.entry-content tr:nth-child(even) td { background: var(--bg); }
.entry-content code {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 6px;
	padding: 2px 7px;
	font-size: 15px;
	direction: ltr;
	unicode-bidi: embed;
}
.entry-content pre {
	background: var(--navy);
	color: #e6edf3;
	padding: 18px 22px;
	border-radius: 10px;
	overflow-x: auto;
	direction: ltr;
	text-align: left;
}
.entry-content pre code { background: none; border: 0; color: inherit; padding: 0; }
.entry-content .wp-caption, .entry-content figure { max-width: 100%; }
.entry-content figcaption, .wp-caption-text { font-size: 14px; color: var(--muted); text-align: center; margin-top: 6px; }
.aligncenter { margin-inline: auto; display: block; }
.alignright { float: right; margin-inline-start: 20px; }
.alignleft { float: left; margin-inline-end: 20px; }

.page-links { padding: 0 32px 20px; }

.entry-footer { padding: 0 32px 10px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
	background: var(--bg);
	border: 1px solid var(--border);
	border-radius: 999px;
	padding: 3px 13px;
	font-size: 13.5px;
	color: var(--muted);
}
.tag:hover { border-color: var(--teal); color: var(--teal-dark); }

/* Related */
.related-posts { padding: 10px 32px 30px; }
.related-title { font-size: 22px; font-weight: 800; }
.related-title::after {
	content: "";
	display: block;
	width: 48px; height: 4px;
	background: var(--teal);
	border-radius: 2px;
	margin-top: 8px;
}
.related-grid { grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr)); }

/* Pagination */
.pagination { margin-top: 34px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pagination .page-numbers {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 6px 15px;
	color: var(--text);
	font-weight: 500;
}
.pagination .page-numbers.current {
	background: var(--navy);
	border-color: var(--navy);
	color: #fff;
}
.pagination a.page-numbers:hover { border-color: var(--teal); color: var(--teal-dark); }

/* Comments */
.comments-area {
	max-width: 860px;
	margin: 30px auto 0;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 26px 32px;
}
.comments-title { margin-top: 0; }
.comment-list { padding-inline-start: 0; list-style: none; }
.comment-list .comment-body {
	border: 1px solid var(--border);
	border-radius: 10px;
	padding: 14px 18px;
	margin-bottom: 14px;
}
.comment-list .children { padding-inline-start: 26px; list-style: none; }
.comment-author { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-form label { display: block; margin-bottom: 4px; font-weight: 500; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	border: 1px solid var(--border);
	border-radius: 8px;
	padding: 10px 14px;
	font-family: inherit;
	font-size: 16px;
	background: #fff;
}
.comment-form .submit {
	background: var(--teal);
	color: #fff;
	border: 0;
	border-radius: 8px;
	padding: 11px 26px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}
.comment-form .submit:hover { background: var(--teal-dark); }

/* Search form (widget / 404) */
.search-form { display: flex; max-width: 480px; }
.search-field {
	flex: 1;
	border: 1px solid var(--border);
	border-radius: 8px 0 0 8px;
	padding: 10px 14px;
	font-family: inherit;
	font-size: 16px;
	border-inline-end: 0;
}
.search-submit {
	background: var(--teal);
	color: #fff;
	border: 0;
	border-radius: 0 8px 8px 0;
	padding: 10px 20px;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
}
.search-submit:hover { background: var(--teal-dark); }

.no-results, .error-404 {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	padding: 30px 32px;
}
.recent-list { padding-inline-start: 20px; }

/* ---------- Footer ---------- */
.site-footer {
	background: var(--navy);
	color: #b9c7d6;
	margin-top: 40px;
	padding: 36px 0 22px;
}
.footer-widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 24px; }
.site-footer .widget-title { color: #fff; }
.site-footer a { color: #dce6ef; }
.site-footer a:hover { color: var(--teal); }
.footer-navigation ul { list-style: none; display: flex; flex-wrap: wrap; gap: 16px; padding: 0; margin: 18px 0 0; }
.site-info {
	margin: 22px 0 0;
	padding-top: 18px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	font-size: 14px;
	text-align: center;
	color: #8fa2b5;
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.layout, .layout-single { grid-template-columns: 1fr; }
	.widget-area { order: 2; }
}

@media (max-width: 760px) {
	.nav-toggle { display: block; margin-inline-start: auto; }
	.main-navigation {
		position: absolute;
		top: 100%;
		inset-inline: 0;
		background: var(--navy-2);
		display: none;
	}
	.main-navigation.is-open { display: block; }
	.main-navigation ul { flex-direction: column; padding: 10px 16px 16px; gap: 2px; }
	.main-navigation a { padding: 11px 14px; }
	.header-search { display: none; }
	.entry-content { padding: 8px 20px 20px; font-size: 17px; }
	.entry-meta, .entry-head { padding-inline: 20px; }
	.toc { margin-inline: 20px; }
	.related-posts, .entry-footer { padding-inline: 20px; }
	.comments-area { padding: 20px; }
	.entry-head .entry-title { font-size: 24px; }
}

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

/* ---------- Homepage (front-page) ---------- */
.home-layout { padding-block: 30px 50px; display: flex; flex-direction: column; gap: 44px; }

.home-hero { margin: 0; }
.hero-card {
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	overflow: hidden;
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: stretch;
}
.hero-thumb { display: block; position: relative; overflow: hidden; background: var(--navy-2); aspect-ratio: 16 / 9; align-self: center; width: 100%; }
.hero-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-body {
	padding: 34px 34px 30px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	justify-content: center;
}
.hero-kicker {
	color: var(--teal-dark);
	font-weight: 800;
	font-size: 14px;
	letter-spacing: .02em;
}
.hero-title { margin: 0; font-size: 32px; font-weight: 800; line-height: 1.55; }
.hero-title a { color: var(--navy); }
.hero-title a:hover { color: var(--teal-dark); }
.hero-excerpt { margin: 0; color: var(--muted); }
.btn {
	display: inline-block;
	background: var(--teal);
	color: #fff;
	font-weight: 700;
	padding: 11px 26px;
	border-radius: 10px;
	margin-top: 6px;
}
.btn:hover, .btn:focus { background: var(--teal-dark); color: #fff; }

.posts-grid-2 { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
	border-bottom: 2px solid var(--border);
	padding-bottom: 12px;
}
.section-title { margin: 0; font-size: 24px; font-weight: 800; }
.section-title::after {
	content: "";
	display: block;
	width: 48px; height: 4px;
	background: var(--teal);
	border-radius: 2px;
	margin-top: 8px;
	margin-bottom: -14px;
}
.section-more { font-weight: 700; white-space: nowrap; }

.cta-band {
	background: var(--navy);
	border-radius: var(--radius);
	padding: 44px 30px;
	text-align: center;
}
.cta-inner { max-width: 560px; margin-inline: auto; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.cta-title { margin: 0; color: #fff; font-size: 26px; font-weight: 800; }
.cta-text { margin: 0; color: #b9c7d6; }
.cta-band .search-form { margin-top: 8px; width: 100%; }
.cta-band .search-field { border: 0; }
.cta-band .search-submit { border-radius: 0 8px 8px 0; }

@media (max-width: 860px) {
	.hero-card { grid-template-columns: 1fr; }
	.hero-body { padding: 24px 22px 26px; }
	.hero-title { font-size: 25px; }
	.section-title { font-size: 21px; }
	.cta-band { padding: 34px 20px; }
}

/* ---------- Ad zones ---------- */
.ad-zone-top { margin-top: 22px; }
.ad-zone-top .container { display: flex; justify-content: center; }
.ad-widget { background: transparent; border: 0; box-shadow: none; padding: 0; }
.ad-widget img {
	display: block;
	margin-inline: auto;
	max-width: 100%;
	height: auto;
	border-radius: 10px;
}
.ad-zone-sidebar { margin-bottom: 22px; }
.ad-link { display: block; }
.ad-image { display: block; margin-inline: auto; max-width: 100%; height: auto; border-radius: 10px; }

/* Single post with an active sidebar */
/* grid comes from .layout; .layout-single only tweaks widths below */
.layout-single .entry-single { max-width: none; margin-inline: 0; }
.layout-single .comments-area { max-width: none; margin-inline: 0; }

/* ---------- Overflow guards (content can never exceed the viewport) ---------- */
.content-area, .widget-area, .card, .hero-body, .entry-single, .comments-area { min-width: 0; }

.entry-content { overflow-wrap: anywhere; }
.entry-content img, .entry-content figure, .entry-content .wp-block-image,
.entry-content iframe, .entry-content video, .entry-content embed, .entry-content object {
	max-width: 100%;
}
.entry-content img { height: auto; }
/* Scrollable table wrapper (added by main.js) and block-editor table figures */
.entry-content .table-scroll, .entry-content figure.wp-block-table, .entry-content .wp-block-table {
	overflow-x: auto;
	max-width: 100%;
	-webkit-overflow-scrolling: touch;
	border-radius: 10px;
	/* subtle edge fades that disappear once scrolled to an edge */
	background:
		linear-gradient(to left, #ffffff 30%, rgba(255, 255, 255, 0)),
		linear-gradient(to right, #ffffff 30%, rgba(255, 255, 255, 0)),
		radial-gradient(farthest-side at 0 50%, rgba(15, 27, 45, .16), rgba(15, 27, 45, 0)),
		radial-gradient(farthest-side at 100% 50%, rgba(15, 27, 45, .16), rgba(15, 27, 45, 0));
	background-repeat: no-repeat;
	background-color: transparent;
	background-size: 36px 100%, 36px 100%, 12px 100%, 12px 100%;
	background-position: 0 0, 100% 0, 0 0, 100% 0;
	background-attachment: local, local, scroll, scroll;
}
.entry-content .table-scroll table, .entry-content figure.wp-block-table table { margin: 0; }
.entry-content pre { max-width: 100%; }

/* Classic-editor content pasted with fixed pixel widths */
.entry-content img[width], .entry-content img[style] { max-width: 100% !important; height: auto !important; }
.entry-content div[style*="width"], .entry-content p[style*="width"] { max-width: 100% !important; }
