/*
Theme Name: Ibn Abi Talib Theme
Theme URI: https://ibnabitalib.com
Description: موقع دورة ابن أبي طالب - تصميم حديث وسريع
Version: 4.0
Author: Ibn Abi Talib
Text Domain: ibntheme
*/

/* ═══════════════════════════════════════════════
   FONTS & VARIABLES
═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Almarai:wght@300;400;700;800&display=swap');

:root {
  --primary:     #273c66;   /* navy — main brand color */
  --primary-dk:  #1e2f52;
  --primary-lt:  #3d5a99;
  --gold:        #c9854a;   /* warm muted amber */
  --gold-lt:     #dda06a;
  --header-bg:   #273c66;   /* ibnabitalib dark navy */
  --header-bg2:  #1e2f52;
  --body-bg:     #f4f6f8;
  --card-bg:     #ffffff;
  --text:        #333333;
  --text-muted:  #6b7280;
  --border:      #e5e7eb;
  --shadow:      0 2px 12px rgba(0,0,0,0.08);
  --shadow-hover:0 8px 32px rgba(0,0,0,0.15);
  --radius:      10px;
  --radius-sm:   6px;
  --font:        'Almarai', sans-serif;
  --transition:  0.25s ease;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input, button, select, textarea { font-family: 'Almarai', sans-serif; }

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 10px;
  margin-bottom: 24px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 2px;
  background: linear-gradient(to left, transparent, var(--border));
  opacity: 1;
}

.section-title .icon {
  width: 36px; height: 36px;
  background: var(--header-bg);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  font-size: 18px;
  flex-shrink: 0;
}

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dk); color: #fff; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #b8903f; color: #fff; }
.btn-outline { background: transparent; border-color: var(--primary); color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-green { background: rgba(39,60,102,0.12); color: var(--primary); }
.badge-gold  { background: rgba(242,101,34,0.12); color: var(--gold); }

/* ═══════════════════════════════════════════════
   HEADER
═══════════════════════════════════════════════ */
.site-header {
  background: var(--header-bg);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0;
}

.site-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-logo img {
  height: 55px;
  width: auto;
}

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

.logo-name {
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
  font-family: 'Almarai', sans-serif;
}

.logo-sub {
  color: var(--gold);
  font-size: 0.75rem;
  font-weight: 400;
}

/* ── Navigation ── */
.main-nav {
  flex: 1;
}

.nav-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  justify-content: center;
}

.nav-list li { position: relative; }

