/*
Theme Name: Derasatek JU-Style
Theme URI: https://alpha.derasatek.com/
Author: Derasatek
Author URI: https://alpha.derasatek.com/
Description: قالب مؤسسي نظيف لموسوعة دراساتك للرسائل الجامعية، مستلهم في روحه ونظامه من المواقع الجامعية المؤسسية (شريط علوي، ترويسة بيضاء، شبكة متساوية، صناديق تواريخ، تذييل داكن). لا ينسخ شعاراً ولا صوراً ولا كوداً من أي موقع آخر. يدعم نوع المحتوى drs_thesis وتصنيف drs_subject، والعربية RTL.
Version: 1.1.2
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: derasatek-ju-style
Tags: rtl, academic, education, thesis, library, responsive, custom-menu, featured-images
*/

/* ============================================================
   Derasatek JU-Style — نظام تصميم مؤسسي
   لوحة: ورقي فاتح، حبر داكن، أزرق مؤسسي واحد فقط.
   بلا تدرجات، بلا ذهبي، بلا مجسمات، بلا وميض.
   مقياس تباعد موحد: 16 / 24 / 32 / 48px
   مقياس أرقام موحد: أرقام الإحصاءات 28px، أعداد الفهرس 15px
   ============================================================ */
:root {
  --paper: #FAF8F4;
  --white: #FFFFFF;
  --ink: #14201F;
  --ink-soft: #3D4A48;
  --muted: #6B7673;
  --line: #E3DDD3;
  --line-strong: #C9C2B4;
  --blue: #123A5C;
  --blue-dark: #0E2C48;
  --blue-light: #EAF0F5;
  --blue-ink: #123A5C;
  --space-16: 16px;
  --space-24: 24px;
  --space-32: 32px;
  --space-48: 48px;
  --radius: 4px;
  --font-serif: "Amiri", "Noto Naskh Arabic", serif;
  --font-sans: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}
