/*
 * docs Blog Theme - Premium Custom Styles v2.0
 * Additional styles on top of Tailwind CSS
 */

/* ========================================
   Base & Root Styles
   ======================================== */
html[dir="rtl"] {
  direction: rtl;
}

html[lang="ar"] body,
.lang-ar {
  font-family:
    "Tajawal", "Noto Sans Arabic", "Segoe UI", Tahoma, Arial, sans-serif;
}

html {
  scroll-behavior: smooth;
}

::selection {
  background-color: #06b6d4;
  color: white;
}

:focus-visible {
  outline: 2px solid #06b6d4;
  outline-offset: 2px;
  border-radius: 6px;
}

/* ========================================
   Reading Progress Bar - Glow Effect
   ======================================== */
#reading-progress {
  box-shadow:
    0 0 12px 2px rgba(6, 182, 212, 0.6),
    0 0 4px 1px rgba(37, 99, 235, 0.4);
  transition: width 0.1s linear;
}

/* ========================================
   Header - Glassmorphism Premium
   ======================================== */
#site-header {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#site-header.scrolled {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid rgba(6, 182, 212, 0.1);
  box-shadow:
    0 4px 32px rgba(6, 182, 212, 0.06),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.dark #site-header.scrolled {
  background: rgba(3, 7, 18, 0.75);
  border-bottom: 1px solid rgba(6, 182, 212, 0.1);
  box-shadow: 0 4px 32px rgba(6, 182, 212, 0.08);
}

/* ========================================
   Navigation Styles
   ======================================== */

/* Desktop Nav Links */
.nav-link {
  @apply px-4 py-2 text-sm font-medium text-gray-600 dark:text-gray-300 rounded-lg transition-all duration-200 relative;
}

.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  right: 50%;
  height: 2px;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  border-radius: 2px;
  transition:
    left 0.3s ease,
    right 0.3s ease;
}

.nav-link:hover::after,
.nav-link-active::after,
.nav-link.active::after {
  left: 8px;
  right: 8px;
}

.nav-link:hover {
  @apply text-cyan-600 dark:text-cyan-400 bg-gray-100/80 dark:bg-gray-800/80;
}

.nav-link-active,
.nav-link.active {
  @apply text-cyan-600 dark:text-cyan-400 bg-cyan-50 dark:bg-cyan-950/50;
}

/* Mobile Nav Links */
.mobile-nav-link {
  @apply flex items-center gap-3 px-4 py-3 text-base font-medium text-gray-700 dark:text-gray-300 rounded-xl transition-all duration-200;
}

.mobile-nav-link:hover {
  @apply bg-gray-100 dark:bg-gray-800 text-cyan-600 dark:text-cyan-400;
  transform: translateX(4px);
}

html[dir="rtl"] .mobile-nav-link:hover {
  transform: translateX(-4px);
}

.mobile-nav-link-active,
.mobile-nav-link.active {
  @apply bg-cyan-50 dark:bg-cyan-950/50 text-cyan-600 dark:text-cyan-400;
}

/* ========================================
   Button Styles
   ======================================== */
.btn {
  @apply inline-flex items-center justify-center gap-2 px-6 py-3 text-sm font-semibold rounded-xl transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  transition: opacity 0.2s;
}

.btn:hover::before {
  opacity: 1;
}

.btn-primary {
  @apply bg-gradient-to-br from-cyan-500 to-blue-600 text-white hover:from-cyan-600 hover:to-blue-700 focus:ring-cyan-500;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.45);
  transform: translateY(-2px);
}

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

