/*
Theme Name: Sakina
Theme URI: https://example.com/sakina
Author: Your Name
Description: قالب ووردبريس هادئ واحترافي بتصميم واجهة محادثة: شريط جانبي قابل للطي، تحية مركزية، صندوق بحث كبير، وضع داكن، ودعم كامل للعربية (RTL).
Version: 1.0.0
Requires at least: 6.0
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: sakina
Tags: blog, rtl-language-support, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready, two-columns, left-sidebar
*/

:root {
	--bg: #F7F5EF;
	--surface: #FFFFFF;
	--sidebar: #EFECE3;
	--border: #E3DFD3;
	--text: #1E1D1B;
	--muted: #6E6B63;
	--hover: rgba(30, 29, 27, .06);
	--accent: #C4623A;
	--accent-soft: rgba(196, 98, 58, .12);
	--radius: 14px;
	--radius-lg: 24px;
	--shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.06);
	--sidebar-w: 280px;
	--font-sans: "IBM Plex Sans Arabic", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
	--font-serif: "Noto Naskh Arabic", "Source Serif 4", Georgia, serif;
}

html[data-theme="dark"] {
	--bg: #262624;
	--surface: #30302E;
	--sidebar: #1F1F1D;
	--border: #3B3B38;
	--text: #ECEAE4;
	--muted: #A3A099;
	--hover: rgba(255, 255, 255, .06);
	--accent-soft: rgba(196, 98, 58, .2);
	--shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 28px rgba(0,0,0,.3);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 16px;
	line-height: 1.75;
	-webkit-font-smoothing: antialiased;
	transition: background .25s, color .25s;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.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: 999; top: 8px; inset-inline-start: 8px;
	background: var(--surface); padding: 8px 14px; border-radius: 8px;
}
.icon { width: 20px; height: 20px; flex: none; }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }

.sidebar {
	position: fixed; inset-block: 0; inset-inline-start: 0;
	width: var(--sidebar-w);
	background: var(--sidebar);
	border-inline-end: 1px solid var(--border);
	display: flex; flex-direction: column;
	padding: 12px;
	z-index: 50;
	transition: width .25s ease, transform .25s ease;
	overflow: hidden;
}
.main {
	flex: 1; min-width: 0;
	margin-inline-start: var(--sidebar-w);
	transition: margin .25s ease;
	display: flex; flex-direction: column; min-height: 100vh;
}
body.sidebar-collapsed .sidebar { width: 64px; }
body.sidebar-collapsed .main { margin-inline-start: 64px; }
body.sidebar-collapsed .sidebar .hide-collapsed { opacity: 0; pointer-events: none; }

.sidebar__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-serif); font-size: 1.25rem; font-weight: 600; white-space: nowrap; padding-inline: 6px; }
.brand img { max-height: 32px; width: auto; }
.brand__mark { width: 28px; height: 28px; flex: none; color: var(--accent); }

.icon-btn {
	width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent;
	display: inline-grid; place-items: center; cursor: pointer; color: var(--muted); flex: none;
	transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--hover); color: var(--text); }

.side-link {
	display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px;
	white-space: nowrap; font-size: .95rem; transition: background .15s;
}
.side-link:hover, .side-link.is-active { background: var(--hover); }
.side-link--primary { margin-block: 10px 6px; font-weight: 500; }
.side-link--primary .plus {
	width: 28px; height: 28px; margin-inline-start: -4px; border-radius: 50%;
	background: var(--accent); color: #fff; display: grid; place-items: center; flex: none;
}

.side-nav ul { list-style: none; margin: 0; padding: 0; }
.side-nav li a { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 10px; white-space: nowrap; font-size: .95rem; }
.side-nav li a:hover, .side-nav .current-menu-item > a { background: var(--hover); }
.side-nav .sub-menu { padding-inline-start: 16px; }

