/**
 * Responsive behavior.
 */

@media (max-width: 1080px) {
  .main-navigation .menu {
    gap: 14px;
  }

  .main-navigation .menu-item {
    font-size: 9px;
  }

  .hero-area {
    gap: 20px;
  }
}

@media (max-width: 800px) {
  .topbar-note,
  .topbar-links a:nth-last-child(-n+2) {
    display: none;
  }

  .topbar-inner {
    justify-content: flex-end;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-navigation {
    display: none;
  }

  .main-navigation.is-open {
    display: block;
  }

  .main-navigation .menu {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
  }

  .main-navigation .menu-item {
    border-bottom: 1px solid var(--ice-border);
    font-size: 11px;
    padding: 11px 0;
  }

  .main-navigation .sub-menu {
    border: 0;
    box-shadow: none;
    display: none;
    opacity: 1;
    padding-left: 15px;
    pointer-events: auto;
    position: static;
    transform: none;
  }

  .main-navigation .menu-item-has-children:hover > .sub-menu,
  .main-navigation .menu-item-has-children:focus-within > .sub-menu {
    display: block;
  }

  .hero-area,
  .latest-layout,
  .archive-layout,
  .article-layout {
    grid-template-columns: 1fr;
  }

  .hero-sidebar {
    border-top-width: 1px;
  }

  .video-player-layout {
    grid-template-columns: 1fr;
  }

  .playlist-items {
    max-height: none;
  }

  .footer-grid {
    gap: 35px;
    grid-template-columns: 1fr 1fr;
  }

  .footer-about {
    grid-column: span 2;
  }
}

@media (max-width: 560px) {
  .site-container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .topbar-links {
    gap: 10px;
  }

  .topbar-date {
    padding-right: 10px;
  }

  .header-inner {
    min-height: 64px;
  }

  .brand-name {
    font-size: 17px;
  }

  .homepage {
    padding-top: 20px;
  }

  .hero-featured {
    height: 280px;
  }

  .hero-copy {
    bottom: 16px;
    left: 16px;
    right: 16px;
  }

  .hero-copy .entry-title {
    font-size: 26px;
  }

  .hero-thumbnails {
    grid-template-columns: repeat(5, 1fr);
  }

  .hero-thumb {
    height: 48px;
  }

  .story-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .story-card {
    height: 220px;
  }

  .video-section {
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
  }

  .video-stage,
  .video-poster,
  .video-frame {
    min-height: 230px;
  }

  .list-story,
  .standard-entry {
    gap: 12px;
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .list-story-image {
    height: 88px;
  }

  .standard-entry-image {
    flex-basis: 105px;
    height: 88px;
  }

  .list-story-copy .entry-title,
  .standard-entry-copy h2 {
    font-size: 16px;
    margin-top: 2px;
  }

  .list-story-copy p,
  .standard-entry-copy p {
    display: none;
  }

  .single-header .entry-title {
    font-size: 34px;
  }

  .single-excerpt {
    font-size: 16px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-about {
    grid-column: auto;
  }

  .footer-bottom-inner {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 14px;
    padding-top: 14px;
  }

  .footer-bottom nav {
    flex-wrap: wrap;
    gap: 8px 15px;
  }
}

/*
 * Compatibility safety layer.
 * Some Android/Vivo browsers can expose a wider CSS viewport than the
 * physical screen. Keep the mobile layout constrained even in that case.
 */
html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

.site,
.site-main,
.homepage,
.video-section,
.video-player-layout,
.video-stage,
.video-poster,
.video-playlist,
.latest-layout,
.latest-list,
.sidebar {
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

img,
video,
iframe,
embed,
object {
  max-width: 100%;
}

/* Desktop: preserve the original centered editorial container. */
@media screen and (min-width: 1025px) {
  .site-container {
    width: 100%;
    max-width: var(--ice-container);
    margin-left: auto;
    margin-right: auto;
  }
}

@media screen and (max-width: 1024px) {
  .site-container {
    width: calc(100% - 32px);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }

  .topbar-inner,
  .header-inner,
  .breaking-inner {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .topbar-inner {
    overflow: hidden;
  }

  .topbar-note {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .topbar-links {
    min-width: 0;
    max-width: 100%;
    flex-shrink: 1;
    overflow: hidden;
  }

  .topbar-links a,
  .topbar-date {
    white-space: nowrap;
  }

  .header-inner {
    min-width: 0;
  }

  .site-branding {
    min-width: 0;
    max-width: calc(100% - 120px);
  }

  .brand-lockup,
  .custom-logo-link,
  .custom-logo {
    max-width: 100%;
  }

  .header-actions {
    flex: 0 0 auto;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .main-navigation {
    display: none;
  }

  .main-navigation.is-open {
    display: block;
  }

  .main-navigation .menu {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    min-width: 0;
    width: 100%;
  }

  .main-navigation .menu-item {
    white-space: normal;
    width: 100%;
  }

  .main-navigation .sub-menu {
    min-width: 0;
    width: 100%;
  }

  .hero-area,
  .latest-layout,
  .archive-layout,
  .article-layout {
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
  }

  .hero-main-column,
  .hero-sidebar,
  .latest-list,
  .sidebar {
    min-width: 0;
    max-width: 100%;
    width: 100%;
  }

  .story-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .video-player-layout {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    max-width: 100%;
  }

  .video-stage {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .video-poster,
  .video-frame {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 0;
  }

  .video-frame {
    display: block;
    border: 0;
  }

  .video-playlist {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .playlist-items {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .playlist-item {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .playlist-copy {
    min-width: 0;
    max-width: 100%;
  }

  .playlist-copy strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .list-story,
  .standard-entry {
    min-width: 0;
  }

  .list-story-copy,
  .standard-entry-copy {
    min-width: 0;
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media screen and (max-width: 767px) {
  .site-container {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
    padding-left: 12px;
    padding-right: 12px;
  }

  .topbar-inner {
    justify-content: flex-end;
  }

  .topbar-note {
    display: none;
  }

  .topbar-links a:nth-last-child(-n+3) {
    display: none;
  }

  .topbar-links {
    gap: 10px;
  }

  .breaking-inner {
    gap: 8px;
  }

  .breaking-text {
    min-width: 0;
    flex: 1 1 auto;
  }

  .hero-featured {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 260px;
    aspect-ratio: 16 / 9;
  }

  .hero-thumbnails {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .story-grid,
  .related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .video-section {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .video-stage {
    aspect-ratio: 16 / 9;
  }

  .video-poster {
    aspect-ratio: 16 / 9;
  }

  .video-stage-copy {
    padding: 16px;
  }

  .video-stage-copy h3 {
    font-size: 18px;
  }

  .video-play-button {
    width: 56px;
    height: 56px;
  }

  .playlist-items {
    max-height: 330px;
    overflow-y: auto;
    overflow-x: hidden;
  }

  .playlist-item {
    padding: 9px 10px;
  }

  .playlist-thumb {
    flex: 0 0 72px;
    width: 72px;
    height: 45px;
  }

  .list-story,
  .standard-entry {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .list-story-image,
  .standard-entry-image {
    width: 100%;
    max-width: 100%;
  }

  .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-about {
    grid-column: auto;
  }
}

/* Final editorial-width safeguard: desktop remains centered and narrow. */
@media screen and (min-width: 1025px) {
  .site-container {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media screen and (min-width: 768px) and (max-width: 1024px) {
  .site-container {
    width: calc(100% - 32px);
    max-width: 960px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 0;
    padding-right: 0;
  }
}
