/* =====================================================================
   ABHIRAM — FINAL HIGH-DENSITY NATIVE APP-FEEL
   Desktop spacing overrides + Screenshot-accurate Article Layout
   ===================================================================== */

:root {
  --native-accent: #e5262c;
  --native-accent-dark: #b3181d;
  --native-ink: #14141a;
  --native-sub: #6b6b76;
  --native-bg: #ffffff;
  --native-card-bg: #ffffff;
  --native-border: rgba(0, 0, 0, 0.08);
  --native-radius: 12px;
  --native-radius-sm: 10px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --appbar-h: 52px;
  --tabs-h: 44px;
  --bottomnav-h: 60px;

  /* App Aliases */
  --app-accent: var(--native-accent);
  --app-sub: var(--native-sub);
  --app-ink: var(--native-ink);
  --app-border: var(--native-border);
}

html.dark {
  --native-ink: #f2f2f5;
  --native-sub: #9a9aa5;
  --native-bg: #000000;
  --native-card-bg: #1c1c1e;
  --native-border: rgba(255, 255, 255, 0.08);
}

/* Hide mobile-specific app UI elements on desktop */
.native-app-bar,
.native-cat-tabs,
.native-ticker,
.mobile-app-nav,
.sticky-bottom-nav,
.mobile-drawer-profile,
.nav-backdrop,
.mobile-only-nav {
  display: none !important;
}

