/* ==========================================================================
   Dainik Bhaskar Style Responsive CSS
   Ensures 100% responsive, mobile-first, no horizontal overflow layout
   ========================================================================== */

/* Universal Box & Overflow Reset */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden !important;
  position: relative;
}

/* Visibility Utilities */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: flex !important;
}

/* ==========================================================================
   1. Large Screens & Laptops (Max 1199px)
   ========================================================================== */
@media (max-width: 1199px) {
  .bhaskar-grid-3col {
    grid-template-columns: 190px minmax(0, 1fr) 280px;
    gap: 16px;
  }
  
  .bhaskar-headline {
    font-size: 1.3rem;
  }

  .footer-grid {
    grid-template-columns: 1.2fr 1fr 1fr 1.2fr;
    gap: 20px;
  }
}

/* ==========================================================================
   2. Tablets & Small Laptops (Max 991px)
   ========================================================================== */
@media (max-width: 991px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  nav.bhaskar-cat-nav-bar.mobile-only {
    display: block !important;
  }

  .bhaskar-top-header {
    height: 78px;
  }

  .bhaskar-brand-logo-img {
    height: 68px;
    max-height: 68px;
    width: auto;
    object-fit: contain;
  }

  /* Single Column Stack */
  .bhaskar-grid-3col {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    gap: 0 !important;
  }

  .bhaskar-main-feed,
  .bhaskar-right-rail {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .bhaskar-right-rail {
    order: 3;
  }

  /* Drawer Navigation on Tablets */
  .bhaskar-left-nav {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100vh;
    z-index: 2100;
    border-radius: 0;
    border: none;
    box-shadow: 5px 0 25px rgba(0,0,0,0.3);
    overflow-y: auto;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }

  .bhaskar-left-nav.drawer-open {
    left: 0;
  }

  .bhaskar-mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .bhaskar-nav-header-mobile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 14px;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 10px;
  }

  .bhaskar-nav-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .bhaskar-nav-close {
    background: var(--gray-100);
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Footer 2-Columns on Tablets */
  .footer-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 24px !important;
  }
}

/* ==========================================================================
   3. Mobiles (Max 767px - Exact m.bhaskar.com Layout)
   ========================================================================== */
