/* ============================================================
   DAINIK BHASKAR CLONE - CSS RESET & VARIABLES
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800;900&family=Noto+Sans+Devanagari:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Exact Bhaskar Brand Colors */
  --orange: #FF8400;
  --orange-dark: #e67600;
  --blue: #0056b3;
  --blue-title: #0066cc; /* Colored titles in feed */
  --green-title: #2e7d32;
  --text-primary: #000000;
  --text-secondary: #4a4a4a;
  --text-light: #757575;
  --bg-body: #f2f2f2;
  --bg-card: #ffffff;
  --border-light: #f0f0f0;
  --border: #e0e0e0;
  --shadow-soft: 0 4px 20px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --container: 1200px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }

/* Responsive Visibility Helpers */
@media (max-width: 1023px) {
  .desktop-only { display: none !important; }
}

@media (min-width: 1024px) {
  .mobile-only { display: none !important; }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
  width: 100%;
}

/* ============================================================
   HEADER & SUBHEADER
   ============================================================ */
.top-subheader {
  background: #f7f7f7;
  border-bottom: 1px solid var(--border-light);
  font-size: 12px;
  color: #666;
  height: 30px;
}
.top-subheader-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}
.sub-left, .sub-center, .sub-right { display: flex; align-items: center; gap: 16px; }

.db-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