#bottom-ticker-bar {
  display: flex !important;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 100px;
  background: var(--native-card-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  border: 0.5px solid var(--native-border);
  position: fixed !important;
  /*! bottom: 20px !important; */
  top: unset !important;
  left: 20px;
  right: 20px;
  width: auto;
  z-index: 1000;
}
.global-ticker-container {
  margin-top: 0;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  /* ---------------------------------------------------------------
     0. GLOBAL OVERRIDES (Killing style.css spacing conflicts)
     --------------------------------------------------------------- */
  body, html { 
    background: var(--native-bg) !important; 
    overscroll-behavior-y: contain; 
    -webkit-tap-highlight-color: transparent;
  }
  
  * {
    -webkit-tap-highlight-color: transparent;
  }

  a, button {
    touch-action: manipulation;
  }

  /* Kill Desktop Bloat */
  .utility-bar, 
  .site-header .header-inner, 
  aside.top-headlines, 
  .il-5c2918, 
  .section-head { 
    display: none !important; 
  }

  /* Mobile top ticker is restored per user request */

  /* Compact Spacing Override */
  .section-block, .cat-collage-section, .hero-section { margin-top: 12px !important; margin-bottom: 12px !important; }
  .container { padding: 0 12px !important; }
  
  body {
    padding-bottom: 0 !important;
    overflow-x: hidden;
  }

  main#main-content {
    padding-top: 2px;
    /* Only account for bottom nav, ticker is now at top */
    padding-bottom: calc(var(--bottomnav-h) + var(--safe-b) + 8px) !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  /* =================================================================
     1. NATIVE TOP BAR (Mockup Style)
     ================================================================= */
  .native-app-bar {
    position: sticky; 
    top: 0; 
    z-index: 500; 
    height: var(--appbar-h);
    display: flex !important; 
    align-items: center; 
    padding: 0 12px;
    background: var(--native-card-bg); 
    border-bottom: 0.5px solid var(--native-border);
  }

  html.dark .native-app-bar {
    background: var(--native-card-bg);
  }

  .native-app-bar .nab-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--native-ink);
    font-size: 18px;
    background: transparent;
    border: none;
    position: relative;
    flex-shrink: 0;
  }

  .native-app-bar .nab-icon-btn:active {
    background: rgba(0, 0, 0, 0.05);
  }

  html.dark .native-app-bar .nab-icon-btn:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .native-app-bar .nab-icon-btn .nab-dot {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--native-accent);
    border: 2px solid var(--native-card-bg);
  }

  .native-app-bar .nab-brand {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    overflow: hidden;
    align-items: center;
  }

  .native-app-bar .nab-brand .nab-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 800;
    font-size: 19px;
    color: var(--native-ink);
  }

  .native-app-bar .nab-brand .nab-title span {
    color: var(--native-accent);
  }

  .native-app-bar .nab-brand .nab-tagline {
    font-size: 10px;
    color: var(--native-sub);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .native-app-bar .nab-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
  }

  /* =================================================================
     2. NATIVE CATEGORY TABS
     ================================================================= */
  .native-cat-tabs {
    position: sticky;
    top: calc(var(--appbar-h) + var(--safe-t));
    z-index: 480;
    display: flex !important;
    gap: 20px;
    height: var(--tabs-h);
    align-items: center;
    padding: 0 14px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 0.5px solid var(--native-border);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    white-space: nowrap;
  }

  html.dark .native-cat-tabs {
    background: rgba(28, 28, 30, 0.95);
  }

  .native-cat-tabs::-webkit-scrollbar {
    display: none;
  }

  .native-cat-tabs a {
    position: relative;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--native-sub);
    text-decoration: none;
    padding-bottom: 10px;
    flex-shrink: 0;
    transition: color 0.2s;
  }

  .native-cat-tabs a.active {
    color: var(--native-ink);
    font-weight: 700;
  }

  .native-cat-tabs a.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--native-accent);
  }

  /* =================================================================
     3. NATIVE BREAKING TICKER
     ================================================================= */
  /* Mobile Ticker: Fixed just above the mobile bottom nav bar */
  #bottom-ticker-bar, .bottom-ticker-bar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 100px;
    background: var(--native-card-bg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 0.5px solid var(--native-border);
    position: fixed !important;
    bottom: calc(var(--bottomnav-h, 60px) + 15px) !important;
    top: unset !important;
    margin: 0 !important;
    left: 15px !important;
    right: 15px !important;
    width: auto !important;
    z-index: 590;
  }

  html.dark #bottom-ticker-bar {
    background: #1a1a1a !important;
    border-color: #333 !important;
  }

  #bottom-ticker-bar .nt-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--native-accent);
    text-transform: uppercase;
  }

  #bottom-ticker-bar .nt-badge .nt-bolt {
    animation: pulse 1.5s infinite;
  }

  @keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.4; }
    100% { opacity: 1; }
  }

  #bottom-ticker-bar .nt-viewport {
    flex-grow: 1;
    height: 16px;
    position: relative;
    overflow: hidden;
  }

  #bottom-ticker-bar .nt-item {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--native-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #bottom-ticker-bar .nt-item a {
    color: inherit;
    text-decoration: none;
  }

  /* =================================================================
     4. ARTICLE PAGE (EXACT MOCKUP REPLICATION)
     ================================================================= */
  .article-wrapper {
    display: flex !important;
    flex-direction: column !important;
    margin: 0 !important;
    padding: 12px !important;
  }
  
  .article-main {
    order: 1 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
  }

  .article-sidebar {
    order: 2 !important;
    margin-top: 32px !important;
  }

  .article-hero { margin-bottom: 24px !important; }
  
  /* Breadcrumbs */
  .article-hero::before {
    content: "Home \00a0 \203A \00a0 India \00a0 \203A \00a0 Story";
    display: block !important; 
    font-size: 11px !important; 
    color: var(--native-sub) !important;
    font-weight: 600 !important; 
    margin-bottom: 12px !important;
  }

  /* Red Badge */
  #art-badge {
    display: inline-block !important;
    background: var(--native-accent) !important; 
    color: #fff !important;
    font-size: 9px !important; 
    padding: 2px 6px !important; 
    border-radius: 3px !important;
    text-transform: uppercase !important; 
    font-weight: 800 !important;
  }

  /* Title & Meta */
  #art-title { 
    font-size: 24px !important; 
    font-weight: 800 !important; 
    line-height: 1.2 !important; 
    margin: 8px 0 12px 0 !important; 
    color: var(--app-ink) !important;
  }
  
  .article-hero > p.cat-excerpt { 
    font-size: 15px !important; 
    line-height: 1.4 !important; 
    color: #333 !important; 
  }

  .premium-meta {
    display: flex !important; 
    align-items: center !important; 
    gap: 10px !important;
    margin: 16px 0 !important; 
    border-bottom: 1px solid var(--native-border) !important; 
    padding-bottom: 16px !important;
  }
  
  .meta-author { display: flex !important; align-items: center !important; gap: 8px !important; }
  .meta-author img.avatar { width: 36px !important; height: 36px !important; border-radius: 50% !important; }
  #art-author { font-size: 14px !important; font-weight: 700 !important; color: var(--app-ink) !important; }
  
  /* Added Tick */
  #art-author::after { 
    content: "\f058"; 
    font-family: "Font Awesome 6 Free"; 
    font-weight: 900; 
    color: #e5262c; 
    font-size: 12px; 
    margin-left: 4px; 
  }
  
  #art-date { font-size: 12px !important; color: var(--native-sub) !important; }
  .meta-details { margin-left: auto !important; font-size: 12px !important; color: var(--native-sub) !important; }

  /* Image 1/8 */
  .article-cover-wrap { position: relative !important; margin-bottom: 24px !important; }
  .article-cover-wrap img { border-radius: 12px !important; }
  .article-cover-wrap::after {
    content: '1/8'; 
    position: absolute !important; 
    top: 8px !important; 
    right: 8px !important;
    background: rgba(0,0,0,0.6) !important; 
    color: #fff !important; 
    font-size: 10px !important;
    padding: 2px 8px !important; 
    border-radius: 6px !important;
  }

  /* Highlights Box (Mockup Accurate) */
  .highlights {
    background: #fff5f5 !important; 
    border-radius: 8px !important;
    padding: 16px !important; 
    margin: 20px 0 !important;
  }
  
  .highlights::before {
    content: 'HIGHLIGHTS'; 
    display: block !important; 
    font-size: 10px !important;
    font-weight: 800 !important; 
    color: #e5262c !important; 
    margin-bottom: 8px !important;
  }
  
  .highlights ul { padding-left: 16px !important; margin: 0 !important; }
  .highlights li { font-size: 14px !important; margin-bottom: 4px !important; }

  /* Sticky Read Next Button */
  .sticky-bottom-nav {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: #fff;
    padding: 12px 16px; 
    border-top: 1px solid var(--native-border);
    display: flex !important; 
    align-items: center; 
    justify-content: space-between;
    z-index: 1000;
  }
  
  .btn-read-next {
    background: var(--native-accent); 
    color: #fff; 
    border-radius: 8px;
    padding: 12px 24px; 
    font-weight: 700; 
    width: 100%; 
    text-align: center;
  }

  /* =================================================================
     5. HOMEPAGE DENSITY REFINEMENT
     ================================================================= */
  .cat-collage-header { margin: 12px 0 8px 0 !important; }
  
  .cat-list-card, .cat-hero-card { padding: 8px 0 !important; }
  .cat-list-card h4 { font-size: 14px !important; }
  
  /* Footer Visibility Fix */
  .site-footer {
    display: none !important;
  }

  /* Bottom Nav */
  .mobile-app-nav {
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    height: var(--bottomnav-h);
    background: #fff; 
    border-top: 1px solid var(--native-border);
    display: flex !important; 
    align-items: center; 
    justify-content: space-around;
    z-index: 600;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, .04);
  }

  html.dark .mobile-app-nav {
    background: var(--native-card-bg) !important;
    border-top-color: var(--native-border) !important;
    box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.4) !important;
  }

  .mobile-app-nav .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    text-decoration: none;
    color: var(--native-sub);
    font-size: 10px;
    font-weight: 600;
  }

  .mobile-app-nav .mobile-nav-item i {
    font-size: 20px;
    transition: transform 0.2s;
  }

  .mobile-app-nav .mobile-nav-item.active {
    color: var(--native-accent);
    font-weight: 700;
  }

  .mobile-app-nav .mobile-nav-item.active i {
    transform: scale(1.1);
  }

  /* Mobile Typography Scaling & Symmetrical Normalization */
  .hero-main-text h1,
  .hero-main h1 {
    font-size: 20px !important;
    line-height: 1.25 !important;
    max-width: 100% !important;
    hyphens: none !important;
    word-break: normal !important;
  }

  .cat-hero-card h3,
  .story-card-title,
  .cat-grid-3 h3,
  .cat-bordered-grid-3 h3,
  .cat-hero-card-horizontal h3,
  .story-card h3,
  .cat-list-card h3,
  .bento-grid h3,
  .magazine-cover h3,
  .mosaic-asymmetric h3,
  .il-5f69be,
  .il-7e465a,
  .il-ba51c8,
  .il-af18ea,
  .il-1551e6,
  .il-768e1f {
    font-size: 15px !important;
    line-height: 1.35 !important;
    font-weight: 700 !important;
  }

  .cat-list-card h4,
  .highlights li span,
  .highlights a {
    font-size: 13.5px !important;
    line-height: 1.35 !important;
  }

  /* Top Hero Secondary Grid Overrides */
  .hero-side {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 12px !important;
    margin-top: 12px !important;
  }

  .hero-side-card img {
    height: 140px !important;
  }

  .hero-side-text {
    padding: 10px !important;
  }

  .hero-side-text h3 {
    font-size: 12.5px !important;
    line-height: 1.35 !important;
    margin-bottom: 4px !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: normal !important;
    hyphens: none !important;
  }

  .hero-side-text .meta-row.small {
    font-size: 9px !important;
    gap: 4px !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    width: 100% !important;
    display: block !important;
  }

  .hero-side-card .badge {
    top: 8px !important;
    left: 8px !important;
    font-size: 9px !important;
    padding: 2px 6px !important;
  }

  /* Mobile-only Nav Drawer Styling */
  .mobile-only-nav {
    display: flex !important;
    flex-direction: column !important;
    position: fixed !important;
    top: 0 !important;
    left: -100% !important;
    width: 320px !important;
    max-width: 85vw !important;
    height: 100vh !important;
    background: var(--paper) !important;
    z-index: 1500 !important;
    padding: 0 !important;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 4px 0 24px rgba(0,0,0,0.15) !important;
    overflow-y: auto !important;
  }
  .mobile-only-nav.open {
    left: 0 !important;
  }
  .nav-backdrop {
    display: block !important;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1400;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
  }
  .nav-backdrop.open {
    opacity: 1;
    visibility: visible;
  }

  /* Drawer Top Header (Close Btn) */
  .drawer-top-header {
    display: flex;
    justify-content: flex-end;
    padding: 16px 20px 8px;
  }
  .drawer-close-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    color: var(--native-sub);
    cursor: pointer;
  }

  /* Mobile Drawer Profile Header */
  .mobile-drawer-profile {
    padding: 0 24px 20px;
    display: block !important;
    border-bottom: 1px solid var(--native-border);
  }
  
  .drawer-user-info {
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 16px;
  }
  .drawer-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(108, 79, 161, 0.15);
    padding: 2px;
  }
  .drawer-user-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }
  .drawer-user-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--native-ink);
  }
  .drawer-user-email {
    font-size: 13px;
    color: var(--native-sub);
    margin-bottom: 6px;
  }
  
  .drawer-premium-badge {
    background: rgba(108, 79, 161, 0.1);
    color: #6c4fa1;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
  }
  
  /* Guest View */
  .drawer-auth-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    width: 100%;
  }
  .drawer-login-btn, .drawer-subscribe-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
  }
  .drawer-login-btn {
    border: 1px solid var(--native-border);
    color: var(--native-ink) !important;
    background: transparent;
  }
  .drawer-subscribe-btn {
    background: #6c4fa1;
    color: #fff !important;
  }

  /* Drawer Navigation List */
  .drawer-nav-list {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    margin: 0;
    list-style: none;
    gap: 4px;
  }
  .drawer-nav-list li {
    width: 100%;
  }
  .drawer-nav-list li a {
    display: flex;
    align-items: center;
    padding: 14px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--native-ink);
    transition: background 0.2s;
  }
  .drawer-nav-list li a.active,
  .drawer-nav-list li a:active {
    background: rgba(108, 79, 161, 0.06);
  }
  
  .dnl-icon {
    width: 32px;
    font-size: 16px;
    color: var(--native-sub);
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }
  .drawer-nav-list li a.active .dnl-icon {
    color: #6c4fa1;
  }
  
  .dnl-text {
    flex-grow: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--native-ink);
  }
  .drawer-nav-list li a.active .dnl-text {
    color: #6c4fa1;
    font-weight: 600;
  }
  
  .dnl-arrow {
    font-size: 12px;
    color: var(--native-sub);
    opacity: 0.5;
  }
  
  /* Bottom Actions (Dark Mode, Logout) */
  .drawer-bottom-actions {
    padding: 16px 24px 24px;
    border-top: 1px solid var(--native-border);
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .drawer-dark-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
  }
  .drawer-dark-mode-toggle .ddmt-icon {
    width: 32px;
    font-size: 18px;
    color: var(--native-sub);
  }
  .drawer-dark-mode-toggle .ddmt-text {
    flex-grow: 1;
    font-size: 15px;
    font-weight: 500;
    color: var(--native-ink);
  }
  .ddmt-switch {
    width: 44px;
    height: 24px;
    border-radius: 12px;
    background: #e2e8f0;
    position: relative;
    transition: background 0.3s;
  }
  html.dark .ddmt-switch {
    background: #6c4fa1;
  }
  .ddmt-knob {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 2px;
    left: 2px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  html.dark .ddmt-knob {
    transform: translateX(20px);
  }

  .drawer-logout-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #e5262c;
    font-weight: 500;
    font-size: 15px;
    padding-top: 8px;
  }
  .drawer-logout-link .dll-icon {
    width: 32px;
    font-size: 18px;
  }
  .drawer-logout-link .dll-text {
    flex-grow: 1;
  }

}