/*
Theme Name: Soujiat Pro
Theme URI: https://soujiat.com
Author: Soujiat
Author URI: https://soujiat.com
Description: قالب احترافي لبنك الفروض والاختبارات الجزائري
Version: 1.0.0
Requires at least: 5.8
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: soujiat
Tags: rtl-language, arabic, education, blog
*/

/* ============================================
   SOUJIAT PRO THEME - Main Stylesheet
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  /* Brand Colors */
  --color-primary:       #1a5276;
  --color-primary-dark:  #154360;
  --color-primary-light: #2e86c1;
  --color-accent:        #f39c12;
  --color-accent-dark:   #d68910;
  --color-accent-light:  #f8c471;

  /* Neutrals */
  --color-bg:            #f4f6f9;
  --color-surface:       #ffffff;
  --color-surface-2:     #eaf0fb;
  --color-border:        #dde3ef;
  --color-text:          #1a2340;
  --color-text-muted:    #6b7a99;
  --color-text-light:    #a0aec0;

  /* Level Colors */
  --color-l1:  #27ae60;
  --color-l2:  #2980b9;
  --color-l3:  #8e44ad;
  --color-l4:  #e67e22;
  --color-l5:  #c0392b;
  --color-lm:  #16a085;

  /* Spacing & Shape */
  --radius-sm:  8px;
  --radius-md:  14px;
  --radius-lg:  22px;
  --radius-xl:  32px;
  --shadow-sm:  0 2px 8px rgba(26,82,118,0.07);
  --shadow-md:  0 6px 24px rgba(26,82,118,0.12);
  --shadow-lg:  0 16px 48px rgba(26,82,118,0.18);

  /* Typography */
  --font-main:  'Cairo', 'Tajawal', sans-serif;
  --font-size-base: 16px;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-bg);
  color: var(--color-text);
  direction: rtl;
  text-align: right;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--color-primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-accent); }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* ============================================
   LAYOUT CONTAINER
   ============================================ */
.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ============================================
   HEADER & NAV
   ============================================ */
.site-header {
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 3px solid var(--color-primary);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 20px;
}

/* Logo */
.site-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
  max-width: 160px;   /* prevent oversized logo */
}

.site-logo img,
.site-logo .custom-logo {
  height: 50px !important;
  width: auto !important;
  max-width: 150px !important;
  object-fit: contain;
  display: block;
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo-text .name {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-primary);
}

.logo-text .tagline {
  font-size: 0.7rem;
  color: var(--color-text-muted);
  font-weight: 400;
}

/* Main Navigation */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.main-nav a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all .2s;
}

.main-nav a:hover,
.main-nav a.current {
  color: var(--color-primary);
  background: var(--color-surface-2);
}

/* Header Quick Search */
.header-search {
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 5px 14px;
  gap: 8px;
  min-width: 220px;
  transition: border-color .2s;
}

.header-search:focus-within {
  border-color: var(--color-primary-light);
}

.header-search input {
  border: none;
  background: transparent;
  font-family: var(--font-main);
  font-size: 0.875rem;
  color: var(--color-text);
  flex: 1;
  outline: none;
  direction: rtl;
}

.header-search button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  padding: 0;
}

.header-search button:hover { color: var(--color-primary); }

/* Mobile Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 5px;
  background: none;
  border: none;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  border-radius: 2px;
  transition: all .3s;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 50%, var(--color-primary-light) 100%);
  padding: 80px 0 100px;
  overflow: hidden;
  text-align: center;
}

/* Decorative background shapes */
.hero-section::before {
  content: '';
  position: absolute;
  top: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  background: rgba(255,255,255,0.04);
  border-radius: 50%;
}

.hero-section::after {
  content: '';
  position: absolute;
  bottom: -80px;
  right: -40px;
  width: 400px;
  height: 400px;
  background: rgba(255,255,255,0.03);
  border-radius: 50%;
}

.hero-bg-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.08) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
  backdrop-filter: blur(4px);
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.25;
  margin-bottom: 14px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero-title span {
  color: var(--color-accent-light);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.8);
  margin-bottom: 40px;
  font-weight: 400;
}

/* Hero Search Box */
.hero-search-box {
  max-width: 680px;
  margin: 0 auto 40px;
  position: relative;
}

.hero-search-form {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 40px rgba(0,0,0,0.25);
  overflow: hidden;
  padding: 6px 6px 6px 20px;
  gap: 10px;
}

.hero-search-form input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-main);
  font-size: 1.05rem;
  color: var(--color-text);
  background: transparent;
  direction: rtl;
  padding: 8px 0;
}

.hero-search-form input::placeholder {
  color: var(--color-text-light);
}

.hero-search-btn {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-dark));
  color: #fff;
  border: none;
  padding: 12px 28px;
  border-radius: var(--radius-lg);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-search-btn:hover {
  background: linear-gradient(135deg, var(--color-accent-dark), #b7770d);
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(243,156,18,0.4);
}

/* Hero Filter Chips */
.hero-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  backdrop-filter: blur(4px);
}

