/*
Theme Name: أقواس | مركز التدريب الإعلامي
Theme URI: https://aqwas.dz
Author: أقواس
Author URI: https://aqwas.dz
Description: قالب مركز التدريب الإعلامي والإبداعي أقواس — تصميم عربي RTL احترافي مع دعم كامل لووردبريس.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
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: aqwas
Tags: rtl-language, arabic, education, news, custom-menu, featured-images, widgets
*/

/* ══════════════════════════════════════════════
   DESIGN TOKENS — DARK MODE
══════════════════════════════════════════════ */
:root {
  --bg:         #0f0f0f;
  --surface:    #181818;
  --surface-2:  #1f1f1f;
  --border:     #2a2a2a;
  --border-2:   #383838;

  --ink:        #f0eeeb;
  --ink-2:      #ccc8c2;
  --ink-3:      #918d88;

  --accent:     #c0392b;
  --accent-2:   #e74c3c;
  --gold:       #d4a017;
  --teal:       #1a8a8a;
  --teal-light: #0d2a2a;

  --font-h: 'Cairo', sans-serif;
  --font-b: 'Tajawal', sans-serif;

  --r: 10px;
  --r-lg: 18px;
  --shadow: 0 2px 16px rgba(0,0,0,.4);
  --shadow-hover: 0 8px 32px rgba(0,0,0,.6);
  --tr: .25s cubic-bezier(.4,0,.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg) !important;
  color: var(--ink);
  font-family: var(--font-b);
  font-size: 15px;
  line-height: 1.7;
  direction: rtl;
}
a { text-decoration: none; color: inherit; transition: color var(--tr); }
a:hover { color: var(--accent); }
img { max-width: 100%; display: block; height: auto; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-b); }

