/* ==========================================================================
   TamilAINews — 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;
  }
}

/* ==========================================================================
   Front-Page Top Spotlight: Editorial Column + Cartoon of the Day
   ========================================================================== */
.editorial-cartoon-strip {
  display: grid;
  gap: 16px;
  margin-bottom: 18px;
}
.editorial-cartoon-strip.has-both {
  grid-template-columns: 1.35fr 1fr;
}
.editorial-cartoon-strip.has-one {
  grid-template-columns: 1fr;
}
.ec-card {
  background: #ffffff;
  border: 1px solid #dbe2ee;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 14px rgba(19, 34, 87, 0.06);
  color: #111827;
}
.ec-editorial {
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%);
  border-top: 3px solid #b45309;
}
.ec-cartoon {
  border-top: 3px solid #c8102e;
}
.ec-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 13px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.ec-head-ed {
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #fde68a;
}
.ec-head-ct {
  background: #132257;
  color: #ffffff;
}
.ec-te {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-weight: 700;
  margin-left: 6px;
  text-transform: none;
  opacity: 0.9;
}
.ec-archive-link {
  color: #92400e;
  font-weight: 800;
  font-size: 11px;
  text-decoration: none;
}
.ec-ed-body {
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}
.ec-ed-body.with-img {
  display: grid;
  grid-template-columns: 195px 1fr;
  gap: 14px;
  align-items: start;
}
.ec-ed-img-wrap {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
}
.ec-ed-img {
  width: 100%;
  height: 155px;
  object-fit: cover;
  display: block;
}
.ec-ed-text {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ec-title {
  margin: 0 0 4px;
  font-family: 'Playfair Display', 'Noto Sans Tamil', serif;
  font-size: 18.5px;
  line-height: 1.28;
  color: #0d173c;
}
.ec-title:hover { color: #c8102e; }
.ec-sub-te {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #132257;
  margin-bottom: 6px;
}
.ec-summary {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.48;
  color: #4b5563;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
.ec-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
}
.ec-author {
  font-size: 11.5px;
  color: #64748b;
}
.ec-read-btn {
  background: #132257;
  color: #ffffff !important;
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.ec-read-btn:hover { background: #c8102e; }

.ec-ct-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.ec-ct-frame {
  width: 100%;
  height: 185px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ec-ct-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.ec-ct-caption {
  font-size: 13px;
  line-height: 1.38;
  color: #0d173c;
}
.ec-ct-punch {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
}

@media (max-width: 900px) {
  .editorial-cartoon-strip.has-both {
    grid-template-columns: 1fr;
  }
  .ec-ed-body.with-img {
    grid-template-columns: 1fr;
  }
  .ec-ed-img {
    height: 175px;
  }
  .ec-ct-frame {
    height: 210px;
  }
}

/* Compact Side-Panel Editorial (Left above Gold) & Cartoon (Right above Weather) */
.ec-side-ed {
  border-top: 3px solid #b45309 !important;
  background: linear-gradient(180deg, #fffdf7 0%, #ffffff 100%) !important;
}
.ec-side-ed-head {
  background: linear-gradient(90deg, #fef3c7, #fde68a) !important;
  color: #78350f !important;
}
.ec-side-ct {
  border-top: 3px solid #c8102e !important;
}
.ec-side-ct-head {
  background: linear-gradient(90deg, #132257, #c8102e) !important;
  color: #ffffff !important;
}
.ec-side-title {
  margin: 0 0 4px;
  font-family: 'Playfair Display', 'Noto Sans Tamil', serif;
  font-size: 13.8px;
  line-height: 1.32;
  font-weight: 800;
  color: #0d173c;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ec-side-title:hover { color: #c8102e; }
.ec-side-te {
  font-family: 'Noto Sans Tamil', sans-serif;
  font-size: 11.5px;
  font-weight: 700;
  color: #132257;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ec-side-sum {
  margin: 0;
  font-size: 11.8px;
  line-height: 1.42;
  color: #4b5563;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   AI Smart Interest Search + Top Search Memory + Live Autocomplete Dropdown
   ========================================================================== */
.mobile-search-btn {
  display: none;
}
@media (max-width: 1024px) {
  .mobile-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #eef2ff;
    border: 1px solid #c7d2fe;
    color: #132257;
    font-size: 16px;
    text-decoration: none;
    justify-self: end;
  }
}

.ai-mini-wrap {
  position: relative;
}
.ai-mini-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 370px;
  max-width: 92vw;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  box-shadow: 0 18px 40px rgba(13, 23, 60, 0.22);
  z-index: 500;
  padding: 10px 12px;
  text-align: left;
  color: #0f172a;
}
.ai-mini-dropdown.open {
  display: block;
}
.ai-dd-head {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  margin-bottom: 6px;
}
.ai-dd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.ai-dd-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  color: #132257;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  text-decoration: none;
}
.ai-dd-chip:hover {
  background: #132257;
  color: #ffffff;
}
.ai-dd-item {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 6px 4px;
  border-top: 1px solid #f1f5f9;
  text-decoration: none;
  color: #0f172a;
}
.ai-dd-item:hover {
  background: #f8fafc;
}
.ai-dd-item img {
  width: 52px;
  height: 38px;
  object-fit: cover;
  border-radius: 5px;
  flex-shrink: 0;
}
.ai-dd-title {
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.3;
  color: #0d173c;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ai-dd-meta {
  font-size: 10.5px;
  color: #64748b;
  margin-top: 2px;
}

.ai-search-hero {
  background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 55%, #fff7ed 100%);
  border: 1px solid #cbd5e1;
  border-top: 3px solid #132257;
  border-radius: 14px;
  padding: 18px 20px;
}
.ai-search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-search-input {
  flex: 1;
  min-width: 0;
  padding: 11px 15px;
  border-radius: 999px;
  border: 1.5px solid #94a3b8;
  font-size: 14.5px;
  background: #ffffff;
  color: #0f172a;
}
.ai-search-input:focus {
  outline: none;
  border-color: #132257;
  box-shadow: 0 0 0 3px rgba(19, 34, 87, 0.12);
}
.ai-search-submit {
  background: #132257;
  color: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}
.ai-search-submit:hover {
  background: #c8102e;
}
.ai-follow-btn {
  background: #fef3c7;
  color: #78350f;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 800;
  cursor: pointer;
}
.ai-follow-btn.following {
  background: #16a34a;
  color: #ffffff;
  border-color: #15803d;
}
.ai-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-top: 8px;
}
.ai-chip-label {
  font-size: 11.5px;
  font-weight: 800;
  color: #132257;
  margin-right: 2px;
}
.ai-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0d173c;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
}
.ai-chip:hover,
.ai-chip.active {
  background: #132257;
  color: #ffffff;
  border-color: #132257;
}
.ai-chip-soft {
  background: #f8fafc;
  font-weight: 600;
  color: #334155;
}
.ai-chip-cnt {
  background: #fee2e2;
  color: #b91c1c;
  font-size: 10px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 999px;
}
.ai-chip.active .ai-chip-cnt,
.ai-chip:hover .ai-chip-cnt {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}
.ai-digest-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-left: 4px solid #132257;
  border-radius: 10px;
  padding: 13px 16px;
  margin-bottom: 12px;
}
@media (max-width: 640px) {
  .ai-search-hero { padding: 14px 12px; }
  .ai-search-form { flex-direction: column; }
  .ai-search-submit { width: 100%; }
}

/* Editorial & Cartoon Dotted Carousels + Like Button */
.ec-slide {
  display: none;
  animation: fadeSlide 0.28s ease;
}
.ec-slide.active {
  display: block;
}
.ec-pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.ec-like-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}
.ec-like-btn:hover {
  background: #ffe4e6;
  transform: scale(1.04);
}
.ec-like-btn.liked {
  background: #c8102e;
  color: #ffffff;
  border-color: #c8102e;
}

/* Live Trending in India Strip (Below Ticker) + Official X Handle Pill */
.india-trends-bar {
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  padding: 5px 0;
}
.india-trends-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}
.itb-label {
  flex-shrink: 0;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  color: #132257;
  background: #e0e7ff;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.itb-scroll {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  flex: 1;
  min-width: 0;
  -webkit-overflow-scrolling: touch;
}
.itb-scroll::-webkit-scrollbar { display: none; }
.itb-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.itb-pill:hover {
  background: #132257;
  color: #ffffff;
  border-color: #132257;
}
.itb-vol {
  font-size: 9.5px;
  font-weight: 800;
  color: #c8102e;
}
.itb-pill:hover .itb-vol {
  color: #fbbf24;
}
.x-follow-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #0f172a;
  color: #ffffff !important;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  text-decoration: none;
}
.x-follow-pill:hover {
  background: #1d9bf0;
}
@media (max-width: 768px) {
  .x-follow-pill { display: none; }
  .itb-label { font-size: 9.5px; padding: 3px 7px; }
}