.nav-list > li > a {
  display: block;
  color: rgba(255,255,255,0.9);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-list > li > a:hover,
.nav-list > li.current-menu-item > a {
  color: var(--gold);
  background: rgba(255,255,255,0.08);
}

/* Dropdown */
.nav-list .sub-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: var(--header-bg2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  min-width: 200px;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all var(--transition);
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.nav-list li:hover .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-list .sub-menu a {
  display: block;
  color: rgba(255,255,255,0.85);
  padding: 10px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: all var(--transition);
}

.nav-list .sub-menu a:hover {
  color: var(--gold);
  padding-right: 22px;
  background: rgba(255,255,255,0.05);
}

/* Header CTA */
.header-cta .btn {
  font-size: 0.85rem;
  padding: 8px 16px;
}

/* Header social icons */
.header-social-link {
  color: rgba(255,255,255,0.6);
  font-size: 15px;
  transition: color var(--transition);
  text-decoration: none;
}
.header-social-link:hover { color: var(--gold); }

/* Mobile menu toggle */
.menu-toggle {
  display: none;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.10);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 19px;
  line-height: 1;
  flex-shrink: 0;
  padding: 0;
}
.menu-toggle:hover { background: rgba(255,255,255,0.18); }
.menu-toggle i { color: #fff; }

/* ═══════════════════════════════════════════════
   HERO / BANNER
═══════════════════════════════════════════════ */
.hero-banner {
  background:
    radial-gradient(ellipse at 85% 0%, rgba(232,158,28,0.28) 0%, transparent 52%),
    radial-gradient(ellipse at 6% 95%, rgba(28,88,188,0.22) 0%, transparent 50%),
    linear-gradient(155deg, #131c2e 0%, #1e2f52 48%, #273c66 100%);
  padding: 76px 0 68px;
  position: relative;
  overflow: hidden;
}

.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
}

.hero-banner::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.hero-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
  animation: fadeUp 0.65s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-content { color: #fff; }

.hero-emblem {
  display: block;
  width: 118px;
  height: auto;
  margin: 0 auto 20px;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.30));
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(201,164,90,0.2);
  border: 1px solid rgba(201,164,90,0.4);
  color: var(--gold-lt);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.hero-badge .dot {
  width: 8px; height: 8px;
  background: var(--gold);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.5;
  margin-bottom: 16px;
  font-family: 'Almarai', sans-serif;
  color: #fff;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: #8ba8cc;
  margin-bottom: 28px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.hero-stats {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-stat {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 20px 28px;
  text-align: center;
  color: #fff;
  min-width: 130px;
}

.hero-stat .num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--gold);
  display: block;
  line-height: 1;
}

.hero-stat .label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

/* ═══════════════════════════════════════════════
   LIVE STREAM BAR
═══════════════════════════════════════════════ */
.live-bar {
  background: #1a0505;
  border-top: 3px solid #e53e3e;
  border-bottom: 1px solid rgba(229,62,62,0.2);
  padding: 12px 0;
}

.live-bar .container {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #e53e3e;
  color: #fff;
  padding: 4px 12px;
  border-radius: 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 1px;
  flex-shrink: 0;
}

.live-badge .dot {
  width: 7px; height: 7px;
  background: #fff;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

.live-text { color: rgba(255,255,255,0.85); font-size: 0.9rem; flex: 1; }

.live-links { display: flex; gap: 10px; }

.live-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid;
  transition: all var(--transition);
}

.live-link.youtube { background: #ff0000; border-color: #ff0000; color: #fff; }
.live-link.youtube:hover { background: #cc0000; color: #fff; }
.live-link.mixlr { background: #f97316; border-color: #f97316; color: #fff; }
.live-link.mixlr:hover { background: #ea6008; color: #fff; }

/* ═══════════════════════════════════════════════
   AUDIO CARDS
═══════════════════════════════════════════════ */
.audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.audio-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.audio-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.audio-card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--header-bg), var(--header-bg2));
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.audio-card-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.audio-card-thumb .play-btn {
  position: absolute;
  width: 52px; height: 52px;
  background: rgba(255,255,255,0.92);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--primary);
  font-size: 22px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  transition: all var(--transition);
}

.audio-card:hover .play-btn {
  background: #fff;
  transform: scale(1.1);
}

.audio-card-thumb .no-thumb {
  font-size: 48px;
  color: rgba(255,255,255,0.3);
}

.audio-card-cat {
  position: absolute;
  bottom: 10px;
  right: 10px;
}

.audio-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.audio-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.audio-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.audio-card-meta .views::before { content: '👁 '; }

/* ═══════════════════════════════════════════════
   CATEGORIES SECTION
═══════════════════════════════════════════════ */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.cat-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text);
  display: block;
}

.cat-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  color: var(--primary);
}

.cat-icon {
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  margin: 0 auto 12px;
  transition: all var(--transition);
}

.cat-card:hover .cat-icon { transform: scale(1.1); }

