/* 
   निर्माणलहर (Nirman Lahar) - Modern Nepali News Portal Stylesheet
   Designed for High Readability, Devanagari Typography & Modern Layouts
*/

@import url('https://fonts.googleapis.com/css2?family=Mukta:wght@300;400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary: #c21807; /* Classic Nepali News Crimson Red */
  --primary-hover: #9e1204;
  --primary-light: #fee2e2;
  --secondary: #0f172a;
  --accent: #2563eb;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --bg-header: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-width: 1240px;
}

[data-theme="dark"] {
  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-header: #111827;
  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Mukta', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s ease, color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--primary);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 16px;
}

/* -----------------------------
   Top Information Bar
----------------------------- */
.top-bar {
  background-color: #0f172a;
  color: #cbd5e1;
  font-size: 14px;
  border-bottom: 1px solid #1e293b;
  padding: 6px 0;
}

.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.date-time-box {
  display: flex;
  align-items: center;
  gap: 14px;
}

.date-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.top-right-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.social-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1e293b;
  color: #cbd5e1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  transition: all 0.2s ease;
}

.social-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateY(-1px);
}

.theme-toggle-btn {
  background: transparent;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.admin-login-link {
  color: #93c5fd;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-login-link:hover {
  color: #ffffff;
}

/* -----------------------------
   Middle Header (Branding & 728x90 Ad)
----------------------------- */
.site-header {
  background-color: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 18px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.brand-wrapper {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 42px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.brand-tagline {
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

.header-ad-box {
  min-width: 320px;
  max-width: 728px;
  height: 90px;
  background: #f1f5f9;
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .header-ad-box {
  background: #1e293b;
}

.ad-sponsor-tag {
  position: absolute;
  top: 2px;
  right: 4px;
  font-size: 10px;
  background: rgba(0,0,0,0.4);
  color: #fff;
  padding: 1px 4px;
  border-radius: 2px;
  text-transform: uppercase;
}

/* -----------------------------
   Main Navigation Bar
----------------------------- */
.main-nav {
  background-color: var(--primary);
  color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 99;
  box-shadow: var(--shadow-md);
}

.nav-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-links {
  display: flex;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-links li a {
  display: inline-block;
  padding: 12px 14px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 600;
  border-bottom: 3px solid transparent;
  transition: all 0.15s ease;
}

.nav-links li a:hover,
.nav-links li a.active {
  background-color: var(--primary-hover);
  border-bottom-color: #facc15;
}

.nav-search-btn {
  background: none;
  border: none;
  color: #ffffff;
  font-size: 18px;
  padding: 10px 14px;
  cursor: pointer;
}

/* -----------------------------
   Breaking News Ticker
----------------------------- */
.ticker-section {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 8px 0;
}

[data-theme="dark"] .ticker-section {
  background: #1e293b;
}

.ticker-wrapper {
  display: flex;
  align-items: center;
  gap: 14px;
}

.ticker-label {
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 15px;
  padding: 3px 12px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
}

.ticker-label::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.9; }
  50% { transform: scale(1.4); opacity: 0.4; }
  100% { transform: scale(0.9); opacity: 0.9; }
}

.ticker-content {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
}

.ticker-item {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-main);
  text-overflow: ellipsis;
  overflow: hidden;
}

/* -----------------------------
   Ad Placement Banners
----------------------------- */
.banner-ad-container {
  margin: 18px 0;
  display: flex;
  justify-content: center;
  width: 100%;
}

.banner-ad-box {
  width: 100%;
  max-width: 1200px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  position: relative;
  text-align: center;
}

[data-theme="dark"] .banner-ad-box {
  background: #1e293b;
}

.banner-ad-box img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  margin: 0 auto;
}

/* -----------------------------
   Lead Hero News (Home)
----------------------------- */
.lead-section {
  margin: 24px 0;
}

.lead-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.lead-primary-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}

.lead-primary-img-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.lead-primary-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.lead-primary-card:hover .lead-primary-img-wrap img {
  transform: scale(1.03);
}

.category-tag {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  z-index: 2;
}

.lead-primary-body {
  padding: 20px;
}

.lead-primary-title {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.lead-primary-excerpt {
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 14px;
}

.meta-info {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--text-muted);
  font-size: 14px;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Secondary Leads column */
.lead-secondary-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sub-lead-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  padding: 14px;
  display: flex;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.sub-lead-img {
  width: 120px;
  height: 85px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}

.sub-lead-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sub-lead-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

/* -----------------------------
   Category Section Layouts
----------------------------- */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 18px;
  padding-bottom: 4px;
}

.section-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--primary);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.view-all-link {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

/* 3-Column News Grid */
.news-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.news-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

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

.news-card-img-wrap {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
}

.news-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.news-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card-title {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 8px;
}

.news-card-excerpt {
  font-size: 15px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}

/* Main Layout with Sidebar */
.main-with-sidebar {
  display: grid;
  grid-template-columns: 2.2fr 1fr;
  gap: 28px;
  margin: 30px 0;
}

.sidebar-sticky-wrap {
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.sidebar-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.widget-title {
  font-size: 20px;
  font-weight: 800;
  border-left: 4px solid var(--primary);
  padding-left: 10px;
  margin-bottom: 16px;
}

.trending-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.trending-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--border-color);
}