.btn-secondary {
  @apply bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-gray-100 hover:bg-gray-200 dark:hover:bg-gray-700 focus:ring-gray-500;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-outline {
  @apply border-2 border-cyan-600 text-cyan-600 dark:text-cyan-400 dark:border-cyan-400 hover:bg-cyan-600 hover:text-white dark:hover:bg-cyan-500 dark:hover:text-white focus:ring-cyan-500;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.btn-ghost {
  @apply text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:ring-gray-500;
}

.btn-sm {
  @apply px-4 py-2 text-xs;
}

.btn-lg {
  @apply px-8 py-4 text-base;
}

/* ========================================
   Card Styles - Premium Lift Effect
   ======================================== */
.card {
  @apply bg-white dark:bg-gray-900 rounded-2xl border border-gray-200 dark:border-gray-800 overflow-hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.card:hover {
  @apply border-cyan-200/60 dark:border-cyan-800/60;
  transform: translateY(-6px);
  box-shadow:
    0 20px 60px rgba(6, 182, 212, 0.08),
    0 8px 24px rgba(0, 0, 0, 0.08),
    0 0 0 1px rgba(6, 182, 212, 0.08);
}

.dark .card:hover {
  box-shadow:
    0 20px 60px rgba(6, 182, 212, 0.12),
    0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Post Card */
.post-card {
  @apply group relative;
}

.post-card-image-wrap {
  overflow: hidden;
  position: relative;
}

.post-card-image {
  aspect-ratio: 16/10;
  width: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.post-card-overlay {
  @apply absolute inset-0 bg-gradient-to-t from-gray-900/80 via-gray-900/20 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300;
}

.post-card-title {
  @apply text-xl font-bold text-gray-900 dark:text-white leading-snug;
  transition: color 0.2s ease;
  font-weight: 500;
  text-align: center;
}

.post-card:hover .post-card-title {
  @apply text-cyan-600 dark:text-cyan-400;
}

.post-card-meta {
  @apply flex items-center gap-4 text-xs text-gray-500 dark:text-gray-500 mt-4;
}

/* Category Badge - More vibrant */
.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.12),
    rgba(37, 99, 235, 0.12)
  );
  color: #0891b2;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 9999px;
  transition: all 0.25s ease;
}

.dark .category-badge {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.15),
    rgba(37, 99, 235, 0.15)
  );
  color: #22d3ee;
  border-color: rgba(6, 182, 212, 0.2);
}

.category-badge:hover {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: white;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(6, 182, 212, 0.3);
  transform: translateY(-1px);
}

/* ========================================
   Hero Section Enhancements
   ======================================== */

/* Animated Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, #06b6d4 0%, #2563eb 50%, #7c3aed 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradientShift 4s ease infinite;
}

@keyframes gradientShift {
  0% {
    background-position: 0% center;
  }
  50% {
    background-position: 100% center;
  }
  100% {
    background-position: 0% center;
  }
}

/* Dot Grid Background */
.dot-grid-bg {
  position: relative;
}

.dot-grid-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.15) 1px,
    transparent 1px
  );
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

.dark .dot-grid-bg::before {
  background-image: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.08) 1px,
    transparent 1px
  );
}

.dot-grid-bg > * {
  position: relative;
  z-index: 1;
}

/* Floating Orbs (decorative background glow) */
.hero-orb-1 {
  position: absolute;
  top: -80px;
  right: -80px;
  width: 400px;
  height: 400px;
  background: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.12) 0%,
    transparent 70%
  );
  border-radius: 9999px;
  pointer-events: none;
  animation: floatOrb 8s ease-in-out infinite;
}

.hero-orb-2 {
  position: absolute;
  bottom: -60px;
  left: -60px;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(37, 99, 235, 0.1) 0%,
    transparent 70%
  );
  border-radius: 9999px;
  pointer-events: none;
  animation: floatOrb 10s ease-in-out infinite reverse;
}

@keyframes floatOrb {
  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }
  33% {
    transform: translate(15px, -20px) scale(1.05);
  }
  66% {
    transform: translate(-10px, 15px) scale(0.97);
  }
}

/* ========================================
   Article Content Styles - FULL Premium
   Covers: h1-h6, p, ul, ol, li, a, strong, em, mark, kbd, abbr,
           sub, sup, blockquote, pre, code, table, hr, figure,
           figcaption, details, summary, iframe, video,
           WordPress: caption, alignments, gallery
   ======================================== */
