/* ═══════════════════════════════════════════════════════════════════════════
   Al-Aqib News — site.css
   Mobile-first, RTL-aware, modern news layout
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --color-primary:     #c0392b;   /* Deep red — main brand */
  --color-primary-dk:  #96281b;
  --color-secondary:   #2c3e50;
  --color-accent:      #e74c3c;
  --color-bg:          #f8f9fa;
  --color-surface:     #ffffff;
  --color-text:        #1a1a2e;
  --color-muted:       #6c757d;
  --color-border:      #dee2e6;
  --font-latin:        'Georgia', 'Times New Roman', serif;
  --font-latin-ui:     'Inter', 'Segoe UI', system-ui, sans-serif;
  --font-urdu:         'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', serif;
  --radius:            0.5rem;
  --shadow-sm:         0 1px 3px rgba(0,0,0,.08);
  --shadow-md:         0 4px 12px rgba(0,0,0,.10);
  --transition:        0.2s ease;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font-latin-ui);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* RTL body */
body.rtl,
html[dir="rtl"] body {
  font-family: var(--font-urdu);
  line-height: 1.9;
}

/* Typography overrides for Urdu */
.font-urdu h1, .font-urdu h2, .font-urdu h3,
.font-urdu h4, .font-urdu h5, .font-urdu h6 {
  font-family: var(--font-urdu);
  line-height: 1.7;
}

.font-latin h1, .font-latin h2, .font-latin h3 {
  font-family: var(--font-latin);
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
header { position: relative; z-index: 100; }

.bg-primary-news {
  background-color: var(--color-secondary) !important;
}

.navbar-brand img { max-height: 42px; width: auto; object-fit: contain; }

.logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 6px;
  padding: 5px 12px;
  line-height: 0;
}

.search-form .form-control {
  min-width: 180px;
  border-radius: var(--radius) 0 0 var(--radius);
}

/* ── Date bar ────────────────────────────────────────────────────────────── */
.date-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .35rem 0;
  font-size: .8rem;
}

/* ── Breaking news ticker ────────────────────────────────────────────────── */
.breaking-news-bar {
  display: flex;
  align-items: center;
  background: var(--color-primary);
  color: #fff;
  overflow: hidden;
  padding: .45rem .75rem;
  gap: .5rem;
}

.breaking-label {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  background: rgba(0,0,0,.25);
  padding: .15rem .5rem;
  border-radius: 3px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-wrapper {
  flex: 1;
  overflow: hidden;
}

.ticker-content {
  display: inline-flex;
  white-space: nowrap;
  animation: ticker 30s linear infinite;
  font-size: .875rem;
}

.ticker-content:hover { animation-play-state: paused; }

@keyframes ticker {
  0%   { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

/* RTL ticker */
html[dir="rtl"] .ticker-content {
  animation: ticker-rtl 30s linear infinite;
}

@keyframes ticker-rtl {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── Section headers ────────────────────────────────────────────────────── */
.section-title {
  font-weight: 700;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--color-primary);
  white-space: nowrap;
  margin-bottom: 0;
}

.section-line {
  height: 2px;
  background: linear-gradient(to right, var(--color-primary) 40%, transparent);
}

html[dir="rtl"] .section-line {
  background: linear-gradient(to left, var(--color-primary) 40%, transparent);
}

/* ── Hero section ────────────────────────────────────────────────────────── */
.hero-section { position: relative; }

.hero-inner {
  min-height: 460px;
  background-color: var(--color-secondary);
  display: flex;
  align-items: flex-end;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.85) 0%, rgba(0,0,0,.25) 60%, transparent 100%);
}

.hero-title {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  color: #fff !important;
}

.hero-summary { font-size: .95rem; color: rgba(255,255,255,.8); }

.hero-meta { color: rgba(255,255,255,.7); }

.text-white-75 { color: rgba(255,255,255,.75); }

/* ── Article card ────────────────────────────────────────────────────────── */
.article-card {
  position: relative;        /* REQUIRED: scopes Bootstrap stretched-link ::after overlay */
  background: var(--color-surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card-img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.article-card-title {
  font-size: .95rem;
  font-weight: 700;
  line-height: 1.35;
}

.article-card-title a:hover { color: var(--color-primary) !important; }

.article-card-summary {
  font-size: .8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Badge — category ───────────────────────────────────────────────────── */
.badge-category {
  background-color: var(--color-primary);
  color: #fff;
  font-size: .65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .3em .55em;
  border-radius: 3px;
}

/* ── Article detail ──────────────────────────────────────────────────────── */
.article-title {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
}

html[dir="rtl"] .article-title { line-height: 1.6; }

.article-featured-img {
  width: 100%;
  max-height: 500px;
  object-fit: cover;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2d2d2d;
}

html[dir="rtl"] .article-content { line-height: 2; }

.article-content p  { margin-bottom: 1.25rem; }
.article-content h2 { font-size: 1.4rem; font-weight: 700; margin-top: 2rem; }
.article-content h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.5rem; }

.article-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: 1rem;
  color: var(--color-muted);
  font-style: italic;
  margin: 1.5rem 0;
}

html[dir="rtl"] .article-content blockquote {
  border-left: none;
  border-right: 4px solid var(--color-primary);
  padding-left: 0;
  padding-right: 1rem;
}

.article-content img { max-width: 100%; border-radius: var(--radius); }
.article-content a   { color: var(--color-primary); }

.article-meta { border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; }

.author-avatar { border: 2px solid var(--color-border); }

/* ── Comment section ────────────────────────────────────────────────────── */
.comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-border);
}

