/* ==========================================================================
   TeluguAINews — Mobile News App Polish + Reader Text/Image Zoom Controls
   Shared across all 3 public themes (telugu_classic, breaking_dark, modern_minimal)
   ========================================================================== */

:root {
  --tan-zoom: 1;
}

html, body {
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

/* Smooth Reader Zoom applied to main news content without breaking fixed nav/headers */
main.main-content,
main.bd-main,
main.mm-main {
  zoom: var(--tan-zoom);
}

/* Header Zoom Control Pill (A- / 100% / A+) */
.zoom-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 2px 4px;
}
.zoom-ctrl button {
  background: transparent;
  border: none;
  color: inherit;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1.2;
}
.zoom-ctrl button:hover {
  background: rgba(255, 255, 255, 0.22);
}
.zoom-ctrl .zoom-val {
  font-size: 10.5px;
  font-weight: 700;
  min-width: 34px;
  text-align: center;
  opacity: 0.92;
  cursor: pointer;
}

/* Modern Minimal theme light topbar variant */
.mm-top .zoom-ctrl {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}
.mm-top .zoom-ctrl button:hover {
  background: #e2e8f0;
}

/* Inline Article Reader Zoom Bar */
.article-zoom-bar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 12px;
  color: #132257;
  margin-bottom: 12px;
}
.article-zoom-bar button {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #132257;
  font-weight: 800;
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  cursor: pointer;
}
.article-zoom-bar button:hover {
  background: #132257;
  color: #ffffff;
}

/* Tap-to-Zoom Article Photo Lightbox */
.article-hero-img {
  cursor: zoom-in;
}
.tan-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(9, 13, 28, 0.94);
  z-index: 9999;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.tan-lightbox.open {
  display: flex;
}
.tan-lightbox-stage {
  max-width: 96vw;
  max-height: 82vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
}
.tan-lightbox-stage img {
  max-width: 94vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.2s ease;
  transform-origin: center center;
}
.tan-lightbox-bar {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  align-items: center;
}
.tan-lightbox-bar button {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.tan-lightbox-bar button:hover {
  background: #c8102e;
  border-color: #c8102e;
}

/* Mobile App Bottom Tab Navigation (hidden on desktop, fixed native-app feel on phones) */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    background: #0d173c;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.22);
  }
  .mobile-bottom-nav a,
  .mobile-bottom-nav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: #cbd5e1;
    font-size: 10.5px;
    font-weight: 700;
    text-decoration: none;
    padding: 4px 2px;
    cursor: pointer;
  }
  .mobile-bottom-nav .mbn-ico {
    font-size: 17px;
    line-height: 1;
  }
  .mobile-bottom-nav a.active {
    color: #fbbf24;
  }

  /* Compact Utility Bar on Phones: keep Visitors, Language & Zoom; hide verbose date/weather/gold */
  .utility-bar {
    padding: 5px 0;
  }
  .utility-inner {
    justify-content: space-between;
    gap: 6px;
  }
  .utility-left .util-pill:nth-child(1),
  .utility-left .util-pill:nth-child(2),
  .utility-left .util-pill:nth-child(3) {
    display: none;
  }
  .site-switcher {
    display: none;
  }

  /* Compact Masthead on Phones */
  .masthead {
    padding: 10px 0 8px;
  }
  .masthead-inner {
    grid-template-columns: auto 1fr auto;
    gap: 8px;
  }
  .hamburger-btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .brand-wordmark {
    font-size: 24px !important;
  }
  .brand-tagline-te {
    font-size: 11.5px;
  }
  .brand-tagline-en,
  .brand-regions {
    display: none;
  }

  /* Horizontally Swipeable Sticky Category Bar on Mobile (Native News App Feel) */
  .cat-nav {
    overflow: hidden;
  }
  .nav-list {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding: 4px 0;
  }
  .nav-list::-webkit-scrollbar {
    display: none;
  }
  .nav-item {
    flex: 0 0 auto;
  }
  .nav-link {
    padding: 7px 10px !important;
    font-size: 12px !important;
  }
  .nav-dropdown {
    display: none !important;
  }

  /* Breaking Ticker compact on phones */
  .ticker-bar {
    padding: 6px 0;
  }
  .ticker-label {
    font-size: 10px;
    padding: 3px 7px;
  }
  .ticker-track {
    font-size: 12px;
  }

  /* Main content & Hero Carousel polish on phones */
  .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .main-content {
    padding-top: 14px !important;
    padding-bottom: 24px !important;
  }
  .lead-img {
    height: 210px !important;
  }
  .lead-body {
    padding: 12px !important;
  }
  .lead-title {
    font-size: 20px !important;
    line-height: 1.28 !important;
  }
  .story-row-card {
    grid-template-columns: 92px 1fr !important;
    gap: 10px !important;
  }
  .story-thumb {
    width: 92px !important;
    height: 68px !important;
  }

  /* Article Reader comfortable mobile sizing */
  .article-hero-img {
    max-height: 260px !important;
  }
  .article-body {
    font-size: 15.5px !important;
    line-height: 1.72 !important;
  }

  /* Live TV Player & Channel Chips compact on phones */
  .livetv-box {
    padding: 12px !important;
    border-radius: 10px !important;
  }
  .livetv-channels {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .livetv-channels::-webkit-scrollbar {
    display: none;
  }
  .livetv-btn {
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 11.5px !important;
    padding: 5px 10px !important;
  }

  /* Subcategory Filter Tabs swipeable on phones */
  .filter-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }
  .filter-tab {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Compact 2-col news cards on phones */
  .news-card img,
  .bd-card img,
  .mm-card img {
    height: 102px !important;
  }
  .news-card-body,
  .bd-card-body,
  .mm-card-body {
    padding: 8px 9px !important;
  }
  .news-card h3,
  .bd-card h3,
  .mm-card h3 {
    font-size: 12.5px !important;
  }
}

@media (max-width: 390px) {
  .cards-3, .cards-4, .portal-center .cards-3, .portal-center .cards-4,
  .bd-grid-3, .bd-grid-4, .mm-grid-3 {
    grid-template-columns: 1fr !important;
  }
  .news-card img, .bd-card img, .mm-card img {
    height: 150px !important;
  }
}
