/* ============================================================
   News Nation — Global Responsive Enhancements
   ============================================================ */

/* ---- Safe areas & overflow ---- */
.container {
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.hn,
.cat-page-main,
.nd-page,
.legal-main {
  overflow-x: clip;
}

/* ---- Top bar ---- */
@media (max-width: 767.98px) {
  .top-bar {
    font-size: 0.75rem;
    padding: 0.4rem 0;
  }

  .top-bar [data-current-date] {
    max-width: 42vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 575.98px) {
  .lang-switcher-btn .lang-label {
    display: none;
  }
}

/* ---- Header ---- */
@media (max-width: 575.98px) {
  .btn-live-tv {
    font-size: 0.6875rem;
    padding: 0.35rem 0.65rem;
    letter-spacing: 0.02em;
  }
}

/* ---- Breaking ticker ---- */
@media (max-width: 575.98px) {
  .breaking-bar {
    flex-direction: column;
    align-items: stretch;
    min-height: auto;
  }

  .breaking-bar .breaking-tag {
    justify-content: center;
    padding: 0.5rem 0.85rem;
    box-shadow: none;
  }

  .breaking-bar .breaking-tag::after {
    display: none;
  }

  .breaking-bar .ticker-wrap {
    min-height: 38px;
  }

  .breaking-bar .ticker-fade {
    width: 1.5rem;
  }
}

/* ---- Hero ---- */
.hero-featured img {
  object-fit: cover;
}

@media (max-width: 991.98px) {
  .hero-grid {
    margin: 1.25rem 0 1.5rem;
  }

  .hero-featured .hero-body {
    padding-top: 1rem;
  }
}

@media (max-width: 575.98px) {
  .hero-featured h1 {
    font-size: 1.25rem;
    line-height: 1.35;
  }

  .hero-featured img {
    aspect-ratio: 16 / 9;
  }

  .hero-side-item h3 {
    font-size: 0.8125rem;
    line-height: 1.35;
  }

  .hero-side-item .meta {
    font-size: 0.75rem;
  }

  .hero-side-item .tag {
    font-size: 0.625rem;
    padding: 0.2rem 0.45rem;
  }
}

/* ---- Section headers & cards ---- */
@media (max-width: 575.98px) {
  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
  }

  .section-head h2 {
    font-size: 1.125rem;
  }

  .section-head a {
    font-size: 0.75rem;
  }

  .cat-block-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .card-article h3,
  .card-article h4 {
    font-size: 0.9375rem;
  }

  .opinion-box,
  .explained-box {
    padding: 1rem;
  }

  .video-thumb .play {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }
}

/* ---- Sidebar ---- */
@media (max-width: 991.98px) {
  .sidebar-sticky {
    position: static !important;
    top: auto !important;
  }

  .sidebar-marquee-panel .sidebar-marquee__viewport {
    max-height: 14rem;
  }

  .sidebar-marquee-panel .sidebar-marquee__viewport--cards {
    max-height: 18rem;
  }
}

@media (max-width: 575.98px) {
  .sidebar-panel {
    padding: 1rem;
  }

  .card-mini {
    gap: 0.75rem;
  }

  .card-mini img {
    width: 64px;
    height: 64px;
  }

  .card-mini h4 {
    font-size: 0.8125rem;
  }
}

/* ---- Newsletter ---- */
@media (max-width: 767.98px) {
  .newsletter-block {
    padding: 2rem 0;
    margin-top: 2rem;
    text-align: center;
  }

  .newsletter-block .input-group {
    flex-direction: column;
    gap: 0.65rem;
  }

  .newsletter-block .input-group .form-control,
  .newsletter-block .input-group .btn-accent {
    border-radius: 999px !important;
    width: 100%;
  }

  .newsletter-block .input-group .btn-accent {
    padding: 0.75rem 1rem;
  }
}

/* ---- Footer ---- */
.site-footer .footer-logo {
  width: 100%;
  max-width: 240px;
  height: auto;
}

@media (max-width: 767.98px) {
  .site-footer {
    padding-top: 2.5rem;
    text-align: center;
  }

  .site-footer .row > [class*="col-"] {
    text-align: center;
  }

  .site-footer .footer-social {
    justify-content: center;
  }

  .site-footer .footer-logo {
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 575.98px) {
  .site-footer .footer-logo {
    max-width: 200px;
  }
}

/* ---- Category page ---- */
@media (max-width: 991.98px) {
  .cat-section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }
}

@media (max-width: 575.98px) {
  .cat-page-hero h1 {
    font-size: 1.5rem;
  }

  .cat-hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .cat-category-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.25rem;
  }

  .cat-category-chips::-webkit-scrollbar {
    display: none;
  }

  .cat-category-chip {
    flex-shrink: 0;
  }

  .cat-ad-slot--leaderboard {
    min-height: 60px;
    font-size: 0.65rem;
  }
}

/* ---- News detail ---- */
@media (max-width: 767.98px) {
  .nd-article-title {
    font-size: clamp(1.35rem, 5vw, 1.75rem);
  }

  .nd-article-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .nd-article-meta span + span::before {
    display: none;
  }

  .nd-share-btns {
    width: 100%;
  }

  .nd-share-btn {
    flex: 1 1 calc(50% - 0.35rem);
    justify-content: center;
    min-width: 0;
    font-size: 0.8125rem;
    padding: 0.55rem 0.65rem;
  }
}

@media (max-width: 575.98px) {
  .nd-breadcrumb .breadcrumb-item {
    max-width: 100%;
  }

  .nd-breadcrumb .breadcrumb-item.active {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 12rem;
  }

  .nd-badges {
    gap: 0.35rem;
  }

  .nd-badge {
    font-size: 0.6875rem;
  }

  .nd-article-body img,
  .nd-article-body iframe,
  .nd-article-body video {
    max-width: 100%;
    height: auto;
  }

  .nd-article-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* ---- Legal & static pages ---- */
@media (max-width: 767.98px) {
  .legal-hero {
    padding: 1.5rem 0 1.75rem;
  }

  .legal-hero h1 {
    font-size: 1.5rem;
  }

  .legal-hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
  }

  .legal-content-card {
    padding: 1.25rem;
  }

  .legal-toc {
    padding: 1rem;
  }

  .page-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-team-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-cta-banner {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 575.98px) {
  .page-ad-packages {
    grid-template-columns: 1fr;
  }

  .page-values {
    grid-template-columns: 1fr;
  }
}

/* ---- Ads ---- */
@media (max-width: 575.98px) {
  .ad-slot,
  .ad-slot.tall {
    min-height: 72px;
    font-size: 0.65rem;
    margin: 1rem 0;
  }

  .ad-slot.tall {
    min-height: 120px;
  }
}

/* ---- Offcanvas mobile nav ---- */
.offcanvas-nav .nav-link {
  padding: 0.85rem 1.25rem;
  font-size: 0.9375rem;
}

.offcanvas-nav .offcanvas-company-links a {
  display: block;
  padding: 0.55rem 0;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.offcanvas-nav .offcanvas-company-links a:hover {
  color: #fff;
}

/* ---- Pagination ---- */
.cat-pagination .pagination {
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem;
}

.cat-pagination .page-link {
  min-width: 2.25rem;
  text-align: center;
}

@media (max-width: 575.98px) {
  .cat-pagination .page-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
  }
}
