/* ============================================================
   NATION NEWS HINDI — SHARED DESIGN SYSTEM
   Loaded by every public page via includes/head.php. Bootstrap
   5.3 utility classes (d-flex, container, row/col, etc.) are still
   used throughout the markup — this file layers a premium,
   "hitech SaaS" visual language on top of them rather than
   replacing Bootstrap outright, so existing markup keeps working.

   Both themes are CSS custom properties on :root / [data-theme],
   matching the toggle script already used on every page (dark by
   default, [data-theme="light"] override, localStorage-remembered).
   ============================================================ */

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

:root, [data-theme="dark"] {
  --bg:        #05070d;
  --bg-soft:   #0a0e1a;
  --surface:   #11151f;
  --surface-2: #171c2a;
  --text:      #f4f5f9;
  --muted:     #9399ad;
  --border:    rgba(255,255,255,0.09);
  --border-2:  rgba(255,255,255,0.16);

  --primary:    #e11d48;
  --primary-2:  #fb3a5d;
  --accent:     #22d3ee;
  --gold:       #fbbf24;

  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow:    0 20px 50px rgba(0,0,0,.35);
  --shadow-lg: 0 30px 80px rgba(0,0,0,.45);
}

[data-theme="light"] {
  --bg:        #f7f8fb;
  --bg-soft:   #ffffff;
  --surface:   #ffffff;
  --surface-2: #f1f3f8;
  --text:      #0b0e14;
  --muted:     #5b6472;
  --border:    rgba(10,14,26,0.09);
  --border-2:  rgba(10,14,26,0.16);
  --shadow:    0 20px 50px rgba(15,15,40,.10);
  --shadow-lg: 0 30px 80px rgba(15,15,40,.14);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans Devanagari', 'Manrope', system-ui, sans-serif;
  transition: background .25s ease, color .25s ease;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; }

.nn-accent { background: linear-gradient(90deg, var(--primary), var(--primary-2)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.nn-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--primary); background: rgba(225,29,72,.10);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 14px;
}

