/**
 * ArDownload Main Stylesheet (Loaded asynchronously after inline critical CSS)
 * RTL-First, Mobile-First, WCAG AA, Zero Layout Shift
 */

/* Self-hosted Tajawal Arabic Subset */
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/tajawal-arabic-400.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+0000-00FF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/tajawal-arabic-500.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+0000-00FF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/tajawal-arabic-700.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+0000-00FF;
}
@font-face {
  font-family: 'Tajawal';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/tajawal-arabic-800.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC, U+0000-00FF;
}

/* Utilities & Accessibility */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -100px;
  right: 1rem;
  z-index: 9999;
  background: var(--ard-accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: var(--ard-radius-sm);
  font-weight: 700;
}
.skip-link:focus {
  top: 1rem;
}

/* Header & Navigation */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ard-surface);
  border-bottom: 1px solid var(--ard-border);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 68px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ard-text);
  font-weight: 800;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.site-brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-wordmark .en {
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}
.brand-wordmark .en span {
  color: var(--ard-accent);
}
.brand-wordmark .ar {
  font-size: 0.75rem;
  color: var(--ard-muted);
  font-weight: 600;
}

.main-nav {
  display: none;
}

.main-nav ul {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 0.85rem;
  color: var(--ard-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--ard-radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.main-nav a:hover,
.main-nav .current-menu-item > a {
  background: var(--ard-accent-soft);
  color: var(--ard-accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ard-radius-sm);
  border: 1px solid var(--ard-border);
  background: var(--ard-surface);
  color: var(--ard-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--ard-accent);
  color: var(--ard-accent);
}

/* Mobile Drawer */
.mobile-drawer {
  display: none;
  background: var(--ard-surface);
  border-bottom: 1px solid var(--ard-border);
  padding: 1rem;
}
.mobile-drawer.is-open {
  display: block;
}
.mobile-drawer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}
.mobile-drawer a {
  display: block;
  padding: 0.65rem 0.85rem;
  border-radius: var(--ard-radius-sm);
  color: var(--ard-text);
  text-decoration: none;
  font-weight: 600;
}
.mobile-drawer a:hover {
  background: var(--ard-accent-soft);
  color: var(--ard-accent);
}

@media (min-width: 992px) {
  .main-nav {
    display: block;
  }
  .menu-toggle-btn {
    display: none;
  }
  .mobile-drawer {
    display: none !important;
  }
}

/* ==========================================================================
   Pure HTML/CSS Hero Banner (Inspired by ArDownload Official Visual Identity)
   ========================================================================== */
.hero-banner {
  position: relative;
  overflow: hidden;
  background: radial-gradient(circle at 15% 25%, rgba(46, 124, 246, 0.28), transparent 45%),
              radial-gradient(circle at 85% 75%, rgba(0, 163, 255, 0.22), transparent 50%),
              linear-gradient(135deg, #040d21 0%, #07193d 50%, #0b2964 100%);
  color: #ffffff;
  border-radius: var(--ard-radius-lg);
  padding: 2rem 1.25rem;
  margin: 1.25rem 0 1.75rem;
  box-shadow: 0 20px 45px rgba(4, 13, 33, 0.25);
  border: 1px solid rgba(83, 163, 255, 0.2);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

@media (min-width: 992px) {
  .hero-banner {
    padding: 2.5rem 2.75rem;
  }
  .hero-grid {
    grid-template-columns: 1.25fr 0.9fr;
  }
}

.hero-brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-logo-glow {
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: #141c2e;
  border: 1px solid rgba(83, 163, 255, 0.45);
  box-shadow: 0 0 25px rgba(46, 124, 246, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.hero-logo-glow img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.hero-title-wrap h1 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  font-weight: 800;
  line-height: 1.25;
  color: #ffffff;
}

.hero-title-wrap .hero-en-brand {
  display: inline-block;
  direction: ltr;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.hero-title-wrap .hero-en-brand span {
  color: #53a3ff;
}

.hero-subtitle-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(11, 43, 107, 0.7);
  border: 1px solid rgba(83, 163, 255, 0.45);
  color: #e2e8f0;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* Hero Live AJAX Search */
.hero-search-form {
  position: relative;
  max-width: 620px;
  margin-bottom: 1.25rem;
}

.hero-search-box {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 14px;
  padding: 0.35rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  border: 2px solid transparent;
  transition: border-color 0.2s ease;
}

.hero-search-box:focus-within {
  border-color: #53a3ff;
}

.hero-search-box input[type="search"] {
  flex: 1;
  border: 0;
  background: transparent;
  padding: 0.75rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  color: #0f172a;
  outline: none;
  min-width: 0;
}

.hero-search-box button {
  background: linear-gradient(135deg, #2e7cf6 0%, #1d5ed6 100%);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 0.75rem 1.35rem;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.hero-search-box button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(46, 124, 246, 0.45);
}

.ajax-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: 0;
  background: var(--ard-surface);
  color: var(--ard-text);
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-md);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  z-index: 60;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}

.ajax-search-results.is-visible {
  display: block;
}

.ajax-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  text-decoration: none;
  color: var(--ard-text);
  border-bottom: 1px solid var(--ard-border);
  transition: background 0.15s ease;
}
.ajax-result-item:last-child {
  border-bottom: 0;
}
.ajax-result-item:hover {
  background: var(--ard-accent-soft);
}
.ajax-result-item img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.ajax-result-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.ajax-result-title {
  font-weight: 700;
  font-size: 0.95rem;
}
.ajax-result-cat {
  font-size: 0.78rem;
  color: var(--ard-muted);
}

/* Hero Platform Highlights & Trust Bar */
.hero-platforms {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1.25rem;
}

.hero-platform-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.hero-platform-chip:hover {
  background: rgba(46, 124, 246, 0.25);
  border-color: #53a3ff;
  color: #fff;
}

.hero-trust-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(4, 13, 33, 0.65);
  border: 1px solid rgba(83, 163, 255, 0.22);
  font-size: 0.85rem;
  color: #cbd5e1;
}

.hero-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
}

/* Hero Visual Showcase (Pure CSS/SVG Laptop + Floating Platform Icons) */
.hero-visual {
  display: none;
  position: relative;
  min-height: 230px;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  .hero-visual {
    display: flex;
  }
}

.hero-device-stage {
  position: relative;
  width: 100%;
  max-width: 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-laptop-screen {
  width: 260px;
  height: 160px;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(145deg, #0b2459 0%, #141c2e 100%);
  border: 3px solid #334155;
  box-shadow: 0 0 40px rgba(46, 124, 246, 0.35), inset 0 0 25px rgba(83, 163, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero-laptop-base {
  width: 305px;
  height: 12px;
  background: linear-gradient(90deg, #1e293b, #475569, #1e293b);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
}

.hero-floating-cards {
  position: absolute;
  bottom: -10px;
  display: flex;
  gap: 0.65rem;
  z-index: 3;
}

.hero-float-card {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(83, 163, 255, 0.45);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Platform Tabs & Category Grid
   ========================================================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.section-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ard-text);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 22px;
  border-radius: 4px;
  background: var(--ard-accent);
}

.platform-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.platform-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--ard-border);
  background: var(--ard-surface);
  color: var(--ard-text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.platform-tab:hover,
.platform-tab.is-active {
  background: var(--ard-accent);
  border-color: var(--ard-accent);
  color: #ffffff;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 2rem;
}

@media (min-width: 640px) {
  .categories-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 992px) {
  .categories-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

.cat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.45rem;
  padding: 1rem 0.75rem;
  background: var(--ard-surface);
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-md);
  text-decoration: none;
  color: var(--ard-text);
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.cat-card:hover {
  transform: translateY(-2px);
  border-color: var(--ard-accent);
  box-shadow: 0 8px 20px rgba(46, 124, 246, 0.1);
}

.cat-card-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ard-accent-soft);
  color: var(--ard-accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-card-name {
  font-weight: 700;
  font-size: 0.92rem;
}

.cat-card-count {
  font-size: 0.78rem;
  color: var(--ard-muted);
}

/* ==========================================================================
   Main Layout & Post Grid
   ========================================================================== */
.content-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 992px) {
  .content-layout {
    grid-template-columns: minmax(0, 1fr) 320px;
  }
}

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

@media (min-width: 640px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1200px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--ard-surface);
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-md);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  border-color: var(--ard-accent);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.08);
}

.post-card-thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16 / 10;
  background: #ffffff;
  padding: 0.75rem;
  border-bottom: 1px solid var(--ard-border);
  overflow: hidden;
  position: relative;
}