.article-content {
  color: #374151;
  font-size: 1.08rem;
  line-height: 1.85;
}

.dark .article-content {
  color: #d1d5db;
}

/* === Headings === */

.article-content h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #111827;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
  line-height: 1.25;
  scroll-margin-top: 6rem;
}

.dark .article-content h1 {
  color: #f9fafb;
}

.article-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: #111827;
  margin-top: 3rem;
  margin-bottom: 1.1rem;
  line-height: 1.3;
  scroll-margin-top: 6rem;
  position: relative;
  padding-bottom: 14px;
}

.dark .article-content h2 {
  color: #f9fafb;
}

.article-content h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: linear-gradient(90deg, #06b6d4, #2563eb);
  border-radius: 9999px;
}

html[dir="rtl"] .article-content h2::after {
  left: auto;
  right: 0;
}

.article-content h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1f2937;
  margin-top: 2.25rem;
  margin-bottom: 0.75rem;
  line-height: 1.4;
  scroll-margin-top: 6rem;
}

.dark .article-content h3 {
  color: #f3f4f6;
}

.article-content h4 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1f2937;
  margin-top: 1.75rem;
  margin-bottom: 0.6rem;
}

.dark .article-content h4 {
  color: #e5e7eb;
}

.article-content h5 {
  font-size: 1rem;
  font-weight: 600;
  color: #374151;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.dark .article-content h5 {
  color: #d1d5db;
}

.article-content h6 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin-top: 1.25rem;
  margin-bottom: 0.4rem;
}

.dark .article-content h6 {
  color: #9ca3af;
}

/* === Paragraph === */
.article-content p {
  margin-bottom: 1.6rem;
  line-height: 1.9;
}

/* Lead paragraph (first) */
.article-content > p:first-of-type {
  font-size: 1.18rem;
  line-height: 2;
  color: #1f2937;
}

.dark .article-content > p:first-of-type {
  color: #e5e7eb;
}

/* === Links === */
.article-content a {
  color: #0891b2;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(6, 182, 212, 0.4);
  transition:
    color 0.2s ease,
    text-decoration-color 0.2s ease;
}

.dark .article-content a {
  color: #22d3ee;
  text-decoration-color: rgba(34, 211, 238, 0.4);
}

.article-content a:hover {
  color: #06b6d4;
  text-decoration-color: #06b6d4;
}

/* === Strong / Bold === */
.article-content strong,
.article-content b {
  font-weight: 700;
  color: #111827;
}

.dark .article-content strong,
.dark .article-content b {
  color: #f9fafb;
}

/* === Italic === */
.article-content em,
.article-content i {
  font-style: italic;
}

/* === Mark / Highlight === */
.article-content mark {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.22),
    rgba(37, 99, 235, 0.15)
  );
  color: inherit;
  padding: 1px 5px;
  border-radius: 4px;
}

/* === Keyboard keys === */
.article-content kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-bottom: 2px solid #9ca3af;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.82em;
  color: #374151;
}

.dark .article-content kbd {
  background: #1f2937;
  border-color: #374151;
  border-bottom-color: #4b5563;
  color: #d1d5db;
}

/* === Abbreviation === */
.article-content abbr[title] {
  border-bottom: 1px dashed rgba(6, 182, 212, 0.6);
  cursor: help;
  text-decoration: none;
}

/* === Sub & Sup === */
.article-content sub,
.article-content sup {
  font-size: 0.75em;
}

/* === Unordered Lists === */
.article-content ul {
  list-style: none;
  padding-left: 1.6rem;
  margin-bottom: 1.5rem;
}

html[dir="rtl"] .article-content ul {
  padding-left: 0;
  padding-right: 1.6rem;
}

.article-content ul li {
  position: relative;
  margin-bottom: 0.5rem;
  line-height: 1.8;
}

.article-content ul li::before {
  content: "";
  position: absolute;
  left: -1.1rem;
  top: 0.65rem;
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  border-radius: 50%;
}

html[dir="rtl"] .article-content ul li::before {
  left: auto;
  right: -1.1rem;
}

