/* ============================================================
   Arabic Tech Blog — Vercel Dark Design System
   ============================================================
   التصميم: داكن أولاً | زوايا 4px | أسطح مسطحة | بنفسجي مميز
   ============================================================ */

/* ----- Reset & Base ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: 'Cairo', 'Tahoma', sans-serif;
  color: #ffffff;
  background: #0a0a0f;
  line-height: 1.9;
  overflow-x: hidden;
  direction: rtl;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ----- Design Tokens ----- */
:root {
  --bg: #0a0a0f;
  --surface: #12121a;
  --elevated: #1a1a2e;
  --accent: #7c5cfc;
  --accent-dark: #6a4ce0;
  --accent-light: #a78bfa;
  --text: #ffffff;
  --text-muted: #7878a0;
  --border: #1a1a2e;
  --radius: 4px;
  --radius-pill: 50px;
  --ease-standard: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-hover: 300ms;
  --duration-enter: 600ms;
  --navbar-height: 64px;
  --container-max: 1200px;
  --content-max: 720px;
}

::selection { background: rgba(124, 92, 252, 0.3); color: #fff; }

/* ----- Utility ----- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.container-narrow {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-header h2 {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 800;
  margin-bottom: 0.5rem;
  text-wrap: balance;
}

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

.accent { color: var(--accent); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

/* ----- Typography Hierarchy ----- */
h1, h2, h3 { text-wrap: balance; }

/* ----- Navbar ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--navbar-height);
  display: flex;
  align-items: center;
  transition: background var(--duration-hover) var(--ease-standard),
              backdrop-filter var(--duration-hover) var(--ease-standard);
  direction: ltr;
}

.navbar.scrolled {
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  direction: rtl;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand .logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color var(--duration-hover) var(--ease-standard);
  position: relative;
}

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

.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 1px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 4px;
  background: none;
  border: none;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
  transition: transform var(--duration-hover) var(--ease-standard),
              opacity var(--duration-hover) var(--ease-standard);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  height: 100vh;
  background: var(--surface);
  padding: 80px 2rem 2rem;
  z-index: 99;
  transition: right var(--duration-hover) var(--ease-standard);
  overflow-y: auto;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu a {
  display: block;
  padding: 0.75rem 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  transition: color var(--duration-hover) var(--ease-standard);
}

.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--accent);
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 98;
}

.mobile-overlay.show {
  display: block;
}

/* ----- Buttons ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-standard),
              transform var(--duration-hover) var(--ease-standard),
              border-color var(--duration-hover) var(--ease-standard);
  text-wrap: nowrap;
}

.btn:hover { transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-dark);
}

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

.btn-outline:hover {
  background: var(--surface);
  border-color: var(--accent);
}

.btn-sm {
  padding: 8px 20px;
  font-size: 0.9rem;
}

.btn-full {
  width: 100%;
}

/* ----- Hero ----- */
.hero {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 7rem 1.5rem 5rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 50% 50%, rgba(124, 92, 252, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.hero-content {
  max-width: 750px;
  position: relative;
  z-index: 1;
}

.hero-label {
  display: inline-block;
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent-light);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  letter-spacing: -0.03em;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 2.5rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* ----- Hero Search ----- */
.hero-search {
  display: flex;
  max-width: 480px;
  margin: 0 auto;
  gap: 0;
}

.hero-search input {
  flex: 1;
  background: var(--surface);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  outline: none;
  transition: border-color var(--duration-hover) var(--ease-standard);
}

.hero-search input:focus {
  border-color: var(--accent);
}

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

.hero-search button {
  background: var(--accent);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-standard);
  text-wrap: nowrap;
}

.hero-search button:hover {
  background: var(--accent-dark);
}

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

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

/* Featured Grid (asymmetric) */
.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.featured-main {
  grid-row: span 2;
}

.featured-side {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ----- Post Card ----- */
.post-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: transform var(--duration-hover) var(--ease-standard),
              background var(--duration-hover) var(--ease-standard);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  background: var(--elevated);
}

.post-card.featured {
  background: var(--elevated);
  padding: 2rem;
}

.post-card.featured:hover {
  background: #20203a;
}

.post-card-category {
  display: inline-block;
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
  align-self: flex-start;
}

.post-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.5rem;
  color: var(--text);
}

.featured .post-card-title {
  font-size: 1.35rem;
}

.post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 1rem;
  flex: 1;
}

.post-card-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.post-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ----- Blog Listing ----- */
.blog-hero {
  padding: 8rem 1.5rem 3rem;
  text-align: center;
}

.blog-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.blog-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Search Bar */
.search-bar {
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
}

.search-bar input {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  padding: 14px 20px 14px 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--duration-hover) var(--ease-standard),
              background var(--duration-hover) var(--ease-standard);
}

