/* ==========================================================================
   MineDL Theme – Light Design
   White background, blue accents, clean cards, Arabic RTL
   ========================================================================== */

/* -----------------------------------------------------------------------
   CSS Custom Properties
----------------------------------------------------------------------- */
:root {
  /* Colors */
  --white:        #ffffff;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-300:     #d1d5db;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-600:     #4b5563;
  --gray-700:     #374151;
  --gray-800:     #1f2937;
  --gray-900:     #111827;

  --blue-50:      #eff6ff;
  --blue-100:     #dbeafe;
  --blue-500:     #3b82f6;
  --blue-600:     #2563eb;
  --blue-700:     #1d4ed8;

  --green-50:     #f0fdf4;
  --green-500:    #22c55e;
  --green-600:    #16a34a;

  --yellow-400:   #facc15;
  --yellow-500:   #eab308;

  --red-500:      #ef4444;
  --orange-500:   #f97316;

  /* Semantic aliases */
  --primary:        var(--blue-600);
  --primary-hover:  var(--blue-700);
  --primary-light:  var(--blue-50);
  --primary-ring:   rgba(37,99,235,.2);

  --text:          var(--gray-800);
  --text-muted:    var(--gray-500);
  --text-faint:    var(--gray-400);
  --heading:       var(--gray-900);
  --border:        var(--gray-200);
  --border-dark:   var(--gray-300);
  --surface:       var(--white);
  --page-bg:       var(--gray-100);

  /* Spacing */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   18px;
  --r-2xl:  24px;
  --r-full: 9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:  0 4px 12px rgba(0,0,0,.1);
  --shadow-lg:  0 8px 30px rgba(0,0,0,.12);
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);

  /* Typography */
  --font-ar:   'Cairo', 'Tajawal', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'Courier New', Consolas, monospace;

  /* Layout */
  --container-max: 1280px;
  --sidebar-w: 300px;
  --header-h: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

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

img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ar);
  color: var(--heading);
  line-height: 1.35;
  font-weight: 700;
}

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.1em 0.4em;
  color: var(--gray-700);
}

input, textarea, select {
  font-family: var(--font-ar);
  background: var(--white);
  border: 1px solid var(--border-dark);
  border-radius: var(--r-sm);
  color: var(--text);
  padding: var(--sp-2) var(--sp-3);
  transition: border-color .2s, box-shadow .2s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
}

/* -----------------------------------------------------------------------
   Layout
----------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--sp-4);
}
@media (min-width: 640px)  { .container { padding-inline: var(--sp-6); } }
@media (min-width: 1024px) { .container { padding-inline: var(--sp-8); } }

.site-wrapper { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1; }

/* -----------------------------------------------------------------------
   Header
----------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 6px rgba(0,0,0,.06);
  height: var(--header-h);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  height: 100%;
}

.site-branding { flex-shrink: 0; }

.site-name-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--heading);
  font-weight: 900;
  font-size: 1.25rem;
  transition: color .2s;
}
.site-name-link:hover { color: var(--primary); }

.site-icon { color: var(--primary); font-size: 1.4rem; line-height: 1; }

.custom-logo-wrap img { height: 40px; width: auto; }

/* Primary Navigation */
.primary-navigation { flex: 1; display: flex; justify-content: center; }

.nav-menu {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
}

.nav-menu li a {
  display: block;
  padding: var(--sp-2) var(--sp-3);
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--r-sm);
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-menu li a:hover,
.nav-menu li.current-menu-item > a {
  color: var(--primary);
  background: var(--primary-light);
}

/* Dropdown */
.nav-menu .sub-menu {
  position: absolute;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all .2s;
  z-index: 200;
}
.nav-menu li:hover > .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.nav-menu .sub-menu a { padding: var(--sp-2) var(--sp-4); color: var(--gray-700); border-radius: 0; }
.nav-menu .sub-menu a:hover { color: var(--primary); background: var(--primary-light); }
.nav-menu li { position: relative; }
.nav-menu li.menu-item-has-children > a::after {
  content: '▾';
  margin-inline-start: var(--sp-1);
  font-size: 0.7em;
  opacity: .5;
}

/* Header Actions */
.header-actions { display: flex; align-items: center; gap: var(--sp-2); }

.search-toggle, .mobile-nav-toggle {
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--gray-500);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  transition: color .2s, border-color .2s, background .2s;
}
.search-toggle:hover, .mobile-nav-toggle:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.mobile-nav-toggle { display: none; }

.hamburger-bar {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}
.hamburger-bar + .hamburger-bar { margin-top: 3px; }
[aria-expanded="true"] .hamburger-bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
[aria-expanded="true"] .hamburger-bar:nth-child(2) { opacity: 0; }
[aria-expanded="true"] .hamburger-bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* Search Drawer */
.search-drawer {
  border-bottom: 1px solid var(--border);
  background: var(--white);
  padding-block: var(--sp-4);
  animation: slideDown .2s ease;
}
.search-drawer[hidden] { display: none; }