.cat-card:nth-child(1) .cat-icon { background: #dbeafe; }
.cat-card:nth-child(2) .cat-icon { background: #d1fae5; }
.cat-card:nth-child(3) .cat-icon { background: #fef3c7; }
.cat-card:nth-child(4) .cat-icon { background: #fce7f3; }
.cat-card:nth-child(5) .cat-icon { background: #ede9fe; }

.cat-name {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

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

/* ═══════════════════════════════════════════════
   LIBRARY SECTION
═══════════════════════════════════════════════ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 20px;
}

.book-card {
  text-align: center;
  transition: all var(--transition);
  display: block;
  color: var(--text);
}

.book-card:hover { transform: translateY(-4px); color: var(--primary); }

.book-cover {
  aspect-ratio: 3/4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 4px 4px 12px rgba(0,0,0,0.15), -2px -2px 8px rgba(0,0,0,0.05);
  background: linear-gradient(135deg, var(--header-bg), var(--header-bg2));
  margin-bottom: 10px;
  position: relative;
  transition: all var(--transition);
}

.book-cover::before {
  content: '';
  position: absolute;
  right: 0; top: 0; bottom: 0;
  width: 12px;
  background: rgba(0,0,0,0.15);
}

.book-card:hover .book-cover {
  box-shadow: 6px 6px 20px rgba(0,0,0,0.2), -3px -3px 12px rgba(0,0,0,0.08);
}

.book-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
}

.book-cover .book-icon {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  color: rgba(255,255,255,0.4);
}

.book-title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   NEWS SECTION
═══════════════════════════════════════════════ */
.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.news-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all var(--transition);
  display: flex;
  gap: 0;
}

.news-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }

.news-card-date {
  background: var(--header-bg);
  color: #fff;
  padding: 16px 14px;
  text-align: center;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 70px;
}

.news-card-date .day { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.news-card-date .month { font-size: 0.72rem; opacity: 0.85; margin-top: 2px; }

.news-card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.news-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.news-card-excerpt {
  font-size: 0.82rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ═══════════════════════════════════════════════
   STATS SECTION
═══════════════════════════════════════════════ */
.stats-section {
  background: linear-gradient(135deg, var(--header-bg2) 0%, var(--header-bg) 100%);
  padding: 60px 0;
  position: relative;
  overflow: hidden;
}

.stats-section::before {
  content: '';
  position: absolute;
  inset: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  position: relative;
  z-index: 1;
}

.stat-item {
  text-align: center;
  color: #fff;
  padding: 20px;
}

.stat-item .num {
  font-size: 3rem;
  font-weight: 800;
  color: var(--gold);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-item .label {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.75);
}

/* ═══════════════════════════════════════════════
   PAGE SECTIONS WRAPPER
═══════════════════════════════════════════════ */
.page-section {
  padding: 50px 0;
}

.page-section:nth-child(even) {
  background: #fff;
}

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

/* ═══════════════════════════════════════════════
   SINGLE POST / PAGE
═══════════════════════════════════════════════ */
.page-hero {
  background: linear-gradient(135deg, var(--header-bg), var(--header-bg2));
  padding: 50px 0 40px;
  color: #fff;
}

.page-hero h1 {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Almarai', sans-serif;
  margin-bottom: 10px;
}

.breadcrumb {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.65);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb a { color: var(--gold-lt); }
.breadcrumb .sep { opacity: 0.4; }

.content-area {
  padding: 40px 0 60px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}
/* let grid columns shrink instead of overflowing (keeps mobile sections equal width) */
.content-grid > * { min-width: 0; }

.post-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  font-size: 1.02rem;
  line-height: 1.8;
}

.post-content h2,
.post-content h3 {
  color: var(--header-bg);
  margin: 28px 0 12px;
  font-weight: 700;
}

.post-content h2 { font-size: 1.4rem; }
.post-content h3 { font-size: 1.15rem; }

.post-content p { margin-bottom: 16px; }

.post-content .wp-audio-shortcode {
  width: 100%;
  margin: 20px 0;
}

/* Audio player styling */
.audio-player-box {
  background: linear-gradient(135deg, var(--header-bg), var(--header-bg2));
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  color: #fff;
}

.audio-player-box h2 {
  color: #fff !important;
  font-size: 1.2rem;
  margin-bottom: 16px;
}

/* Sidebar */
.sidebar-widget {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.widget-title {
  background: linear-gradient(135deg, var(--header-bg), var(--header-bg2));
  color: #fff;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.widget-body { padding: 16px; }

.related-posts { list-style: none; }

.related-posts li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.related-posts li:last-child { border-bottom: none; }

.related-posts a {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
}

.related-posts a:hover { color: var(--primary); }

.related-posts .views {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ═══════════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════════ */
.site-footer {
  background: #1a2b48;
  color: rgba(255,255,255,0.75);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-about .site-logo { margin-bottom: 16px; }

.footer-about p {
  font-size: 0.88rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-social { display: flex; gap: 10px; }

.footer-social a {
  width: 36px; height: 36px;
  background: rgba(255,255,255,0.08);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.7);
  font-size: 16px;
  transition: all var(--transition);
  text-decoration: none;
}

.footer-social a:hover {
  background: var(--gold);
  color: #fff;
  transform: translateY(-2px);
}

.footer-heading {
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gold);
  display: inline-block;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: 10px; }

.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.88rem;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-links a::before {
  content: '←';
  font-size: 12px;
  opacity: 0;
  transition: all var(--transition);
}

.footer-links a:hover {
  color: var(--gold);
  padding-right: 4px;
}

.footer-links a:hover::before { opacity: 1; }

.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.45);
}

.footer-bottom a { color: var(--gold); }

/* ═══════════════════════════════════════════════
   UTILITIES & MISC
═══════════════════════════════════════════════ */
.text-center { text-align: center; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-4 { margin-bottom: 16px; }
.view-all {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
  display: flex; align-items: center; gap: 4px;
}
.view-all:hover { color: var(--gold); }

/* Scroll to top */
.scroll-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px; height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
  transition: all var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 99;
}

.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { background: var(--primary-dk); transform: translateY(-2px); }

/* ═══════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .categories-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .hero-stats { flex-direction: row; }
}

@media (max-width: 768px) {
  /* keep the top bar on a single row */
  .header-inner { flex-wrap: wrap; justify-content: space-between; gap: 10px; }
  .logo-text { display: none; }          /* title lives in the hero; free the row */
  .site-logo img { height: 40px; }
  .header-cta { gap: 8px; }

  .menu-toggle { display: flex; }

  .main-nav {
    order: 3;
    flex: 0 0 100%;     /* force the menu onto its own full-width row below the bar */
    width: 100%;
    display: none;
  }

  .main-nav.open { display: block; }

  .nav-list {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    border-top: 1px solid rgba(255,255,255,0.1);
  }

  .nav-list > li > a {
    padding: 12px 16px;
    border-radius: 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
  }

  .nav-list .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    background: var(--primary-dk);   /* distinct darker block for the sub-menu */
    border-radius: 0;
    border: none;
    border-right: 3px solid var(--gold);   /* gold accent (RTL) */
    display: none;
  }

  .nav-list li.open .sub-menu { display: block; }

  .nav-list .sub-menu a {
    padding: 11px 34px 11px 16px;          /* indented under the parent item */
    font-size: 0.85rem;
    color: rgba(255,255,255,0.7);
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .nav-list .sub-menu a:hover { color: var(--gold); background: rgba(255,255,255,0.05); }
  /* show ▾ caret on the parent so it reads as expandable */
  .nav-list .menu-item-has-children > a::after { content: ' ▾'; opacity: .7; font-size: .8em; }
  .nav-list .menu-item-has-children.open > a::after { content: ' ▴'; }

  .hero-banner { padding: 40px 0; }
  .hero-emblem { width: 92px; margin-bottom: 14px; }
  .hero-title { font-size: 1.6rem; }
  .hero-stats { flex-direction: row; gap: 12px; }
  .hero-stat .num { font-size: 1.6rem; }
  .hero-stat { padding: 14px 18px; min-width: 100px; }

  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .audio-grid { grid-template-columns: 1fr; }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: 1fr; }

  .page-section { padding: 36px 0; }
}

@media (max-width: 480px) {
  .hero-actions { flex-direction: column; }
  .hero-stats { flex-direction: column; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .books-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════
   HOMEPAGE REDESIGN — PROTOTYPE COMPONENTS
═══════════════════════════════════════════════ */

/* White outline button for hero */
.btn-outline-white {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.08);
  color: #d0dcee;
  border: 1px solid rgba(255,255,255,0.18);
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: var(--font);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
}
.btn-outline-white:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* btn-gold larger variant for hero */
.btn.btn-gold { padding: 12px 28px; font-size: 0.95rem; border-radius: 8px; }

/* ── Stats bar (white strip below hero) ── */
.stats-bar-strip {
  background: #fff;
  border-bottom: 1px solid #e4e9f2;
  box-shadow: 0 2px 10px rgba(30,47,82,0.06);
}

.stats-bar-inner { display: flex; }

.stats-bar-item {
  flex: 1;
  text-align: center;
  padding: 24px 0;
  border-left: 1px solid #e4e9f2;
}
.stats-bar-item:last-child { border-left: none; }

.stats-bar-item .num {
  font-size: 2.1rem;
  font-weight: 800;
  color: #273c66;
  line-height: 1;
  display: block;
}

.stats-bar-item .label {
  font-size: 0.82rem;
  color: #7a90b5;
  margin-top: 6px;
}

/* ── Section header alt (h2 + subtitle + amber link) ── */
.section-header-alt {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 12px;
}

.section-header-alt h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e2f52;
  margin: 0;
}

.section-sub {
  font-size: 0.82rem;
  color: #7a90b5;
  margin-top: 4px;
}

.view-all-amber {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
  transition: color var(--transition);
}
.view-all-amber:hover { text-decoration: underline; color: var(--gold-lt); }

/* ── Dawra grid cards ── */
.dawrat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.dawra-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 14px rgba(30,47,82,0.08);
  overflow: hidden;
  display: block;
  color: var(--text);
  transition: all var(--transition);
}
.dawra-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(30,47,82,0.14);
  color: var(--text);
}

.dawra-card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #182640 0%, #2a4372 100%);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dawra-card-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 18px 18px;
  z-index: 1;
}

.dawra-card-thumb::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top left, rgba(201,133,74,0.08), transparent);
  z-index: 1;
}

