/* ==========================================================================
   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: 16px !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;
  }

  /* Body Padding for Bottom Nav */
  body {
    padding-bottom: 56px;
  }

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

  .bhaskar-header-container {
    padding: 0 10px;
  }

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

  .bhaskar-brand-logo {
    display: flex;
    align-items: center;
  }

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

  .footer-logo {
    justify-content: flex-start;
  }

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

  /* Category Swipe Bar */
  .bhaskar-cat-scroll {
    padding: 6px 10px;
    gap: 10px;
  }

  .bhaskar-cat-item {
    font-size: 0.88rem;
    padding: 4px 10px;
  }

  /* Compact Top Billboard Ad on Mobile */
  .bhaskar-top-ad-wrapper {
    padding: 6px 0 2px;
    width: 100%;
    overflow: hidden;
  }

  .bhaskar-ad-banner-slot {
    min-height: 50px;
    max-height: 65px;
    border-radius: var(--radius-sm);
    width: 100%;
  }

  .bhaskar-running-ad-img {
    max-height: 60px;
    object-fit: contain;
  }

  .bhaskar-page-body {
    padding: 8px 0 30px;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
    width: 100%;
    max-width: 100%;
  }

  .bhaskar-trending-bar {
    padding-bottom: 8px;
  }

  /* Hero Story Card 1 */
  .bhaskar-card-hero {
    padding: 12px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  .bhaskar-hero-headline {
    font-size: 1.2rem;
    line-height: 1.38;
    margin-bottom: 6px;
    word-break: break-word;
  }

  .bhaskar-hero-subheadline {
    font-size: 0.88rem;
    line-height: 1.4;
    margin-bottom: 8px;
    word-break: break-word;
  }

  .bhaskar-hero-media {
    margin: 8px 0;
  }

  .bhaskar-hero-media img,
  .bhaskar-hero-media video {
    max-height: 280px;
    object-fit: cover;
  }

  /* Split Cards (Cards 2+) - 100% Fit without Overflow */
  .bhaskar-card-split {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 12px !important;
    margin-bottom: 12px !important;
    border-radius: var(--radius-sm) !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .bhaskar-split-left {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    overflow: hidden !important;
  }

  .bhaskar-split-headline {
    font-size: 0.98rem !important;
    line-height: 1.35 !important;
    margin-bottom: 4px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
  }

  .bhaskar-split-headline a {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .bhaskar-split-sub {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
    margin-bottom: 6px !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .bhaskar-split-right {
    flex: 0 0 95px !important;
    width: 95px !important;
    max-width: 95px !important;
    margin-left: 6px;
  }

  .bhaskar-split-right .bhaskar-thumb-link {
    width: 95px !important;
    min-width: 95px !important;
    max-width: 95px !important;
    height: 72px !important;
    border-radius: 6px;
  }

  .bhaskar-card-bottom-bar {
    margin-top: 6px;
    padding-top: 6px;
  }

  .bhaskar-tag-pill {
    font-size: 0.78rem;
    padding: 3px 8px;
  }

  .bhaskar-share-btn {
    font-size: 0.8rem;
    padding: 3px 8px;
  }

  /* In-feed Google Follow Card */
  .bhaskar-infeed-google-card {
    padding: 10px 12px;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
  }

  .bhaskar-infeed-google-text {
    font-size: 0.82rem;
  }

  .bhaskar-google-badge-btn {
    font-size: 0.75rem;
    padding: 4px 8px;
  }

  /* 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 */
  .article-rich-body {
    font-size: 1.05rem !important;
    line-height: 1.7 !important;
    word-break: break-word;
  }

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