/* ---------- TICKER ---------- */
.ticker-wrap { background: #000; height: 44px; display: flex; overflow: hidden; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2000; }
.ticker-head { background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: #fff; padding: 10px 18px; font-weight: 900; font-size: .8rem; display: flex; align-items: center; letter-spacing: .04em; flex-shrink: 0; }
.ticker-track { display: flex; white-space: nowrap; gap: 40px; align-items: center; animation: ticker-move 40s linear infinite; }
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-move { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* ---------- NAV ---------- */
.main-nav {
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border); padding: 14px 0;
  position: sticky; top: 44px; z-index: 1900;
}
.brand-text { font-weight: 900; font-size: 1.7rem; letter-spacing: -0.03em; text-decoration: none; color: var(--text); }
.nav-link { font-weight: 700; font-size: .92rem; color: var(--text); opacity: .78; text-decoration: none; transition: opacity .15s, color .15s; }
.nav-link:hover, .nav-link.is-active { opacity: 1; color: var(--primary); }
.lang-pill {
  border: 1.5px solid var(--primary); color: var(--primary); padding: 6px 16px;
  border-radius: 999px; font-size: .78rem; font-weight: 800; text-decoration: none; transition: .2s;
}
.lang-pill:hover { background: var(--primary); color: #fff; }
.theme-toggle-btn { cursor: pointer; font-size: 1.15rem; background: none; border: 0; line-height: 1; color: var(--text); }

/* Mobile nav — every page that includes nav.php gets this for free.
   Fixes the original bug: categories were `d-none d-lg-flex` with no
   mobile alternative at all, so mobile visitors had zero way to
   browse categories except scrolling the footer. */
.nn-menu-btn { display: none; background: none; border: 0; padding: 6px; color: var(--text); cursor: pointer; }
.nn-menu-btn svg { display: block; }
.nn-mobile-panel {
  position: fixed; top: 0; right: 0; height: 100dvh; width: min(82vw, 340px);
  background: var(--bg-soft); border-left: 1px solid var(--border);
  transform: translateX(100%); transition: transform .3s ease;
  z-index: 2100; overflow-y: auto; padding: 90px 26px 30px; display: flex; flex-direction: column; gap: 4px;
}
.nn-mobile-panel.is-open { transform: translateX(0); }
.nn-mobile-panel a { padding: 14px 4px; font-weight: 700; text-decoration: none; color: var(--text); border-bottom: 1px solid var(--border); }
.nn-mobile-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 2050;
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility .3s ease;
}
.nn-mobile-backdrop.is-open { opacity: 1; visibility: visible; }
body.nn-menu-open { overflow: hidden; }
@media (max-width: 991px) {
  .nn-desktop-links { display: none !important; }
  .nn-menu-btn { display: inline-flex; align-items: center; justify-content: center; }
}

/* ---------- HERO / CARDS (homepage) ---------- */
.hero-box { border-radius: var(--radius-lg); overflow: hidden; position: relative; background: var(--surface); box-shadow: var(--shadow); }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.overlay {
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(0,0,0,.88) 8%, rgba(0,0,0,.15) 60%, transparent 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 42px; gap: 12px;
}
.overlay h2 { font-size: clamp(1.5rem, 3vw, 2.4rem); font-weight: 900; color: #fff; line-height: 1.25; text-shadow: 0 2px 14px rgba(0,0,0,.5); }

.news-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; display: block; text-decoration: none; color: inherit;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.news-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: var(--shadow); }
.news-card__img { aspect-ratio: 16/10; overflow: hidden; }
.news-card__img img { width: 100%; height: 100%; object-fit: cover; }

.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.section-title { font-weight: 900; font-size: clamp(1.3rem, 2.5vw, 1.7rem); border-left: 5px solid var(--primary); padding-left: 14px; margin: 0; }
.nn-view-all { font-size: 12px; font-weight: 700; color: var(--primary); text-decoration: none; white-space: nowrap; }
.nn-view-all:hover { text-decoration: underline; }
@media (max-width: 576px) { .nn-view-all { font-size: 11px; } }

.sidebar-card { position: sticky; top: 160px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.trending-num { font-family: 'Manrope', sans-serif; font-weight: 900; opacity: .3; }

/* ---------- BUTTONS ---------- */
.btn-nn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, var(--primary), var(--primary-2)); color: #fff !important;
  font-weight: 800; padding: 12px 26px; border-radius: 999px; text-decoration: none; border: 0;
  box-shadow: 0 12px 30px rgba(225,29,72,.30); transition: transform .15s, box-shadow .15s;
}
.btn-nn-primary:hover { transform: translateY(-2px); box-shadow: 0 18px 40px rgba(225,29,72,.4); color: #fff; }
.btn-nn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text); border: 1.5px solid var(--border-2);
  font-weight: 800; padding: 11px 24px; border-radius: 999px; text-decoration: none; transition: .15s;
}
.btn-nn-ghost:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- ARTICLE ---------- */
.article-hero { position: relative; width: 100%; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.hero-title { font-size: clamp(22px, 4vw, 38px); font-weight: 900; line-height: 1.28; color: #fff; }
.hero-meta { font-size: 14px; opacity: .92; color: #fff; }
.hero-overlay { position: absolute; left: 0; right: 0; bottom: 0; padding: 26px; background: linear-gradient(to top, rgba(0,0,0,.88), rgba(0,0,0,.2)); }

.article-body-content { font-size: 18px; line-height: 1.95; max-width: 100%; word-wrap: break-word; }
.article-body-content img { max-width: 100%; height: auto; border-radius: var(--radius-sm); margin: 18px 0; }
.article-body-content iframe, .article-body-content video { max-width: 100%; width: 100%; height: auto; }
/* Neutralize inline background/text-color styling baked into older
   articles' saved HTML (pasted from Word/Google Docs through the
   admin editor, which carries its own highlight/color spans along
   with the pasted text). Applies to every element inside the body,
   however deeply nested — the inline style beats this without
   !important, so !important is required here, not optional. */
.article-body-content [style*="background"] { background: transparent !important; background-color: transparent !important; }
.article-body-content [style*="color"] { color: inherit !important; }

.lead-box { background: rgba(225,29,72,.08); border-left: 6px solid var(--primary); padding: 22px; border-radius: var(--radius-md); font-weight: 700; }
.toc-box { background: rgba(255,255,255,.06); border: 1px solid var(--border); border-left: 4px solid var(--primary); border-radius: var(--radius-sm); }
[data-theme="light"] .toc-box { background: #f8fafc; }
.toc-link { text-decoration: none; color: inherit; font-weight: 600; opacity: .85; }
.toc-link:hover, .toc-link.active { color: var(--primary); opacity: 1; }

.also-read-box { background: rgba(225,29,72,.06); border-left: 4px solid var(--primary); }
.also-read-title { display: flex; align-items: center; gap: 10px; font-size: 1.25rem; font-weight: 900; }
.also-bar { width: 5px; height: 22px; background: var(--primary); border-radius: 10px; }
.also-card { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); overflow: hidden; transition: .25s; }
.also-card:hover { border-color: var(--primary); transform: translateY(-3px); }

.must-read-box { background: rgba(225,29,72,.08); border-left: 5px solid var(--primary); padding: 16px; margin: 26px 0; border-radius: var(--radius-sm); }
.must-read-label { font-size: 11px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; color: var(--primary); margin-bottom: 5px; }
.must-read-title { font-size: 16px; font-weight: 800; line-height: 1.4; color: var(--text); }
.must-read-link { text-decoration: none; display: block; }

/* ---------- AD UNITS ---------- */
.ad-container { width: 100%; max-width: 100%; margin: auto; text-align: center; min-height: 100px; }
.adsbygoogle { display: block !important; width: 100% !important; max-width: 100% !important; overflow: hidden; }
.ad-unit { position: relative; }
.ad-label { display: block; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; text-align: center; }
.ad-unit--image { margin: 0 auto; }
.ad-unit--image img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); }
.ad-unit--video { max-width: 400px; margin: 0 auto; border-radius: var(--radius-sm); overflow: hidden; background: #000; aspect-ratio: 16/9; position: relative; }
.ad-unit--video .ad-video-click { display: block; width: 100%; height: 100%; }
.ad-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.ad-video-playhint { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 44px; height: 44px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; font-size: 16px; display: flex; align-items: center; justify-content: center; pointer-events: none; opacity: .9; }
.ad-video-mute { position: absolute; bottom: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; border: none; font-size: 13px; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Backlink / advertorial card — title + description + optional
   thumbnail + outbound link. Always rendered with rel="sponsored" by
   the render function (see includes/ads-render.php), never a plain
   dofollow link — that's what keeps a paid placement like this
   compliant with Google's paid-link guidelines regardless of who
   the advertiser is. */
.ad-unit--link {
  display: flex; gap: 14px; align-items: center; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px;
  text-decoration: none; color: inherit; transition: .2s;
}
.ad-unit--link:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.ad-unit--link__thumb { width: 72px; height: 72px; border-radius: var(--radius-sm); object-fit: cover; flex-shrink: 0; background: var(--surface-2); }
.ad-unit--link__body { min-width: 0; }
.ad-unit--link__title { font-weight: 800; font-size: 15.5px; margin-bottom: 4px; }
.ad-unit--link__desc { font-size: 13.5px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ad-unit--link__url { font-size: 11.5px; color: var(--accent); font-weight: 700; margin-top: 4px; display: block; }

/* ---------- FORMS (contact form, newsletter, etc.) ---------- */
.form-control, .form-select {
  background: var(--bg); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: var(--radius-sm);
}
.form-control:focus, .form-select:focus {
  background: var(--bg); color: var(--text); border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(225,29,72,.15);
}
.form-control::placeholder { color: var(--muted); opacity: .8; }

/* ---------- FOOTER ---------- */
footer.nn-footer { background: #000; padding: 70px 0 40px; color: #94a3b8; border-top: 1px solid var(--border); }
.footer-link { color: #94a3b8; text-decoration: none; font-size: .9rem; transition: .2s; }
.footer-link:hover { color: var(--primary); padding-left: 4px; }

/* ---------- SHARED RESPONSIVE ---------- */
@media (max-width: 992px) {
  .hero-title { font-size: 26px; }
  .article-body-content { font-size: 17px; }
  .sidebar-card { position: relative; top: 0; margin-top: 40px; }
}
@media (max-width: 768px) {
  .brand-text { font-size: 1.4rem; }
  .hero-title { font-size: 22px; line-height: 1.4; }
  .hero-overlay { padding: 16px; }
  .article-body-content { font-size: 16px; line-height: 1.85; }
  .lead-box { font-size: 16px; padding: 16px; }
  .ticker-track { gap: 20px; font-size: 13.5px; }
  .article-hero { border-radius: 14px; }
  .overlay { padding: 22px; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 19px; }
  .article-body-content { font-size: 15px; }
  .ticker-head { padding: 10px 12px; font-size: 12px; }
}

/* ---------- STICKY MOBILE AD ---------- */
.sticky-ad { position: fixed; bottom: 0; left: 0; right: 0; background: var(--bg-soft); border-top: 1px solid var(--border); z-index: 9999; padding: 6px 5px 10px; box-shadow: 0 -3px 16px rgba(0,0,0,.25); text-align: center; min-height: 90px; max-height: 120px; }
.sticky-ad-close { position: absolute; top: -12px; right: 10px; background: var(--text); color: var(--bg); font-size: 14px; width: 24px; height: 24px; line-height: 24px; border-radius: 50%; cursor: pointer; text-align: center; }
body.has-sticky-ad { padding-bottom: 130px; }
@media (min-width: 768px) { .sticky-ad { display: none; } }
