/* ===========================
   Google Fonts + Variables
   =========================== */
@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');

:root {
  --bg-primary: #080c18;
  --bg-secondary: #0d1226;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --accent-primary: #7c6dfa;
  --accent-secondary: #b0a4ff;
  --accent-glow: rgba(124, 109, 250, 0.4);
  --text-primary: #eef2ff;
  --text-secondary: #8896b3;
  --text-muted: #4a5270;
  --border-color: rgba(255, 255, 255, 0.07);
  --border-accent: rgba(124, 109, 250, 0.45);
  --gradient-accent: linear-gradient(135deg, #7c6dfa, #b0a4ff);
  --gradient-card: linear-gradient(145deg, rgba(124,109,250,0.07), rgba(176,164,255,0.02));
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(124, 109, 250, 0.2);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Cairo', 'Tajawal', sans-serif;

  /* Fluid spacing tokens */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2rem;
  --space-xl:  3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  /* Nav height */
  --nav-h: 70px;
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
  font-size: 16px; /* base for rem */
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  min-height: 100vh;
}

img, video, iframe, svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Background glow */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%, rgba(124,109,250,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 85%, rgba(176,164,255,0.08) 0%, transparent 55%);
  pointer-events: none;
  z-index: 0;
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-primary); border-radius: 3px; }

/* ========== HEADER ========== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  background: rgba(8, 12, 24, 0.88);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-direction: row-reverse;
  height: var(--nav-h);
  position: relative;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
  z-index: 110;
}

.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: 0 0 20px rgba(124,109,250,0.55);
  transition: var(--transition);
  flex-shrink: 0;
}

.nav-logo:hover .logo-icon {
  transform: rotate(-6deg) scale(1.1);
  box-shadow: 0 0 30px rgba(124,109,250,0.75);
}

.logo-text {
  font-size: clamp(1.05rem, 3vw, 1.3rem);
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

/* ===== NAV LINKS (Desktop) ===== */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.48rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
}

.nav-cta {
  background: var(--gradient-accent) !important;
  color: #fff !important;
  border-radius: 50px !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 16px var(--accent-glow);
  padding: 0.5rem 1.3rem !important;
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 26px var(--accent-glow) !important;
}

/* ===== HAMBURGER BUTTON ===== */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 110;
  border-radius: 8px;
  transition: var(--transition);
}

.menu-toggle:hover {
  background: var(--bg-card-hover);
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition);
  transform-origin: center;
}

/* Hamburger → X animation */
.menu-toggle.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.menu-toggle.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ========== HERO ========== */
.hero {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 5vw, 2rem) clamp(2.5rem, 6vw, 4.5rem);
  text-align: center;
  max-width: 860px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(124,109,250,0.12);
  border: 1px solid var(--border-accent);
  color: var(--accent-secondary);
  font-size: clamp(0.72rem, 2vw, 0.82rem);
  font-weight: 700;
  padding: 0.38rem 1rem;
  border-radius: 50px;
  margin-bottom: 1.5rem;
  animation: fadeInDown 0.6s ease;
}

.hero-title {
  font-size: clamp(1.9rem, 5.5vw, 3.8rem);
  font-weight: 900;
  line-height: 1.18;
  margin-bottom: 1.2rem;
  animation: fadeInUp 0.65s ease 0.1s both;
}

.hero-title .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: clamp(0.95rem, 2.5vw, 1.1rem);
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2.5rem;
  animation: fadeInUp 0.65s ease 0.2s both;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.65s ease 0.3s both;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.78rem 1.8rem;
  border-radius: 50px;
  font-family: var(--font);
  font-size: clamp(0.85rem, 2vw, 0.93rem);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  border: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-accent);
  color: #fff;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

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

.btn-outline:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  transform: translateY(-2px);
}

/* ========== STATS ========== */
.stats-bar {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.6rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.stat-number {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  font-weight: 800;
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ========== MAIN CONTENT ========== */
.main-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) clamp(3rem, 8vw, 5rem);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-title {
  font-size: clamp(1.3rem, 3.5vw, 1.75rem);
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.title-icon {
  width: 34px;
  height: 34px;
  background: var(--gradient-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  flex-shrink: 0;
}

.section-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(to left, var(--border-color), transparent);
  margin: 0 1.5rem;
  min-width: 0;
}

/* ========== FILTER TABS ========== */
.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}

.tab-btn {
  padding: 0.42rem 1rem;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font);
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tab-btn:hover {
  border-color: var(--border-accent);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--gradient-accent);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}