.comment-avatar-placeholder {
  width: 40px;
  height: 40px;
  background: var(--color-border);
  font-size: 1.1rem;
  color: var(--color-muted);
}

.comment-replies {
  border-left: 2px solid var(--color-border);
  padding-left: 1rem;
}

html[dir="rtl"] .comment-replies {
  border-left: none;
  border-right: 2px solid var(--color-border);
  padding-left: 0;
  padding-right: 1rem;
}

/* ── Category pills ─────────────────────────────────────────────────────── */
.category-pill { border-radius: 2rem; font-size: .8rem; }

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-secondary);
  color: rgba(255,255,255,.85);
  padding-top: 2.5rem;
  padding-bottom: .5rem;
}

/* Override Bootstrap's .text-muted inside the dark footer */
.site-footer .text-muted,
.site-footer .footer-muted {
  color: rgba(255,255,255,.6) !important;
}

.footer-muted {
  color: rgba(255,255,255,.6);
}

.footer-heading {
  color: #fff;
  font-size: .85rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: .75rem;
}

.footer-link {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  font-size: .875rem;
  display: block;
  margin-bottom: .4rem;
  transition: color var(--transition);
}

.footer-link:hover { color: #fff; }

.footer-divider { border-color: rgba(255,255,255,.15); }

.social-links { display: flex; gap: .75rem; flex-wrap: wrap; }

.social-link {
  color: rgba(255,255,255,.7);
  font-size: 1.3rem;
  text-decoration: none;
  transition: color var(--transition), transform var(--transition);
}

.social-link:hover { color: #fff; transform: translateY(-2px); }

/* ── Utility ─────────────────────────────────────────────────────────────── */
.z-1 { z-index: 1; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
  .hero-inner { min-height: 300px; }
  .article-title { font-size: 1.4rem; }
  .search-form .form-control { min-width: 120px; }
}

/* ── Reaction bar ────────────────────────────────────────────────────────── */
.reaction-bar {
  border: 1px solid var(--color-border);
}

.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 2px solid var(--color-border);
  border-radius: 2rem;
  padding: .35rem .85rem;
  font-size: .9rem;
  background: var(--color-surface);
  color: var(--color-muted);
  transition: all var(--transition);
  cursor: pointer;
  user-select: none;
}

.reaction-btn:hover {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #fff5f5;
}

.reaction-btn.liked {
  border-color: #e74c3c;
  color: #e74c3c;
  background: #fff5f5;
}

.reaction-btn.liked .reaction-icon {
  animation: heartPop .35s ease;
}

.reaction-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.reaction-count {
  font-weight: 600;
  min-width: 1.5ch;
}

@keyframes heartPop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ── Most Read sidebar ───────────────────────────────────────────────────── */
.most-read-list { counter-reset: most-read; }

.most-read-rank {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--color-border);
  line-height: 1;
  min-width: 1.8ch;
  flex-shrink: 0;
}

.most-read-item:first-child .most-read-rank { color: var(--color-primary); }
.most-read-item:nth-child(2) .most-read-rank { color: var(--color-accent); opacity: .7; }
.most-read-item:nth-child(3) .most-read-rank { color: var(--color-muted); }