.search-form {
  display: flex;
  gap: var(--sp-2);
  max-width: 600px;
  margin-inline: auto;
}
.search-field { flex: 1; }
.search-submit {
  background: var(--primary);
  border: none;
  border-radius: var(--r-sm);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-4);
  height: 42px;
  transition: background .2s;
}
.search-submit:hover { background: var(--primary-hover); }

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Mobile Nav */
@media (max-width: 1023px) {
  .mobile-nav-toggle { display: flex; }

  .primary-navigation {
    position: fixed;
    inset: var(--header-h) 0 0 0;
    background: var(--white);
    border-top: 1px solid var(--border);
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform .3s ease;
    z-index: 90;
    justify-content: flex-start;
    padding: var(--sp-6);
  }
  .primary-navigation.is-open { transform: translateX(0); }
  .nav-menu { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-menu li a { font-size: 1rem; padding: var(--sp-3); }
  .nav-menu .sub-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: none;
    background: var(--gray-50);
    border-radius: var(--r-sm);
    margin-top: 2px;
    padding: var(--sp-1) 0;
  }
}

/* -----------------------------------------------------------------------
   Breadcrumbs
----------------------------------------------------------------------- */
.breadcrumbs-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-2);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-1);
  font-size: 0.82rem;
  color: var(--text-muted);
}
.breadcrumb-list a { color: var(--text-muted); transition: color .2s; }
.breadcrumb-list a:hover { color: var(--primary); }
.breadcrumb-item + .breadcrumb-item::before {
  content: '/';
  margin-inline-end: var(--sp-1);
  opacity: .4;
}
.breadcrumb-item.active { color: var(--text); font-weight: 600; }

/* -----------------------------------------------------------------------
   Content Layout
----------------------------------------------------------------------- */
.content-area-wrap { padding-block: var(--sp-8); }

.main-article { max-width: 860px; margin-inline: auto; }

/* -----------------------------------------------------------------------
   App Hero
----------------------------------------------------------------------- */
.app-hero {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-8);
}

.app-hero-inner {
  display: flex;
  gap: var(--sp-6);
  align-items: flex-start;
}

/* App Icon */
.app-icon-wrap { flex-shrink: 0; }

.app-icon {
  width: 110px;
  height: 110px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  object-fit: cover;
  transition: transform .3s, box-shadow .3s;
}
.app-icon:hover { transform: scale(1.04); box-shadow: var(--shadow-lg); }

.app-icon-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  color: var(--text-faint);
  width: 110px;
  height: 110px;
  border-radius: var(--r-xl);
  border: 1px solid var(--border);
}

/* App Info */
.app-info-wrap { flex: 1; min-width: 0; }

.app-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  color: var(--heading);
  line-height: 1.2;
  margin-bottom: var(--sp-2);
}

.app-developer {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: var(--sp-3);
}

/* Rating Row */
.app-rating-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-bottom: var(--sp-3);
}

.star-rating { display: inline-flex; align-items: center; gap: 2px; }
.star { font-size: 1rem; line-height: 1; }
.star-full  { color: #b45309; }
.star-half  { color: var(--yellow-400); opacity: .8; }
.star-empty { color: var(--gray-300); }
.rating-number {
  font-size: 0.85rem;
  font-weight: 700;
  color: #92400e;
  margin-inline-start: var(--sp-1);
}

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

.download-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 3px var(--sp-3);
  font-size: 0.78rem;
  color: var(--gray-700);
}

/* App Tags */
.app-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-5);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px var(--sp-3);
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}
.tag-category {
  background: var(--blue-50);
  color: var(--blue-600);
  border: 1px solid var(--blue-100);
}
.tag-version {
  background: var(--green-50);
  color: #166534;
  border: 1px solid rgba(22,163,74,.2);
  font-family: var(--font-mono);
}
.tag-link {
  background: var(--gray-100);
  color: var(--gray-600);
  border: 1px solid var(--border);
  transition: color .2s, background .2s;
}
.tag-link:hover { color: var(--primary); background: var(--primary-light); }

/* CTA Buttons */
.app-cta-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  align-items: center;
}

.btn-download {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--primary);
  color: var(--white) !important;
  font-size: 1rem;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  border: none;
  text-decoration: none;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
}
.btn-download:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(37,99,235,.4);
  color: var(--white) !important;
}
.btn-download:active { transform: translateY(0); }

.btn-icon { flex-shrink: 0; width: 18px; height: 18px; }
.btn-label { white-space: nowrap; }
.btn-size {
  font-size: 0.75rem;
  font-weight: 400;
  border-inline-start: 1px solid rgba(255,255,255,.3);
  padding-inline-start: var(--sp-2);
  margin-inline-start: var(--sp-1);
}

.btn-download-lg {
  font-size: 1.05rem;
  padding: var(--sp-4) var(--sp-8);
  border-radius: var(--r-lg);
}

.btn-play-store {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--white);
  color: var(--gray-700) !important;
  font-size: 0.9rem;
  font-weight: 600;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-md);
  border: 1px solid var(--border-dark);
  transition: border-color .2s, color .2s, background .2s, box-shadow .2s;
}
.btn-play-store:hover {
  border-color: var(--primary);
  color: var(--primary) !important;
  background: var(--primary-light);
}