/* ══ TOP BAR ══ */
.topbar {
  background: #080808 !important;
  color: rgba(255,255,255,.6);
  padding: 8px 0;
  font-size: 12px;
  font-family: var(--font-h);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.breadcrumb { display: flex; align-items: center; gap: 8px; }
.breadcrumb a { color: rgba(255,255,255,.7); font-size: 12px; }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { color: rgba(255,255,255,.3); font-size: 10px; }
.breadcrumb .current {
  background: var(--accent); color: #fff;
  padding: 3px 12px; border-radius: 4px; font-size: 11px; font-weight: 700;
}
.topbar-actions { display: flex; gap: 8px; align-items: center; }
.topbar-actions a {
  color: rgba(255,255,255,.6); font-size: 12px; padding: 4px 10px;
  border: 1px solid rgba(255,255,255,.15); border-radius: 4px;
  transition: all var(--tr);
}
.topbar-actions a:hover { background: rgba(255,255,255,.1); color: #fff; }
.topbar-actions .btn-login {
  background: var(--accent); color: #fff !important; border-color: var(--accent) !important;
  font-weight: 600;
}

/* ══ HEADER ══ */
header.site-header,
.site-header {
  background: #111111 !important;
  border-bottom: 2px solid var(--accent);
  box-shadow: 0 2px 20px rgba(0,0,0,.5);
  position: sticky; top: 0; z-index: 200;
}
.header-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.logo-mark {
  width: 48px; height: 48px; border-radius: var(--r);
  background: linear-gradient(135deg, var(--accent), var(--gold));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: var(--font-h); font-weight: 900; font-size: 22px;
  box-shadow: 0 4px 12px rgba(192,57,43,.3);
}
.logo-text .name {
  font-family: var(--font-h); font-size: 22px; font-weight: 900;
  color: var(--ink); line-height: 1.1;
}
.logo-text .tagline { font-size: 11px; color: var(--ink-3); letter-spacing: .04em; }

/* ── WordPress Primary Navigation ── */
.main-navigation { display: flex; }
.main-navigation ul {
  display: flex; gap: 2px; list-style: none; margin: 0; padding: 0;
}
.main-navigation ul li a {
  font-family: var(--font-h); font-size: 13px; font-weight: 600; color: var(--ink-2);
  padding: 8px 14px; border-radius: var(--r); transition: all var(--tr); white-space: nowrap;
  display: block;
}
.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item > a,
.main-navigation ul li.current_page_item > a { color: var(--accent); background: rgba(192,57,43,.12); }
.main-navigation .nav-enroll > a {
  background: var(--accent); color: #fff !important; padding: 8px 20px !important;
  border-radius: var(--r) !important; font-weight: 700 !important; margin-right: 8px;
  box-shadow: 0 3px 12px rgba(192,57,43,.4);
}
.main-navigation .nav-enroll > a:hover { background: var(--accent-2) !important; transform: translateY(-1px); }

/* Dropdown */
.main-navigation ul ul {
  position: absolute; top: 100%; right: 0;
  background: #1e1e1e; border: 1px solid var(--border-2);
  border-radius: var(--r); box-shadow: 0 8px 32px rgba(0,0,0,.6);
  min-width: 200px; display: none; flex-direction: column; z-index: 300; padding: 6px;
}
.main-navigation ul li { position: relative; }
.main-navigation ul li:hover > ul { display: flex; }
.main-navigation ul ul li a { padding: 10px 14px; border-radius: 6px; font-size: 13px; }

/* ══ HERO GRID ══ */
.hero-section {
  max-width: 1280px; margin: 28px auto 0; padding: 0 24px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 260px 260px;
  gap: 3px;
  background: #080808;
  border: 2px solid #2a0d0d;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 8px 48px rgba(0,0,0,.6);
}
.hcell {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform .35s ease;
}
.hcell:hover { z-index: 1; transform: scale(1.01); }
.hcell-bg-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .5s ease;
}
.hcell:hover .hcell-bg-img { transform: scale(1.06); }
.hcell-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.38) 55%, rgba(0,0,0,.08) 100%);
}
.hcell-overlay--red {
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.42) 55%, rgba(0,0,0,.1) 100%);
}
.hcell-overlay--dark {
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.48) 55%, rgba(0,0,0,.12) 100%);
}
.hcell-overlay--teal {
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.42) 55%, rgba(0,0,0,.1) 100%);
}
.hcell-content {
  position: relative; z-index: 2;
  padding: 22px 24px 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.hcell-title {
  font-family: var(--font-h);
  font-size: 24px; font-weight: 900;
  color: #fff; line-height: 1.2;
  text-shadow: 0 1px 6px rgba(0,0,0,.6);
}
.hcell-desc {
  font-size: 15px; color: rgba(255,255,255,.93);
  line-height: 1.8;
  text-shadow: 0 1px 4px rgba(0,0,0,.7);
  display: -webkit-box; -webkit-line-clamp: 4;
  -webkit-box-orient: vertical; overflow: hidden;
}
.hcell-link {
  display: inline-flex; align-items: center; gap: 5px; margin-top: 6px;
  font-size: 13px; font-weight: 700; color: var(--accent);
  font-family: var(--font-h); transition: gap var(--tr), color var(--tr);
  width: fit-content; text-shadow: none;
}
.hcell-link:hover { gap: 9px; color: var(--accent-2); }
.hcell-left { display: none; }
.hcell-training  { grid-row: 1; grid-column: 1; }
.hcell-forum     { grid-row: 1; grid-column: 2; }
.hcell-services  { grid-row: 2; grid-column: 1; }
.hcell-reports   { grid-row: 2; grid-column: 2; }

/* ══ MEDIA SECTIONS (AJ360 style) ══ */
.media-section {
  max-width: 1280px; margin: 48px auto 0; padding: 0 24px;
}
.media-section-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border-2);
}
.media-section-label {
  font-family: var(--font-h); font-size: 18px; font-weight: 900; color: var(--ink);
  display: flex; align-items: center; gap: 12px;
}
.media-section-label::before {
  content: ''; display: inline-block;
  width: 5px; height: 22px; border-radius: 3px;
  background: var(--accent);
}
.media-section-more {
  font-family: var(--font-h); font-size: 12px; font-weight: 700;
  color: var(--accent); letter-spacing: .03em;
  transition: color var(--tr), gap var(--tr);
}
.media-section-more:hover { color: var(--accent-2); }

/* Grid layout — first card big, rest small */
.media-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  grid-template-rows: 320px;
  gap: 4px;
  border-radius: var(--r-lg); overflow: hidden;
}

/* Base card */
.mcard {
  position: relative; overflow: hidden; display: block;
  cursor: pointer; text-decoration: none;
}
.mcard:hover .mcard-bg { transform: scale(1.07); }

.mcard-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: transform .5s ease;
}
.mcard-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top,
    rgba(0,0,0,.9)  0%,
    rgba(0,0,0,.45) 45%,
    rgba(0,0,0,.08) 100%);
}
.mcard:hover .mcard-overlay {
  background: linear-gradient(to top,
    rgba(0,0,0,.92) 0%,
    rgba(0,0,0,.5)  50%,
    rgba(0,0,0,.1)  100%);
}

.mcard-body {
  position: relative; z-index: 2;
  padding: 16px 14px 14px;
  display: flex; flex-direction: column; gap: 6px;
  height: 100%; justify-content: flex-end;
}