.dawra-card-thumb img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 3;
}

.dawra-num-watermark {
  font-size: 64px;
  font-weight: 800;
  color: rgba(255,255,255,0.07);
  position: relative;
  z-index: 2;
  direction: ltr;
  line-height: 1;
}

.dawra-num-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--gold);
  color: #fff;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.73rem;
  font-weight: 700;
  z-index: 4;
}

.dawra-year-label {
  position: absolute;
  bottom: 10px; left: 12px;
  color: rgba(255,255,255,0.6);
  font-size: 0.73rem;
  z-index: 4;
}

.dawra-card-body { padding: 16px 18px 18px; }

.dawra-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e2f52;
  margin-bottom: 10px;
  line-height: 1.4;
}

.dawra-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dawra-lec-count {
  font-size: 0.75rem;
  color: #7a90b5;
  background: #f0f3fa;
  padding: 3px 11px;
  border-radius: 20px;
}

.dawra-view-link {
  font-size: 0.82rem;
  color: var(--gold);
  font-weight: 700;
}

/* ── Lecture cards (homepage — latest lectures) ── */
.lectures-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.lec-card {
  border: 1px solid #e4e9f2;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card-bg);
  transition: all var(--transition);
}
.lec-card:hover {
  box-shadow: 0 6px 22px rgba(30,47,82,0.1);
  border-color: transparent;
}