.sidebar__section { flex: 1; overflow-y: auto; margin-top: 14px; padding-inline-end: 2px; transition: opacity .2s; }
.sidebar__label { font-size: .78rem; color: var(--muted); padding: 6px 10px; font-weight: 500; }
.recent-list { list-style: none; margin: 0; padding: 0; }
.recent-list a {
	display: block; padding: 7px 10px; border-radius: 9px; font-size: .9rem;
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.recent-list a:hover, .recent-list .is-current a { background: var(--hover); }

.sidebar__bottom { border-top: 1px solid var(--border); padding-top: 10px; display: flex; align-items: center; gap: 10px; }
.avatar-chip { width: 32px; height: 32px; border-radius: 50%; background: var(--text); color: var(--bg); display: grid; place-items: center; font-size: .85rem; font-weight: 600; flex: none; }
.sidebar__bottom .meta { line-height: 1.3; font-size: .85rem; white-space: nowrap; overflow: hidden; }
.sidebar__bottom .meta small { color: var(--muted); display: block; }

/* Top bar */
.topbar {
	position: sticky; top: 0; z-index: 30;
	display: flex; align-items: center; justify-content: space-between; gap: 8px;
	padding: 10px 16px; background: color-mix(in srgb, var(--bg) 85%, transparent);
	backdrop-filter: blur(10px);
}
.topbar__title { font-size: .95rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .menu-toggle { display: none; }
.topbar__actions { display: flex; gap: 4px; margin-inline-start: auto; }
.moon { display: none; }
html[data-theme="dark"] .sun { display: none; }
html[data-theme="dark"] .moon { display: block; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .25s; }

/* ===== Home / Hero ===== */
.hero {
	flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
	padding: 6vh 20px 40px; text-align: center;
}
.hero__badge {
	display: inline-flex; align-items: center; gap: 8px; font-size: .82rem; color: var(--muted);
	background: var(--surface); border: 1px solid var(--border); padding: 4px 12px; border-radius: 999px; margin-bottom: 26px;
}
.hero__badge span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.greeting {
	display: flex; align-items: center; justify-content: center; gap: 14px;
	font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.9rem, 4.5vw, 2.9rem);
	line-height: 1.3; margin: 0 0 30px; letter-spacing: -.01em;
}
.greeting .brand__mark { width: 38px; height: 38px; }

.composer {
	width: 100%; max-width: 700px; background: var(--surface); border: 1px solid var(--border);
	border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 14px 14px 10px; text-align: start;
	transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.composer textarea {
	width: 100%; border: 0; outline: 0; resize: none; background: transparent;
	font-size: 1.05rem; min-height: 56px; max-height: 220px; padding: 4px 6px; line-height: 1.6;
}
.composer textarea::placeholder { color: var(--muted); }
.composer__bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.composer__tools { display: flex; align-items: center; gap: 6px; }
.composer select {
	border: 1px solid var(--border); background: transparent; border-radius: 10px; padding: 6px 10px; font-size: .88rem; color: var(--muted); cursor: pointer;
}
.send-btn {
	width: 36px; height: 36px; border-radius: 10px; border: 0; cursor: pointer;
	background: var(--accent); color: #fff; display: grid; place-items: center; transition: transform .15s, opacity .15s;
}
.send-btn:disabled { opacity: .4; cursor: default; }
.send-btn:not(:disabled):hover { transform: translateY(-1px); }
[dir="rtl"] .send-btn .icon { transform: scaleX(-1); }

.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; max-width: 700px; }
.chip {
	display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 10px;
	border: 1px solid var(--border); background: transparent; font-size: .9rem; color: var(--text);
	transition: background .15s, border-color .15s;
}
.chip:hover { background: var(--surface); border-color: color-mix(in srgb, var(--text) 20%, var(--border)); }
.chip .count { color: var(--muted); font-size: .8rem; }

/* ===== Post cards ===== */
.section { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 24px 60px; }
.section__head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 18px; }
.section__head h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.4rem; margin: 0; }
.section__head a { color: var(--muted); font-size: .9rem; }
.section__head a:hover { color: var(--accent); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 18px; }
.card {
	background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
	overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card__thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--sidebar); }
