/* ==========================================================================
   Ghouri Tadween CMS — سكربت غوري للتدوين
   ملف تنسيق الموقع العام (الواجهة الأمامية)
   ========================================================================== */

:root{
  --brand: #7C3AED;
  --brand-dark: #5B21B6;
  --brand-light: #F1E9FE;
  --brand-2: #22D3EE;
  --brand-rgb: 124,58,237;
  --ink: #0F1720;
  --ink-soft: #3C4552;
  --muted: #6B7686;
  --bg: #FFFFFF;
  --bg-soft: #F7F5FD;
  --line: #E9E4F5;
  --footer-bg: #1E1147;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 28px;
  --maxw: 1100px;
  --shadow: 0 10px 30px rgba(15, 23, 32, 0.07);
  --shadow-lg: 0 24px 60px rgba(15, 23, 32, 0.12);
  --font-body: 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --font-head: 'Cairo', 'Tajawal', 'Segoe UI', Tahoma, sans-serif;
  --fs-scale: 1;
}

[data-theme="dark"]{
  --brand: #A78BFA;
  --brand-dark: #C4B5FD;
  --brand-light: rgba(167,139,250,.16);
  --brand-2: #67E8F9;
  --ink: #F3F6FA;
  --ink-soft: #C9D2DE;
  --muted: #8B96A6;
  --bg: #150E2E;
  --bg-soft: #1D1440;
  --line: #2E2358;
  --footer-bg: #0B0720;
  --shadow: 0 10px 30px rgba(0,0,0,.5);
  --shadow-lg: 0 24px 60px rgba(0,0,0,.6);
}