/* === Ordered Lists === */
.article-content ol {
  list-style: none;
  padding-left: 1.8rem;
  margin-bottom: 1.5rem;
  counter-reset: article-counter;
}

html[dir="rtl"] .article-content ol {
  padding-left: 0;
  padding-right: 1.8rem;
}

.article-content ol li {
  position: relative;
  margin-bottom: 0.5rem;
  line-height: 1.8;
  counter-increment: article-counter;
}

.article-content ol li::before {
  content: counter(article-counter) ".";
  position: absolute;
  left: -1.7rem;
  top: 0;
  font-weight: 700;
  font-size: 0.85rem;
  color: #06b6d4;
  line-height: 1.8;
  min-width: 1.4rem;
}

html[dir="rtl"] .article-content ol li::before {
  left: auto;
  right: -1.7rem;
}

/* Nested lists */
.article-content ul ul,
.article-content ol ol,
.article-content ul ol,
.article-content ol ul {
  margin-top: 0.5rem;
  margin-bottom: 0;
}

/* === Images === */
.article-content img {
  display: block;
  width: 100%;
  border-radius: 16px;
  margin-top: 2rem;
  margin-bottom: 2rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease;
}

.article-content img:hover {
  transform: scale(1.01);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.18);
}

/* === Figure & Figcaption === */
.article-content figure {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.article-content figure img {
  margin-top: 0;
  margin-bottom: 0;
}

.article-content figcaption,
.article-content .wp-caption-text,
.article-content .wp-element-caption {
  font-size: 0.85rem;
  text-align: center;
  margin-top: 0.75rem;
  color: #6b7280;
  font-style: italic;
}

.dark .article-content figcaption,
.dark .article-content .wp-caption-text {
  color: #9ca3af;
}

/* === Premium Blockquote === */
.article-content blockquote {
  position: relative;
  margin: 2.5rem 0;
  padding: 1.5rem 1.75rem 1.5rem 4rem;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.06),
    rgba(37, 99, 235, 0.06)
  );
  border-left: 4px solid #06b6d4;
  border-radius: 0 16px 16px 0;
  overflow: visible;
}

html[dir="rtl"] .article-content blockquote {
  padding: 1.5rem 4rem 1.5rem 1.75rem;
  border-left: none;
  border-right: 4px solid #06b6d4;
  border-radius: 16px 0 0 16px;
}

.article-content blockquote::before {
  content: "\201C";
  position: absolute;
  top: -8px;
  left: 14px;
  font-size: 4.5rem;
  line-height: 1;
  font-family: Georgia, serif;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html[dir="rtl"] .article-content blockquote::before {
  left: auto;
  right: 14px;
  content: "\201D";
}

.article-content blockquote p {
  font-size: 1.1rem;
  color: #374151;
  font-style: italic;
  line-height: 1.9;
  margin-bottom: 0;
}

.dark .article-content blockquote {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.08),
    rgba(37, 99, 235, 0.08)
  );
}

.dark .article-content blockquote p {
  color: #e5e7eb;
}

/* === Horizontal Rule === */
.article-content hr {
  border: none;
  height: 1px;
  margin: 3rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(6, 182, 212, 0.5),
    rgba(37, 99, 235, 0.4),
    transparent
  );
}

/* === Code Blocks === */
.article-content pre {
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 16px;
  padding: 1.5rem;
  overflow-x: auto;
  margin: 2rem 0;
  box-shadow:
    0 8px 30px rgba(0, 0, 0, 0.25),
    0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  position: relative;
}

.article-content pre::before {
  content: "CODE";
  position: absolute;
  top: 10px;
  right: 14px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.2);
  font-family: monospace;
}

html[dir="rtl"] .article-content pre::before {
  right: auto;
  left: 14px;
}

.article-content code {
  font-family: "JetBrains Mono", "Fira Code", "Consolas", monospace;
  font-size: 0.9em;
}

