/*
Theme Name: Ibda3y Pro
Theme URI: https://ibda3y.com/
Author: Ahmed Bazoka
Description: قالب عربي خفيف وسريع لمواقع شروحات ومراجعات التطبيقات والألعاب. شبكة مقالات بصور كبيرة، قائمة على شكل كبسولات، صفحة مقال مريحة للقراءة، وأماكن إعلانات بتتفعل من التخصيص.
Version: 2.3.6
Requires at least: 6.3
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ibda3y
Tags: blog, news, rtl-language-support, grid-layout, custom-menu, custom-logo, featured-images, threaded-comments
*/

:root {
	--accent: #1a8cff;
	--accent-dark: #0b6fd6;
	--bg: #ffffff;
	--soft: #f3f6fa;
	--text: #1c2333;
	--muted: #6b7385;
	--border: #e7ebf1;
	--footer: #0c1424;
	--radius: 16px;
	--shadow: 0 2px 6px rgba(20, 40, 80, .05), 0 10px 28px rgba(20, 40, 80, .06);
	--wrap: 1180px;
	--font: "Tajawal", "Segoe UI", Tahoma, "Geeza Pro", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.9;
	color: var(--text); background: var(--bg);
}
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.5; margin: 1.5em 0 .55em; font-weight: 800; }
p { margin: 0 0 1.1em; }
svg.i { width: 1em; height: 1em; vertical-align: -.12em; flex: none; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 1000; inset-inline-start: 12px; top: 12px;
	padding: 10px 16px; background: #fff; color: var(--text); border-radius: 10px;
}
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }

/* ---------- Header ---------- */
.site-header {
	position: sticky; top: 0; z-index: 60; background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid #d9e9fb;
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }
.header-inner { display: flex; align-items: center; gap: 16px; min-height: 64px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 22px; text-decoration: none; }
.brand:hover { color: var(--text); }
.brand-badge {
	width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
	background: linear-gradient(160deg, #36a2ff, var(--accent-dark)); color: #fff; font-size: 21px;
	box-shadow: 0 4px 12px rgba(26, 140, 255, .35);
}
.brand img { max-height: 42px; width: auto; }

.main-nav { margin-inline: auto; }
.main-nav ul {
	list-style: none; margin: 0; padding: 4px; display: flex; gap: 2px;
	border: 1px solid var(--border); border-radius: 999px; background: #fff;
}
.main-nav a {
	display: flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px;
	color: #3b4357; font-weight: 700; font-size: 15px; white-space: nowrap;
}
.main-nav a:hover { background: var(--soft); color: var(--text); }
.main-nav .current-menu-item > a, .main-nav .current-cat > a,
.main-nav .current-post-ancestor > a, .main-nav .current-menu-parent > a {
	background: var(--accent); color: #fff;
}

.header-search { position: relative; width: 210px; }
.header-search input[type="search"] {
	width: 100%; padding: 9px 40px 9px 14px; border: 0; border-radius: 999px;
	background: var(--soft); font: inherit; font-size: 14.5px; color: var(--text);
}
.header-search button {
	position: absolute; inset-inline-start: 6px; top: 50%; transform: translateY(-50%);
	border: 0; background: transparent; color: var(--muted); padding: 6px; cursor: pointer; display: grid;
}
.header-search button svg { width: 18px; height: 18px; }

.menu-toggle {
	display: none; width: 42px; height: 42px; border: 1px solid var(--border); border-radius: 12px;
	background: #fff; color: var(--text); cursor: pointer; place-items: center; padding: 0;
}
.menu-toggle svg { width: 22px; height: 22px; }

@media (max-width: 980px) {
	.header-inner { flex-wrap: wrap; }
	.menu-toggle { display: grid; margin-inline-start: auto; }
	.header-search { order: 3; width: 100%; margin-bottom: 10px; }
	.main-nav { order: 4; width: 100%; display: none; margin: 0 0 12px; }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; border-radius: 16px; }
	.main-nav a { border-radius: 12px; }
}