/* ========== FEATURED ARTICLE ========== */
.featured-article {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 0;
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 3rem;
  transition: var(--transition);
  position: relative;
}

.featured-article:hover {
  border-color: var(--border-accent);
  box-shadow: var(--shadow-glow);
  transform: translateY(-5px);
}

.featured-image {
  background: linear-gradient(135deg, #12103a, #0c1128);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 5.5rem;
  min-height: 280px;
  position: relative;
  overflow: hidden;
}

.featured-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(124,109,250,0.22), transparent 70%);
}

.featured-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, transparent, rgba(13,18,38,0.5));
}

.featured-content {
  padding: clamp(1.5rem, 4vw, 2.8rem) clamp(1.2rem, 3vw, 2.5rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: rgba(124,109,250,0.15);
  color: var(--accent-secondary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.28rem 0.8rem;
  border-radius: 50px;
  margin-bottom: 1rem;
  width: fit-content;
}

.featured-content h2 {
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  font-weight: 800;
  line-height: 1.35;
  margin-bottom: 0.8rem;
  color: var(--text-primary);
}

.featured-content .card-excerpt {
  font-size: clamp(0.85rem, 2vw, 0.92rem);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.featured-meta {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

/* ========== ARTICLES GRID ========== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(330px, 100%), 1fr));
  gap: 1.8rem;
}

/* ========== ARTICLE CARD ========== */
.article-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  animation: fadeInUp 0.55s ease both;
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0; right: 0; left: 0;
  height: 2px;
  background: var(--gradient-accent);
  opacity: 0;
  transition: var(--transition);
}

.article-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-accent);
  box-shadow: var(--shadow-card), 0 0 28px rgba(124,109,250,0.14);
  transform: translateY(-6px);
}

.article-card:hover::before { opacity: 1; }

.article-card:nth-child(1) { animation-delay: 0.05s; }
.article-card:nth-child(2) { animation-delay: 0.10s; }
.article-card:nth-child(3) { animation-delay: 0.15s; }
.article-card:nth-child(4) { animation-delay: 0.20s; }
.article-card:nth-child(5) { animation-delay: 0.25s; }
.article-card:nth-child(6) { animation-delay: 0.30s; }

.card-image {
  height: clamp(140px, 20vw, 185px);
  background: linear-gradient(135deg, #12103a, #0c1128);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3.5rem;
  position: relative;
  overflow: hidden;
}

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

.card-image .img-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(124,109,250,0.18), transparent 70%);
}

.card-body {
  padding: clamp(1rem, 3vw, 1.5rem);
  flex: 1;
  display: flex;
  flex-direction: column;
  text-align: center;
  align-items: center;
}

.card-category {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-secondary);
  margin-bottom: 0.65rem;
}

.card-title {
  font-size: clamp(1rem, 2.5vw, 1.12rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.65rem;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: var(--transition);
}

.article-card:hover .card-title { color: var(--accent-secondary); }

.card-excerpt {
  font-size: clamp(0.82rem, 2vw, 0.88rem);
  color: var(--text-secondary);
  line-height: 1.65;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 0.9rem clamp(1rem, 3vw, 1.5rem);
  border-top: 1px solid var(--border-color);
  gap: 0.8rem;
}

.card-author {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.author-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gradient-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.author-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* ========== NEWSLETTER ========== */
.newsletter-section {
  position: relative;
  z-index: 1;
  padding: clamp(3rem, 8vw, 6rem) clamp(1rem, 4vw, 2rem);
  overflow: hidden;
}

.newsletter-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 100% 80% at 50% 50%, rgba(124,109,250,0.11) 0%, transparent 65%);
  pointer-events: none;
}

.newsletter-border {
  position: absolute;
  inset: 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  pointer-events: none;
}

.newsletter-container {
  max-width: 660px;
  margin: 0 auto;
  text-align: center;
  position: relative;
}

.newsletter-icon {
  width: 72px;
  height: 72px;
  background: var(--gradient-accent);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1.6rem;
  box-shadow: 0 0 40px rgba(124,109,250,0.45);
  animation: float 3s ease-in-out infinite;
}