.lec-card-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #1a2b48 0%, #2e4878 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  text-decoration: none;
}

.lec-card-thumb::before {
  content: '';
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 16px 16px;
}

.lec-play-btn {
  width: 46px; height: 46px;
  background: rgba(255,255,255,0.13);
  border: 1.5px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1;
  transition: background var(--transition);
}

.lec-play-btn span { color: #fff; font-size: 15px; margin-right: -2px; }

.lec-card:hover .lec-play-btn { background: rgba(255,255,255,0.22); }

.lec-card-body { padding: 13px 15px 15px; }

.lec-card-dawra {
  font-size: 0.72rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 5px;
  letter-spacing: 0.3px;
}

.lec-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #1e2f52;
  margin-bottom: 4px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.lec-card-title a { color: inherit; }
.lec-card-title a:hover { color: var(--primary); }

.lec-card-sheikh { font-size: 0.78rem; color: #7a90b5; margin-bottom: 11px; }

.lec-card-actions { display: flex; gap: 6px; }

.btn-listen {
  flex: 1;
  background: var(--primary);
  color: #fff;
  padding: 7px 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  transition: background var(--transition);
  text-decoration: none;
  display: block;
}
.btn-listen:hover { background: var(--primary-dk); color: #fff; }

.btn-download-sm {
  background: #f0f3fa;
  color: var(--primary);
  padding: 7px 11px;
  border-radius: 6px;
  font-size: 0.78rem;
  transition: background var(--transition);
  text-decoration: none;
  display: block;
  flex-shrink: 0;
}
.btn-download-sm:hover { background: #e2e8f4; color: var(--primary); }

/* ── Books grid (new card style with PDF download) ── */
.books-grid-new {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.book-card-new {
  display: block;
  color: var(--text);
  text-decoration: none;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 2px 12px rgba(30,47,82,0.07);
  overflow: hidden;
  transition: all var(--transition);
}
.book-card-new:hover { color: var(--text); }
.book-card-new:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(30,47,82,0.13);
}

.book-card-cover {
  aspect-ratio: 3 / 4;
  background: linear-gradient(150deg, #1e2f52 0%, #354f80 100%);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  overflow: hidden;
}

.book-card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  position: absolute; inset: 0;
}

.book-pdf-icon { display: flex; align-items: center; justify-content: center; position: relative; z-index: 1; }

.book-pdf-spine {
  width: 56px; height: 72px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.18);
  display: flex; align-items: flex-end; justify-content: center;
  padding-bottom: 8px;
}

.book-pdf-spine span { font-size: 9px; color: rgba(255,255,255,0.55); font-weight: 700; letter-spacing: 1px; }

.book-cat-badge {
  position: absolute; top: 10px; right: 10px;
  background: rgba(201,133,74,0.9); color: #fff;
  font-size: 0.68rem; font-weight: 700;
  padding: 3px 8px; border-radius: 20px;
  z-index: 2;
}

.book-card-body { padding: 12px 13px 14px; }

.book-card-title {
  font-size: 0.82rem; font-weight: 700; color: #1e2f52;
  margin-bottom: 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}

.book-card-author { font-size: 0.72rem; color: #7a90b5; margin-bottom: 10px; }

.btn-download-pdf {
  display: block; width: 100%;
  background: var(--primary); color: #fff;
  padding: 7px 0; border-radius: 6px;
  font-size: 0.78rem; font-weight: 700;
  text-align: center; text-decoration: none;
  transition: background var(--transition);
}
.btn-download-pdf:hover { background: var(--primary-dk); color: #fff; }

/* ── Responsive for new homepage components ── */
@media (max-width: 1024px) {
  .dawrat-grid    { grid-template-columns: repeat(2, 1fr); }
  .lectures-grid  { grid-template-columns: repeat(2, 1fr); }
  .books-grid-new { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .dawrat-grid    { grid-template-columns: 1fr; }
  .lectures-grid  { grid-template-columns: 1fr; }
  .books-grid-new { grid-template-columns: repeat(2, 1fr); }
  .stats-bar-inner { flex-wrap: wrap; }
  .stats-bar-item { flex: 1 1 33%; }
  .section-header-alt { flex-direction: column; align-items: flex-start; gap: 4px; }
}
