/*
Theme Name: PDF الآن
Theme URI: https://wadhefaalaan.com/
Author: PDF الآن
Description: قالب عربي خفيف وسريع لمواقع الأدوات، مصمم للعمل مع إضافة «PDF الآن — أدوات PDF عربية». اتجاه من اليمين لليسار، خط IBM Plex Sans Arabic مضمّن، قوائم تُملأ تلقائيًا بالصفحات الأساسية، وتخطيط مناسب لمتطلبات AdSense.
Version: 1.2.0
Requires at least: 5.8
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: pdfalaan-theme
Tags: rtl-language-support, one-column, custom-logo, custom-menu, featured-images
*/

/* ====== الخطوط (مضمّنة مع القالب، بلا طلبات خارجية) ====== */
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url(fonts/plex-arabic-400.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url(fonts/plex-arabic-500.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url(fonts/plex-arabic-700.woff2) format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FEFC; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 400; font-display: swap; src: url(fonts/plex-latin-400.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 500; font-display: swap; src: url(fonts/plex-latin-500.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: "IBM Plex Sans Arabic"; font-weight: 700; font-display: swap; src: url(fonts/plex-latin-700.woff2) format("woff2"); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

/* ====== المتغيرات ====== */
:root {
	--brand: #4338ca;
	--brand-dark: #3730a3;
	--brand-soft: #eef2ff;
	--brand-line: #c7d2fe;
	--accent: #f59e0b;
	--ink: #0f172a;
	--text: #1e293b;
	--muted: #64748b;
	--line: #e2e8f0;
	--bg: #f8fafc;
	--card: #ffffff;
	--radius: 18px;
	--wrap: 1120px;
	--read: 760px;
	--font: "IBM Plex Sans Arabic", system-ui, -apple-system, "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(--bg); color: var(--text); font-family: var(--font); font-size: 17px; line-height: 1.9; -webkit-font-smoothing: antialiased; }
img, video, iframe { max-width: 100%; height: auto; }
a { color: var(--brand); text-underline-offset: 4px; }
a:hover { color: var(--brand-dark); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.45; font-weight: 700; margin: 0 0 .6em; }
:focus-visible { outline: 3px solid #6366f1; outline-offset: 2px; border-radius: 4px; }
.screen-reader-text, .sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 10px; right: 10px; z-index: 100001; width: auto; height: auto; clip: auto; padding: 10px 16px; background: #fff; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.15); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.read { max-width: var(--read); margin: 0 auto; }

/* ====== الترويسة ====== */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(8px); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; position: relative; } }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand .custom-logo { max-height: 44px; width: auto; }
.brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 19px; font-weight: 700; }
.brand-tag { font-size: 12px; color: var(--muted); }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; align-items: center; }
.main-nav a { display: block; padding: 8px 12px; border-radius: 10px; color: var(--text); font-weight: 500; font-size: 15px; text-decoration: none; }
.main-nav a:hover, .main-nav .current-menu-item > a, .main-nav .current_page_item > a { background: var(--brand-soft); color: var(--brand-dark); }
.main-nav .sub-menu { display: none; }
.nav-toggle { display: none; background: none; border: 0; padding: 8px; border-radius: 10px; color: var(--text); cursor: pointer; }
.nav-toggle svg { width: 26px; height: 26px; display: block; }
@media (max-width: 860px) {
	.nav-toggle { display: block; }
	.main-nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 12px 24px -12px rgba(15,23,42,.2); }
	.main-nav.is-open { display: block; }
	.main-nav ul { flex-direction: column; align-items: stretch; padding: 8px 12px 14px; }
	.main-nav a { padding: 12px; font-size: 16px; }
}

/* ====== الواجهة (الصفحة الرئيسية) ====== */
.hero { background: linear-gradient(180deg, var(--brand-soft), var(--bg)); border-bottom: 1px solid var(--line); padding: 44px 0 36px; text-align: center; }
.hero h1 { font-size: clamp(28px, 5vw, 46px); margin-bottom: 12px; }
.hero h1 span { color: var(--brand); }
.hero p.lead { max-width: 700px; margin: 0 auto; color: #475569; font-size: clamp(16px, 2.2vw, 19px); }
.trust { list-style: none; padding: 0; margin: 18px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; color: #475569; font-size: 14px; }
.trust li::before { content: "✓"; color: var(--brand); font-weight: 700; margin-inline-end: 6px; }
.front-content { padding: 28px 0 10px; }

/* ====== المحتوى ====== */
.site-main { padding-bottom: 40px; }
.page-head { padding: 34px 0 6px; }
.page-head h1 { font-size: clamp(26px, 4vw, 36px); margin: 0; }
.page-head .meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--brand); }
.entry { padding: 18px 0; }
.entry-content > * { margin-top: 0; margin-bottom: 1.1em; }
.entry-content h2 { font-size: 24px; margin-top: 1.6em; }
.entry-content h3 { font-size: 19px; margin-top: 1.3em; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.5em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote { margin: 1.4em 0; padding: 12px 20px; border-inline-start: 4px solid var(--brand); background: var(--brand-soft); border-start-end-radius: 12px; border-end-end-radius: 12px; }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content .pa-note { border-inline-start-color: #f59e0b; background: #fffbeb; color: #422006; }
.entry-content .pa-note strong:first-child { color: #b45309; }
.entry-content figure { margin-inline: 0; }
.entry-content .wp-block-image img { width: 100%; height: auto; display: block; box-shadow: 0 10px 30px -18px rgba(15,23,42,.45); }
.entry-content .wp-block-image figcaption { margin-top: 10px; line-height: 1.7; }
.entry-content .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content .wp-block-table table { min-width: 520px; }
.entry-content .wp-block-table tbody tr:nth-child(even) td { background: #f8fafc; }
@media (max-width: 640px) { .entry-content .wp-block-table table { min-width: 460px; font-size: 14px; } .entry-content .wp-block-table th, .entry-content .wp-block-table td { padding: 6px 8px; } }
.entry-content table { width: 100%; border-collapse: collapse; font-size: 15px; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 8px 12px; text-align: start; }
.entry-content th { background: #f1f5f9; }
.entry-content code { background: #f1f5f9; padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry-content img { border-radius: 12px; }
.entry-content .alignwide, .entry-content .alignfull { max-width: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.content-card { padding: clamp(18px, 4vw, 40px); }

/* صفحات الأدوات: مساحة أوسع للأداة */
.tool-page .entry-content { max-width: none; }
.tool-page .entry-content > :not(.pdfalaan-embed) { max-width: var(--read); margin-inline: auto; }

/* ====== المقالات ====== */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-head h2 { font-size: clamp(22px, 3vw, 28px); margin: 0; }
.posts-grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.post-card { display: flex; flex-direction: column; padding: 20px; transition: border-color .15s, box-shadow .15s, transform .15s; }
.post-card:hover { border-color: var(--brand-line); box-shadow: 0 10px 30px -14px rgba(67,56,202,.35); transform: translateY(-2px); }
.post-card .thumb { margin: -20px -20px 14px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16/9; background: var(--brand-soft); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card .meta { font-size: 13px; color: var(--muted); }
.post-card h3 { font-size: 18px; margin: 6px 0 8px; }
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--brand); }
.post-card p { margin: 0; font-size: 15px; color: #475569; line-height: 1.8; }
.post-card .more { margin-top: auto; padding-top: 12px; font-size: 14px; font-weight: 700; text-decoration: none; }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 12px; background: var(--brand); color: #fff !important; font-weight: 700; text-decoration: none; border: 0; cursor: pointer; font-family: inherit; font-size: 15px; }
.btn:hover { background: var(--brand-dark); }
.btn-ghost { background: transparent; color: var(--brand) !important; border: 1px solid var(--brand-line); }
.btn-ghost:hover { background: var(--brand-soft); }
.related { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.related ul { padding-inline-start: 1.2em; }
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination .page-numbers { padding: 6px 14px; border-radius: 10px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--text); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.empty { text-align: center; padding: 50px 0; }
.empty .big { font-size: 64px; font-weight: 700; color: var(--brand-line); line-height: 1; }
.search-form { display: flex; gap: 8px; max-width: 460px; margin: 16px auto 0; }
.search-form input[type="search"] { flex: 1; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: 12px; font: inherit; }

/* ====== الفوتر ====== */
.site-footer { margin-top: 30px; background: #fff; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 28px; padding: 40px 16px 26px; grid-template-columns: 1.4fr 1fr 1fr 1fr; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h2 { font-size: 15px; margin-bottom: 10px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: #475569; text-decoration: none; font-size: 14px; }
.footer-grid a:hover { color: var(--brand); text-decoration: underline; }
.footer-about p { color: #475569; font-size: 14px; line-height: 1.9; margin: 10px 0 0; }
.footer-bottom { border-top: 1px solid #f1f5f9; padding: 16px; text-align: center; color: var(--muted); font-size: 13px; }

/* ====== تعليقات ووردبريس ====== */
.comments-area { margin-top: 30px; }
.comment-list { list-style: none; padding: 0; }
.comment-body { padding: 14px 0; border-bottom: 1px solid var(--line); }
.comment-form input:not([type="submit"]):not([type="checkbox"]), .comment-form textarea { width: 100%; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 12px; font: inherit; }
.comment-form .submit { background: var(--brand); color: #fff; border: 0; padding: 10px 20px; border-radius: 12px; font: inherit; font-weight: 700; cursor: pointer; }

/* محاذاة صور المحرر */
.alignright { float: right; margin: 0 0 1em 1.5em; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: 14px; color: var(--muted); text-align: center; }

/* ====== صفحة اتصل بنا ====== */
.contact-hero { background: linear-gradient(180deg, var(--brand-soft), var(--bg)); border-bottom: 1px solid var(--line); padding: 34px 0 30px; }
.contact-hero h1 { font-size: clamp(28px, 4.5vw, 40px); margin: 0 0 8px; }
.contact-hero p { margin: 0; max-width: 640px; color: #475569; font-size: 18px; }
.contact-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; padding-top: 28px; padding-bottom: 20px; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form-card { padding: clamp(20px, 4vw, 36px); scroll-margin-top: 90px; }
.contact-form-card h2 { font-size: 22px; margin-bottom: 18px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .cf-row { grid-template-columns: 1fr; } }
.cf-field { margin-bottom: 16px; }
.cf-field > label { display: block; font-weight: 700; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.cf-field > label > span[aria-hidden] { color: #dc2626; }
.cf input[type="text"], .cf input[type="email"], .cf select, .cf textarea {
	width: 100%; padding: 12px 14px; border: 1.5px solid #cbd5e1; border-radius: 12px; background: #fff;
	font: inherit; font-size: 16px; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
.cf textarea { resize: vertical; min-height: 160px; line-height: 1.8; }
.cf select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 12px center; background-size: 18px; padding-left: 40px; }
.cf input::placeholder, .cf textarea::placeholder { color: #94a3b8; }
.cf input:focus, .cf select:focus, .cf textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(67,56,202,.12); }
.cf-msg { display: none; margin: 6px 0 0; font-size: 13px; color: #dc2626; }
.cf-field.is-invalid input, .cf-field.is-invalid textarea { border-color: #dc2626; }
.cf-field.is-invalid .cf-msg { display: block; }
.cf-under { display: flex; justify-content: space-between; gap: 10px; }
.cf-count { margin-inline-start: auto; font-size: 12px; color: var(--muted); padding-top: 6px; }
.cf-field.cf-check > label { font-weight: 400; color: #475569; margin: 0; }
.cf-check label { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: #475569; cursor: pointer; line-height: 1.8; }
.cf-check input { width: 18px; height: 18px; margin-top: 4px; accent-color: var(--brand); flex-shrink: 0; }
.cf-submit { padding: 13px 28px; font-size: 16px; }
.cf-submit svg { width: 18px; height: 18px; }
.cf-submit:disabled { opacity: .7; cursor: wait; }
.cf-note { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.cf-hp { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.cf-alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; font-size: 15px; line-height: 1.8; }
.cf-alert svg { width: 24px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.cf-ok { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.cf-err { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.contact-side { display: grid; gap: 14px; }
.side-card { display: flex; gap: 14px; padding: 18px; }
.side-card h3 { font-size: 16px; margin: 0 0 4px; }
.side-card p { margin: 0; font-size: 14px; color: #475569; line-height: 1.8; }
.side-card ul { margin: 6px 0 0; padding-inline-start: 1.2em; font-size: 14px; }
.side-ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.side-ico svg { width: 22px; height: 22px; }