@media (max-width: 767px) {
  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: flex !important;
  }

  nav.bhaskar-cat-nav-bar.mobile-only {
    display: block !important;
  }

  /* Sticky Bottom Navigation Bar on Mobile */
  .bhaskar-mobile-bottom-nav {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 56px;
    background: #ffffff;
    border-top: 1px solid var(--gray-200);
    box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
    z-index: 2000;
    align-items: center;
    justify-content: space-around;
  }

  .bhaskar-bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--gray-500);
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    flex: 1;
    height: 100%;
  }

  .bhaskar-bottom-nav-item i {
    font-size: 1.25rem;
  }

  .bhaskar-bottom-nav-item.active {
    color: #f97316;
  }

  .bhaskar-bottom-nav-item.active i {
    color: #f97316;
  }

  /* =========================================================================
     Dainik Bhaskar Mobile Stream Design (Exact https://www.bhaskar.com/ Look)
     Matches Reference Images 3, 4, 5 with Bada Bada Bold Typography & Layout
     ========================================================================= */
  body {
    background: #ffffff !important;
    padding-bottom: 64px !important;
  }

  .bhaskar-page-body {
    background: #ffffff !important;
    padding: 0 0 20px 0 !important;
  }

  .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Single Column Full Width Layout (No Grid Gaps or Desktop Columns on Mobile) */
  .bhaskar-grid-3col,
  .bhaskar-layout-grid {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 0 !important;
  }

  .bhaskar-main-feed,
  .bhaskar-main-stream {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
  }

  .bhaskar-top-header {
    height: 56px !important;
    background: #ffffff !important;
    border-bottom: 1px solid #f4f4f5 !important;
  }

  .bhaskar-header-container {
    padding: 0 12px !important;
  }

  .bhaskar-header-left {
    gap: 8px !important;
    flex-shrink: 0 !important;
  }

  .bhaskar-brand-logo-img {
    height: 44px !important;
    max-height: 44px !important;
    width: auto !important;
    object-fit: contain !important;
  }

  /* Compact Top Billboard Ad on Mobile (Edge-to-Edge Responsive) */
  .bhaskar-top-ad-wrapper {
    padding: 6px 10px 10px !important;
    margin: 4px 0 !important;
    width: 100% !important;
    background: transparent !important;
    box-sizing: border-box !important;
  }

  .bhaskar-ad-banner-slot {
    min-height: auto !important;
    max-height: 140px !important;
    border-radius: 8px !important;
    width: 100% !important;
    overflow: hidden !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
    background: #ffffff !important;
  }

  .bhaskar-running-ad-img {
    width: 100% !important;
    height: auto !important;
    max-height: 140px !important;
    min-height: 80px !important;
    display: block !important;
    object-fit: cover !important;
    border-radius: 8px !important;
  }

  /* Category Swipe Bar - Exact Dainik Bhaskar Horizontal Scroll */
  .bhaskar-cat-scroll {
    padding: 4px 10px 0 10px !important;
    gap: 6px !important;
    border-bottom: 1px solid #f4f4f5 !important;
    display: flex !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  .bhaskar-cat-scroll::-webkit-scrollbar {
    display: none !important;
  }

  .bhaskar-cat-item {
    font-size: 0.95rem !important;
    font-weight: 700 !important;
    padding: 8px 10px 8px 10px !important;
    white-space: nowrap !important;
    color: #3f3f46 !important;
    border-radius: 0 !important;
    background: transparent !important;
    border-bottom: 2.5px solid transparent !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    text-decoration: none !important;
  }

  .bhaskar-cat-item.active {
    color: #18181b !important;
    font-weight: 800 !important;
    background: transparent !important;
    border-bottom: 2.5px solid #18181b !important;
  }

  /* Trending Tags Bar (Exact Dainik Bhaskar Screenshot 3) */
  .bhaskar-trending-bar {
    padding: 10px 12px !important;
    border-bottom: 1px solid #f4f4f5 !important;
    background: #ffffff !important;
  }

  .bhaskar-trending-inner {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .bhaskar-trending-inner::-webkit-scrollbar {
    display: none !important;
  }

  .bhaskar-trend-badge {
    color: #ef4444 !important;
    font-weight: 800 !important;
    font-size: 0.88rem !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
  }

  .bhaskar-trend-pills {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
  }

  .bhaskar-trend-pill {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #18181b !important;
    background: #ffffff !important;
    border: 1px solid #e4e4e7 !important;
    border-radius: 20px !important;
    padding: 3px 10px !important;
    text-decoration: none !important;
  }

  /* Hero Story Card 1 (Dainik Bhaskar Signature Full Width Feature - Reference Image 3) */
  .bhaskar-card-hero {
    background: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    border-bottom: 8px solid #f4f4f5 !important;
    box-shadow: none !important;
    padding: 14px 12px !important;
    margin: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .bhaskar-hero-headline {
    font-size: 1.40rem !important;
    font-weight: 800 !important;
    line-height: 1.34 !important;
    color: #18181b !important;
    margin: 0 0 10px 0 !important;
    word-break: break-word !important;
    letter-spacing: -0.2px !important;
  }

  .bhaskar-hero-headline a {
    color: #18181b !important;
    text-decoration: none !important;
  }

  .bhaskar-hero-subheadline,
  .bhaskar-hero-sub {
    display: none !important;
  }

  .bhaskar-hero-media {
    margin: 0 0 10px 0 !important;
    width: 100% !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  .bhaskar-hero-media figure {
    margin: 0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
  }

  .bhaskar-hero-media img,
  .bhaskar-hero-media video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    max-height: 240px !important;
    object-fit: cover !important;
    display: block !important;
    border-radius: 8px !important;
  }

  .bhaskar-hero-video-box {
    margin: 0 !important;
    border-radius: 8px !important;
    aspect-ratio: 16 / 9 !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* Continuous Pure White Feed Stream (Reference Images 4 & 5) */
  .bhaskar-feed-stream {
    background: #ffffff !important;
    width: 100% !important;
  }

  /* Split Cards: Large High-Contrast Headlines & Big Thumbnails (Bada Bada) */
  .bhaskar-card-split {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch !important;
    justify-content: space-between !important;
    background: #ffffff !important;
    border: none !important;
    border-bottom: 1px solid #f4f4f5 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    padding: 14px 12px !important;
    gap: 12px !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .bhaskar-split-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }

  .bhaskar-split-headline {
    font-size: 1.18rem !important;
    font-weight: 800 !important;
    line-height: 1.34 !important;
    color: #18181b !important;
    margin: 0 0 8px 0 !important;
    letter-spacing: -0.2px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .bhaskar-split-headline a {
    color: #18181b !important;
    text-decoration: none !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 4 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }

  .bhaskar-split-sub {
    display: none !important;
  }

  .bhaskar-split-right {
    flex: 0 0 118px !important;
    width: 118px !important;
    max-width: 118px !important;
    height: 88px !important;
    margin-left: 4px !important;
    align-self: flex-start !important;
  }

  .bhaskar-split-right .bhaskar-thumb-link {
    width: 118px !important;
    min-width: 118px !important;
    max-width: 118px !important;
    height: 88px !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    display: block !important;
    position: relative !important;
    background: #f4f4f5 !important;
  }

  .bhaskar-split-right .bhaskar-thumb-link img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
  }

  .bhaskar-thumb-play-circle {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 32px !important;
    height: 32px !important;
    background: rgba(0, 0, 0, 0.65) !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-size: 0.8rem !important;
  }

  .bhaskar-thumb-duration-pill {
    position: absolute !important;
    bottom: 4px !important;
    right: 4px !important;
    background: rgba(0, 0, 0, 0.8) !important;
    color: #ffffff !important;
    font-size: 0.68rem !important;
    font-weight: 700 !important;
    padding: 1px 5px !important;
    border-radius: 4px !important;
  }

  .bhaskar-card-bottom-bar {
    margin-top: 6px !important;
    padding-top: 0 !important;
    border-top: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
  }

  .bhaskar-tag-pill {
    font-size: 0.78rem !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    background: #ffffff !important;
    color: #3f3f46 !important;
    border-radius: 14px !important;
    border: 1px solid #e4e4e7 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
  }

  .bhaskar-share-btn {
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    color: #71717a !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 2px 6px !important;
    text-decoration: none !important;
  }

  .bhaskar-share-btn i {
    font-size: 0.95rem !important;
    color: #22c55e !important;
  }

  /* In-feed Google Follow Banner (Exact Reference Image 4) */
  .bhaskar-infeed-google-card {
    margin: 8px 0 !important;
    padding: 10px 14px !important;
    box-sizing: border-box !important;
    border-radius: 0 !important;
    background: #ffe8d6 !important; /* Authentic Bhaskar Peach Tint */
    border: none !important;
    border-top: 1px solid #ffd4b2 !important;
    border-bottom: 1px solid #ffd4b2 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
  }

  .bhaskar-infeed-google-text {
    font-size: 0.88rem !important;
    font-weight: 700 !important;
    color: #18181b !important;
    line-height: 1.3 !important;
  }

  .bhaskar-google-badge-btn {
    background: #1a73e8 !important;
    color: #ffffff !important;
    padding: 5px 12px !important;
    border-radius: 6px !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }

  /* Floating "ऐप खोलें" Pill (Reference Images 3, 4, 5) */
  .bhaskar-floating-app-pill {
    position: fixed !important;
    bottom: 64px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: #18181b !important;
    color: #ffffff !important;
    padding: 7px 18px !important;
    border-radius: 24px !important;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
    z-index: 99998 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
  }

  /* Sticky Bottom Navigation Bar on Mobile (Exact Reference Images 3, 4, 5) */
  .bhaskar-mobile-bottom-nav {
    display: flex !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 52px !important;
    background: #ffffff !important;
    border-top: 1px solid #e4e4e7 !important;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05) !important;
    z-index: 99999 !important;
    align-items: center !important;
    justify-content: space-around !important;
  }

  .bhaskar-bottom-nav-item {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 2px !important;
    color: #71717a !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    flex: 1 !important;
    height: 100% !important;
  }

  .bhaskar-bottom-nav-item i {
    font-size: 1.25rem !important;
  }

  .bhaskar-bottom-nav-item.active {
    color: #f97316 !important;
  }

  .bhaskar-bottom-nav-item.active i {
    color: #f97316 !important;
  }

  /* Right Rail on Mobile: Seamless below feed stream */
  .bhaskar-right-rail {
    margin: 14px 12px 20px 12px !important;
    width: auto !important;
  }

  /* Right Rail Widgets on Mobile */
  .google-follow-card {
    padding: 12px;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
  }

  .google-follow-text {
    font-size: 0.85rem;
  }

  .google-follow-btn {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  .bhaskar-sidebar-ad {
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .bhaskar-trending-widget {
    padding: 14px 12px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Footer 1-Column Stacking on Mobile */
  .site-footer {
    margin-top: 25px;
    width: 100%;
    overflow: hidden;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    width: 100% !important;
  }

  .footer-col {
    width: 100% !important;
    box-sizing: border-box;
  }

  .footer-top {
    padding: 25px 0 15px;
  }

  .footer-bottom-inner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
  }

  /* Article Reading Page Mobile - Exact Dainik Bhaskar Mobile App/Web */
  .article-rich-body {
    font-size: 1.15rem !important;
    line-height: 1.78 !important;
    color: #1e293b !important;
    word-break: break-word;
  }

  .article-rich-body p {
    margin-bottom: 16px;
  }

  .db-article-container {
    padding: 14px 12px !important;
    border-radius: 8px !important;
    margin-bottom: 16px !important;
  }

  .db-breadcrumb {
    font-size: 0.76rem !important;
    margin-bottom: 8px !important;
    gap: 4px !important;
  }

  .db-bc-current {
    max-width: 130px !important;
  }

  .db-headline {
    font-size: 1.65rem !important;
    font-weight: 900 !important;
    line-height: 1.3 !important;
    color: #0b0f19 !important;
    margin: 0 0 12px 0 !important;
    letter-spacing: -0.3px !important;
  }

  .db-story-highlights {
    padding: 12px 14px !important;
    margin-bottom: 16px !important;
    border-radius: 0 8px 8px 0 !important;
  }

  .db-highlights-header {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    margin-bottom: 8px !important;
  }

  .db-highlights-content {
    font-size: 1.02rem !important;
    line-height: 1.55 !important;
    color: #1e293b !important;
  }

  .db-meta-bar {
    padding: 10px 0 !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }

  .db-author-avatar {
    width: 36px !important;
    height: 36px !important;
    font-size: 1rem !important;
  }

  .db-author-name {
    font-size: 0.88rem !important;
  }

  .db-post-meta {
    font-size: 0.74rem !important;
  }

  .db-share-actions {
    gap: 6px !important;
  }

  .db-share-btn {
    width: 32px !important;
    height: 32px !important;
    font-size: 0.9rem !important;
  }

  .db-hero-media-wrapper {
    margin: 12px 0 16px 0 !important;
  }

  .bhaskar-media-figure {
    border-radius: 8px !important;
  }

  .db-wa-channel-box {
    padding: 9px 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
    margin: 12px 0 14px 0 !important;
  }

  .db-wa-join-pill {
    width: 100% !important;
    justify-content: center !important;
    padding: 7px 12px !important;
    font-size: 0.84rem !important;
  }

  .db-article-body {
    font-size: 1.05rem !important;
    line-height: 1.72 !important;
    margin-top: 12px !important;
  }

  .db-article-body p {
    margin-bottom: 10px !important;
    line-height: 1.72 !important;
  }

  .db-article-body p:empty,
  .db-article-body p:has(> br:only-child),
  .db-article-body div:empty,
  .db-article-body div:has(> br:only-child) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .db-article-body br + br {
    display: none !important;
  }

  .db-bottom-share-card {
    padding: 14px 12px !important;
    margin-top: 24px !important;
  }

  .db-bottom-share-title {
    font-size: 0.88rem !important;
  }

  .db-bottom-btn {
    font-size: 0.82rem !important;
    padding: 6px 12px !important;
  }

  .db-related-section {
    margin-top: 24px !important;
  }

  .db-section-title {
    font-size: 1.12rem !important;
  }

  .db-related-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .db-related-card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px !important;
    border-radius: 8px !important;
  }

  .db-related-thumb-link {
    flex: 0 0 110px !important;
    width: 110px !important;
    height: 75px !important;
    border-radius: 6px !important;
    aspect-ratio: auto !important;
  }

  .db-related-body {
    padding: 0 !important;
  }

  .db-related-headline {
    font-size: 0.88rem !important;
    margin: 0 0 4px 0 !important;
  }

  .db-related-headline a {
    -webkit-line-clamp: 2 !important;
  }

  .db-related-tag {
    font-size: 0.72rem !important;
    padding: 1px 6px !important;
    margin-bottom: 4px !important;
  }

  .db-related-time {
    font-size: 0.72rem !important;
  }
}