.hero-filter-chip:hover,
.hero-filter-chip.active {
  background: rgba(255,255,255,0.25);
  color: #fff;
  border-color: rgba(255,255,255,0.5);
}

/* Hero Stats */
.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,0.15);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  color: #fff;
}

.hero-stat .stat-number {
  font-size: 1.8rem;
  font-weight: 900;
  display: block;
  line-height: 1;
  color: var(--color-accent-light);
}

.hero-stat .stat-label {
  font-size: 0.8rem;
  opacity: 0.75;
  margin-top: 4px;
}

/* ============================================
   LEVELS SECTION
   ============================================ */
.levels-section {
  padding: 70px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--color-surface-2);
  padding: 5px 14px;
  border-radius: var(--radius-xl);
  margin-bottom: 12px;
}

.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 10px;
}

.section-desc {
  color: var(--color-text-muted);
  font-size: 1rem;
  max-width: 540px;
  margin: 0 auto;
}

/* Levels Grid */
.levels-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 20px;
}

.level-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  text-align: center;
  text-decoration: none;
  border: 2px solid var(--color-border);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  position: relative;
  overflow: hidden;
}

.level-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: var(--level-color, var(--color-primary));
  transition: height .25s;
}

.level-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--level-color, var(--color-primary));
}

.level-card:hover::before {
  height: 6px;
}

.level-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  font-size: 1.6rem;
  background: color-mix(in srgb, var(--level-color, var(--color-primary)) 12%, transparent);
  transition: transform .25s;
}

.level-card:hover .level-icon {
  transform: scale(1.1) rotate(-5deg);
}

.level-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 6px;
  line-height: 1.3;
}

.level-count {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.level-count span {
  color: var(--level-color, var(--color-primary));
  font-weight: 700;
}

/* Level Colors */
.level-card[data-level="1ap"] { --level-color: var(--color-l1); }
.level-card[data-level="2ap"] { --level-color: var(--color-l2); }
.level-card[data-level="3ap"] { --level-color: var(--color-l3); }
.level-card[data-level="4ap"] { --level-color: var(--color-l4); }
.level-card[data-level="5ap"] { --level-color: var(--color-l5); }
.level-card[data-level="moyen"] { --level-color: var(--color-lm); }

/* ============================================
   LATEST POSTS SECTION
   ============================================ */
.posts-section {
  padding: 0 0 70px;
}

.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}

.posts-header-right { display: flex; align-items: center; gap: 14px; }

.view-all-link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 2px solid var(--color-primary);
  border-radius: var(--radius-xl);
  transition: all .2s;
}

.view-all-link:hover {
  background: var(--color-primary);
  color: #fff;
}

/* Posts Filter Tabs */
.posts-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.posts-tab {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 6px 14px;
  border-radius: var(--radius-xl);
  cursor: pointer;
  transition: all .2s;
  border: 1.5px solid transparent;
  background: var(--color-surface);
}

.posts-tab.active,
.posts-tab:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-surface-2);
}

/* Posts Grid */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

/* Post Card */
.post-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1.5px solid var(--color-border);
  transition: all .25s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
}

.post-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: linear-gradient(135deg, var(--color-surface-2), var(--color-border));
  position: relative;
}

.post-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s;
}

.post-card:hover .post-card-image img {
  transform: scale(1.05);
}

/* No-image placeholder */
.post-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--color-text-muted);
  font-size: 2rem;
}

.post-card-image-placeholder span {
  font-size: 0.8rem;
  font-weight: 500;
}

.post-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.post-cat-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  color: #fff;
  background: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.post-date {
  font-size: 0.75rem;
  color: var(--color-text-light);
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  line-height: 1.5;
  flex: 1;
}

.post-card-title a {
  color: inherit;
  transition: color .2s;
}

.post-card-title a:hover {
  color: var(--color-primary);
}

.post-card-excerpt {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 16px;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--color-border);
}

.post-read-more {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: gap .2s;
}

.post-read-more:hover {
  gap: 8px;
  color: var(--color-accent);
}

.post-download-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================
   SINGLE POST / PAGE
   ============================================ */
.content-area {
  padding: 50px 0 70px;
}

.content-inner {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}

/* Main Article */
.post-article {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-featured-image {
  aspect-ratio: 16/6;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-content-wrap {
  padding: 36px 40px;
}

.post-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.post-breadcrumb a { color: var(--color-primary); }
.post-breadcrumb .sep { color: var(--color-border); }

.post-header-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.entry-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 24px;
  color: var(--color-text);
}

/* Post Content Styles */
.entry-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--color-text);
}

.entry-content h2 {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 32px 0 14px;
  color: var(--color-primary-dark);
  padding-right: 14px;
  border-right: 4px solid var(--color-accent);
}

.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--color-text);
}

.entry-content p { margin-bottom: 18px; }

/* Responsive table wrapper — auto-injected via JS */
.table-responsive-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.entry-content table {
  width: 100%;
  min-width: 420px;   /* force scroll on small screens */
  border-collapse: collapse;
  margin: 0;
  border-radius: 0;
  overflow: visible;
  box-shadow: none;
  border: none;
}