*{ box-sizing: border-box; }
html{ scroll-behavior: smooth; background: var(--bg); }
body{
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.9;
  font-size: calc(18px * var(--fs-scale));
  direction: rtl;
  text-align: right;
  transition: background-color .25s ease, color .25s ease;
}
img{ max-width: 100%; display: block; }
a{ color: var(--brand-dark); text-decoration: none; transition: color .15s ease; }
a:hover{ text-decoration: none; color: var(--brand); }
h1,h2,h3,h4{ font-family: var(--font-head); color: var(--ink); line-height: 1.4; margin: 0 0 16px; font-weight: 800; }
h1{ font-size: calc(clamp(32px, 6vw, 46px) * var(--fs-scale)); }
h2{ font-size: calc(clamp(26px, 4.5vw, 32px) * var(--fs-scale)); }
h3{ font-size: calc(clamp(20px, 3.5vw, 23px) * var(--fs-scale)); }
p{ margin: 0 0 18px; color: var(--ink-soft); }
.container{ max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section{ padding: 60px 0; }
.section-soft{ background: var(--bg-soft); }
.section-title{ text-align: center; margin-bottom: 34px; }

/* Buttons */
.btn{ display:inline-flex; align-items:center; gap:8px; font-family:var(--font-head); font-weight:700; font-size:calc(16px * var(--fs-scale)); padding:13px 26px; border-radius:999px; border:2px solid transparent; cursor:pointer; transition:transform .2s ease, box-shadow .2s ease; }
.btn:hover{ text-decoration:none; transform:translateY(-3px); }
.btn-primary{ background:var(--brand); color:#fff; box-shadow:0 8px 22px rgba(var(--brand-rgb),.3); }
.btn-primary:hover{ background:var(--brand-dark); color:#fff; }
.btn-outline{ background:transparent; border-color:var(--brand); color:var(--brand-dark); }
.btn-outline:hover{ background:var(--brand-light); }
.btn-block{ width:100%; justify-content:center; }

/* Header */
.site-header{ position:sticky; top:0; z-index:40; background:rgba(255,255,255,.92); backdrop-filter:blur(10px); border-bottom:1px solid var(--line); }
[data-theme="dark"] .site-header{ background:rgba(14,22,32,.86); }
.topbar{ background:var(--brand); color:#fff; text-align:center; padding:8px 16px; font-size:14px; }
.nav{ max-width:var(--maxw); margin:0 auto; padding:14px 20px; display:flex; align-items:center; justify-content:space-between; gap:16px; }
.brand{ display:flex; align-items:center; gap:10px; font-family:var(--font-head); font-weight:800; font-size:calc(19px * var(--fs-scale)); color:var(--ink); }
.logo-mark{ width:38px; height:38px; border-radius:11px; background:linear-gradient(135deg,var(--brand),var(--brand-2)); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.logo-mark svg{ width:19px; height:19px; }
.logo-mark.lg{ width:42px; height:42px; }
.logo-img{ width:38px; height:38px; border-radius:11px; object-fit:cover; }
.nav-right{ display:flex; align-items:center; gap:20px; }
.nav-links{ display:flex; align-items:center; gap:24px; list-style:none; margin:0; padding:0; }
.nav-links a{ color:var(--ink-soft); font-weight:600; font-size:calc(15px * var(--fs-scale)); }
.nav-links a.active,.nav-links a:hover{ color:var(--brand-dark); }
.nav-icon-row{ display:none; }
.nav-mobile-tools{ display:none; }
.nav-tools-desktop{ display:flex; align-items:center; gap:8px; }
.fs-btn,.theme-toggle{ display:flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:10px; border:1px solid var(--line); background:var(--bg); color:var(--ink-soft); cursor:pointer; font-family:var(--font-head); font-size:13px; }
.fs-btn:hover,.theme-toggle:hover{ background:var(--brand-light); color:var(--brand-dark); }
.nav-auth-form{ display:inline-flex; margin:0; }
.theme-toggle .icon-moon{ display:block; }
.theme-toggle .icon-sun{ display:none; }
[data-theme="dark"] .theme-toggle .icon-moon{ display:none; }
[data-theme="dark"] .theme-toggle .icon-sun{ display:block; }
.nav-toggle{ display:none; background:none; border:none; cursor:pointer; padding:6px; }
.nav-toggle span{ display:block; width:22px; height:2px; background:var(--ink); margin:5px 0; border-radius:2px; }

/* Hero */
.hero{ position:relative; padding:60px 0; background:linear-gradient(180deg,var(--brand-light) 0%, var(--bg) 82%); overflow:hidden; }
.hero-grid{ display:grid; grid-template-columns:360px 1fr; gap:40px; align-items:center; }
.hero-name-line h1{ margin-bottom:8px; }
.hero-text{ font-size:calc(18px * var(--fs-scale)); max-width:600px; }
.hero-cta{ display:flex; flex-wrap:wrap; gap:14px; margin-top:22px; }
.hero-mockup{ background:var(--bg); border:1px solid var(--line); border-radius:var(--radius-lg); box-shadow:var(--shadow-lg); padding:22px; max-width:340px; width:100%; justify-self:center; }
.hero-mockup-bar{ display:flex; gap:6px; margin-bottom:18px; }
.hero-mockup-bar span{ width:9px; height:9px; border-radius:50%; background:var(--line); }
.hero-mockup-line{ height:11px; border-radius:6px; background:var(--bg-soft); margin-bottom:11px; }
.hero-mockup-line.w-90{ width:90%; } .hero-mockup-line.w-70{ width:70%; } .hero-mockup-line.w-50{ width:50%; }
.hero-mockup-cta{ height:30px; width:110px; border-radius:999px; background:linear-gradient(135deg,var(--brand),var(--brand-2)); margin:16px 0; }
.hero-mockup-stats{ display:flex; gap:9px; align-items:flex-end; height:52px; }
.hero-mockup-stats span{ flex:1; border-radius:6px 6px 0 0; }
.hero-mockup-stats span:nth-child(1){ height:40%; background:var(--brand-light); }
.hero-mockup-stats span:nth-child(2){ height:75%; background:var(--brand); }
.hero-mockup-stats span:nth-child(3){ height:55%; background:var(--brand-2); }
.hero-mockup-stats span:nth-child(4){ height:90%; background:var(--brand); }

/* Cards / Articles */
.article-grid{ display:grid; grid-template-columns:repeat(auto-fit, minmax(270px,1fr)); gap:24px; }
.article-card{ background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); display:flex; flex-direction:column; transition:transform .2s ease, box-shadow .2s ease; }
.article-card:hover{ transform:translateY(-5px); box-shadow:var(--shadow-lg); }
.article-card.featured{ border-color:var(--brand); box-shadow:0 0 0 1px var(--brand), var(--shadow); }
.featured-badge{ font-family:var(--font-head); font-size:12px; font-weight:700; color:#fff; background:var(--brand); display:inline-flex; align-items:center; gap:4px; padding:4px 12px; border-radius:999px; margin-bottom:10px; width:fit-content; }
.article-thumb{ width:100%; aspect-ratio:16/9; object-fit:cover; transition:transform .4s ease; }
.article-card:hover .article-thumb{ transform:scale(1.05); }
.article-card-body{ padding:24px; display:flex; flex-direction:column; flex:1; }
.article-tag{ font-family:var(--font-head); font-size:12px; font-weight:700; color:var(--brand-dark); background:var(--brand-light); display:inline-block; padding:4px 12px; border-radius:999px; margin-bottom:10px; width:fit-content; }
.article-card h3{ margin-bottom:8px; font-size:calc(19px * var(--fs-scale)); }
.article-card p{ font-size:calc(15px * var(--fs-scale)); flex:1; }
.article-meta{ font-size:13px; color:var(--muted); margin:0 0 10px; }
.article-link{ font-family:var(--font-head); font-weight:700; color:var(--brand-dark); display:inline-flex; align-items:center; gap:6px; }

/* FAQ */
.faq-list{ max-width:760px; margin:0 auto; }
.faq-item{ background:var(--bg); border:1px solid var(--line); border-radius:var(--radius-sm); padding:4px 20px; margin-bottom:12px; }
.faq-item summary{ cursor:pointer; font-family:var(--font-head); font-weight:700; padding:15px 0; list-style:none; display:flex; justify-content:space-between; }
.faq-item summary::-webkit-details-marker{ display:none; }
.faq-item summary::after{ content:"+"; font-size:20px; color:var(--brand-dark); }
.faq-item[open] summary::after{ content:"−"; }
.faq-item p{ padding-bottom:14px; margin:0; }

/* Footer */
.site-footer{ background:var(--footer-bg); color:#C7CEDA; padding:44px 0 24px; }
.footer-grid{ display:grid; grid-template-columns:repeat(4, 1fr); gap:28px 32px; padding-bottom:24px; border-bottom:1px solid rgba(255,255,255,.1); }
.footer-grid.footer-cols-4{ grid-template-columns:repeat(4, 1fr); }
.footer-grid.footer-cols-3{ grid-template-columns:repeat(3, 1fr); }
@media (max-width:900px){ .footer-grid.footer-cols-4, .footer-grid.footer-cols-3{ grid-template-columns:repeat(2, 1fr); } }
@media (max-width:560px){ .footer-grid.footer-cols-4, .footer-grid.footer-cols-3{ grid-template-columns:1fr; } }
.footer-col-brand{ display:flex; flex-direction:column; }
.footer-brand{ display:flex; align-items:center; gap:12px; font-family:var(--font-head); font-weight:800; color:#fff; }
.footer-col-title{ color:#fff; font-size:15px; font-weight:700; margin:0 0 14px; position:relative; padding-bottom:12px; }
.footer-col-title::after{ content:''; position:absolute; bottom:0; right:0; width:34px; height:3px; background:var(--brand); border-radius:2px; }
.footer-brand-desc{ color:#98A2B3; font-size:13.5px; line-height:1.9; margin:14px 0 0; max-width:280px; }
.footer-links{ display:flex; flex-direction:column; gap:10px; list-style:none; margin:0; padding:0; }
.footer-links a{ color:#C7CEDA; font-weight:600; font-size:14px; }
.footer-links a:hover{ color:#fff; }
.footer-contact{ display:flex; gap:20px; flex-wrap:wrap; padding-top:18px; font-size:14px; }
.footer-contact a{ color:#C7CEDA; }
.footer-contact a:hover{ color:#fff; }
.footer-social{ display:flex; gap:14px; padding-top:14px; font-size:18px; }
.footer-social a{ color:#C7CEDA; }
.footer-social a:hover{ color:#fff; }
.footer-bottom{ padding-top:18px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px; font-size:13px; color:#8E97A6; }

/* Article single / generic page */
.article-hero{ padding:40px 0 28px; background:var(--bg-soft); border-bottom:1px solid var(--line); }
.breadcrumb{ font-size:13px; color:var(--muted); margin-bottom:16px; }
.breadcrumb a{ color:var(--muted); }
.article-hero h1{ max-width:780px; }
.article-hero-meta{ display:flex; gap:16px; font-size:14px; color:var(--muted); }
.article-body{ max-width:760px; margin:0 auto; padding:44px 20px; }
.article-body h2{ margin-top:36px; } .article-body h3{ margin-top:26px; }
.article-body ul,.article-body ol{ color:var(--ink-soft); padding-inline-start:24px; margin:0 0 18px; }
.article-body li{ margin-bottom:8px; }
.article-body blockquote{ margin:26px 0; padding:16px 20px; background:var(--brand-light); border-inline-start:4px solid var(--brand); border-radius:var(--radius-sm); color:var(--ink); font-weight:600; }
.article-figure{ border-radius:var(--radius); overflow:hidden; box-shadow:var(--shadow); margin:26px 0; }
.post-body h2{ margin-top:32px; } .post-body p{ font-size:calc(18px * var(--fs-scale)); }

.cta-box{ background:var(--brand); color:#fff; border-radius:var(--radius); padding:32px; text-align:center; margin:36px 0; }
.cta-box h3{ color:#fff; margin-bottom:8px; }
.cta-box p{ color:rgba(255,255,255,.9); }
.cta-box .btn-primary{ background:#fff; color:var(--brand-dark); box-shadow:none; }

/* Contact form */
.contact-methods{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:20px; margin-bottom:40px; }
.contact-method{ background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:22px; text-align:center; box-shadow:var(--shadow); }
.card-icon{ width:56px; height:56px; border-radius:14px; background:var(--brand-light); display:flex; align-items:center; justify-content:center; color:var(--brand-dark); font-size:22px; }
.contact-form{ max-width:640px; margin:0 auto; background:var(--bg); border:1px solid var(--line); border-radius:var(--radius); padding:30px; box-shadow:var(--shadow); }
.form-row{ margin-bottom:18px; }
.form-row label{ display:block; font-family:var(--font-head); font-weight:700; margin-bottom:7px; color:var(--ink); font-size:14px; }
.form-row input,.form-row textarea,.form-row select{ width:100%; padding:11px 15px; border-radius:var(--radius-sm); border:1px solid var(--line); background:var(--bg); color:var(--ink); font-family:var(--font-body); font-size:15px; }
.form-row textarea{ min-height:130px; resize:vertical; }
.form-row input:focus,.form-row textarea:focus,.form-row select:focus{ outline:none; border-color:var(--brand); }
.hp-field{ position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); }
.cf-turnstile-row{ display:flex; justify-content:center; }
.form-status{ font-size:14px; text-align:center; margin:0 0 14px; }
.form-status-success{ color:#16A34A; } .form-status-error{ color:#DC2626; }

/* تحريكات خفيفة عند التمرير */
.reveal-init{ opacity:0; transform:translateY(18px); transition:opacity .5s ease, transform .5s ease; }
.reveal-init.reveal-visible{ opacity:1; transform:none; }
@media (prefers-reduced-motion: reduce){
  .reveal-init{ opacity:1; transform:none; transition:none; }
  .article-thumb{ transition:none; }
  .article-card:hover .article-thumb{ transform:none; }
}

/* Responsive */
@media (max-width:860px){
  .nav-links{ position:fixed; right:0; top:64px; height:calc(100vh - 64px); background:var(--bg); flex-direction:column; width:78%; max-width:300px; padding:26px; box-shadow:-8px 0 30px rgba(0,0,0,.1); transform:translateX(105%); transition:transform .25s ease; align-items:flex-start; overflow-y:auto; z-index:35; }
  .nav-links.is-open{ transform:translateX(0); }
  .nav-toggle{ display:block; }
  .nav-tools-desktop{ display:none; }
  .nav-mobile-tools{ display:flex; gap:10px; margin-top:18px; padding-top:18px; border-top:1px solid var(--line); width:100%; }
  .nav-icon-row{ display:grid; grid-template-columns:repeat(3, 44px); gap:12px; margin-top:16px; padding-top:16px; border-top:1px solid var(--line); }
  .nav-icon-row a{ width:44px; height:44px; border-radius:12px; background:var(--bg-soft); display:flex; align-items:center; justify-content:center; color:var(--ink-soft); font-size:18px; }
  .nav-icon-row a:hover{ background:var(--brand-light); color:var(--brand-dark); }
  .hero-grid{ grid-template-columns:1fr; text-align:center; }
  .hero-grid > *:first-child{ order:2; } .hero-grid > *:last-child{ order:1; }
  .hero-mockup{ max-width:300px; margin:0 auto; }
  .hero-cta{ justify-content:center; }
}
@media (max-width:520px){ body{ font-size:calc(17px * var(--fs-scale)); } .section{ padding:44px 0; } }

/* وقت القراءة داخل شريط بيانات المقالة، أيقونة الساعة */
.article-hero-meta i{ margin-left:4px; }

/* فهرس المحتوى (جدول محتويات المقالة) */
.article-toc{ background:var(--bg-soft); border:1px solid var(--line); border-radius:var(--radius-sm); padding:18px 20px; margin:0 0 28px; }
.article-toc-title{ font-weight:700; margin:0 0 10px; display:flex; align-items:center; gap:8px; }
.article-toc ul{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.article-toc .toc-level-3{ padding-right:18px; font-size:14px; }
.article-toc a{ color:var(--ink-soft); }
.article-toc a:hover{ color:var(--brand); }

/* أزرار المشاركة */
.article-share{ display:flex; align-items:center; gap:10px; margin:36px 0; padding:18px 0; border-top:1px solid var(--line); border-bottom:1px solid var(--line); flex-wrap:wrap; }
.article-share-label{ font-weight:700; color:var(--ink-soft); font-size:14px; margin-left:4px; }
.share-btn{ width:40px; height:40px; border-radius:50%; display:flex; align-items:center; justify-content:center; color:#fff; font-size:16px; border:none; cursor:pointer; transition:transform .15s ease, opacity .15s ease; }
.share-btn:hover{ transform:translateY(-2px); opacity:.9; }
.share-whatsapp{ background:#25D366; }
.share-x{ background:#000; }
.share-fb{ background:#1877F2; }
.share-copy{ background:var(--ink-soft); }

/* بطاقة الكاتب */
.author-card{ display:flex; gap:18px; align-items:flex-start; background:var(--bg-soft); border:1px solid var(--line); border-radius:var(--radius); padding:22px; margin-top:10px; }
.author-card-photo{ width:64px; height:64px; border-radius:50%; object-fit:cover; flex:0 0 auto; }
.author-card-photo-placeholder{ display:flex; align-items:center; justify-content:center; background:var(--brand-light); color:var(--brand-dark); font-size:24px; }
.author-card-name{ font-weight:800; margin:0 0 6px; font-size:16px; }
.author-card-bio{ color:var(--ink-soft); font-size:14px; line-height:1.9; margin:0 0 10px; }
.author-card-social{ display:flex; gap:10px; }
.author-card-social a{ color:var(--ink-soft); font-size:16px; }
.author-card-social a:hover{ color:var(--brand); }

/* مقالات ذات صلة */
.related-articles{ margin:48px 0; }
.related-articles-title{ font-size:20px; font-weight:800; margin:0 0 20px; }

/* النشرة البريدية */
.newsletter-block{ display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; background:linear-gradient(135deg, var(--brand), var(--brand-2)); border-radius:var(--radius); padding:28px 32px; margin:36px 0; color:#fff; }
.newsletter-block-title{ font-size:18px; font-weight:800; margin:0 0 6px; display:flex; align-items:center; gap:8px; }
.newsletter-block-sub{ margin:0; opacity:.9; font-size:14px; }
.newsletter-form{ display:flex; gap:10px; flex-wrap:wrap; }
.newsletter-form input{ padding:12px 16px; border-radius:999px; border:none; min-width:220px; font-family:inherit; }
.newsletter-form button{ border-radius:999px; background:#fff; color:var(--brand-dark); border:none; padding:12px 22px; font-weight:700; cursor:pointer; }

/* التعليقات */
.comments-section{ margin:48px 0; }
.comments-title{ font-size:20px; font-weight:800; margin:0 0 20px; display:flex; align-items:center; gap:8px; }
.comments-list{ display:flex; flex-direction:column; gap:16px; margin-bottom:32px; }
.comments-empty{ color:var(--muted); }
.comment-item{ background:var(--bg-soft); border:1px solid var(--line); border-radius:var(--radius-sm); padding:16px 18px; }
.comment-item-head{ display:flex; justify-content:space-between; gap:10px; margin-bottom:8px; }
.comment-item-name{ font-weight:700; }
.comment-item-date{ color:var(--muted); font-size:13px; }
.comment-item-body{ margin:0; line-height:1.8; }
.comment-form-wrap h4{ margin:0 0 14px; }
.comment-form textarea{ resize:vertical; }

/* صفحة البحث */
.site-search-form{ display:flex; gap:10px; max-width:480px; margin:18px auto 0; }
.site-search-form input{ flex:1; padding:12px 16px; border-radius:999px; border:1px solid var(--line); font-family:inherit; }
.site-search-form button{ width:44px; height:44px; border-radius:50%; border:none; background:var(--brand); color:#fff; cursor:pointer; }
.search-results-count{ text-align:center; color:var(--muted); margin-top:14px; }
.search-group{ margin-bottom:40px; }
.search-group-title{ font-size:18px; font-weight:800; margin:0 0 18px; }
.search-page-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:14px; }
.search-page-list a{ font-weight:700; font-size:16px; }
.search-page-list p{ margin:4px 0 0; color:var(--muted); font-size:14px; }