.trending-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.trending-number {
  font-size: 26px;
  font-weight: 900;
  color: #94a3b8;
  line-height: 1;
  min-width: 24px;
}

.trending-item:hover .trending-number {
  color: var(--primary);
}

.trending-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
}

/* -----------------------------
   Single Article Detail Page
----------------------------- */
.article-detail-wrap {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: var(--shadow-sm);
}

.article-breadcrumbs {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.article-headline {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 18px;
}

.article-meta-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  padding: 14px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
  gap: 14px;
}

.author-info-box {
  display: flex;
  align-items: center;
  gap: 12px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: #cbd5e1;
}

.author-name {
  font-weight: 700;
  font-size: 16px;
}

.author-role-badge {
  font-size: 12px;
  color: var(--text-muted);
}

.reading-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}

.font-resize-btns {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.font-resize-btn {
  background: var(--bg-card);
  border: none;
  padding: 4px 10px;
  cursor: pointer;
  font-weight: 700;
  color: var(--text-main);
}

.font-resize-btn:hover {
  background: var(--primary);
  color: #fff;
}

.social-share-btns {
  display: flex;
  gap: 8px;
}

.share-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.share-fb { background: #1877f2; }
.share-wa { background: #25d366; }
.share-tw { background: #000000; }
.share-copy { background: #64748b; }

.article-featured-img-wrap {
  margin: 20px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
}

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

.image-caption-text {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  padding: 6px 0;
  font-style: italic;
  background: rgba(0,0,0,0.03);
}

.article-content-body {
  font-size: 20px;
  line-height: 1.85;
  color: var(--text-main);
  margin-top: 24px;
}

.article-content-body p {
  margin-bottom: 22px;
}

/* -----------------------------
   Footer
----------------------------- */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 40px 0 20px;
  margin-top: 50px;
  border-top: 4px solid var(--primary);
}

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

.footer-brand h3 {
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 15px;
  color: #94a3b8;
  margin-bottom: 14px;
}

.footer-col h4 {
  color: #fff;
  font-size: 18px;
  margin-bottom: 16px;
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 15px;
}

.footer-links a:hover {
  color: #ffffff;
  padding-left: 4px;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid #1e293b;
  font-size: 14px;
  color: #64748b;
}

/* -----------------------------
   Modal Popup Ad
----------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

.modal-content {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  max-width: 650px;
  width: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

.modal-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  z-index: 10;
}

.modal-close-btn:hover {
  background: var(--primary);
}

/* -----------------------------
   Responsive Mobile
----------------------------- */
@media (max-width: 900px) {
  .lead-grid,
  .main-with-sidebar,
  .news-grid-3,
  .footer-grid {
    grid-template-columns: 1fr;
  }
  
  .header-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .header-ad-box {
    width: 100%;
  }

  .article-headline {
    font-size: 28px;
  }
}