.hero-dl-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: var(--sp-2);
}
.hero-dl-count svg { color: var(--primary); }

@media (max-width: 640px) {
  .app-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .app-rating-row { justify-content: center; }
  .app-tags { justify-content: center; }
  .app-cta-wrap { justify-content: center; }
  .app-icon { width: 90px; height: 90px; }
  .app-icon-placeholder { width: 90px; height: 90px; }
  .app-info-wrap { width: 100%; }
}

/* -----------------------------------------------------------------------
   App Stats Bar
----------------------------------------------------------------------- */
.app-stats-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding-block: var(--sp-3);
}

.stats-grid {
  display: flex;
  flex-wrap: wrap;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-5);
  border-inline-end: 1px solid var(--border);
  min-width: 120px;
  flex: 1;
  color: var(--primary);
}
.stat-item:last-child { border-inline-end: none; }

.stat-content { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: 0.72rem; color: var(--text-muted); font-weight: 400; }
.stat-value { font-size: 0.88rem; font-weight: 700; color: var(--heading); }

@media (max-width: 640px) {
  .stat-item {
    flex-basis: 50%;
    border-bottom: 1px solid var(--border);
    border-inline-end: none;
  }
  .stat-item:nth-child(odd) { border-inline-end: 1px solid var(--border); }
}

/* -----------------------------------------------------------------------
   Main Article
----------------------------------------------------------------------- */
.main-article {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  padding: var(--sp-8);
  box-shadow: var(--shadow-card);
}

@media (max-width: 640px) { .main-article { padding: var(--sp-5); border-radius: var(--r-lg); } }

.entry-header { margin-bottom: var(--sp-6); }
.entry-title  { font-size: clamp(1.4rem, 2.5vw, 1.9rem); font-weight: 900; color: var(--heading); }

.page-thumbnail {
  margin-bottom: var(--sp-6);
  border-radius: var(--r-lg);
  overflow: hidden;
  border: 1px solid var(--border);
}
.rounded-img { width: 100%; border-radius: var(--r-lg); }

/* Entry Content */
.entry-content { color: var(--text); font-size: 1rem; line-height: 1.8; }

.entry-content h2 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--heading);
  margin-top: var(--sp-8);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 2px solid var(--border);
  position: relative;
}
.entry-content h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  inset-inline-start: 0;
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.entry-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--heading);
  margin-top: var(--sp-6);
  margin-bottom: var(--sp-3);
}

.entry-content ul, .entry-content ol {
  margin-bottom: var(--sp-4);
  padding-inline-start: var(--sp-6);
}
.entry-content ul { list-style: none; padding-inline-start: 0; }
.entry-content ul li {
  position: relative;
  padding-inline-start: var(--sp-5);
  margin-bottom: var(--sp-2);
}
.entry-content ul li::before {
  content: '▸';
  position: absolute;
  inset-inline-start: 0;
  color: var(--primary);
  font-size: 0.85em;
  top: 2px;
}
.entry-content ol { list-style: decimal; }
.entry-content ol li { margin-bottom: var(--sp-2); }

.entry-content blockquote {
  border-inline-start: 3px solid var(--primary);
  background: var(--blue-50);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: var(--sp-4) var(--sp-5);
  margin-block: var(--sp-5);
  color: var(--text-muted);
  font-style: italic;
}

.entry-content pre {
  background: var(--gray-900);
  border: 1px solid var(--gray-800);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: #e2e8f0;
  margin-block: var(--sp-5);
}

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin-block: var(--sp-5);
  font-size: 0.9rem;
}
.entry-content table th,
.entry-content table td {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  text-align: start;
}
.entry-content table th {
  background: var(--gray-50);
  color: var(--heading);
  font-weight: 700;
}
.entry-content table tr:nth-child(even) { background: var(--gray-50); }

.entry-content img {
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  max-width: 100%;
}

.entry-content a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { color: var(--primary-hover); }

/* -----------------------------------------------------------------------
   Mod Features Box
----------------------------------------------------------------------- */
.mod-features-box {
  background: var(--blue-50);
  border: 1px solid var(--blue-100);
  border-radius: var(--r-lg);
  padding: var(--sp-6);
  margin-bottom: var(--sp-8);
}

.features-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: var(--sp-4);
}

.features-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-2);
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: 0.9rem;
  padding: var(--sp-2) var(--sp-3);
  background: var(--white);
  border: 1px solid var(--blue-100);
  border-radius: var(--r-sm);
}

.feature-check {
  color: var(--green-600);
  font-weight: 900;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 2px;
}

/* -----------------------------------------------------------------------
   Safe Notice
----------------------------------------------------------------------- */
.safe-notice {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--green-50);
  border: 1px solid rgba(22,163,74,.2);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-block: var(--sp-6);
  font-size: 0.85rem;
  color: #166534;
}

/* -----------------------------------------------------------------------
   App Info Table
----------------------------------------------------------------------- */
.app-info-table {
  margin-block: var(--sp-6);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}

.table-title {
  font-size: 1rem;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-4);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
  color: var(--heading);
}