.post-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.post-card:hover .post-card-thumb img {
  transform: scale(1.04);
}

.post-card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
}

.post-card-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.post-cat-badge {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--ard-accent-soft);
  color: var(--ard-accent);
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.post-card-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.45;
}

.post-card-title a {
  color: var(--ard-text);
  text-decoration: none;
}

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

.post-card-excerpt {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ard-muted);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-meta {
  margin-top: auto;
  padding-top: 0.65rem;
  border-top: 1px solid var(--ard-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--ard-muted);
}

/* Pagination */
.pagination-wrap {
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  border-radius: var(--ard-radius-sm);
  border: 1px solid var(--ard-border);
  background: var(--ard-surface);
  color: var(--ard-text);
  text-decoration: none;
  font-weight: 700;
}

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

/* ==========================================================================
   Sidebar & Widgets
   ========================================================================== */
.sidebar-area {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.widget-box {
  background: var(--ard-surface);
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-md);
  padding: 1.15rem;
}

.widget-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--ard-accent-soft);
}

.widget-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.65rem;
}

.widget-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ard-text);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 600;
}

.widget-list a:hover {
  color: var(--ard-accent);
}

/* ==========================================================================
   Single Post Template (Breadcrumbs, App Header Box, TOC, Content, Related)
   ========================================================================== */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.86rem;
  color: var(--ard-muted);
  margin: 1rem 0;
}