/* Inline code */
.article-content p code,
.article-content li code,
.article-content td code,
.article-content h2 code,
.article-content h3 code {
  background: #f1f5f9;
  color: #db2777;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.88em;
  font-family: monospace;
}

.dark .article-content p code,
.dark .article-content li code,
.dark .article-content td code {
  background: #1e293b;
  color: #f472b6;
}

/* === Tables === */
.article-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  border-radius: 12px;
  overflow: hidden;
  display: block;
  overflow-x: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.article-content thead {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1),
    rgba(37, 99, 235, 0.1)
  );
}

.dark .article-content thead {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.18),
    rgba(37, 99, 235, 0.15)
  );
}

.article-content th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #111827;
  border-bottom: 2px solid rgba(6, 182, 212, 0.3);
  white-space: nowrap;
}

.dark .article-content th {
  color: #f9fafb;
}

html[dir="rtl"] .article-content th {
  text-align: right;
}

.article-content td {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  color: #374151;
  font-size: 0.95rem;
}

.dark .article-content td {
  border-top-color: #374151;
  color: #d1d5db;
}

html[dir="rtl"] .article-content td {
  text-align: right;
}

.article-content tbody tr:hover td {
  background: rgba(6, 182, 212, 0.03);
}

/* === Horizontal Rule === */
.article-content hr {
  border: none;
  height: 1px;
  margin: 3rem 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(6, 182, 212, 0.5),
    rgba(37, 99, 235, 0.4),
    transparent
  );
}

/* === Details / Summary (Accordion) === */
.article-content details {
  margin: 1.5rem 0;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
}

.dark .article-content details {
  border-color: #374151;
}

.article-content summary {
  padding: 14px 20px;
  font-weight: 600;
  font-size: 0.97rem;
  color: #111827;
  cursor: pointer;
  background: #f9fafb;
  transition: background 0.2s ease;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.article-content summary::-webkit-details-marker {
  display: none;
}

.dark .article-content summary {
  color: #f3f4f6;
  background: #1e293b;
}

.article-content summary::after {
  content: "+";
  font-size: 1.3rem;
  font-weight: 400;
  color: #06b6d4;
  flex-shrink: 0;
}

.article-content details[open] summary::after {
  content: "\2212";
}

.article-content details[open] summary {
  background: #ffffff;
  border-bottom: 1px solid rgba(6, 182, 212, 0.15);
}

.dark .article-content details[open] summary {
  background: #0f172a;
}

.article-content details > *:not(summary) {
  padding: 16px 20px;
}

/* === Embedded Video / Iframe === */
.article-content .wp-block-embed__wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 16px;
  margin: 2rem 0;
}

.article-content .wp-block-embed__wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  margin: 0;
}

.article-content iframe {
  width: 100%;
  border-radius: 16px;
  margin: 2rem 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  display: block;
}