/* Tag / badge */
.mcard-tag {
  display: inline-block; width: fit-content;
  background: none; color: rgba(255,255,255,.85);
  font-family: var(--font-h); font-size: 10px; font-weight: 800;
  padding: 0; border-radius: 0;
  letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 2px;
}
.mcard-tag--top {
  position: absolute; top: 12px; left: 12px; z-index: 3;
  margin-bottom: 0;
}
.mcard--featured .mcard-tag--top { top: 16px; left: 16px; font-size: 11px; }

.mcard-title {
  font-family: var(--font-h); font-weight: 800; color: #fff;
  font-size: 13px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 5px rgba(0,0,0,.7);
}
.mcard-meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 10px; color: rgba(255,255,255,.65);
  font-family: var(--font-h);
}

/* Featured (first) card */
.mcard--featured .mcard-title {
  font-size: 20px; line-height: 1.4; -webkit-line-clamp: 4;
}
.mcard--featured .mcard-meta { font-size: 12px; }
.mcard--featured .mcard-body { padding: 22px 20px 18px; gap: 10px; }

/* Thin red accent line at bottom of featured */
.mcard--featured::after {
  content: '';
  position: absolute; bottom: 0; left: 0; right: 0; height: 3px;
  background: var(--accent); z-index: 3;
}

.media-empty { color: var(--ink-3); padding: 40px; font-size: 13px; grid-column: 1/-1; }