.breadcrumbs a {
  color: var(--ard-muted);
  text-decoration: none;
}
.breadcrumbs a:hover {
  color: var(--ard-accent);
}

.single-article {
  background: var(--ard-surface);
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-lg);
  padding: 1.25rem;
}

@media (min-width: 768px) {
  .single-article {
    padding: 2rem;
  }
}

.app-header-box {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  padding: 1.25rem;
  border-radius: var(--ard-radius-md);
  background: var(--ard-surface-alt);
  border: 1px solid var(--ard-border);
  margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
  .app-header-box {
    grid-template-columns: 110px 1fr;
    align-items: center;
  }
}

.app-header-icon {
  width: 110px;
  height: 110px;
  border-radius: var(--ard-radius-md);
  overflow: hidden;
  background: #ffffff;
  padding: 0.45rem;
  border: 1px solid var(--ard-border);
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-header-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.app-header-title {
  margin: 0 0 0.65rem;
  font-size: clamp(1.35rem, 2.8vw, 1.85rem);
  font-weight: 800;
  line-height: 1.3;
}

.app-quick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1.15rem;
  font-size: 0.86rem;
  color: var(--ard-muted);
  margin-bottom: 1rem;
}

.app-quick-meta span strong {
  color: var(--ard-text);
}

.app-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.btn-download-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--ard-radius-sm);
  background: linear-gradient(135deg, var(--ard-accent) 0%, #1d5ed6 100%);
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 8px 20px rgba(46, 124, 246, 0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-download-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(46, 124, 246, 0.35);
}

.trust-scanned-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-size: 0.82rem;
  font-weight: 700;
}

[data-theme="dark"] .trust-scanned-badge {
  color: #34d399;
}

/* Auto Table of Contents */
.toc-box {
  background: var(--ard-surface-alt);
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-md);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  cursor: pointer;
}

.toc-list {
  margin: 0.75rem 0 0;
  padding-right: 1.25rem;
  display: grid;
  gap: 0.35rem;
}

.toc-list a {
  color: var(--ard-text);
  text-decoration: none;
  font-size: 0.92rem;
}
.toc-list a:hover {
  color: var(--ard-accent);
}
.toc-item-h3 {
  padding-right: 1rem;
  font-size: 0.86rem;
}

/* Entry Content & Info Table Preservation */
.entry-content {
  font-size: 1.02rem;
  line-height: 1.85;
}