.newsletter-title {
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  font-weight: 900;
  margin-bottom: 0.8rem;
  line-height: 1.2;
}

.newsletter-title .highlight {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.newsletter-subtitle {
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto 2.5rem;
}

.newsletter-form {
  display: flex;
  gap: 0.75rem;
  max-width: 510px;
  margin: 0 auto 1.2rem;
  flex-wrap: wrap;
}

.newsletter-input-wrap {
  flex: 1;
  position: relative;
  min-width: 200px;
}

.input-icon {
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
  pointer-events: none;
  transition: var(--transition);
}

.newsletter-input {
  width: 100%;
  padding: 0.9rem 2.8rem 0.9rem 1.2rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.93rem;
  outline: none;
  transition: var(--transition);
  text-align: right;
}

.newsletter-input::placeholder { color: var(--text-muted); opacity: 0.6; font-weight: 300; }

.newsletter-input:focus {
  border-color: var(--accent-primary);
  background: rgba(124,109,250,0.08);
  box-shadow: 0 0 0 3px rgba(124,109,250,0.16);
}

.newsletter-input:focus ~ .input-icon { color: var(--accent-secondary); }

.newsletter-btn {
  padding: 0.9rem 2rem;
  background: var(--gradient-accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: var(--font);
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  box-shadow: 0 4px 20px var(--accent-glow);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.newsletter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.newsletter-btn:active { transform: translateY(0); }

.newsletter-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.newsletter-success {
  display: none;
  background: rgba(124,109,250,0.1);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.5rem;
  color: var(--accent-secondary);
  font-weight: 600;
  animation: fadeInUp 0.4s ease;
  margin-top: 1rem;
}

.newsletter-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trust-icon { color: var(--accent-secondary); }

/* ========== FOOTER ========== */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-color);
  padding: clamp(2rem, 6vw, 4rem) clamp(1rem, 4vw, 2rem) clamp(1rem, 4vw, 2rem);
  text-align: center !important;
}

.site-footer .footer-col[style*="text-align: right"],
.site-footer .footer-col[style*="text-align:right"] {
  text-align: center !important;
}

.site-footer .newsletter-form {
  justify-content: center;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-bottom: 2rem;
}

/* Footer newsletter form flex fix */
.footer-grid .newsletter-form {
  flex-wrap: wrap;
}

.brand-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 1rem;
  line-height: 1.7;
  max-width: 270px;
  margin: 1rem auto 0;
}

.footer-social {
  display: flex;
  gap: 0.6rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.social-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.social-btn:hover {
  border-color: var(--border-accent);
  color: var(--accent-secondary);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}

.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.55rem;
}

.footer-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.86rem;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-secondary);
  transform: translateX(-4px);
  display: inline-block;
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-copyright { font-size: 0.83rem; color: var(--text-muted); }

.footer-bottom-links { display: flex; gap: 1.5rem; flex-wrap: wrap; }

.footer-bottom-links a {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}

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

/* ========== SEARCH BAR ========== */
.search-container {
  position: relative;
  max-width: 600px;
  width: 100%;
  margin: 0 0 2rem;
}

.search-input {
  width: 100%;
  padding: 0.9rem 3.2rem 0.9rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 50px;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: clamp(0.88rem, 2vw, 0.95rem);
  outline: none;
  transition: var(--transition);
}

.search-input::placeholder { color: var(--text-muted); }

.search-input:focus {
  background: rgba(124, 109, 250, 0.05);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(124, 109, 250, 0.16);
}