/* Divider */
.divider { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.divider hr { border: none; border-top: 1px solid var(--border); margin: 0; }

/* ══ WORDPRESS CONTENT AREA ══ */
.site-content { max-width: 1280px; margin: 40px auto; padding: 0 24px; }
.entry-title { font-family: var(--font-h); font-size: 28px; font-weight: 900; color: var(--ink); margin-bottom: 16px; }
.entry-content { line-height: 1.8; color: var(--ink-2); }
.entry-content h2 { font-family: var(--font-h); font-size: 22px; font-weight: 700; color: var(--ink); margin: 24px 0 12px; }
.entry-content h3 { font-family: var(--font-h); font-size: 18px; font-weight: 700; color: var(--ink); margin: 20px 0 10px; }
.entry-content p { margin-bottom: 16px; }
.entry-content ul, .entry-content ol { padding-right: 24px; margin-bottom: 16px; }
.entry-content img { border-radius: var(--r); box-shadow: var(--shadow); margin: 16px 0; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin: 40px 0; }
.pagination .page-numbers {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--font-h); font-size: 14px; color: var(--ink-2); transition: all var(--tr);
}
.pagination .page-numbers:hover,
.pagination .page-numbers.current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Widgets */
.widget { margin-bottom: 28px; }
.widget-title { font-family: var(--font-h); font-size: 16px; font-weight: 700; color: var(--ink); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--accent); }
.widget ul { list-style: none; }
.widget ul li { padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.widget ul li a { color: var(--ink-2); }
.widget ul li a:hover { color: var(--accent); }

/* ══ FOOTER ══ */
footer.site-footer,
.site-footer {
  background: #0d0d0d !important;
  color: rgba(255,255,255,.6);
  margin-top: 60px; padding: 48px 0 0;
  border-top: 2px solid var(--border-2);
}
.footer-grid {
  max-width: 1280px; margin: 0 auto; padding: 0 24px;
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 40px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand .name { font-family: var(--font-h); font-size: 22px; font-weight: 900; color: #fff; margin-bottom: 6px; }
.footer-brand p { font-size: 13px; line-height: 1.8; color: rgba(255,255,255,.5); margin-bottom: 16px; }
.footer-col-title { font-family: var(--font-h); font-size: 13px; font-weight: 700; color: rgba(255,255,255,.9); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.1); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 8px; }
.footer-col ul li a { font-size: 13px; color: rgba(255,255,255,.5); transition: all var(--tr); }
.footer-col ul li a:hover { color: var(--accent); padding-right: 4px; }
.footer-bottom {
  max-width: 1280px; margin: 0 auto; padding: 14px 24px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12px; color: rgba(255,255,255,.3);
}
.footer-bottom span { color: var(--accent); }
.social-links { display: flex; gap: 8px; }
.social-links a {
  width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,.07);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
  color: rgba(255,255,255,.5); transition: all var(--tr);
}
.social-links a:hover { background: var(--accent); color: #fff; }

/* ══ UTILITIES ══ */
.divider { max-width: 1280px; margin: 32px auto 0; padding: 0 24px; }
.divider hr { border: none; border-top: 1px solid var(--border); }

@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp .5s ease both; }
.fade-up-1 { animation-delay: .1s; }
.fade-up-2 { animation-delay: .2s; }
.fade-up-3 { animation-delay: .3s; }

/* ══ HAMBURGER ══ */
.menu-toggle {
  display: none; flex-direction: column; gap: 5px; justify-content: center;
  width: 40px; height: 40px; padding: 8px;
  background: var(--surface-2); border: 1px solid var(--border-2);
  border-radius: var(--r); cursor: pointer; flex-shrink: 0; transition: all var(--tr);
}
.menu-toggle span { display: block; height: 2px; background: var(--ink-2); border-radius: 2px; transition: all var(--tr); }
.menu-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none; position: fixed; top: 0; right: -100%; bottom: 0;
  width: 80%; max-width: 300px; background: #1a1a1a; z-index: 500;
  flex-direction: column; box-shadow: -4px 0 40px rgba(0,0,0,.7);
  transition: right .3s cubic-bezier(.4,0,.2,1); overflow-y: auto;
}
.mobile-nav.open { right: 0; }
.mobile-nav-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 499; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.mobile-nav-overlay.open { opacity: 1; pointer-events: auto; }
.mobile-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--border-2); background: #111; }
.mobile-nav-head .m-logo { font-family: var(--font-h); font-size: 20px; font-weight: 900; color: #fff; }
.mobile-nav-close { width: 32px; height: 32px; border-radius: 6px; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; color: #fff; font-size: 20px; cursor: pointer; line-height: 1; }
.mobile-nav a { display: flex; align-items: center; gap: 12px; padding: 14px 20px; font-family: var(--font-h); font-size: 15px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--border); transition: all var(--tr); }
.mobile-nav a:hover, .mobile-nav a.active { color: var(--accent); background: rgba(192,57,43,.1); padding-right: 26px; }
.mobile-nav .m-enroll { margin: 16px; border-radius: var(--r) !important; border: none !important; background: var(--accent) !important; color: #fff !important; justify-content: center; font-weight: 700 !important; padding: 14px 20px !important; }
.mobile-nav .m-enroll:hover { background: var(--accent-2) !important; padding-right: 20px !important; }

/* ══ TABLET ══ */
@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 190px 1fr 1fr; }
  .hcell-title { font-size: 18px; }
  .hcell-training .hcell-title { font-size: 20px; }
  .stats-row { flex-wrap: wrap; }
  .stat-item { min-width: 33%; border-left: none; border-bottom: 1px solid rgba(255,255,255,.08); padding: 10px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ══ MOBILE ══ */
@media (max-width: 768px) {
  .topbar-inner { flex-direction: column; gap: 6px; align-items: flex-start; padding: 8px 16px; }
  .topbar-actions { flex-wrap: wrap; }
  .header-inner { padding: 0 16px; height: 60px; }
  .main-navigation { display: none; }
  .menu-toggle { display: flex; }
  .mobile-nav { display: flex; }
  .mobile-nav-overlay { display: block; pointer-events: none; }
  .hero-section { padding: 0 12px; margin-top: 16px; }
  .hero-grid { grid-template-columns: 1fr !important; grid-template-rows: repeat(4,220px) !important; gap: 3px; border-radius: var(--r); }
  .hcell-training, .hcell-forum, .hcell-services, .hcell-reports { grid-column: 1 !important; grid-row: auto !important; }
  .hcell-title { font-size: 20px !important; }
  .media-section { padding: 0 12px; margin-top: 28px; }
  .media-row { grid-template-columns: 1fr 1fr; grid-template-rows: 180px 180px 180px; }
  .mcard--featured { grid-column: 1 / -1; }
  .mcard--featured .mcard-title { font-size: 16px; }
  .footer-grid { grid-template-columns: 1fr !important; gap: 24px; padding: 0 16px 32px; }
  .footer-bottom { flex-direction: column; gap: 6px; text-align: center; padding: 14px 16px; }
  .social-links { justify-content: center; }
}

@media (max-width: 420px) {
  .topbar { display: none; }
  .logo-text .tagline { display: none; }
  .logo-mark { width: 40px; height: 40px; font-size: 18px; }
  .logo-text .name { font-size: 18px; }
  .prog-card { min-width: 175px; max-width: 175px; }
  .art-card { min-width: 190px !important; max-width: 190px !important; }
  .media-card { min-width: 180px; max-width: 180px; }
  .stat-num { font-size: 18px; }
  .stat-label { font-size: 10px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 6px; }
}