.card__thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card__thumb img { transform: scale(1.04); }
.card__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__cat { font-size: .78rem; color: var(--accent); font-weight: 600; }
.card__title { font-family: var(--font-serif); font-size: 1.15rem; font-weight: 600; line-height: 1.5; margin: 0; }
.card__excerpt { color: var(--muted); font-size: .92rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card__meta { margin-top: auto; font-size: .8rem; color: var(--muted); display: flex; gap: 10px; }

/* ===== Archive header ===== */
.page-head { max-width: 1040px; margin: 0 auto; padding: 40px 24px 10px; }
.page-head h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.7rem, 3.5vw, 2.4rem); margin: 0 0 6px; }
.page-head p, .page-head .archive-description { color: var(--muted); margin: 0; }

/* ===== Single ===== */
.article { width: 100%; max-width: 760px; margin: 0 auto; padding: 30px 24px 40px; }
.article__cat a { display: inline-block; font-size: .82rem; color: var(--accent); background: var(--accent-soft); padding: 3px 12px; border-radius: 999px; margin-inline-end: 6px; }
.article__title { font-family: var(--font-serif); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.35; margin: 16px 0 14px; }
.article__meta { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: .9rem; margin-bottom: 26px; }
.article__meta img { width: 36px; height: 36px; border-radius: 50%; }
.article__thumb { border-radius: var(--radius); overflow: hidden; margin-bottom: 30px; border: 1px solid var(--border); }

.entry-content { font-size: 1.08rem; line-height: 1.95; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2, .entry-content h3, .entry-content h4 { font-family: var(--font-serif); font-weight: 600; line-height: 1.45; margin-top: 1.8em; }
.entry-content h2 { font-size: 1.6rem; }
.entry-content h3 { font-size: 1.3rem; }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.entry-content blockquote {
	margin-inline: 0; padding: 14px 20px; border-inline-start: 3px solid var(--accent);
	background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; font-family: var(--font-serif); font-size: 1.15rem;
}
[dir="rtl"] .entry-content blockquote { border-radius: var(--radius) 0 0 var(--radius); }
.entry-content code { background: var(--hover); padding: 2px 6px; border-radius: 6px; font-size: .9em; }
.entry-content pre {
	background: #1E1D1B; color: #ECEAE4; padding: 18px 20px; border-radius: var(--radius);
	overflow-x: auto; direction: ltr; text-align: left; font-size: .9rem; line-height: 1.6;
}
.entry-content pre code { background: none; padding: 0; }
.entry-content img, .entry-content figure { border-radius: var(--radius); }
.entry-content figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 8px; }
.entry-content table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--border); padding: 10px; text-align: start; }
.entry-content ul, .entry-content ol { padding-inline-start: 1.4em; }
.entry-content hr { border: 0; border-top: 1px solid var(--border); margin: 2.4em 0; }
.alignwide { max-width: 1000px; margin-inline: auto; }
.alignfull { width: 100%; }
.aligncenter { margin-inline: auto; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.tags a { font-size: .85rem; padding: 4px 12px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.tags a:hover { color: var(--text); background: var(--surface); }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.post-nav a { display: block; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); transition: border-color .2s; }
.post-nav a:hover { border-color: var(--accent); }
.post-nav small { color: var(--muted); display: block; font-size: .8rem; }
.post-nav .next { text-align: end; }

.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 40px; padding: 20px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.author-box img { border-radius: 50%; }
.author-box h3 { margin: 0 0 4px; font-size: 1rem; }
.author-box p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ===== Comments (chat style) ===== */
.comments { max-width: 760px; margin: 0 auto; padding: 0 24px 60px; width: 100%; }
.comments__title { font-family: var(--font-serif); font-weight: 500; font-size: 1.35rem; }
.comment-list, .comment-list .children { list-style: none; margin: 0; padding: 0; }
.comment-list .children { padding-inline-start: 34px; }
.comment-body { display: flex; gap: 12px; margin-bottom: 18px; }
.comment-body .avatar { border-radius: 50%; flex: none; }
.comment-bubble { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 12px 16px; flex: 1; }
.comment-bubble .who { font-weight: 600; font-size: .92rem; }
.comment-bubble .when { color: var(--muted); font-size: .78rem; margin-inline-start: 8px; }
.comment-bubble p { margin: 6px 0 0; }
.comment-bubble .reply a { font-size: .82rem; color: var(--accent); }
.bypostauthor > .comment-body .comment-bubble { background: var(--accent-soft); border-color: transparent; }

.comment-respond { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-top: 24px; box-shadow: var(--shadow); }
.comment-respond .comment-reply-title { margin-top: 0; font-size: 1.05rem; }
.comment-form label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.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); background: var(--bg); border-radius: 12px; padding: 10px 12px; outline: 0;
}
.comment-form textarea:focus, .comment-form input:focus { border-color: var(--accent); }
.comment-form p { margin: 0 0 12px; }