/* ---------- Main ---------- */
.site-main { padding: 40px 0 50px; min-height: 50vh; }
.page-head { margin-bottom: 26px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 32px); }
.page-head p, .page-head .archive-description { color: var(--muted); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 14px 0 0; padding: 0; }
.chips a {
	display: inline-block; padding: 6px 14px; border-radius: 999px; font-size: 14px; font-weight: 700;
	background: var(--soft); color: #3b4357;
}
.chips a:hover { background: var(--accent); color: #fff; }

/* ---------- Cards ---------- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px; }
@media (max-width: 1100px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 820px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; } }
@media (max-width: 560px) { .grid { grid-template-columns: minmax(0, 1fr); } }

.card {
	display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
	box-shadow: var(--shadow); overflow: hidden; transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(20, 40, 80, .07), 0 16px 36px rgba(20, 40, 80, .10); }
.card-img { display: block; aspect-ratio: 16 / 11; background: var(--soft); overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img.empty { display: grid; place-items: center; font-size: 44px; color: var(--accent); background: linear-gradient(135deg, #e8f3ff, #f3f6fa); }
.card-body { padding: 18px 22px 20px; display: flex; flex-direction: column; flex: 1; }
.card-date { display: flex; align-items: center; gap: 6px; color: #8a92a3; font-size: 13px; margin-bottom: 8px; }
.card-title { font-size: 18px; line-height: 1.55; margin: 0 0 10px; }
.card-title a { color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover { color: var(--accent); }
.card-excerpt {
	color: var(--muted); font-size: 14.5px; line-height: 1.75; margin: 0 0 14px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-more { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 15px; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 36px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers {
	min-width: 42px; height: 42px; padding: 0 14px; display: inline-grid; place-items: center;
	border: 1px solid var(--border); border-radius: 12px; color: var(--text); font-weight: 700; font-size: 15px;
}
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- Single ---------- */
.article { max-width: 760px; margin-inline: auto; }
.article-cover { margin: 0 0 26px; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.article-cover img { display: block; width: 100%; }
.breadcrumbs { font-size: 13.5px; color: var(--muted); margin-bottom: 8px; }
.breadcrumbs a { color: var(--muted); }
.article-cat { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 14.5px; }
.article-cat::after { content: ""; width: 14px; height: 2px; background: var(--accent); border-radius: 2px; }
.article-title { font-size: clamp(26px, 3.6vw, 36px); margin: 6px 0 14px; line-height: 1.45; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; color: var(--muted); font-size: 14px; margin-bottom: 26px; }
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta img { width: 28px; height: 28px; border-radius: 50%; }

.content { font-size: 17.5px; color: #2b3345; }
.content > *:first-child { margin-top: 0; }
.content h2 { font-size: 24px; color: var(--text); }
.content h3 { font-size: 20px; color: var(--text); }
.content ul, .content ol { padding-inline-start: 1.4em; margin: 0 0 1.2em; }
.content li { margin-bottom: .4em; }
.content li::marker { color: var(--accent); font-weight: 800; }
.content strong { color: var(--text); }
.content blockquote {
	margin: 1.4em 0; padding: 14px 20px; border-inline-start: 4px solid var(--accent);
	background: var(--soft); border-radius: 12px;
}
.content table { width: 100%; border-collapse: collapse; margin: 0 0 1.3em; font-size: 15.5px; }
.content th, .content td { border: 1px solid var(--border); padding: 9px 12px; text-align: start; }
.content th { background: var(--soft); }
.content figure { margin: 1.5em 0; }
.content figure img { border-radius: 14px; }
.content figcaption { font-size: 13.5px; color: var(--muted); text-align: center; }

#ez-toc-container, .ez-toc-container {
	width: 100% !important; border-radius: 14px !important; border: 1px solid var(--border) !important;
	background: var(--soft) !important; box-shadow: none !important; padding: 16px 20px !important; margin-bottom: 1.6em !important;
}
#ez-toc-container .ez-toc-title { font-weight: 800 !important; color: var(--text) !important; }
#ez-toc-container a { color: #3b4357 !important; }
#ez-toc-container a:hover { color: var(--accent) !important; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.tags a { padding: 5px 14px; border-radius: 999px; background: var(--soft); font-size: 14px; color: #3b4357; }

.author-box {
	display: flex; gap: 16px; align-items: flex-start; margin-top: 30px; padding: 20px;
	border-radius: var(--radius); background: var(--soft);
}
.author-box img { border-radius: 50%; }
.author-box h3 { margin: 0 0 4px; font-size: 17px; }
.author-box p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.8; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; }
.post-nav a { display: block; padding: 14px 18px; border-radius: 14px; border: 1px solid var(--border); color: var(--text); font-weight: 700; font-size: 15px; line-height: 1.6; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { display: block; color: var(--muted); font-weight: 500; }
@media (max-width: 620px) { .post-nav { grid-template-columns: 1fr; } }

.section-title { font-size: 22px; margin: 50px 0 20px; display: flex; align-items: center; gap: 10px; }
.section-title::before { content: ""; width: 6px; height: 24px; border-radius: 4px; background: var(--accent); }

/* ---------- Pages ---------- */
.page-article { max-width: 820px; margin-inline: auto; }
.page-article .article-title { margin-top: 0; }
.empty-state { text-align: center; padding: 50px 10px; }
.search-form { display: flex; gap: 8px; max-width: 520px; margin: 16px auto 0; }
.search-form input[type="search"] {
	flex: 1; min-width: 0; padding: 11px 16px; border: 1px solid var(--border); border-radius: 999px;
	background: var(--soft); font: inherit; font-size: 15px;
}
.btn, .search-form button, input[type="submit"], .wpcf7-submit {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 22px;
	border: 0; border-radius: 999px; background: var(--accent); color: #fff; cursor: pointer;
	font: inherit; font-size: 15px; font-weight: 800;
}
.btn:hover, .search-form button:hover, input[type="submit"]:hover { background: var(--accent-dark); color: #fff; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 textarea,
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--soft);
	font: inherit; font-size: 15px; color: var(--text);
}

/* ---------- Comments ---------- */
.comments-area { max-width: 760px; margin: 40px auto 0; }
.comment-list { list-style: none; padding: 0; margin: 0 0 20px; }
.comment-list .children { list-style: none; padding-inline-start: 24px; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--border); }
.comment-meta { font-size: 13.5px; color: var(--muted); }