.article-content video {
  width: 100%;
  border-radius: 16px;
  margin: 2rem 0;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

/* === WordPress Caption === */
.article-content .wp-caption {
  max-width: 100% !important;
  margin: 2rem 0;
}

.article-content .wp-caption img {
  margin-top: 0;
  margin-bottom: 0;
}

/* === WordPress Alignments === */
.article-content .aligncenter {
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.article-content .alignleft {
  float: left;
  margin-right: 1.5rem;
  margin-bottom: 1rem;
}

.article-content .alignright {
  float: right;
  margin-left: 1.5rem;
  margin-bottom: 1rem;
}

html[dir="rtl"] .article-content .alignleft {
  float: right;
  margin-right: 0;
  margin-left: 1.5rem;
}

html[dir="rtl"] .article-content .alignright {
  float: left;
  margin-left: 0;
  margin-right: 1.5rem;
}

/* Clearfix for floats */
.article-content::after {
  content: "";
  display: table;
  clear: both;
}

/* ========================================
   Sidebar Widget Styles
   ======================================== */
.widget {
  @apply bg-white dark:bg-gray-900 rounded-2xl border border-gray-200 dark:border-gray-800 p-6;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.widget:hover {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 12px 40px rgba(6, 182, 212, 0.06);
}

.widget-title {
  @apply text-lg font-bold text-gray-900 dark:text-white mb-4 pb-4;
  border-bottom: 1px solid transparent;
  background:
    linear-gradient(white, white) padding-box,
    linear-gradient(90deg, rgba(6, 182, 212, 0.3), rgba(37, 99, 235, 0.3))
      border-box;
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(
      90deg,
      rgba(6, 182, 212, 0.4),
      rgba(37, 99, 235, 0.2),
      transparent
    )
    1;
}

.dark .widget-title {
  background: none;
  border-image: linear-gradient(
      90deg,
      rgba(6, 182, 212, 0.3),
      rgba(37, 99, 235, 0.15),
      transparent
    )
    1;
  border-bottom: 1px solid transparent;
}

/* ========================================
   Tag Styles
   ======================================== */
.tag {
  @apply inline-flex items-center px-3 py-1.5 text-sm bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 rounded-lg;
  transition: all 0.25s ease;
}

.tag:hover {
  @apply text-cyan-600 dark:text-cyan-400;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1),
    rgba(37, 99, 235, 0.1)
  );
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

/* ========================================
   Pagination Styles - Premium
   ======================================== */
.pagination {
  @apply flex items-center justify-center gap-2 mt-12;
}

.page-link {
  @apply w-10 h-10 flex items-center justify-center text-sm font-medium rounded-xl;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.page-link.current {
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: white;
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.35);
}

.page-link:not(.current) {
  @apply bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300;
}

.page-link:not(.current):hover {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.15),
    rgba(37, 99, 235, 0.15)
  );
  @apply text-cyan-600 dark:text-cyan-400;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

/* ========================================
   Comment Styles
   ======================================== */
.comment {
  @apply p-6 bg-white dark:bg-gray-900 rounded-2xl border border-gray-200 dark:border-gray-800;
  transition: border-color 0.25s ease;
}

.comment:hover {
  border-color: rgba(6, 182, 212, 0.25);
}

.comment-author {
  @apply font-semibold text-gray-900 dark:text-white;
}

.comment-date {
  @apply text-sm text-gray-500 dark:text-gray-500;
}

.comment-content {
  @apply mt-3 text-gray-700 dark:text-gray-300;
}

/* ========================================
   Language Switcher
   ======================================== */
.lang-switcher-btn {
  @apply flex items-center gap-2 px-3 py-2 text-sm font-medium text-gray-700 dark:text-gray-300 bg-gray-100 dark:bg-gray-800 rounded-xl;
  transition: all 0.2s ease;
}

.lang-switcher-btn:hover {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1),
    rgba(37, 99, 235, 0.1)
  );
  @apply text-cyan-600 dark:text-cyan-400;
}

.lang-dropdown {
  @apply absolute top-full right-0 mt-2 min-w-[150px] bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-xl overflow-hidden z-50;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

html[dir="rtl"] .lang-dropdown {
  @apply right-auto left-0;
}

.lang-dropdown-item {
  @apply flex items-center gap-2 px-4 py-2.5 text-sm text-gray-700 dark:text-gray-300;
  transition: all 0.2s ease;
}

.lang-dropdown-item:hover {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.08),
    rgba(37, 99, 235, 0.08)
  );
  @apply text-cyan-600 dark:text-cyan-400;
}

.lang-dropdown-item.active {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1),
    rgba(37, 99, 235, 0.1)
  );
  @apply text-cyan-600 dark:text-cyan-400 font-medium;
}
.btn {
  @apply bg-cyan-600/90 hover:bg-cyan-600 text-white text-xs font-bold px-3 py-1.5 rounded-full backdrop-blur-sm transition-colors shadow-sm;
}
/* ========================================
   Scroll Reveal Animations
   ======================================== */