.info-table { width: 100%; border-collapse: collapse; }
.info-table th,
.info-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
  text-align: start;
  vertical-align: middle;
}
.info-table tr:last-child th,
.info-table tr:last-child td { border-bottom: none; }
.info-table th {
  width: 38%;
  background: var(--gray-50);
  color: var(--text-muted);
  font-weight: 600;
}
.info-table td { color: var(--text); }
.info-table tr:hover td { background: var(--gray-50); }

/* -----------------------------------------------------------------------
   Bottom CTA
----------------------------------------------------------------------- */
.bottom-cta {
  margin-block: var(--sp-8);
  text-align: center;
  padding: var(--sp-6);
  background: var(--blue-50);
  border: 1px dashed var(--blue-100);
  border-radius: var(--r-xl);
}

/* -----------------------------------------------------------------------
   Entry Meta Footer
----------------------------------------------------------------------- */
.entry-meta {
  margin-top: var(--sp-8);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--border);
}

.entry-meta-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--sp-4);
}

.meta-date { font-size: 0.8rem; color: var(--text-muted); }
.meta-date time { font-variant-numeric: tabular-nums; }

.entry-tags a {
  font-size: 0.78rem;
  color: var(--text-muted);
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 2px var(--sp-2);
  margin-inline-start: var(--sp-1);
  transition: color .2s, border-color .2s;
}
.entry-tags a:hover { color: var(--primary); border-color: var(--primary); }
.tags-label { font-size: 0.8rem; color: var(--text-muted); margin-inline-end: var(--sp-1); }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  font-size: 0.8rem;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--gray-700);
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  transition: color .2s, border-color .2s;
  font-family: var(--font-ar);
}
.share-btn:hover { color: var(--primary); border-color: var(--primary); }
.share-btn.copied { color: var(--green-600); }

.share-btn-whatsapp { background: #0e7a40; color: #fff !important; border-color: #0e7a40; }
.share-btn-whatsapp:hover { background: #0a5f32; border-color: #0a5f32; color: #fff !important; }
.share-btn-telegram { background: #076ba8; color: #fff !important; border-color: #076ba8; }
.share-btn-telegram:hover { background: #054f7d; border-color: #054f7d; color: #fff !important; }
.share-btn-twitter { background: var(--gray-900); color: #fff !important; border-color: var(--gray-900); }
.share-btn-twitter:hover { background: var(--gray-700); border-color: var(--gray-700); color: #fff !important; }

/* -----------------------------------------------------------------------
   Comments
----------------------------------------------------------------------- */
.comments-area-section { padding-block: var(--sp-8); border-top: 1px solid var(--border); }
.comments-area-section .container { max-width: 860px; }

/* -----------------------------------------------------------------------
   Sidebar
----------------------------------------------------------------------- */
.widget-area { position: sticky; top: calc(var(--header-h) + 16px); }

.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-5);
  box-shadow: var(--shadow-card);
}

.widget-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.widget-title::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
  flex-shrink: 0;
}

.sidebar-post-list { display: flex; flex-direction: column; gap: var(--sp-3); }

.sidebar-post-item {
  display: flex;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  transition: background .2s;
}
.sidebar-post-item:hover { background: var(--gray-50); }

.sidebar-thumb img {
  width: 52px;
  height: 52px;
  border-radius: var(--r-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-post-info { min-width: 0; flex: 1; }
.sidebar-post-title {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  transition: color .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-post-title:hover { color: var(--primary); }
.sidebar-post-version {
  display: inline-block;
  margin-top: 3px;
  font-size: 0.72rem;
  color: var(--primary);
  font-family: var(--font-mono);
  background: var(--blue-50);
  padding: 1px 6px;
  border-radius: var(--r-full);
}

.cat-list li { border-bottom: 1px solid var(--border); }
.cat-list li:last-child { border-bottom: none; }
.cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-2) 0;
  color: var(--text);
  font-size: 0.875rem;
  transition: color .2s;
}
.cat-list a:hover { color: var(--primary); }
.cat-list .count {
  font-size: 0.75rem;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--r-full);
  padding: 1px 8px;
  color: var(--text-muted);
}

/* -----------------------------------------------------------------------
   Posts Grid (Archive / Home)
----------------------------------------------------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--sp-5);
  margin-bottom: var(--sp-8);
}

.post-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s, box-shadow .25s;
  box-shadow: var(--shadow-card);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card-thumb-wrap {
  position: relative;
  background: var(--gray-50);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-5);
  border-bottom: 1px solid var(--border);
  min-height: 140px;
}

.card-thumb {
  width: 96px;
  height: 96px;
  border-radius: var(--r-lg);
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.card-thumb-placeholder {
  width: 96px;
  height: 96px;
  border-radius: var(--r-lg);
  background: var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
}

.card-thumb-link { display: block; line-height: 0; }

.card-version-badge {
  position: absolute;
  bottom: var(--sp-2);
  inset-inline-end: var(--sp-2);
  background: var(--primary);
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 2px 7px;
  border-radius: var(--r-full);
}

.card-body { padding: var(--sp-4); display: flex; flex-direction: column; flex: 1; }

.card-title { font-size: 1rem; font-weight: 700; margin-bottom: var(--sp-2); line-height: 1.4; }
.card-title a { color: var(--heading); transition: color .2s; }
.card-title a:hover { color: var(--primary); }

.card-rating { margin-bottom: var(--sp-2); }
.card-rating .star { font-size: 0.85rem; }

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

.card-meta { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.card-meta-item { display: inline-flex; align-items: center; gap: 4px; font-size: 0.72rem; color: var(--text-faint); }

.card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  background: var(--primary);
  color: var(--white) !important;
  font-size: 0.85rem;
  font-weight: 700;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  transition: background .2s, transform .15s;
  margin-top: auto;
}
.card-btn:hover { background: var(--primary-hover); transform: translateY(-1px); color: var(--white) !important; }

/* -----------------------------------------------------------------------
   Pagination
----------------------------------------------------------------------- */
.pagination-wrap { display: flex; justify-content: center; margin-top: var(--sp-8); }

.pagination-wrap .nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  flex-wrap: wrap;
}

.pagination-wrap .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--white);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all .2s;
}
.pagination-wrap .page-numbers:hover,
.pagination-wrap .page-numbers.current {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}
.pagination-wrap .page-numbers.dots {
  border: none;
  background: none;
  color: var(--text-muted);
}