[dir="ltr"] body { direction: ltr; }
img { max-width: 100%; height: auto; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-serif); line-height: 1.45; margin: 0 0 16px; color: var(--ink); font-weight: 700; }
h1 { font-size: 36px; }
h2 { font-size: 28px; }
h3 { font-size: 22px; }
h4 { font-size: 18px; }
p { margin: 0 0 16px; }
.container { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.section { padding: 48px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 2px solid var(--blue); }
.section-head h2 { margin: 0; flex: 1; min-width: 0; }
.section-head .more { font-size: 14px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }

/* ---------- الشريط العلوي ---------- */
.topbar { background: var(--blue-dark); color: #DCE6EE; font-size: 13px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; min-height: 36px; gap: 16px; }
.topbar a { color: #DCE6EE; }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; }
.topbar .topbar-note { margin: 0; }

/* ---------- الترويسة ---------- */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; padding-top: 16px; padding-bottom: 16px; }
.site-brand { display: flex; align-items: center; gap: 16px; }
.site-brand .custom-logo { max-height: 56px; width: auto; }
.site-title { font-family: var(--font-serif); font-size: 28px; line-height: 1.2; margin: 0; }
.site-title a { color: var(--ink); }
.site-title a:hover { text-decoration: none; }
.site-tagline { font-size: 13px; color: var(--muted); margin: 0; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 24px; flex-wrap: wrap; }
.main-nav a { color: var(--ink); font-weight: 700; font-size: 15px; padding: 8px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav .current-menu-item a { color: var(--blue); border-bottom-color: var(--blue); text-decoration: none; }
.menu-toggle { display: none; background: var(--blue); color: #fff; border: 0; padding: 8px 16px; font-family: var(--font-sans); font-size: 15px; border-radius: var(--radius); cursor: pointer; }
.header-cart { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
.header-cart:hover { color: var(--blue); text-decoration: none; }
.cart-count { display: inline-block; min-width: 24px; text-align: center; background: var(--blue); color: #fff; font-size: 13px; font-weight: 700; padding: 2px 6px; border-radius: 12px; }

/* ---------- البطل المؤسسي ---------- */
.hero { background: var(--white); border-bottom: 1px solid var(--line); padding: 48px 0 32px; }
.hero-eyebrow { color: var(--blue); font-weight: 700; font-size: 14px; letter-spacing: 0; margin: 0 0 16px; }
.hero h1 { font-size: 40px; margin-bottom: 16px; }
.hero p.lead { font-size: 18px; color: var(--ink-soft); max-width: 760px; margin-bottom: 24px; }
.hero-search { background: var(--blue-light); border: 1px solid var(--line-strong); padding: 16px; border-radius: var(--radius); }
.hero-search form { display: flex; gap: 16px; }
.hero-search input[type="search"] { flex: 1; min-width: 0; padding: 12px 16px; font-family: var(--font-sans); font-size: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.hero-search button { background: var(--blue); color: #fff; border: 0; padding: 12px 24px; font-family: var(--font-sans); font-size: 16px; font-weight: 700; border-radius: var(--radius); cursor: pointer; white-space: nowrap; }
.hero-search button:hover { background: var(--blue-dark); }

/* ---------- شريط الإحصاءات (أرقام موحدة) ---------- */
.stats-strip { background: var(--white); border-bottom: 1px solid var(--line); }
.stats-strip .container { display: flex; gap: 32px; padding-top: 16px; padding-bottom: 16px; flex-wrap: wrap; }
.stat { display: flex; align-items: baseline; gap: 8px; }
.stat-number { font-size: 28px; font-weight: 700; line-height: 1.2; color: var(--blue); font-family: var(--font-sans); }
.stat-label { font-size: 14px; color: var(--muted); }

/* ---------- شبكة الرسائل (بطاقات متساوية، عناوين بارزة) ---------- */
.thesis-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.thesis-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; display: flex; flex-direction: column; min-height: 220px; }
.thesis-card:hover { border-color: var(--blue); }
.thesis-date { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.date-box { background: var(--blue); color: #fff; text-align: center; min-width: 56px; padding: 8px 4px; border-radius: var(--radius); line-height: 1.2; }
.date-box .date-day { display: block; font-size: 20px; font-weight: 700; }
.date-box .date-month { display: block; font-size: 12px; }
.thesis-card h3 { font-size: 20px; margin: 0 0 8px; }
.thesis-card h3 a { color: var(--ink); }
.thesis-card h3 a:hover { color: var(--blue); }
.thesis-meta { font-size: 14px; color: var(--muted); margin: 0 0 16px; }
.thesis-card .card-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.badge { display: inline-block; font-size: 13px; font-weight: 700; padding: 4px 8px; border: 1px solid var(--blue); color: var(--blue); border-radius: var(--radius); background: #fff; }
.badge.no-fulltext { border-color: var(--muted); color: var(--muted); }
.btn { display: inline-block; background: var(--blue); color: #fff; padding: 8px 16px; font-size: 14px; font-weight: 700; border-radius: var(--radius); border: 0; cursor: pointer; }
.btn:hover { background: var(--blue-dark); color: #fff; text-decoration: none; }
.btn-outline { background: #fff; color: var(--blue); border: 1px solid var(--blue); }

/* ---------- قائمة ببليوغرافية ---------- */
.thesis-list { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); }
.thesis-list li { padding: 24px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; }
.thesis-list li:last-child { border-bottom: 0; }
.thesis-list h3 { font-size: 20px; margin: 0 0 8px; }
.thesis-list .thesis-meta { margin: 0; }

/* ---------- تصفح 3 أعمدة ---------- */
.browse-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.browse-col { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.browse-col h3 { border-bottom: 2px solid var(--blue); padding-bottom: 8px; }
.browse-col ul { list-style: none; margin: 0; padding: 0; }
.browse-col li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.browse-col li:last-child { border-bottom: 0; }
.browse-col .count { font-size: 15px; font-weight: 700; color: var(--blue); }

/* ---------- الرحلة المرقمة ---------- */
.journey { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.journey-step { border-top: 2px solid var(--blue); padding-top: 16px; }
.journey-step .step-num { font-size: 28px; font-weight: 700; color: var(--blue); line-height: 1.2; display: block; }
.journey-step h3 { font-size: 18px; margin: 8px 0; }

/* ---------- الخدمات ---------- */
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.service-card { background: var(--white); border: 1px solid var(--line); padding: 24px; border-radius: var(--radius); }
.service-card h3 { font-size: 18px; }

/* ---------- الفلاتر ---------- */
.filters { background: var(--white); border: 1px solid var(--line); padding: 16px; border-radius: var(--radius); margin-bottom: 24px; }
.filters form { display: flex; gap: 16px; flex-wrap: wrap; align-items: end; }
.filters label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.filters input, .filters select { padding: 8px 12px; font-family: var(--font-sans); font-size: 15px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; min-width: 160px; }
.results-count { font-size: 15px; font-weight: 700; margin-bottom: 16px; }

/* ---------- جدول ببليوغرافي ---------- */
.meta-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line); margin-bottom: 24px; }
.meta-table th, .meta-table td { text-align: right; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.meta-table th { width: 180px; background: var(--blue-light); font-size: 14px; }
.meta-table tr:last-child th, .meta-table tr:last-child td { border-bottom: 0; }
.citation-box { background: var(--white); border: 1px solid var(--line); border-right: 4px solid var(--blue); padding: 16px 24px; margin-bottom: 24px; }
.citation-box pre { white-space: pre-wrap; font-family: var(--font-sans); font-size: 15px; margin: 0 0 16px; }
/* تبويبات الاقتباس وأزرار التصدير — 1.1.0 */
.citation-tabs { display: flex; gap: 8px; margin-bottom: 0; }
.citation-tab { background: var(--white); color: var(--ink); border: 1px solid var(--line-strong); border-bottom: 0; padding: 8px 16px; font-family: var(--font-sans); font-size: 14px; font-weight: 700; border-radius: var(--radius) var(--radius) 0 0; cursor: pointer; }
.citation-tab.is-active { background: var(--blue); color: #fff; border-color: var(--blue); }
.export-links { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.cart-toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--blue-dark); color: #fff; padding: 12px 24px; border-radius: var(--radius); font-size: 15px; font-weight: 700; z-index: 100; }

/* ---------- صفحة سلة الطلب — 1.1.1 ---------- */
.basket-page { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.basket-success { background: #EAF5EC; border: 1px solid #7FB98A; border-right: 4px solid #2E7D32; padding: 12px 16px; border-radius: var(--radius); font-weight: 700; }
.basket-error { background: #FDECEA; border: 1px solid #D89A94; border-right: 4px solid #B3261E; padding: 12px 16px; border-radius: var(--radius); font-weight: 700; }
.basket-list { list-style: none; margin: 0 0 24px; padding: 0; }
.basket-list li { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.basket-list li:last-child { border-bottom: 0; }
.basket-list a { font-weight: 700; }
.basket-empty { color: var(--muted); }
.basket-form > div { margin-bottom: 16px; }
.basket-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.basket-form input[type="text"], .basket-form input[type="email"], .basket-form textarea { width: 100%; max-width: 560px; padding: 8px 12px; font-family: var(--font-sans); font-size: 15px; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; }
.basket-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }

/* ---------- التذييل الداكن ---------- */
.site-footer { background: var(--blue-dark); color: #DCE6EE; margin-top: 48px; }
.site-footer .container { padding-top: 48px; padding-bottom: 24px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-bottom: 32px; }
.site-footer h3 { color: #fff; font-size: 18px; border-bottom: 1px solid rgba(255,255,255,.25); padding-bottom: 8px; }
.site-footer a { color: #DCE6EE; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 4px 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.25); padding-top: 16px; font-size: 13px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- ترقيم الصفحات ---------- */
.pagination { margin: 32px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 8px 12px; border: 1px solid var(--line-strong); background: #fff; border-radius: var(--radius); }
.pagination .current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---------- استجابة الجوال ---------- */
@media (max-width: 1024px) {
  .thesis-grid, .browse-3, .services-grid { grid-template-columns: repeat(2, 1fr); }
  .journey { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  h1, .hero h1 { font-size: 28px; }
  h2 { font-size: 24px; }
  .section { padding: 32px 0; }
  .menu-toggle { display: inline-block; }
  .main-nav { display: none; width: 100%; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { border-top: 1px solid var(--line); }
  .site-header .container { flex-wrap: wrap; }
  .hero-search form { flex-direction: column; }
  .thesis-grid, .browse-3, .services-grid, .journey { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .stats-strip .container { gap: 16px; }
  .stat-number { font-size: 24px; }
  .meta-table th { width: 120px; }
  .thesis-list li { flex-direction: column; }
}