/* Initial hidden state */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delay for grid cards */
.animate-on-scroll:nth-child(2) {
  transition-delay: 0.1s;
}
.animate-on-scroll:nth-child(3) {
  transition-delay: 0.2s;
}
.animate-on-scroll:nth-child(4) {
  transition-delay: 0.1s;
}
.animate-on-scroll:nth-child(5) {
  transition-delay: 0.2s;
}
.animate-on-scroll:nth-child(6) {
  transition-delay: 0.3s;
}

/* Classic animations for HTMX-loaded content */
.fade-in {
  animation: fadeIn 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.slide-up {
  animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

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

.scale-in {
  animation: scaleIn 0.35s cubic-bezier(0.4, 0, 0.2, 1) both;
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.94);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Dark Mode toggle morphing transition */
.dark-toggle-icon {
  transition:
    transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.3s ease;
}

/* ========================================
   Loading States
   ======================================== */
.skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
  @apply rounded-lg;
}

.dark .skeleton {
  background: linear-gradient(90deg, #1f2937 25%, #374151 50%, #1f2937 75%);
  background-size: 200% 100%;
}

@keyframes shimmer {
  from {
    background-position: 200% 0;
  }
  to {
    background-position: -200% 0;
  }
}

.htmx-request {
  @apply opacity-60 pointer-events-none;
}

/* ========================================
   Author Box - Premium Card
   ======================================== */

/* ========================================
   Post Navigation - Thumbnail Style
   ======================================== */
.post-nav-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(229, 231, 235, 1);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark .post-nav-card {
  border-color: rgba(31, 41, 55, 1);
}

.post-nav-card:hover {
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-3px);
  box-shadow: 0 12px 36px rgba(6, 182, 212, 0.12);
}

.post-nav-card .thumbnail-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.08;
  transition: opacity 0.35s ease;
}

.post-nav-card:hover .thumbnail-bg {
  opacity: 0.15;
}

/* ========================================
   Back to Top Button
   ======================================== */
#back-to-top {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#back-to-top:hover {
  box-shadow: 0 8px 28px rgba(6, 182, 212, 0.5);
}

/* ========================================
   Scrollbar Styles
   ======================================== */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  @apply bg-gray-100 dark:bg-gray-900;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #06b6d4, #2563eb);
  border-radius: 9999px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #0891b2, #1d4ed8);
}

/* ========================================
   RTL Adjustments
   ======================================== */
html[dir="rtl"] .back-to-top {
  right: auto;
  left: 2rem;
}

html[dir="rtl"] .search-input {
  padding-left: 1rem;
  padding-right: 2.5rem;
}

html[dir="rtl"] .search-icon {
  left: auto;
  right: 0.75rem;
}

/* ========================================
   Newsletter Input in Footer
   ======================================== */
.newsletter-wrap {
  position: relative;
}

.newsletter-wrap input {
  padding-right: 120px !important;
  transition: all 0.3s ease;
}

html[dir="rtl"] .newsletter-wrap input {
  padding-right: 1rem !important;
  padding-left: 120px !important;
}

.newsletter-wrap input:focus {
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.newsletter-wrap .newsletter-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  padding: 0 16px;
  background: linear-gradient(135deg, #06b6d4, #2563eb);
  color: white;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  transition: all 0.3s ease;
  white-space: nowrap;
}

html[dir="rtl"] .newsletter-wrap .newsletter-btn {
  right: auto;
  left: 6px;
}

.newsletter-wrap .newsletter-btn:hover {
  box-shadow: 0 4px 16px rgba(6, 182, 212, 0.4);
  filter: brightness(1.1);
}

/* ========================================
   Footer Glow Effect
   ======================================== */
.footer-logo-glow {
  filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.4));
  transition: filter 0.3s ease;
}

.footer-logo-glow:hover {
  filter: drop-shadow(0 0 20px rgba(6, 182, 212, 0.6));
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  .no-print,
  .site-header,
  .site-footer,
  .sidebar,
  .comments,
  .back-to-top,
  .reading-progress {
    display: none !important;
  }

  body {
    background: white;
    color: black;
  }

  .article-content a {
    text-decoration: underline;
  }

  .article-content a::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
}