/* -----------------------------------------------------------------------
   Related Posts
----------------------------------------------------------------------- */
.related-posts-section {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding-block: var(--sp-10);
}

.section-heading {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: var(--sp-6);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.section-heading-icon { color: var(--primary); font-size: 1rem; }
.section-heading::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-inline-start: var(--sp-3);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--sp-4);
}

.related-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .25s, box-shadow .25s;
  box-shadow: var(--shadow-card);
}
.related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.related-card-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--sp-4);
  gap: var(--sp-3);
  text-decoration: none;
}

.related-thumb {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  object-fit: cover;
  border: 1px solid var(--border);
}
.related-thumb-placeholder {
  width: 72px;
  height: 72px;
  border-radius: var(--r-md);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 1.5rem;
}

.related-info { text-align: center; }
.related-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .2s;
}
.related-card-link:hover .related-title { color: var(--primary); }

.related-rating .star { font-size: 0.7rem; }
.related-version { font-size: 0.7rem; color: var(--primary); font-family: var(--font-mono); }

.related-dl-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-2);
  background: var(--primary);
  color: var(--white) !important;
  font-size: 0.78rem;
  font-weight: 700;
  border-top: 1px solid var(--blue-100);
  transition: background .2s;
}
.related-dl-btn:hover { background: var(--primary-hover); }

/* -----------------------------------------------------------------------
   Archive / Page Header
----------------------------------------------------------------------- */
.archive-header {
  margin-bottom: var(--sp-8);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--border);
}

.archive-title {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 900;
  margin-bottom: var(--sp-2);
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.archive-title::before { content: '▸'; color: var(--primary); font-size: 0.7em; }
.archive-description { color: var(--text-muted); font-size: 0.95rem; }
.page-header { margin-bottom: var(--sp-8); }
.page-title  { font-size: 1.8rem; font-weight: 900; }

/* -----------------------------------------------------------------------
   404 Page
----------------------------------------------------------------------- */
.error-404-wrap {
  text-align: center;
  padding-block: var(--sp-16);
  max-width: 500px;
  margin-inline: auto;
}

.error-blocks { display: flex; justify-content: center; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.error-block {
  display: inline-block;
  width: 20px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
  animation: bounce 1.2s ease-in-out infinite;
}
.error-block:nth-child(2) { animation-delay: .15s; background: var(--blue-500); }
.error-block:nth-child(3) { animation-delay: .3s; background: var(--blue-700); }
.error-block:nth-child(4) { animation-delay: .45s; background: var(--yellow-500); }

@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-12px); }
}

.error-title {
  font-size: clamp(4rem, 15vw, 7rem);
  font-weight: 900;
  color: var(--primary);
  line-height: 1;
  margin-bottom: var(--sp-3);
}
.error-subtitle { font-size: 1.3rem; font-weight: 700; margin-bottom: var(--sp-3); }
.error-desc { color: var(--text-muted); margin-bottom: var(--sp-6); }
.error-actions { display: flex; flex-direction: column; align-items: center; gap: var(--sp-4); }

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  background: var(--primary);
  color: var(--white) !important;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-md);
  transition: background .2s, transform .2s;
}
.btn-home:hover { background: var(--primary-hover); transform: translateY(-2px); color: var(--white) !important; }

/* -----------------------------------------------------------------------
   Comments
----------------------------------------------------------------------- */
.comments-area {
  margin-top: var(--sp-8);
  padding-top: var(--sp-8);
  border-top: 1px solid var(--border);
}
.comments-title { font-size: 1.1rem; font-weight: 800; margin-bottom: var(--sp-6); }
.comments-title span { color: var(--primary); }

.comment-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-5); }

.comment-body {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
}

.comment-author .avatar { border-radius: var(--r-full); }
.comment-meta { font-size: 0.8rem; color: var(--text-muted); margin-bottom: var(--sp-2); }
.comment-content { font-size: 0.9rem; color: var(--text); }