/* ===== Buttons / forms ===== */
.btn, .comment-form .submit, .wp-block-button__link, .search-submit {
	display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 12px; border: 0;
	background: var(--text); color: var(--bg); font-weight: 500; cursor: pointer; transition: opacity .15s;
}
.btn:hover, .comment-form .submit:hover { opacity: .88; }
.btn--accent { background: var(--accent); color: #fff; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 40px; }
.pagination .page-numbers { min-width: 40px; height: 40px; display: grid; place-items: center; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); font-size: .92rem; }
.pagination .current { background: var(--text); color: var(--bg); border-color: var(--text); }
.pagination a:hover { background: var(--surface); }

/* Widgets */
.widget-area { max-width: 1040px; margin: 0 auto; padding: 0 24px 40px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; width: 100%; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.widget-title, .widget h2 { font-size: 1rem; margin: 0 0 10px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 4px 0; }

/* Footer */
.site-footer { text-align: center; color: var(--muted); font-size: .82rem; padding: 18px 24px 26px; }
.site-footer a:hover { color: var(--text); }
.footer-nav ul { list-style: none; display: flex; justify-content: center; gap: 16px; padding: 0; margin: 0 0 8px; flex-wrap: wrap; }

/* 404 / empty */
.empty { text-align: center; padding: 12vh 20px; flex: 1; }
.empty .big { font-family: var(--font-serif); font-size: 5rem; color: var(--accent); line-height: 1; }
.empty h1 { font-family: var(--font-serif); font-weight: 500; }
.empty p { color: var(--muted); }
.empty .composer { margin: 24px auto 0; }

/* Reveal animation */
.reveal { opacity: 0; transform: translateY(10px); transition: opacity .5s ease, transform .5s ease; }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } * { transition: none !important; } }

/* ===== Responsive ===== */
@media (max-width: 900px) {
	.sidebar { transform: translateX(-100%); width: var(--sidebar-w) !important; box-shadow: var(--shadow); }
	[dir="rtl"] .sidebar { transform: translateX(100%); }
	.main, body.sidebar-collapsed .main { margin-inline-start: 0; }
	body.sidebar-open .sidebar { transform: none; }
	body.sidebar-open .overlay { opacity: 1; pointer-events: auto; }
	body.sidebar-collapsed .sidebar .hide-collapsed { opacity: 1; pointer-events: auto; }
	.topbar .menu-toggle { display: inline-grid; }
	.sidebar .collapse-toggle { display: none; }
	.post-nav { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.hero { padding-top: 4vh; }
	.greeting { flex-direction: column; gap: 8px; }
	.section, .article, .page-head { padding-inline: 16px; }
}
