/* =====================================================================
   KSA Holidays — ملف الألوان والتنسيق الموحّد (تباين عالٍ)
   يُحمَّل بعد تنسيق كل صفحة، فيتحكّم بألوان جميع الصفحات من مكان واحد
   ===================================================================== */

/* ---------- الوضع الفاتح: نصوص داكنة واضحة ---------- */
:root {
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-2: #e9eef4;
  --border: #cfd8e3;
  --border-2: #a9b7c8;
  --text: #0a1020;      /* تباين ~18:1 */
  --text-2: #1e293b;    /* تباين ~14:1 */
  --text-3: #475569;    /* تباين ~7:1 (كان 2.6:1) */
  --primary: #00612e;
  --primary-light: #008743;
  --primary-bg: #dff2e7;
  --primary-border: #8ccaa5;
  --info: #0a4f8f;
  --info-bg: #e1edf9;
  --info-border: #9ec2e8;
  --warn: #7a4300;
  --warn-bg: #fff1d1;
  --warn-border: #eec56b;
  --danger: #9b1c1c;
  --danger-bg: #fde4e4;
  --danger-border: #f3b0b0;
}

/* ---------- الوضع الداكن: نصوص فاتحة واضحة ---------- */
[data-theme="dark"] {
  --bg: #0a0e14;
  --surface: #141a23;
  --surface-2: #1c2430;
  --border: #334155;
  --border-2: #4b5b70;
  --text: #f8fafc;
  --text-2: #e2e8f0;
  --text-3: #b8c4d3;
  --primary: #5fe394;
  --primary-light: #86efac;
  --primary-bg: rgba(95, 227, 148, 0.14);
  --primary-border: rgba(95, 227, 148, 0.45);
  --info: #82bdff;
  --info-bg: rgba(130, 189, 255, 0.14);
  --info-border: rgba(130, 189, 255, 0.45);
  --warn: #fcd34d;
  --warn-bg: rgba(252, 211, 77, 0.14);
  --warn-border: rgba(252, 211, 77, 0.45);
}

/* ---------- خطوط أوضح وأكبر ---------- */
body { font-size: 16px; font-weight: 500; -webkit-font-smoothing: antialiased; }
p, li, .news-excerpt, .article-text, .faq-answer, .value-text, .news-item-body { font-weight: 500; }

.news-date, .holiday-hijri, .table-hijri, .countdown-label, .stat-label,
.keydate-date, .cal-weekdays, .status-badge, .table-badge, .news-category,
.news-src, .footer-col p, .footer-bottom, .calc-note, .calendar-legend,
.progress-head, .news-tag, .cal-quick-btn, .x-head span, .last-updated,
.ad-slot::before {
  font-size: 13px !important;
}
.holiday-name, .ev-name, .news-title { font-size: 15.5px; }
.detail-item, .schedule-table td, .news-excerpt, .x-text { font-size: 14px; }
.cal-day { font-size: 14px; font-weight: 600; }
.status-badge, .table-badge, .news-category { font-weight: 700; }

/* حدود وظلال أوضح للبطاقات */
.section, .holiday-card, .news-card, .article-card, .faq-item, .content-section,
.news-item, .contact-card, .content, .toc, .footer, .hero, .banner, .page-header {
  border-width: 1px; border-style: solid;
}

/* تمييز التركيز للوحة المفاتيح */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--info); outline-offset: 2px;
}

/* ---------- شريط التبويبات السفلي للجوال ---------- */
.tabbar { display: none; }

@media (max-width: 820px) {
  .nav-mobile-toggle, .nav-mobile { display: none !important; }

  body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }

  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; bottom: 0; right: 0; left: 0; z-index: 1001;
    background: var(--surface);
    border-top: 1px solid var(--border-2);
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.08);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
  }
  .tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 6px 2px; border-radius: 12px;
    color: var(--text-2); text-decoration: none;
    font-size: 12px; font-weight: 700; min-height: 54px;
    transition: background 0.15s, color 0.15s;
  }
  .tab i { font-size: 23px; }
  .tab.active { color: var(--primary); background: var(--primary-bg); }
  .tab:active { background: var(--surface-2); }

  .to-top { bottom: calc(84px + env(safe-area-inset-bottom, 0px)) !important; }
}

/* ---------- الأخبار المباشرة ---------- */
.live-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--danger);
  background: var(--danger-bg); border: 1px solid var(--danger-border);
  padding: 3px 10px; border-radius: 999px;
}
.live-badge::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--danger); animation: livePulse 1.6s infinite;
}
@keyframes livePulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.live-meta { font-size: 12.5px; color: var(--text-3); margin-top: 10px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.live-refresh {
  font-family: inherit; font-size: 12.5px; font-weight: 700; color: var(--info);
  background: var(--info-bg); border: 1px solid var(--info-border);
  padding: 4px 10px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.live-list { display: flex; flex-direction: column; }
.live-item {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 13px 0; border-bottom: 1px solid var(--border);
  text-decoration: none; color: inherit;
}
.live-item:last-child { border-bottom: none; }
.live-item:hover .live-title { color: var(--primary); }
.live-dot { width: 34px; height: 34px; border-radius: 9px; background: var(--primary-bg); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 17px; flex-shrink: 0; }
.live-title { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.55; }
.live-sub { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }
.skeleton { height: 54px; border-radius: 10px; margin: 8px 0; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