.comment-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: var(--sp-2);
  color: var(--gray-700);
}

.comment-form-captcha {
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-3);
}
.comment-form-captcha label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
  margin-bottom: var(--sp-2);
}
.comment-form-captcha input[type="number"] {
  width: 90px;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 1rem;
  font-family: var(--font-ar);
  text-align: center;
  display: block;
  margin-top: var(--sp-2);
}
.comment-form-captcha input[type="number"]:focus {
  outline: 2px solid var(--primary);
  border-color: var(--primary);
}

.btn-submit-comment {
  background: var(--primary);
  border: none;
  border-radius: var(--r-md);
  color: var(--white);
  cursor: pointer;
  font-family: var(--font-ar);
  font-size: 0.9rem;
  font-weight: 700;
  padding: var(--sp-3) var(--sp-6);
  transition: background .2s;
}
.btn-submit-comment:hover { background: var(--primary-hover); }

/* -----------------------------------------------------------------------
   Footer
----------------------------------------------------------------------- */
.site-footer {
  background: var(--gray-800);
  border-top: 1px solid var(--gray-700);
  color: var(--gray-300);
  margin-top: auto;
}

.footer-widgets {
  padding-block: var(--sp-10);
  border-bottom: 1px solid var(--gray-700);
}

.footer-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--sp-8);
}

.footer-widget-title {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-300);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--gray-700);
}

.footer-nav-wrap {
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--gray-700);
}

.footer-nav-menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1);
  justify-content: center;
  list-style: none;
}
.footer-nav-menu a {
  font-size: 0.82rem;
  color: var(--gray-400);
  padding: var(--sp-1) var(--sp-3);
  border-radius: var(--r-sm);
  transition: color .2s, background .2s;
}
.footer-nav-menu a:hover { color: var(--white); background: rgba(255,255,255,.06); }

.footer-bottom { padding-block: var(--sp-5); }

.footer-bottom-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-2);
}

.copyright, .disclaimer { font-size: 0.8rem; color: var(--gray-300); }

/* -----------------------------------------------------------------------
   Back to Top
----------------------------------------------------------------------- */
.back-to-top {
  position: fixed;
  bottom: var(--sp-6);
  inset-inline-end: var(--sp-6);
  width: 42px;
  height: 42px;
  background: var(--primary);
  border: none;
  border-radius: var(--r-full);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: background .2s, transform .2s;
  z-index: 50;
}
.back-to-top[hidden] { display: none; }
.back-to-top:hover { background: var(--primary-hover); transform: translateY(-3px); }

/* -----------------------------------------------------------------------
   Search Form (widget / standalone)
----------------------------------------------------------------------- */
.widget .search-form,
.error-actions .search-form { display: flex; gap: var(--sp-2); }
.widget .search-field { flex: 1; }
.widget .search-submit {
  background: var(--primary);
  border: none;
  border-radius: var(--r-sm);
  color: var(--white);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--sp-3);
  height: 40px;
  transition: background .2s;
}
.widget .search-submit:hover { background: var(--primary-hover); }

/* -----------------------------------------------------------------------
   No Results
----------------------------------------------------------------------- */
.no-results-box {
  text-align: center;
  padding-block: var(--sp-12);
  color: var(--text-muted);
}
.no-results-icon { font-size: 3rem; margin-bottom: var(--sp-4); }
.no-results-title { font-size: 1.4rem; color: var(--heading); margin-bottom: var(--sp-3); }
.no-results-text { max-width: 400px; margin-inline: auto; margin-bottom: var(--sp-6); }

/* -----------------------------------------------------------------------
   WordPress Core Classes Overrides
----------------------------------------------------------------------- */
.wp-block-image img { border-radius: var(--r-md); }
.wp-block-quote {
  border-inline-start: 3px solid var(--primary);
  background: var(--blue-50);
  padding: var(--sp-4) var(--sp-5);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.wp-block-separator { border-color: var(--border); }
.wp-block-code { background: var(--gray-900); border: 1px solid var(--gray-800); border-radius: var(--r-md); }
.wp-block-table td, .wp-block-table th { border-color: var(--border); }

/* Alignments */
.alignleft   { float: inline-start; margin-inline-end: var(--sp-5); margin-bottom: var(--sp-3); }
.alignright  { float: inline-end; margin-inline-start: var(--sp-5); margin-bottom: var(--sp-3); }
.aligncenter { margin-inline: auto; display: block; }

/* Screen reader */
.screen-reader-text {
  clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

/* -----------------------------------------------------------------------
   Utility
----------------------------------------------------------------------- */
.text-primary { color: var(--primary); }
.text-muted   { color: var(--text-muted); }
.text-heading { color: var(--heading); }
.mt-auto      { margin-top: auto; }
.hidden       { display: none !important; }

/* -----------------------------------------------------------------------
   Scrollbar (webkit)
----------------------------------------------------------------------- */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* -----------------------------------------------------------------------
   Print
----------------------------------------------------------------------- */
@media print {
  .site-header, .site-footer, .widget-area,
  .related-posts-section, .back-to-top, .app-cta-wrap { display: none; }
  .content-sidebar-grid { grid-template-columns: 1fr; }
  body { background: white; color: black; }
}

/* -----------------------------------------------------------------------
   Inline Download Mirrors (single.php)
----------------------------------------------------------------------- */
.inline-mirrors-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-block: var(--sp-6);
  box-shadow: var(--shadow-card);
}

.inline-mirrors-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.inline-mirrors-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.inline-mirror-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color .2s, background .2s;
}
.inline-mirror-row:hover { border-color: var(--primary); background: var(--primary-light); }