.db-logo-text { font-size: 24px; font-weight: 900; color: #000; }
.db-logo img { display: block; max-height: 70px; object-fit: contain; object-position: left center; }

@media (max-width: 1023px) {
  .db-logo {
    margin-left: -20px; /* Pulls image left to hide built-in white space */
  }
}

/* Header Nav Items */
.header-center-nav { display: flex; align-items: center; gap: 24px; }
.header-right-nav { display: flex; gap: 16px; align-items: center; }

.h-nav-item {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.h-nav-item:hover, .h-nav-item.active { color: #f26522; }

.header-search-dropdown {
  display: none;
  background: #f9f9f9;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.header-search-dropdown.active { display: block; }
.header-search-input { flex:1; padding:10px; border:1px solid #ccc; border-radius:4px 0 0 4px; font-size:14px; outline:none;}
.header-search-btn { padding:10px 16px; background:var(--orange); color:#fff; border:none; border-radius:0 4px 4px 0; font-weight:600; cursor:pointer;}

/* Mobile Category Strip */
.mobile-cat-strip {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border-light);
  scrollbar-width: none;
}
.mobile-cat-strip::-webkit-scrollbar { display: none; }
.m-cat-link {
  font-size: 14px;
  font-weight: 700;
  color: #4a4a4a;
  margin-right: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid transparent;
}
.m-cat-link.active { color: #f26522; border-bottom-color: #000; }

/* ============================================================
   MAIN LAYOUT GRID (Desktop)
   ============================================================ */
.main-wrapper {
  margin-top: 20px;
  margin-bottom: 80px; /* bottom margin for mobile nav */
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
}

@media (min-width: 1024px) {
  .main-wrapper {
    grid-template-columns: 200px 1fr 300px;
    margin-bottom: 40px;
  }
}

.center-feed {
  min-width: 0; /* Prevents grid blowout */
}

/* ============================================================
   LEFT SIDEBAR (Desktop Nav)
   ============================================================ */
.left-sidebar {
  position: sticky;
  top: 80px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 12px 0;
  box-shadow: var(--shadow-soft);
}

.desktop-cat-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  border-left: 4px solid transparent;
}

.desktop-cat-link:hover, .desktop-cat-link.active {
  background: #f5f5f5;
  border-left-color: var(--orange);
  color: var(--orange);
}

/* ============================================================
   MAIN CONTENT & FEED
   ============================================================ */
.main-content { min-width: 0; }

.page-view { display: none; }
.page-view.active { display: block; }

.trending-tags-strip {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  padding: 10px 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  margin-bottom: 16px;
  align-items: center;
  font-size: 12px;
  scrollbar-width: none;
}
.trending-tags-strip::-webkit-scrollbar { display: none; }
.tag-chip {
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px 10px;
  margin-right: 8px;
  background: #f9f9f9;
}

/* ============================================================
   NEWS CARDS (Exact Mobile/Desktop Layout)
   ============================================================ */

/* Hero Card */
.card-hero {
  background: #fff;
  margin-bottom: 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  cursor: pointer;
}
.card-hero:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.card-hero-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.card-hero-img-wrap img { width: 100%; height: 100%; object-fit: cover; }

/* Text OVER image on Mobile */
.card-hero-title-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  padding: 30px 16px 12px;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
}

/* Text ABOVE image on Desktop */
@media (min-width: 1024px) {
  .card-hero-title-overlay {
    position: static;
    background: #fff;
    color: var(--text-primary);
    padding: 16px 16px 12px;
    font-size: 26px;
    letter-spacing: -0.5px;
  }
}

/* Standard Feed Card (Text Left, Image Right) */
.card-feed {
  background: #fff;
  padding: 20px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-soft);
  transition: var(--transition);
  cursor: pointer;
}
.card-feed:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
  border-color: transparent;
}
.card-feed:last-child { margin-bottom: 0; }

.card-feed-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.card-feed-title {
  flex: 1;
  font-size: 17px;
  font-weight: 700;
  color: #0066cc; /* Default blue */
  line-height: 1.3;
  margin-bottom: 8px;
}
.card-feed-title.sports { color: #2e7d32; }

.card-feed-img-wrap {
  width: 120px;
  height: 68px; /* 16:9 approx */
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.card-feed-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.video-badge { position:absolute; bottom:4px; right:4px; background:rgba(0,0,0,0.7); color:#fff; font-size:10px; padding:2px 4px; border-radius:2px; font-weight:700;}
.play-icon { position:absolute; top:50%; left:50%; transform:translate(-50%,-50%); font-size:24px; color:rgba(255,255,255,0.9); }

/* Bottom Action Row (Category Tag + Share) */
.card-feed-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
}

.cat-pill {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-light);
  background: none;
  border: none;
  cursor: pointer;
}

/* ============================================================
   RIGHT SIDEBAR (Widgets)
   ============================================================ */
.right-sidebar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.widget-box {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 16px;
  overflow: hidden;
}
.widget-title {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.market-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}
.market-item:last-child { border-bottom: none; }
.market-val { font-weight: 700; }
.market-change { font-size: 12px; font-weight: 700; padding: 2px 6px; border-radius: 4px; }
.market-change.up { color: #2e7d32; background: #e8f5e9; }
.market-change.down { color: #d32f2f; background: #ffebee; }

.ad-placeholder {
  width: 300px;
  height: 250px;
  background: #eaeaea;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 12px;
  border-radius: 4px;
}
.epaper-widget-img { width: 100%; border-radius: 4px; border: 1px solid #ccc; }

.google-news-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffe4c4;
  padding: 12px;
  border-radius: 8px;
  text-decoration: none;
}

.widget-card {
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Common Header for Widgets */
.sidebar-card-header, .markets-header, .cricket-header {
  padding: 16px;
  font-size: 16px;
  font-weight: 800;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-light);
  background: var(--bg-body);
}

.sidebar-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
}

.sidebar-card-more {
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  text-decoration: none;
}

/* Trending Widget */
.trending-list {
  padding: 12px 16px;
}
.trending-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-light);
  cursor: pointer;
  transition: var(--transition);
}
.trending-item:last-child { border-bottom: none; padding-bottom: 0; }
.trending-item:hover { color: var(--blue); transform: translateX(4px); }
.trending-num {
  font-size: 20px;
  font-weight: 900;
  color: #ccc;
  min-width: 20px;
}
.trending-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

/* Markets Widget */
.markets-body {
  padding: 12px 16px;
}
.market-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
}
.market-row:last-child { border-bottom: none; padding-bottom: 0; }
.market-name { font-weight: 700; font-size: 14px; }
.market-sub { font-size: 11px; color: var(--text-light); }
.market-value { text-align: right; }
.market-points { font-weight: 800; font-size: 14px; }
.market-change { font-size: 12px; font-weight: 700; }
.market-change.up { color: #2e7d32; }
.market-change.down { color: #d32f2f; }

/* Cricket Widget */
.cricket-body {
  padding: 16px;
}
.cricket-team-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.cricket-team-row:last-child { margin-bottom: 0; }
.cricket-team-info { display: flex; align-items: center; gap: 12px; }
.cricket-flag { font-size: 20px; }
.cricket-team-name { font-weight: 700; font-size: 15px; }
.cricket-overs { font-size: 12px; color: var(--text-light); }
.cricket-score { text-align: right; }
.cricket-runs { font-size: 18px; font-weight: 800; }
.cricket-wickets { font-size: 14px; color: var(--text-light); }
.cricket-result {
  background: #fff8e1;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  color: #f57f17;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

/* ============================================================
   MOBILE BOTTOM NAVIGATION BAR
   ============================================================ */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--border);
  z-index: 1000;
}

.bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 10px;
  font-weight: 600;
  gap: 4px;
}

.bottom-nav-item.active { color: var(--orange); }
.bottom-nav-item .icon { font-size: 20px; }

.app-open-pill {
  position: absolute;
  top: -45px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
}

/* ============================================================
   FLOATING FEEDBACK TAB (Desktop)
   ============================================================ */
.feedback-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  background: #333;
  color: #fff;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  padding: 16px 8px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px 0 0 4px;
  cursor: pointer;
  z-index: 1000;
  letter-spacing: 1px;
}
.feedback-tab:hover { background: #000; }

.cat-section-header {
  margin-top: 20px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 18px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-light);
  background: #fff;
}