/* ---------- Ads ---------- */
.ad-slot { margin: 26px auto; text-align: center; overflow: hidden; }
.ad-label { display: block; font-size: 11.5px; color: #9aa1b0; margin-bottom: 6px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer); color: #aab3c5; margin-top: 20px; border-top: 2px solid #1d4f8c; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 40px; padding: 50px 0 36px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.site-footer .brand { color: #fff; margin-bottom: 12px; }
.site-footer p { line-height: 1.9; margin: 0 0 14px; }
.site-footer h3 { color: #fff; font-size: 17px; margin: 4px 0 14px; display: flex; align-items: center; gap: 8px; }
.site-footer h3::before { content: ""; width: 14px; height: 2px; background: var(--accent); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; }
.site-footer li a { color: #d3d9e6; display: inline-flex; align-items: center; gap: 6px; }
.site-footer li a::before { content: "‹"; color: var(--accent); font-weight: 800; }
.site-footer a:hover { color: #fff; }
.social { display: flex; gap: 8px; }
.social a {
	width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px;
	background: rgba(255, 255, 255, .07); color: #d3d9e6;
}
.social a:hover { background: var(--accent); color: #fff; }
.social svg { width: 17px; height: 17px; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 18px 0; font-size: 14px; text-align: start; }

.to-top {
	position: fixed; inset-inline-end: 18px; bottom: 18px; z-index: 50; width: 44px; height: 44px;
	border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff;
	box-shadow: 0 6px 18px rgba(26, 140, 255, .35); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 20px; height: 20px; }

/* ---------- WordPress core ---------- */
.aligncenter { display: block; margin-inline: auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption-text, .gallery-caption { font-size: 13.5px; color: var(--muted); }
.bypostauthor > .comment-body .fn::after { content: " ✓"; color: var(--accent); }

@media print {
	.site-header, .site-footer, .ad-slot, .post-nav, .related, .comments-area, .to-top { display: none !important; }
}
.brand-badge svg { width: 22px; height: 22px; }

/* ---------- Download card ---------- */
.dl-card {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px;
	margin: 1.6em 0; padding: 16px 18px; border: 1px solid #d6e8ff; border-radius: 18px;
	background: linear-gradient(135deg, #f3f9ff, #ffffff);
}
.dl-info { display: flex; align-items: center; gap: 12px; }
.dl-info strong { display: block; font-size: 17px; color: var(--text); line-height: 1.4; }
.dl-info small { color: var(--muted); font-size: 13.5px; }
.dl-ico { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent); color: #fff; font-size: 20px; flex: none; }
.dl-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.content .dl-btn, .dl-btn {
	display: inline-flex; align-items: center; gap: 10px; padding: 9px 16px; border-radius: 12px;
	background: #111; color: #fff; font-weight: 800; font-size: 15px; line-height: 1.2; text-decoration: none;
}
.dl-btn small { display: block; font-size: 11px; font-weight: 500; opacity: .8; }
.dl-btn svg { width: 22px; height: 22px; }
.dl-btn:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, .18); }
@media (max-width: 560px) { .dl-btns, .dl-btn { width: 100%; } .dl-btn { justify-content: center; } }

/* ---------- Content boxes ---------- */
.ib-box { margin: 1.5em 0; padding: 16px 20px; border-radius: 14px; background: #eef6ff; border-inline-start: 4px solid var(--accent); }
.ib-box.tip { background: #ecfdf3; border-color: #12b76a; }
.ib-box.warn { background: #fff7ed; border-color: #f79009; }
.ib-box.summary { background: #f5f3ff; border-color: #7a5af8; }
.ib-box > *:last-child { margin-bottom: 0; }
.ib-box ul { margin-bottom: 0; }
.ib-box h3 { margin-top: 0; font-size: 18px; }
details.faq { border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; margin: 0 0 10px; background: #fff; }
details.faq summary { font-weight: 800; cursor: pointer; color: var(--text); list-style-position: inside; }
details.faq[open] summary { color: var(--accent); margin-bottom: 8px; }
details.faq p { margin: 0; color: #3b4357; }
.content .wp-block-table { overflow-x: auto; margin: 1.4em 0; }
.content .wp-block-table table { width: 100%; border-radius: 12px; overflow: hidden; }
.content .wp-block-table thead th { background: var(--accent); color: #fff; border-color: var(--accent); }
.content .wp-block-table tbody tr:nth-child(even) td { background: #f8fafc; }
.content h2 { padding-inline-start: 14px; border-inline-start: 5px solid var(--accent); line-height: 1.5; }
.content p { line-height: 2; }
.dl-app-icon { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* Mobile: never let wide content push the page sideways */
.site-main { overflow-x: clip; }
.content { min-width: 0; overflow-wrap: anywhere; }
.content table:not(.wp-block-table table) { max-width: 100%; }
.content img, .content iframe, .content video, .content figure { max-width: 100%; height: auto; }
.content pre { max-width: 100%; overflow-x: auto; }

/* Tables fit the screen: no sideways scrolling */
.content .wp-block-table { overflow-x: visible; }
.content table { table-layout: auto; }
.content th, .content td { overflow-wrap: anywhere; vertical-align: top; }
@media (max-width: 600px) {
	.content table { font-size: 13.5px; line-height: 1.55; }
	.content th, .content td { padding: 8px 7px; }
}

/* Table of contents reads right-to-left like the article */
#ez-toc-container, #ez-toc-container.ez-toc-container-direction { direction: rtl !important; text-align: right !important; width: 100% !important; box-sizing: border-box; }
#ez-toc-container .ez-toc-title-container { display: flex; align-items: center; justify-content: space-between; }
#ez-toc-container .ez-toc-title, #ez-toc-container nav, #ez-toc-container ul, #ez-toc-container li, #ez-toc-container a { direction: rtl !important; text-align: right !important; }
#ez-toc-container ul { padding-right: 0 !important; padding-left: 0 !important; margin-right: 0 !important; }
#ez-toc-container ul ul { padding-right: 1.1em !important; }
/* Headings already carry their own numbers; drop the TOC counters */
#ez-toc-container li::before, #ez-toc-container li a::before, #ez-toc-container .ez-toc-link::before { content: none !important; display: none !important; }
#ez-toc-container li { list-style: none !important; margin-bottom: 4px; }
#ez-toc-container li a { display: block; padding-right: 14px; position: relative; }
#ez-toc-container li a::after { content: ""; position: absolute; right: 0; top: .72em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