.entry-content a {
  color: var(--ard-link);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(96, 165, 250, 0.35);
  transition: color 0.15s ease, border-color 0.15s ease;
}

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

.entry-content a[href*="download.html"],
.entry-content a[href*="/download"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.85rem 1.75rem;
  margin: 0.75rem 0;
  border-radius: 12px;
  border-bottom: 0;
  background: linear-gradient(135deg, var(--ard-accent) 0%, #1d5ed6 100%);
  color: #ffffff !important;
  font-weight: 800;
  font-size: 1.05rem;
  box-shadow: 0 10px 25px rgba(46, 124, 246, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.entry-content a[href*="download.html"]:hover,
.entry-content a[href*="/download"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(46, 124, 246, 0.45);
}

.entry-content ul {
  padding-right: 1.25rem;
  display: grid;
  gap: 0.45rem;
}

/* Rich Sidebar Post Items & Category Pills */
.sidebar-post-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem;
  border-radius: var(--ard-radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  color: var(--ard-text);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-post-item:hover {
  background: var(--ard-accent-soft);
  border-color: rgba(46, 124, 246, 0.25);
}

.sidebar-post-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid var(--ard-border);
  padding: 0.25rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.sidebar-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-post-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.sidebar-post-title {
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sidebar-post-cat {
  font-size: 0.75rem;
  color: var(--ard-link);
  font-weight: 600;
}

.sidebar-cat-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.sidebar-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: var(--ard-surface-alt);
  border: 1px solid var(--ard-border);
  color: var(--ard-text);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
  transition: all 0.15s ease;
}

.sidebar-cat-pill:hover {
  background: var(--ard-accent);
  border-color: var(--ard-accent);
  color: #ffffff;
}

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

.entry-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 1.35rem 0 0.5rem;
}

.entry-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--ard-radius-sm);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  border: 1px solid var(--ard-border);
  border-radius: var(--ard-radius-sm);
  overflow: hidden;
}

.entry-content th,
.entry-content td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--ard-border);
  text-align: right;
}

.entry-content th {
  background: var(--ard-surface-alt);
  font-weight: 700;
  width: 35%;
}

/* ==========================================================================
   Ad Slots (Fixed min-height to guarantee CLS < 0.1)
   ========================================================================== */
.ard-ad-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 1.25rem 0;
  background: var(--ard-surface-alt);
  border: 1px dashed var(--ard-border);
  border-radius: var(--ard-radius-sm);
  overflow: hidden;
}

.ard-ad-header { min-height: 90px; }
.ard-ad-incontent { min-height: 250px; }
.ard-ad-sidebar { min-height: 250px; }
.ard-ad-sticky { min-height: 60px; margin: 0; }

/* ==========================================================================
   Footer & Mobile Bottom Nav / Sticky Download Bar
   ========================================================================== */
.site-footer {
  background: #0b1120;
  color: #cbd5e1;
  padding: 2.5rem 0 5.5rem;
  border-top: 1px solid #1e293b;
}

@media (min-width: 992px) {
  .site-footer {
    padding-bottom: 2.5rem;
  }
}

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

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.footer-links a {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-links a:hover {
  color: #53a3ff;
}

.footer-bottom {
  padding-top: 1.25rem;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  right: 0;
  left: 0;
  z-index: 90;
  background: var(--ard-surface);
  border-top: 1px solid var(--ard-border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 60px;
}

@media (min-width: 992px) {
  .mobile-bottom-nav {
    display: none;
  }
}

.mobile-bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  text-decoration: none;
  color: var(--ard-muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.mobile-bottom-nav a:hover,
.mobile-bottom-nav a.is-active {
  color: var(--ard-accent);
}

.sticky-download-bar {
  position: fixed;
  bottom: 60px;
  right: 0;
  left: 0;
  z-index: 89;
  background: var(--ard-surface);
  border-top: 1px solid var(--ard-border);
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.12);
  transform: translateY(150%);
  transition: transform 0.2s ease;
}

.sticky-download-bar.is-visible {
  transform: translateY(0);
}

@media (min-width: 992px) {
  .sticky-download-bar {
    display: none;
  }
}