.search-bar input:focus {
  border-color: var(--accent);
  background: var(--elevated);
}

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

.search-bar .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Filter Pills */
.filter-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 2.5rem;
}

.filter-pill {
  background: transparent;
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--duration-hover) var(--ease-standard);
}

.filter-pill:hover {
  border-color: var(--accent);
  color: var(--text);
}

.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
}

.pagination button {
  background: var(--surface);
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 10px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--duration-hover) var(--ease-standard);
  min-width: 40px;
}

.pagination button:hover {
  border-color: var(--accent);
  color: var(--text);
}

.pagination button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.pagination button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--text-muted);
}

.empty-state svg {
  margin-bottom: 1rem;
  opacity: 0.4;
}

.empty-state h3 {
  font-size: 1.25rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* ----- Single Post ----- */
.post-header {
  padding: 8rem 1.5rem 2rem;
  text-align: center;
}

.post-header .post-category {
  display: inline-block;
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent-light);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 1.5rem;
}

.post-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 1rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.post-header .post-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.post-header .post-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Progress Bar */
.progress-bar {
  position: fixed;
  top: var(--navbar-height);
  left: 0;
  width: 0%;
  height: 3px;
  background: var(--accent);
  z-index: 99;
  transition: width 0.1s linear;
}

/* Post Content */
.post-content {
  padding-bottom: 4rem;
}

.post-content h2 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 2.5rem 0 1rem;
  color: var(--text);
  line-height: 1.4;
}

.post-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  color: var(--text);
  line-height: 1.4;
}

.post-content p {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 1.25rem;
  max-width: 70ch;
}

.post-content a {
  color: var(--accent-light);
  border-bottom: 1px solid rgba(167, 139, 250, 0.2);
  transition: border-color var(--duration-hover) var(--ease-standard);
}

.post-content a:hover {
  border-bottom-color: var(--accent-light);
}

.post-content ul,
.post-content ol {
  margin: 1rem 0 1.25rem;
  padding-right: 1.5rem;
  line-height: 1.9;
}

.post-content li {
  margin-bottom: 0.5rem;
  color: var(--text);
}

.post-content ul li::marker {
  color: var(--accent);
}

.post-content blockquote {
  background: rgba(124, 92, 252, 0.05);
  border-right: 3px solid var(--accent);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 0 var(--radius) var(--radius) 0;
}

.post-content blockquote p {
  color: var(--accent-light);
  margin-bottom: 0;
  font-style: italic;
}

/* Code Blocks */
.post-content pre {
  background: #0d0d14;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  direction: ltr;
  text-align: left;
}

.post-content code {
  font-family: 'JetBrains Mono', 'Cascadia Code', 'Consolas', monospace;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #e0e0e0;
}

.post-content p code,
.post-content li code {
  background: rgba(124, 92, 252, 0.1);
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 0.85rem;
  color: var(--accent-light);
}

/* Tags */
.post-tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.post-tag {
  background: rgba(124, 92, 252, 0.1);
  color: var(--accent-light);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
}

/* Share */
.share-buttons {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  color: var(--text-muted);
  font-family: 'Cairo', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all var(--duration-hover) var(--ease-standard);
}

.share-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--elevated);
}

/* TOC */
.toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.toc-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toc-list {
  list-style: none;
  padding: 0;
}

.toc-list li {
  margin-bottom: 0.4rem;
}

.toc-list a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color var(--duration-hover) var(--ease-standard);
  display: block;
  padding: 4px 0;
}

.toc-list a:hover {
  color: var(--accent-light);
}

.toc-list .toc-h2 {
  padding-right: 0;
}

.toc-list .toc-h3 {
  padding-right: 1.25rem;
  font-size: 0.85rem;
}

/* Related Posts */
.related-posts {
  padding: 3rem 0;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.related-posts h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

/* Comments */
.comments-section {
  padding: 2rem 0;
  border-top: 1px solid var(--border);
  margin-top: 1rem;
}

.comments-section h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.comment-form textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  resize: vertical;
  min-height: 100px;
  transition: border-color var(--duration-hover) var(--ease-standard);
}

.comment-form textarea:focus {
  border-color: var(--accent);
}

.comment-form .btn {
  margin-top: 0.75rem;
}

.comment {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.5rem;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
}

.comment-author {
  font-weight: 700;
  font-size: 0.9rem;
}

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

.comment-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text);
}

/* ----- About Page ----- */
.page-hero {
  padding: 8rem 1.5rem 3rem;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.page-hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.about-content {
  padding-bottom: 4rem;
}

.about-content p {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text);
  margin-bottom: 1.25rem;
  max-width: 70ch;
}

/* Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 3rem 0;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Team */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}

.team-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: transform var(--duration-hover) var(--ease-standard);
}

.team-card:hover {
  transform: translateY(-4px);
}

.team-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  margin: 0 auto 1rem;
}

.team-name {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.team-role {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ----- Contact Page ----- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  padding-bottom: 4rem;
}

.contact-info h3 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
}

.contact-info-item {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 1rem;
  color: var(--text-muted);
}

.contact-info-item svg {
  flex-shrink: 0;
}

.contact-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: var(--text);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 1rem;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: none;
  margin-bottom: 1.25rem;
  transition: border-color var(--duration-hover) var(--ease-standard);
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* ----- Newsletter ----- */
.newsletter {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  text-align: center;
  margin: 2rem 0;
  border: 1px solid var(--border);
}

.newsletter h3 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.newsletter p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
}

.newsletter-form {
  display: flex;
  max-width: 420px;
  margin: 0 auto;
  gap: 0;
}

.newsletter-form input {
  flex: 1;
  background: var(--elevated);
  color: var(--text);
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius) var(--radius) 0;
  outline: none;
  transition: border-color var(--duration-hover) var(--ease-standard);
}

.newsletter-form input:focus {
  border-color: var(--accent);
}

.newsletter-form button {
  background: var(--accent);
  color: #fff;
  font-family: 'Cairo', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius) 0 0 var(--radius);
  cursor: pointer;
  transition: background var(--duration-hover) var(--ease-standard);
  text-wrap: nowrap;
}

.newsletter-form button:hover {
  background: var(--accent-dark);
}

/* ----- Footer ----- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: 0.75rem;
  max-width: 300px;
}

.footer h4 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text);
}

.footer-links a {
  display: block;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.35rem 0;
  transition: color var(--duration-hover) var(--ease-standard);
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  color: var(--text-muted);
  transition: color var(--duration-hover) var(--ease-standard);
}

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

/* ----- Back to Top ----- */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--duration-hover) var(--ease-standard),
              visibility var(--duration-hover) var(--ease-standard),
              transform var(--duration-hover) var(--ease-standard);
  z-index: 50;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  transform: translateY(-3px);
}

/* ----- 404 Page ----- */
.page-404 {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.page-404 h1 {
  font-size: clamp(5rem, 15vw, 10rem);
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.page-404 h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.page-404 p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 2rem;
}

.page-404 .search-bar {
  max-width: 400px;
}

/* ----- Privacy Policy ----- */
.privacy-content {
  padding-bottom: 4rem;
}

.privacy-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  margin: 2rem 0 0.75rem;
}

.privacy-content p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text);
  margin-bottom: 1rem;
}

.privacy-content ul {
  padding-right: 1.5rem;
  margin-bottom: 1rem;
}

.privacy-content li {
  margin-bottom: 0.5rem;
  color: var(--text-muted);
}

/* ----- Scroll Reveal Animation ----- */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity var(--duration-enter) var(--ease-standard),
              transform var(--duration-enter) var(--ease-standard);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ----- Reduced Motion ----- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
}

/* ----- Responsive: Tablet 992px ----- */
@media (max-width: 992px) {
  .posts-grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .featured-grid {
    grid-template-columns: 1fr;
  }

  .featured-main {
    grid-row: auto;
  }

  .featured-side {
    flex-direction: row;
  }

  .featured-side .post-card {
    flex: 1;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

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

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* ----- Responsive: Mobile 768px ----- */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: block; }

  .hero h1 {
    font-size: clamp(2rem, 7vw, 2.8rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .posts-grid-3 {
    grid-template-columns: 1fr;
  }

  .featured-side {
    flex-direction: column;
  }

  .featured-side .post-card {
    flex: none;
  }

  .section {
    padding: 3rem 0;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .footer-brand p {
    margin-left: auto;
    margin-right: auto;
  }

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

  .newsletter-form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .newsletter-form input {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
  }

  .newsletter-form button {
    border-radius: var(--radius) !important;
  }

  .hero-search {
    flex-direction: column;
    gap: 0.75rem;
  }

  .hero-search input {
    border-radius: var(--radius) !important;
    border: 1px solid var(--border) !important;
  }

  .hero-search button {
    border-radius: var(--radius) !important;
  }

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

  .pagination {
    flex-wrap: wrap;
  }
}

/* ----- Responsive: Small Mobile 480px ----- */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }

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

  .post-card { padding: 1.25rem; }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
  }

  .stat-card { padding: 1rem; }

  .stat-number { font-size: 1.5rem; }

  .page-hero { padding: 6rem 1rem 2rem; }

  .blog-hero { padding: 6rem 1rem 2rem; }

  .post-header { padding: 6rem 1rem 2rem; }
}