.entry-content table th {
  background: var(--color-primary);
  color: #fff;
  padding: 12px 14px;
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
  font-size: 0.9rem;
}

.entry-content table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--color-border);
  text-align: right;
  font-size: 0.9rem;
  white-space: nowrap;
}

.entry-content table td a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  transition: all .2s;
  font-size: 0.85rem;
}

.entry-content table td a:hover {
  background: var(--color-primary);
  color: #fff;
}

.entry-content table tr:nth-child(even) td {
  background: var(--color-surface-2);
}

.entry-content table tr:nth-child(even) td a {
  background: #fff;
}

.entry-content table tr:last-child td {
  border-bottom: none;
}

/* Scroll hint shadow on right side */
.table-responsive-wrap::after {
  content: '';
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 30px;
  background: linear-gradient(to left, rgba(255,255,255,0.8), transparent);
  pointer-events: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  opacity: 0;
  transition: opacity .2s;
}

.table-responsive-wrap.has-scroll::after {
  opacity: 1;
}

/* Download Buttons */
.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  border: none;
  text-decoration: none;
}

.download-btn-primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  box-shadow: 0 4px 12px rgba(26,82,118,0.3);
}

.download-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26,82,118,0.4);
  color: #fff;
}

.download-btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.download-btn-outline:hover {
  background: var(--color-primary);
  color: #fff;
}

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: sticky;
  top: 90px;
}

.widget {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  border: 1.5px solid var(--color-border);
}

.widget-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--color-text);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-title::before {
  content: '';
  display: block;
  width: 4px;
  height: 18px;
  background: var(--color-accent);
  border-radius: 2px;
  flex-shrink: 0;
}

/* Categories Widget */
.category-list { display: flex; flex-direction: column; gap: 4px; }

.category-item a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 0.875rem;
  transition: all .2s;
}

.category-item a:hover {
  background: var(--color-surface-2);
  color: var(--color-primary);
}

.cat-count {
  background: var(--color-bg);
  color: var(--color-text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-xl);
}

/* Recent Posts Widget */
.recent-post-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--color-border);
}

.recent-post-item:last-child { border-bottom: none; }

.recent-post-thumb {
  width: 60px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-bg);
}

.recent-post-info { flex: 1; }

.recent-post-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 4px;
  line-height: 1.4;
}

.recent-post-title a { color: inherit; }
.recent-post-title a:hover { color: var(--color-primary); }

.recent-post-date {
  font-size: 0.72rem;
  color: var(--color-text-light);
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--color-primary-dark);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 50px;
}

.footer-brand .logo-text .name { color: #fff; }
.footer-brand .logo-text .tagline { color: rgba(255,255,255,0.5); }

.footer-about {
  font-size: 0.875rem;
  line-height: 1.8;
  color: rgba(255,255,255,0.6);
  margin-top: 16px;
}

.footer-heading {
  font-size: 1rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid rgba(255,255,255,0.1);
}

.footer-links { display: flex; flex-direction: column; gap: 8px; }

.footer-links a {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.6);
  transition: color .2s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a:hover { color: var(--color-accent-light); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.4);
  flex-wrap: wrap;
  gap: 10px;
}

/* ============================================
   PAGINATION
   ============================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 40px 0 20px;
  flex-wrap: wrap;
}

.page-numbers {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  transition: all .2s;
  text-decoration: none;
}

.page-numbers.current,
.page-numbers:hover {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

/* ============================================
   SEARCH RESULTS PAGE
   ============================================ */
.search-header {
  background: var(--color-surface);
  padding: 30px 0;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 40px;
}

.search-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-text);
}

.search-title span {
  color: var(--color-primary);
}

/* ============================================
   404 PAGE
   ============================================ */
.error-404 {
  text-align: center;
  padding: 80px 20px;
}

.error-404 .error-number {
  font-size: 8rem;
  font-weight: 900;
  color: var(--color-border);
  line-height: 1;
  margin-bottom: 20px;
}

.error-404 h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 14px;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center { text-align: center; }
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.hidden { display: none !important; }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  color: #fff;
  padding: 12px 28px;
  border-radius: var(--radius-lg);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all .2s;
  text-decoration: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(26,82,118,0.35);
  color: #fff;
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.animate-fadeInUp { animation: fadeInUp 0.55s ease both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .content-inner { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 768px) {
  .header-search { display: none; }
  .main-nav { display: none; position: absolute; top: 70px; right: 0; left: 0; background: var(--color-surface); flex-direction: column; padding: 20px; box-shadow: var(--shadow-md); border-bottom: 3px solid var(--color-primary); }
  .main-nav.open { display: flex; }
  .menu-toggle { display: flex; }
  .hero-section { padding: 50px 0 70px; }
  .hero-title { font-size: 1.8rem; }
  .hero-stats { gap: 24px; }
  .levels-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .post-content-wrap { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .levels-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-filter-chip { font-size: 0.75rem; }
  .hero-stats { gap: 16px; }
  .hero-stat .stat-number { font-size: 1.4rem; }
}