.im-icon { font-size: 1.2rem; flex-shrink: 0; line-height: 1; }

.im-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.im-label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.im-size { font-size: 0.72rem; color: var(--text-muted); }

.im-count {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.72rem;
  color: var(--text-faint);
  white-space: nowrap;
}

.im-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  background: var(--primary);
  color: var(--white) !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  white-space: nowrap;
  transition: background .2s, transform .15s;
}
.im-btn:hover { background: var(--primary-hover); transform: translateY(-1px); color: var(--white) !important; }
.im-btn.is-loading { opacity: .7; pointer-events: none; }

.view-dl-page-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  border: 1px solid var(--blue-100);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-4);
  transition: background .2s, border-color .2s;
}
.view-dl-page-btn:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* -----------------------------------------------------------------------
   Download Landing Page
----------------------------------------------------------------------- */
.dl-page-main { background: var(--page-bg); }

.dl-page-wrap { padding-block: var(--sp-8); }

.dl-page-inner {
  max-width: 680px;
  margin-inline: auto;
  padding-inline: var(--sp-4);
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
}

/* App info card */
.dl-app-card {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-card);
}

.dl-app-icon-wrap { flex-shrink: 0; }
.dl-app-icon {
  width: 80px;
  height: 80px;
  border-radius: var(--r-lg);
  border: 1px solid var(--border);
  object-fit: cover;
  box-shadow: var(--shadow-sm);
}
.dl-app-icon-placeholder {
  width: 80px;
  height: 80px;
  border-radius: var(--r-lg);
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  border: 1px solid var(--border);
}

.dl-app-details { flex: 1; min-width: 0; }
.dl-app-title { font-size: 1.15rem; font-weight: 900; color: var(--heading); margin-bottom: 4px; }
.dl-app-dev   { font-size: 0.82rem; color: var(--text-muted); margin-bottom: var(--sp-2); }
.dl-app-badges { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-2); }

.dl-total-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  color: var(--primary);
  text-align: center;
}
.dl-total-num { font-size: 1.1rem; font-weight: 900; color: var(--heading); }
.dl-total-lbl { font-size: 0.68rem; color: var(--text-muted); }

/* Countdown card — centered prominent layout */
.dl-countdown-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-8) var(--sp-6);
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--sp-4);
}

.dl-preparing {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.dl-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dl-ring-wrap .countdown-ring {
  position: absolute;
  inset: 0;
  width: 140px;
  height: 140px;
}

#countdown-progress { transition: stroke-dashoffset .95s linear; }

.dl-ring-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.countdown-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--primary);
  display: block;
  min-width: 2ch;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.countdown-unit { font-size: 0.72rem; color: var(--text-muted); margin-top: 4px; }

.dl-cd-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--heading);
  margin: 0;
}
.dl-cd-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin: 0;
}

.dl-main-btn { font-size: 1.1rem; padding: var(--sp-4) var(--sp-10); min-width: 220px; justify-content: center; }

.countdown-done .countdown-number { color: var(--green-600); }
.countdown-done .dl-cd-title      { color: var(--green-600); }
.countdown-done .dl-cd-sub        { color: var(--green-600); font-weight: 600; }

/* Mirrors section */
.dl-mirrors-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-card);
}

.dl-mirrors-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 1rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: var(--sp-5);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--border);
}

.dl-mirrors-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.dl-mirror-item {
  display: grid;
  grid-template-columns: 2.5rem 1fr auto auto 120px;
  align-items: center;
  gap: var(--sp-3);
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  transition: border-color .2s, background .2s;
}
.dl-mirror-item:hover { border-color: var(--primary); background: var(--primary-light); }

.dl-mirrors-section.mirrors-ready {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light), var(--shadow-card);
  animation: mirrorsReveal .4s ease;
}
@keyframes mirrorsReveal {
  from { transform: translateY(6px); opacity: .6; }
  to   { transform: translateY(0);   opacity: 1;  }
}

.dl-mirror-icon { font-size: 1.4rem; text-align: center; line-height: 1; }
.dl-mirror-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-mirror-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--heading);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-mirror-server { font-size: 0.72rem; color: var(--text-muted); }
.dl-mirror-meta   { display: flex; flex-direction: column; gap: 3px; text-align: end; }
.dl-mirror-size   { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; }
.dl-mirror-count  { font-size: 0.7rem; color: var(--text-faint); white-space: nowrap; }

.dl-mirror-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  background: var(--primary);
  color: var(--white) !important;
  font-size: 0.85rem;
  font-weight: 700;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-md);
  white-space: nowrap;
  transition: background .2s, transform .15s;
}
.dl-mirror-btn:hover { background: var(--primary-hover); transform: translateY(-1px); color: var(--white) !important; }
.dl-mirror-btn.is-loading { opacity: .65; pointer-events: none; cursor: wait; }