.most-read-title {
  font-size: .875rem;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.most-read-title:hover { color: var(--color-primary) !important; }

/* ── Draggable trending strip ────────────────────────────────────────────── */
.drag-strip {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE/Edge */
  padding-bottom: .5rem;
  cursor: grab;
  user-select: none;
}

.drag-strip::-webkit-scrollbar { display: none; }  /* Chrome/Safari */

.drag-strip.is-dragging { cursor: grabbing; scroll-behavior: auto; }

.drag-card {
  flex: 0 0 220px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: box-shadow var(--transition), transform var(--transition);
}

.drag-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.drag-card-img-link { display: block; }

.drag-card-img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  pointer-events: none;   /* prevent image drag interfering */
}

.drag-card-body { padding: .75rem; }

.drag-card-title {
  font-size: .82rem;
  font-weight: 700;
  line-height: 1.35;
  margin: .35rem 0 .35rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.drag-card-title a:hover { color: var(--color-primary) !important; }

/* ── Page-load progress bar ──────────────────────────────────────────────── */
#page-loader {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), #ff6b6b);
  z-index: 9999;
  transition: width .3s ease;
  pointer-events: none;
}
#page-loader.loading { width: 70%; }
#page-loader.done    { width: 100%; opacity: 0; transition: width .2s, opacity .4s .1s; }

/* ── Upcoming Events section ─────────────────────────────────────────────── */
.events-section { background: var(--color-bg-alt, #f8f9fa); }

.event-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition), transform var(--transition);
}
.event-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.event-card-img-wrap { position: relative; }
.event-card-img { width: 100%; height: 160px; object-fit: cover; }
.event-badge {
  position: absolute; top: .5rem; right: .5rem;
  font-size: .7rem; padding: .25em .55em;
}

.event-card-body {
  display: flex;
  gap: .75rem;
  padding: 1rem;
  flex: 1;
}

.event-date-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-width: 42px;
  padding: .4rem .5rem;
  background: var(--color-primary);
  color: #fff;
  border-radius: 6px;
  text-align: center;
  line-height: 1.1;
}
.event-date-day   { font-size: 1.4rem; font-weight: 800; }
.event-date-month { font-size: .65rem; text-transform: uppercase; letter-spacing: .05em; }

.event-card-content { flex: 1; display: flex; flex-direction: column; }
.event-card-title {
  font-size: .9rem; font-weight: 700; line-height: 1.3;
  margin: 0 0 .4rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.event-card-location { font-size: .75rem; color: var(--color-text-muted); margin-bottom: .3rem; }
.event-card-desc { font-size: .78rem; color: var(--color-text-muted); margin-bottom: .5rem; flex: 1; }

/* ── Back-to-top button ──────────────────────────────────────────────────── */
.back-to-top-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1050;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: var(--color-primary);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
}
.back-to-top-btn.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top-btn:hover { background: var(--color-primary-dark, #0056b3); }

/* ── Archive / Latest page ───────────────────────────────────────────────── */
.archive-sidebar { position: sticky; top: 1.5rem; }

.archive-tree { border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }

.archive-year-node { border-bottom: 1px solid var(--color-border); }
.archive-year-node:last-child { border-bottom: none; }

.archive-year-btn {
  display: flex;
  align-items: center;
  width: 100%;
  padding: .6rem 1rem;
  background: var(--color-surface);
  border: none;
  text-align: start;
  font-weight: 700;
  font-size: .9rem;
  cursor: pointer;
  color: var(--color-text);
  transition: background var(--transition);
}
.archive-year-btn:hover,
.archive-year-btn.active { background: var(--color-bg-alt, #f1f3f5); }
.archive-year-btn.active  { color: var(--color-primary); }

.archive-year-link { color: inherit; }
.archive-year-link:hover { color: var(--color-primary); }

.archive-chevron { transition: transform .2s; font-size: .75rem; }
.archive-year-btn[aria-expanded="true"] .archive-chevron { transform: rotate(90deg); }

.archive-count {
  font-size: .72rem;
  color: var(--color-text-muted);
  background: var(--color-bg-alt, #f1f3f5);
  border-radius: 99px;
  padding: .1em .5em;
}

.archive-month-list { border-top: 1px solid var(--color-border); }
.archive-month-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem 1rem .45rem 2.2rem;
  font-size: .85rem;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}
.archive-month-link:hover { background: var(--color-bg-alt, #f1f3f5); color: var(--color-primary); }
.archive-month-link.active { color: var(--color-primary); font-weight: 600; background: var(--color-bg-alt, #f1f3f5); }