.search-icon {
  position: absolute;
  right: 1.4rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* ========== CONTACT FORM ========== */
.contact-form-container {
  width: 100%;
  max-width: 600px;
  background: var(--bg-card);
  padding: clamp(1.5rem, 5vw, 3rem);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.contact-title {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.contact-subtitle {
  font-size: clamp(0.9rem, 2vw, 1rem);
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
  text-align: center;
  line-height: 1.6;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-group label {
  font-size: 0.95rem;
  color: var(--text-primary);
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.9rem 1.2rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s, background 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(255, 255, 255, 0.06);
}

.contact-submit-btn {
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
}

/* ========== ARTICLE PAGE (single) ========== */
.single-article-container {
  max-width: 800px;
  margin: 0 auto;
  margin-top: calc(var(--nav-h) + 2rem);
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  padding-bottom: 4rem;
}

.article-header {
  margin-bottom: 2rem;
  text-align: center;
}

.article-header h1 {
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  line-height: 1.3;
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.article-content {
  line-height: 1.9;
  font-size: clamp(1rem, 2.5vw, 1.1rem);
  color: var(--text-primary);
}

.article-content p { margin-bottom: 1.2rem; }

.article-content h1,
.article-content h2,
.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.article-content h1 { font-size: clamp(1.5rem, 4vw, 2rem); }
.article-content h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); }
.article-content h3 { font-size: clamp(1.1rem, 2.5vw, 1.3rem); }

.article-content ul,
.article-content ol {
  margin: 0.75rem 1.5rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  margin: 1.5rem 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
}

.back-btn:hover { color: var(--accent-primary); }

/* ========== SKELETON LOADING ========== */
.skeleton {
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.04) 25%,
    rgba(255,255,255,0.08) 50%,
    rgba(255,255,255,0.04) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  border-radius: 4px;
}

/* ========== ANIMATIONS ========== */
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-9px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}

/* ============================================================
   RESPONSIVE — TABLET  (≤ 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-grid > .footer-brand {
    grid-column: span 2;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — SMALL TABLET / LARGE MOBILE  (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  .featured-article {
    grid-template-columns: 1fr;
  }

  .featured-image {
    min-height: 220px;
    font-size: 4rem;
  }

  .featured-content {
    padding: 1.5rem;
  }

  .articles-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr));
  }
}

/* ============================================================
   RESPONSIVE — MOBILE  (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* --- Nav Layout --- */
  /* row-reverse is now applied globally to .nav-container */

  /* --- Hamburger Menu --- */
  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    height: calc(100vh - var(--nav-h));
    background: rgba(8, 12, 24, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    padding: 2rem;
    z-index: 99;
    border-top: 1px solid var(--border-color);
    overflow-y: auto;
  }

  .nav-links.open {
    display: flex;
    animation: fadeInDown 0.3s ease;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-align: center;
  }

  .nav-links .nav-cta {
    display: inline-flex !important;
    justify-content: center;
    width: auto !important;
    margin-top: 0.5rem;
    padding: 0.75rem 2rem !important;
    font-size: 1rem !important;
  }

  /* --- Hero --- */
  .hero {
    padding: 3rem 1rem 2.5rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  /* --- Stats --- */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* --- Articles --- */
  .articles-grid {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  /* --- Newsletter --- */
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-input-wrap {
    min-width: unset;
  }

  .newsletter-btn {
    width: 100%;
    justify-content: center;
  }

  .newsletter-trust {
    gap: 1rem;
  }

  /* --- Footer --- */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-grid > .footer-brand {
    grid-column: span 1;
  }

  .footer-grid .footer-col[style*="span 2"],
  .footer-grid .footer-col {
    grid-column: span 1 !important;
    text-align: right !important;
  }

  .footer-grid .newsletter-form {
    flex-direction: column;
    gap: 0.6rem;
  }

  .footer-grid .newsletter-form input {
    flex: unset;
    width: 100%;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
  }

  /* --- Section header --- */
  .section-header {
    flex-wrap: wrap;
  }

  /* --- Search --- */
  .search-container {
    max-width: 100%;
  }

  /* --- Single article --- */
  .single-article-container {
    margin-top: calc(var(--nav-h) + 1rem);
    padding: 0 1rem 3rem;
  }
}

/* ============================================================
   RESPONSIVE — SMALL MOBILE  (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --nav-h: 62px;
  }

  .nav-container {
    padding: 0 0.9rem;
  }

  .logo-text {
    font-size: 1rem;
  }

  .logo-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .main-content {
    padding: 0 0.9rem 2.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-line {
    display: none;
  }

  .hero-badge {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
  }

  .btn {
    padding: 0.7rem 1.4rem;
    font-size: 0.85rem;
  }

  .card-footer {
    flex-direction: column;
    align-items: center;
  }

  .featured-image {
    min-height: 170px;
    font-size: 3rem;
  }

  .stat-card {
    padding: 1.2rem;
  }

  .contact-form-container {
    padding: 1.2rem;
    border-radius: 14px;
  }

  .newsletter-section {
    padding: 2.5rem 0.9rem;
  }

  .newsletter-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
  }

  .footer-social {
    justify-content: flex-start;
  }

  .single-article-container {
    padding: 0 0.75rem 2.5rem;
  }

  /* Inline footer newsletter on tiny screens */
  .footer-grid .newsletter-form {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

/* ============================================================
   RESPONSIVE — VERY SMALL MOBILE  (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .logo-text {
    display: none; /* Keep only icon on very small screens */
  }

  .articles-grid {
    gap: 1rem;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
}

/* ========== PRINT STYLES ========== */
@media print {
  .site-header,
  .menu-toggle,
  .newsletter-section,
  .site-footer { display: none !important; }

  body { background: #fff; color: #000; }

  .main-content, .single-article-container {
    max-width: 100%;
    padding: 0;
  }
}

/* ============================================================
   RESPONSIVE ADDITIONS — تجاوب إضافي بدون تغيير التصميم
   تُضاف هذه الأنماط فقط في نهاية الملف
   ============================================================ */

/* --- (≤ 768px) الجوال --- */
@media (max-width: 768px) {

  /* الصور والحاويات لا تتجاوز حدود الشاشة */
  img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
  }

  /* أي حاوية ذات عرض ثابت تصبح مرنة */
  .footer-grid,
  .stats-grid,
  .articles-grid,
  .newsletter-form,
  .hero-actions,
  .filter-tabs,
  .featured-meta,
  .card-footer,
  .nav-links,
  .footer-bottom,
  .newsletter-trust {
    flex-wrap: wrap;
  }

  /* تحويل الـ footer-grid من شبكة إلى عمود */
  .footer-grid {
    display: flex;
    flex-direction: column-reverse;
    gap: 2rem;
  }

  /* تحويل الـ stats-grid إلى عمود */
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* تحويل شبكة المقالات إلى عمود واحد */
  .articles-grid {
    grid-template-columns: 1fr;
  }

  /* تحويل المقال المميز إلى عمود واحد */
  .featured-article {
    grid-template-columns: 1fr;
  }

  /* نموذج النشرة البريدية يصطف عمودياً */
  .newsletter-form {
    flex-direction: column;
    align-items: stretch;
  }

  .newsletter-btn {
    width: 100%;
    justify-content: center;
  }

  .newsletter-input-wrap {
    min-width: unset;
    width: 100%;
  }

  /* أزرار الـ hero تصطف عمودياً */
  .hero-actions {
    flex-direction: column;
    align-items: center;
  }



  /* الـ footer-bottom يصطف عمودياً */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  /* تقليل حشوة قسم المحتوى الرئيسي */
  .main-content {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  /* ضمان عدم خروج أي عنصر عن حدود الشاشة */
  * {
    max-width: 100%;
    word-break: break-word;
  }

  /* استثناء العناصر المحتاجة لأبعاد محددة */
  .logo-icon,
  .author-avatar,
  .title-icon,
  .newsletter-icon,
  .social-btn {
    max-width: unset;
  }
}

/* --- (≤ 480px) الجوال الصغير --- */
@media (max-width: 480px) {

  .nav-container {
    padding: 0 1rem;
  }

  .hero {
    padding: 3rem 1rem 2.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .section-line {
    display: none;
  }

  .contact-form-container {
    padding: 1.5rem 1rem;
  }

  /* نموذج النشرة في الـ footer يصطف عمودياً */
  .site-footer .newsletter-form {
    flex-direction: column;
  }

  .site-footer .newsletter-form input {
    width: 100%;
  }

  .site-footer .newsletter-form button {
    width: 100%;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* ===== توسيط النشرة البريدية في الفوتر على الجوال ===== */
@media (max-width: 768px) {
  .footer-grid .footer-col[style*="text-align: right"],
  .footer-grid .footer-col[style*="text-align:right"] {
    text-align: center !important;
  }

  .footer-grid .footer-col[style*="text-align"] .newsletter-form {
    align-items: center;
    justify-content: center;
  }

  .footer-grid .footer-col[style*="text-align"] .newsletter-form input {
    width: 100%;
  }

  .footer-grid .footer-col[style*="text-align"] .newsletter-form button {
    width: 100%;
    text-align: center !important;
    justify-content: center !important;
  }
}

