/* =========================================================
   قالب الشيخ خليفة الخزي — التنسيقات الرئيسية
   ملاحظة: هذا القالب مصمم بالكامل لاتجاه RTL
========================================================= */

:root{
	--sheikh-primary: #12463b;
	--sheikh-gold: #b48b3c;
	--sheikh-beige: #f7f3ea;
	--sheikh-gray: #5b5f5a;
	--sheikh-white: #ffffff;
	--sheikh-text: #23281f;
	--sheikh-border: #e6e0d2;
	--radius: 10px;
	--shadow: 0 4px 18px rgba(18,70,59,0.08);
	--container: 1240px;
	--header-height: 84px;
}

/* ===== Reset أساسي ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	direction: rtl;
	font-family: 'Cairo', 'Tajawal', sans-serif;
	color: var(--sheikh-text);
	background: var(--sheikh-white);
	line-height: 1.85;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s ease; }
ul { list-style: none; margin: 0; padding: 0; }
h1,h2,h3,h4,h5,h6 { font-weight: 700; line-height: 1.4; margin: 0 0 .6em; color: var(--sheikh-primary); }
p { margin: 0 0 1em; }
button { font-family: inherit; cursor: pointer; }

.screen-reader-text{position:absolute!important;clip:rect(1px,1px,1px,1px);overflow:hidden;height:1px;width:1px;word-wrap:normal!important;}
.skip-link{position:fixed;top:-100px;right:10px;background:var(--sheikh-primary);color:#fff;padding:10px 18px;border-radius:6px;z-index:9999;transition:top .2s;}
.skip-link:focus{top:10px;}

.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.btn { display:inline-flex; align-items:center; gap:8px; padding: 12px 26px; border-radius: 30px; font-weight:600; font-size:.95rem; border:2px solid transparent; }
.btn-gold { background: var(--sheikh-gold); color:#fff; }
.btn-gold:hover { background:#96712c; }
.btn-outline { border-color: var(--sheikh-primary); color: var(--sheikh-primary); }
.btn-outline:hover { background: var(--sheikh-primary); color:#fff; }

.section { padding: 64px 0; }
.section.alt-bg { background: var(--sheikh-beige); }
.section-title { font-size: 1.7rem; position: relative; padding-bottom: 14px; margin-bottom: 34px; text-align: center; }
.section-title::after {
	content:''; position:absolute; bottom:0; right:50%; transform:translateX(50%);
	width:60px; height:3px; background: var(--sheikh-gold); border-radius: 2px;
}
.section-more{ text-align:center; margin-top: 30px; }

/* ===== الهيدر ===== */
.site-header {
	background: var(--sheikh-white);
	border-bottom: 1px solid var(--sheikh-border);
	position: sticky; top: 0; z-index: 500;
	box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.header-inner {
	display:flex; align-items:center; justify-content:space-between;
	min-height: var(--header-height); gap: 24px; flex-wrap: wrap;
}
.site-branding { display:flex; align-items:center; gap:14px; }
.site-logo img { max-height: 58px; width:auto; border-radius: 6px; }
.site-identity { display:flex; flex-direction:column; }
.site-title { font-size:1.25rem; font-weight:800; color: var(--sheikh-primary); }
.site-tagline { margin:2px 0 0; font-size:.82rem; color: var(--sheikh-gray); font-weight:500; }

.primary-navigation { display:flex; align-items:center; gap: 22px; }
.primary-menu { display:flex; align-items:center; gap: 6px; flex-wrap: wrap; }
.primary-menu li { position: relative; }
.primary-menu > li > a {
	display:block; padding: 12px 14px; font-weight:600; color: var(--sheikh-text); border-radius: 6px;
}
.primary-menu > li > a:hover,
.primary-menu > li.current-menu-item > a { color: var(--sheikh-gold); }

.primary-menu ul.sub-menu, .primary-menu ul.children {
	position:absolute; top:100%; right:0; min-width:220px; background:#fff; border:1px solid var(--sheikh-border);
	border-radius: 8px; box-shadow: var(--shadow); padding: 8px; opacity:0; visibility:hidden; transform: translateY(8px);
	transition: all .2s ease; z-index: 100;
}
.primary-menu li:hover > ul.sub-menu,
.primary-menu li:hover > ul.children,
.primary-menu li.focus-within > ul.sub-menu { opacity:1; visibility:visible; transform:translateY(0); }
.primary-menu ul.sub-menu a { padding: 9px 12px; display:block; border-radius:6px; }
.primary-menu ul.sub-menu a:hover { background: var(--sheikh-beige); }
.primary-menu li.menu-item-has-children > a::after { content:'▾'; font-size:.7em; margin-right:6px; }

.header-search-toggle {
	background:none; border:1px solid var(--sheikh-border); border-radius:50%;
	width:40px; height:40px; display:flex; align-items:center; justify-content:center; color: var(--sheikh-primary);
}
.header-search-panel { max-height:0; overflow:hidden; background: var(--sheikh-beige); transition: max-height .3s ease; }
.header-search-panel.is-open { max-height: 120px; padding: 16px 0; }

.menu-toggle { display:none; background:none; border:none; width:40px; height:34px; flex-direction:column; justify-content:space-between; padding:4px; }
.menu-toggle span { display:block; height:3px; background: var(--sheikh-primary); border-radius:2px; }

/* ===== Hero Slider ===== */
.hero-slider { position: relative; height: 78vh; min-height: 460px; max-height: 720px; overflow:hidden; }
.hero-slider-track { position:relative; width:100%; height:100%; }
.hero-slide {
	position:absolute; inset:0; opacity:0; visibility:hidden; transition: opacity 1s ease;
	display:flex; align-items:flex-end;
}
.hero-slide.is-active { opacity:1; visibility:visible; }
.hero-slide-bg {
	position:absolute; inset:0; background-size:cover; background-position:center;
	animation: sheikhKenBurns 12s ease-in-out infinite alternate;
}
@keyframes sheikhKenBurns { from{ transform:scale(1);} to{ transform:scale(1.08);} }
.hero-slide-overlay { position:absolute; inset:0; background: linear-gradient(to top, rgba(10,30,25,.92) 5%, rgba(10,30,25,.35) 55%, rgba(10,30,25,.15) 100%); }
.hero-slide-content { position:relative; z-index:2; color:#fff; padding-bottom: 60px; max-width: 760px; }
.hero-slide-cat { display:inline-block; background: var(--sheikh-gold); padding:5px 14px; border-radius:20px; font-size:.8rem; font-weight:700; margin-bottom:14px; }
.hero-slide-title { color:#fff; font-size: clamp(1.5rem, 3.4vw, 2.5rem); margin-bottom:.5em; }
.hero-slide-title a { color:#fff; }
.hero-slide-excerpt { color:#e9e9e9; margin-bottom: 22px; font-size:1.02rem; }

.hero-nav {
	position:absolute; top:50%; transform:translateY(-50%); z-index:3; background: rgba(0,0,0,.35); color:#fff;
	border:none; width:46px; height:46px; border-radius:50%; font-size:1.6rem; display:flex; align-items:center; justify-content:center;
}
.hero-nav:hover { background: var(--sheikh-gold); }
.hero-prev { right: 24px; }
.hero-next { left: 24px; }
.hero-dots { position:absolute; bottom:20px; left:50%; transform:translateX(-50%); display:flex; gap:8px; z-index:3; }
.hero-dots button { width:10px; height:10px; border-radius:50%; border:none; background: rgba(255,255,255,.5); padding:0; }
.hero-dots button.is-active { background: var(--sheikh-gold); width:26px; border-radius: 6px; }

/* ===== مربع البحث الرئيسي ===== */
.home-search { margin: -30px auto 40px; position:relative; z-index: 5; }
.sheikh-search-form { display:flex; background:#fff; border-radius: 40px; box-shadow: var(--shadow); overflow:hidden; border:1px solid var(--sheikh-border); max-width: 640px; margin:0 auto; }
.sheikh-search-form .search-field { flex:1; border:none; padding: 16px 22px; font-size:1rem; font-family:inherit; outline:none; background:transparent; }
.sheikh-search-form .search-submit { background: var(--sheikh-primary); color:#fff; border:none; padding: 0 26px; display:flex; align-items:center; }
.sheikh-search-form .search-submit:hover { background: var(--sheikh-gold); }

/* ===== البطاقات (المقالات) ===== */
.cards-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.post-card { background:#fff; border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); border:1px solid var(--sheikh-border); display:flex; flex-direction:column; transition: transform .25s ease, box-shadow .25s ease; }
.post-card:hover { transform: translateY(-6px); box-shadow: 0 14px 30px rgba(18,70,59,.14); }
.post-card-thumb { position:relative; display:block; aspect-ratio: 16/10; overflow:hidden; background: var(--sheikh-beige); }
.post-card-thumb img { width:100%; height:100%; object-fit:cover; transition: transform .4s ease; }
.post-card:hover .post-card-thumb img { transform: scale(1.06); }
.post-card-cat { position:absolute; top:12px; right:12px; background: var(--sheikh-gold); color:#fff; font-size:.75rem; font-weight:700; padding: 4px 12px; border-radius:16px; }
.post-card-body { padding: 20px; display:flex; flex-direction:column; flex:1; }
.post-card-date { color: var(--sheikh-gray); font-size:.8rem; margin-bottom: 8px; }
.post-card-title { font-size: 1.08rem; margin-bottom: 10px; }
.post-card-title a:hover { color: var(--sheikh-gold); }
.post-card-excerpt { color: var(--sheikh-gray); font-size:.92rem; flex:1; }
.post-card-more { color: var(--sheikh-primary); font-weight:700; font-size:.88rem; margin-top:auto; }
.post-card-more::after { content:' ‹'; }

/* ===== المؤلفات ===== */
.books-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.book-card { background:#fff; border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); border:1px solid var(--sheikh-border); text-align:center; transition: transform .25s ease; }
.book-card:hover { transform: translateY(-6px); }
.book-card-cover { display:block; aspect-ratio: 3/4; background: var(--sheikh-beige); overflow:hidden; }
.book-card-cover img { width:100%; height:100%; object-fit:cover; }
.cover-placeholder { display:flex; align-items:center; justify-content:center; height:100%; font-size:2.4rem; }
.book-card-body { padding: 16px; }
.book-card-title { font-size:1rem; margin-bottom:10px; }
.book-card-more { font-size:.85rem; font-weight:700; color: var(--sheikh-gold); }

/* ===== التصنيفات ===== */
.categories-grid { display:grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.category-card { background:#fff; border:1px solid var(--sheikh-border); border-radius: var(--radius); padding: 26px 16px; text-align:center; display:flex; flex-direction:column; gap:8px; box-shadow: var(--shadow); }
.category-card:hover { border-color: var(--sheikh-gold); }
.category-icon { font-size: 1.8rem; }
.category-name { font-weight:700; color: var(--sheikh-primary); }
.category-count { font-size:.8rem; color: var(--sheikh-gray); }

/* ===== الفيديو ===== */
.video-widget { max-width: 780px; margin: 0 auto; }
.video-widget-trigger { position:relative; display:block; width:100%; border:none; padding:0; border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); }
.video-widget-trigger img { width:100%; aspect-ratio:16/9; object-fit:cover; }
.play-icon {
	position:absolute; top:50%; right:50%; transform:translate(50%, -50%);
	width:74px; height:74px; border-radius:50%; background: rgba(18,70,59,.85); color:#fff;
	display:flex; align-items:center; justify-content:center; font-size:1.6rem;
}
.video-title { position:absolute; bottom:0; right:0; left:0; background: linear-gradient(to top, rgba(0,0,0,.75), transparent); color:#fff; padding: 16px; font-weight:700; text-align:right; }
.video-lightbox { position:fixed; inset:0; background: rgba(0,0,0,.85); z-index: 9999; display:flex; align-items:center; justify-content:center; padding: 20px; }
.video-lightbox[hidden] { display:none; }
.video-lightbox-inner { width:100%; max-width: 960px; aspect-ratio:16/9; position:relative; }
.video-lightbox-frame iframe { width:100%; height:100%; border:0; border-radius:8px; }
.video-lightbox-close { position:absolute; top:-44px; left:0; background:none; border:none; color:#fff; font-size:1.6rem; }

/* ===== تخطيط الصفحات الداخلية ===== */
.page-layout { display:grid; grid-template-columns: 2.4fr 1fr; gap: 44px; padding: 44px 0 70px; align-items:start; }
.content-area { min-width:0; }

.sheikh-breadcrumbs ol { display:flex; flex-wrap:wrap; gap:6px; align-items:center; margin-bottom: 24px; font-size:.85rem; color: var(--sheikh-gray); }
.sheikh-breadcrumbs li:not(:last-child)::after { content:'/'; margin-right:6px; }
.sheikh-breadcrumbs a:hover { color: var(--sheikh-gold); }

/* ===== صفحة المقال ===== */
.single-post-header, .archive-header { margin-bottom: 26px; }
.post-cat-badge { display:inline-block; background: var(--sheikh-gold); color:#fff; padding:5px 14px; border-radius:16px; font-size:.8rem; font-weight:700; margin-bottom:14px; }
.single-post-title, .archive-title { font-size: clamp(1.5rem, 3vw, 2.1rem); }
.single-post-meta { display:flex; gap:18px; color: var(--sheikh-gray); font-size:.9rem; flex-wrap:wrap; }
.single-post-thumb { border-radius: var(--radius); overflow:hidden; margin-bottom: 26px; box-shadow: var(--shadow); }
.single-post-content { font-size: 1.08rem; line-height:2; }
.single-post-content h2, .single-post-content h3 { margin-top: 1.4em; }
.single-post-content img { border-radius: 8px; margin: 1em 0; }
.single-post-content blockquote { border-right: 4px solid var(--sheikh-gold); background: var(--sheikh-beige); padding: 16px 22px; margin: 1.6em 0; border-radius: 6px; }

.social-share { display:flex; align-items:center; gap:10px; margin: 22px 0; flex-wrap:wrap; }
.share-label { font-weight:700; color: var(--sheikh-primary); }
.social-share a { border:1px solid var(--sheikh-border); padding:7px 16px; border-radius:20px; font-size:.85rem; font-weight:600; }
.social-share a:hover { background: var(--sheikh-primary); color:#fff; border-color: var(--sheikh-primary); }

.single-post-tags { display:flex; flex-wrap:wrap; gap:8px; margin: 20px 0; }
.single-post-tags a { background: var(--sheikh-beige); padding:6px 14px; border-radius:16px; font-size:.82rem; }
.single-post-tags a:hover { background: var(--sheikh-gold); color:#fff; }

.post-navigation { display:grid; grid-template-columns:1fr 1fr; gap:20px; margin: 34px 0; }
.post-navigation a { display:block; padding: 16px 18px; background: var(--sheikh-beige); border-radius: 8px; font-weight:600; }
.post-navigation a:hover { background: var(--sheikh-primary); color:#fff; }
.nav-next { text-align:left; }

.related-posts { margin-top: 44px; }
.related-posts .section-title { text-align:right; }
.related-posts .section-title::after { right:auto; left:0; transform:none; }

/* ===== الكتاب (صفحة مفردة) ===== */
.single-book-header { display:flex; gap: 28px; margin-bottom: 30px; align-items:flex-start; flex-wrap:wrap; }
.single-book-cover { width: 220px; flex-shrink:0; border-radius: var(--radius); overflow:hidden; box-shadow: var(--shadow); }
.single-book-info { flex:1; min-width: 240px; }

/* ===== الشريط الجانبي ===== */
.widget-area .widget { background:#fff; border:1px solid var(--sheikh-border); border-radius: var(--radius); padding: 22px; margin-bottom: 22px; }
.widget-title { font-size:1.05rem; padding-bottom:10px; border-bottom: 2px solid var(--sheikh-beige); }
.recent-posts-list li, .popular-posts-list li { display:flex; align-items:center; gap:12px; padding: 10px 0; border-bottom:1px solid var(--sheikh-beige); font-size:.92rem; font-weight:600; }
.recent-posts-list li:last-child, .popular-posts-list li:last-child { border-bottom:none; }
.recent-posts-list .thumb img, .popular-posts-list .thumb img { width:56px; height:56px; object-fit:cover; border-radius:8px; }
.widget-categories ul li { display:flex; justify-content:space-between; padding: 8px 0; border-bottom:1px solid var(--sheikh-beige); font-size:.92rem; }
.tag-cloud { display:flex; flex-wrap:wrap; gap:8px; }
.tag-cloud a { background: var(--sheikh-beige); padding:5px 12px; border-radius:14px; font-size:.8rem; }

/* ===== الفوتر ===== */
.site-footer { background: var(--sheikh-primary); color: #d9e3df; margin-top: 40px; }
.footer-columns { display:grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; padding: 60px 0 40px; }
.footer-col .widget-title, .footer-col h3, .footer-col h4 { color:#fff; border-bottom: 2px solid rgba(180,139,60,.5); padding-bottom:10px; }
.footer-col a:hover { color: var(--sheikh-gold); }
.footer-links li, .footer-recent-posts li { padding: 6px 0; }
.footer-site-title { color:#fff; }
.social-links { display:flex; flex-wrap:wrap; gap:10px; margin-top: 14px; }
.social-links a { border:1px solid rgba(255,255,255,.3); padding:6px 14px; border-radius:16px; font-size:.82rem; }
.social-links a:hover { background: var(--sheikh-gold); border-color: var(--sheikh-gold); color:#fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); padding: 18px 0; text-align:center; font-size:.85rem; }

/* ===== التعليقات ===== */
.comments-area { margin-top: 44px; }
.comment-list { margin-top: 20px; }
.comment-list .comment-body { background:#fff; border:1px solid var(--sheikh-border); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; }
.comment-form input, .comment-form textarea { width:100%; padding:12px 14px; border:1px solid var(--sheikh-border); border-radius:8px; font-family:inherit; margin-bottom: 14px; }
.comment-form .form-submit input { width:auto; background: var(--sheikh-primary); color:#fff; border:none; padding: 12px 30px; border-radius:26px; font-weight:700; }

/* ===== 404 ===== */
.error-404-inner { text-align:center; padding: 90px 0; }
.error-404-inner h1 { font-size: 5rem; color: var(--sheikh-gold); }
.error-404-inner .sheikh-search-form { margin: 26px auto; }

.no-results { text-align:center; padding: 40px 0; color: var(--sheikh-gray); }
.pagination { display:flex; justify-content:center; gap:8px; margin-top: 34px; }
.pagination .page-numbers { display:flex; align-items:center; justify-content:center; width:40px; height:40px; border-radius:50%; border:1px solid var(--sheikh-border); }
.pagination .page-numbers.current { background: var(--sheikh-primary); color:#fff; border-color: var(--sheikh-primary); }

/* ===================================================
   الاستجابة (Responsive)
=================================================== */
@media (max-width: 991px) {
	.page-layout { grid-template-columns: 1fr; }
	.cards-grid { grid-template-columns: repeat(2, 1fr); }
	.books-grid { grid-template-columns: repeat(3, 1fr); }
	.categories-grid { grid-template-columns: repeat(2, 1fr); }
	.footer-columns { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 782px) {
	.menu-toggle { display:flex; }
	.primary-navigation {
		position:fixed; inset: var(--header-height) 0 0 auto; width: min(320px, 85vw);
		background:#fff; flex-direction:column; align-items:flex-start; padding: 20px;
		transform: translateX(100%); transition: transform .3s ease; overflow-y:auto; box-shadow: -4px 0 20px rgba(0,0,0,.15);
	}
	.primary-navigation.is-open { transform: translateX(0); }
	.primary-menu { flex-direction:column; align-items:flex-start; width:100%; }
	.primary-menu ul.sub-menu, .primary-menu ul.children { position:static; opacity:1; visibility:visible; transform:none; box-shadow:none; border:none; padding-right: 14px; display:none; }
	.primary-menu li.submenu-open > ul.sub-menu { display:block; }
	.header-search-toggle { margin-top: 16px; }

	.hero-slider { height: 62vh; min-height: 380px; }
	.cards-grid { grid-template-columns: 1fr; }
	.books-grid { grid-template-columns: repeat(2, 1fr); }
	.categories-grid { grid-template-columns: 1fr; }
	.footer-columns { grid-template-columns: 1fr; padding: 40px 0; }
	.single-book-header { flex-direction:column; }
	.single-book-cover { width: 160px; }
}