/* ============================================================
   CATEGORY LISTING PAGE
   ============================================================ */
.cat-listing-header {
  background: #fff;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-soft);
}
.cat-listing-name { font-size: 24px; font-weight: 900; color: var(--text-primary); }
.cat-listing-count { font-size: 14px; font-weight: 600; color: var(--text-light); }

.listing-card-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.listing-card-h {
  display: flex;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: var(--transition);
}
.listing-card-h:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}
.listing-card-img {
  width: 200px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  flex-shrink: 0;
}
.listing-card-img img { width: 100%; height: 100%; object-fit: cover; }
.listing-card-body {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}
.listing-card-cat { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 8px; }
.listing-card-title { font-size: 18px; font-weight: 800; line-height: 1.4; margin-bottom: 8px; }
.listing-card-summary { font-size: 14px; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ============================================================
   ARTICLE PAGE
   ============================================================ */
.article-layout {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.article-main {
  padding: 24px;
}

.article-breadcrumb {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb-link { color: var(--text-light); text-decoration: none; transition: color 0.2s; }
.breadcrumb-link:hover { color: var(--orange); }
.breadcrumb-sep { font-size: 16px; color: #ccc; }

.article-cat-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--blue);
  padding: 4px 10px;
  border-radius: 4px;
  margin-bottom: 16px;
}

.article-headline {
  font-size: 32px;
  font-weight: 900;
  line-height: 1.3;
  color: #000;
  margin-bottom: 12px;
}

.article-summary-lead {
  font-size: 18px;
  font-weight: 500;
  color: #444;
  line-height: 1.5;
  margin-bottom: 20px;
}

.article-meta-row {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--text-secondary);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.article-author { font-weight: 700; color: #000; }

.article-share-btns {
  display: flex;
  gap: 8px;
  margin-left: auto;
}
.share-btn {
  background: #f5f5f5;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}
.share-btn:hover { background: #e0e0e0; transform: translateY(-2px); }

.feed-share-btn {
  background: #f5f5f5;
  border: none;
  padding: 6px 12px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #333;
  cursor: pointer;
  transition: var(--transition);
}
.feed-share-btn:hover { background: #e0e0e0; transform: translateY(-1px); }

.article-hero-img {
  width: 100%;
  max-height: 450px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}
.article-img-caption {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-content p {
  font-size: 18px;
  line-height: 1.8;
  color: #222;
  margin-bottom: 20px;
}

.article-tags {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 16px;
}
.tags-label { font-weight: 700; font-size: 14px; }
.tag-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.tag-chip {
  background: #f0f0f0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: #333;
  cursor: pointer;
  transition: var(--transition);
}
.tag-chip:hover { background: var(--orange); color: #fff; }

.related-articles { margin-top: 40px; }
.related-title { font-size: 24px; font-weight: 800; margin-bottom: 20px; border-bottom: 2px solid var(--orange); padding-bottom: 10px; display: inline-block; }