/* Safety notice */
.dl-safety-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-4);
  background: var(--green-50);
  border: 1px solid rgba(22,163,74,.2);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
}
.dl-safety-icon { color: var(--green-600); flex-shrink: 0; margin-top: 2px; }
.dl-safety-text { flex: 1; }
.dl-safety-text strong { display: block; color: var(--heading); margin-bottom: 4px; font-size: 0.95rem; }
.dl-safety-text p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }
.dl-safety-checks { display: flex; flex-direction: column; gap: var(--sp-1); flex-shrink: 0; }
.safety-check { font-size: 0.78rem; color: var(--green-600); font-weight: 600; white-space: nowrap; }

/* Quick info */
.dl-quick-info {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-card);
}
.dl-quick-info h3 {
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--border);
}
.dl-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--sp-4);
}
.dl-quick-item   { display: flex; flex-direction: column; gap: 4px; }
.dl-quick-label  { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.dl-quick-val    { font-size: 0.9rem; font-weight: 700; color: var(--heading); }

/* Back link */
.dl-back-link { text-align: center; padding-bottom: var(--sp-4); }
.dl-back-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.85rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-2) var(--sp-4);
  transition: color .2s, border-color .2s;
}
.dl-back-btn:hover { color: var(--primary); border-color: var(--primary); }

/* Responsive: download page */
@media (max-width: 768px) {
  .dl-countdown-box {
    flex-direction: column;
    text-align: center;
    gap: var(--sp-5);
    padding: var(--sp-6) var(--sp-4);
  }
  .dl-mirror-item {
    grid-template-columns: 2rem 1fr auto;
    grid-template-rows: auto auto;
  }
  .dl-mirror-info { grid-column: 2; }
  .dl-mirror-meta { grid-column: 3; grid-row: 1; }
  .dl-mirror-btn  { grid-column: 1 / -1; justify-content: center; margin-top: var(--sp-1); }
  .dl-app-summary { flex-wrap: wrap; }
  .dl-total-count { flex-direction: row; gap: var(--sp-3); }
}

@media (max-width: 480px) {
  .dl-app-summary  { flex-direction: column; align-items: flex-start; }
  .dl-safety-notice { flex-direction: column; }
  .dl-safety-checks { flex-direction: row; flex-wrap: wrap; gap: var(--sp-3); }
  .dl-app-card { flex-direction: column; align-items: center; text-align: center; }
  .dl-app-dev  { text-align: center; }
  .dl-app-badges { justify-content: center; }
  .dl-app-details { display: flex; flex-direction: column; align-items: center; }
}

/* Mirror button flash */
.btn-mirror.flash { animation: mirrorFlash .4s ease; }

/* -----------------------------------------------------------------------
   Screenshots Section
----------------------------------------------------------------------- */
.app-screenshots-section {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: var(--sp-5) 0;
}

.screenshots-heading {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--heading);
  margin-bottom: var(--sp-4);
}

.screenshots-strip {
  display: flex;
  gap: var(--sp-3);
  overflow-x: auto;
  padding-bottom: var(--sp-2);
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
  -webkit-overflow-scrolling: touch;
}
.screenshots-strip::-webkit-scrollbar { height: 4px; }
.screenshots-strip::-webkit-scrollbar-track { background: transparent; }
.screenshots-strip::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 2px; }

.screenshot-item {
  flex-shrink: 0;
  border: none;
  background: none;
  padding: 0;
  cursor: pointer;
  scroll-snap-align: start;
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .2s, box-shadow .2s;
  display: block;
}
.screenshot-item:hover,
.screenshot-item:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.screenshot-thumb {
  display: block;
  height: 220px;
  width: auto;
  max-width: 130px;
  object-fit: cover;
}

/* -----------------------------------------------------------------------
   Screenshots Lightbox
----------------------------------------------------------------------- */
.screenshots-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  backdrop-filter: blur(6px);
}
.screenshots-lightbox[hidden] { display: none; }

.lb-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 90vh;
}
.lb-img {
  display: block;
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--r-lg);
  box-shadow: 0 8px 60px rgba(0,0,0,.6);
  object-fit: contain;
}

.lb-close {
  position: fixed;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .2s;
  z-index: 1;
}
.lb-close:hover { background: rgba(255,255,255,.3); }

.lb-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background .2s;
}
.lb-nav:hover { background: rgba(255,255,255,.3); }
.lb-prev { right: var(--sp-4); }
.lb-next { left: var(--sp-4); }

.lb-counter {
  position: fixed;
  bottom: var(--sp-5);
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,.65);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: .04em;
  margin: 0;
  pointer-events: none;
}

@media (max-width: 480px) {
  .screenshot-thumb { height: 180px; max-width: 105px; }
  .lb-prev { right: var(--sp-2); }
  .lb-next { left: var(--sp-2); }
}
@keyframes mirrorFlash {
  0%   { background: var(--primary); }
  50%  { background: var(--blue-500); }
  100% { background: var(--primary); }
}
