/**
 * Mobile viewport width fix (extract-safe new file).
 *
 * Root causes this file addresses:
 * 1. body { overflow-x: clip/hidden } + sticky header makes iOS size
 *    header/main/footer to content width (~70%), leaving a blank strip
 *    on the right. Fixed-position controls (back-to-top) still use the
 *    real visual viewport — matching the screenshots.
 * 2. .article-ed-wrapper keeps grid-template-columns: 1fr 310px when
 *    .article-ed-sidebar { display: flex } overrides [hidden], so an
 *    empty 310px column survives on phones.
 * 3. Footer 5-col grid minmax(12rem, …) can refuse to shrink.
 * 4. .auth-slot .btn { display: inline-flex } beats .auth-desk { display: none },
 *    so the desktop Sign in button AND the mobile login icon both show.
 * 5. Header search min-width / 100vw can inflate the layout viewport.
 *
 * Do not treat overflow-x: hidden as the fix. Overflow sources are
 * corrected; body overflow is restored to visible.
 */

html {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: visible;
  box-sizing: border-box;
}

.site-header,
#site-header-el,
main,
.site-footer {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.article-ed-sidebar[hidden] {
  display: none !important;
}

.auth-slot .btn.auth-desk,
.auth-slot a.btn.auth-desk {
  display: none;
}

@media (min-width: 1024px) {
  .auth-slot .btn.auth-desk,
  .auth-slot a.btn.auth-desk {
    display: inline-flex;
  }

  .auth-slot .auth-mobile {
    display: none;
  }
}

@media (max-width: 900px) {
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }

  .site-header .header-inner.container,
  .site-header .header-inner {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: clamp(16px, 4vw, 24px);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .header-actions {
    margin-inline-start: auto;
    flex-shrink: 0;
  }

  .header-actions .icon-btn.header-icon-btn,
  .header-actions .mobile-toggle,
  .auth-slot .auth-mobile.icon-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
  }

  .brand {
    min-width: 0;
    font-size: clamp(1.2rem, 5.2vw, 1.65rem);
  }

  .article-ed-wrapper,
  .article-ed-wrapper--solo {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: clamp(16px, 4vw, 24px);
    grid-template-columns: minmax(0, 1fr);
    justify-content: stretch;
  }

  .article-ed-card,
  .article-ed-sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .article-ed-card img,
  .article-page--editorial .article-body img,
  .article-page--editorial .content-image img,
  .article-page--editorial .article-second {
    max-width: 100%;
  }

  .article-ed-header {
    max-width: 100%;
    padding-inline: clamp(16px, 4vw, 24px);
    box-sizing: border-box;
  }

  .article-page--editorial .article-body {
    padding-inline: clamp(16px, 4.5vw, 24px);
    line-height: 1.85;
    overflow-wrap: break-word;
  }

  .article-ed-nav,
  .article-page--editorial .article-comments {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-inline: clamp(16px, 4vw, 24px);
  }

  .site-footer {
    width: 100%;
    max-width: 100%;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .site-footer .footer-inner.container,
  .site-footer .footer-inner,
  .site-footer .footer-bottom .container {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding-inline: clamp(16px, 4vw, 24px);
    box-sizing: border-box;
  }

  .site-footer .footer-grid {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .site-footer .footer-brand,
  .site-footer .footer-col {
    min-width: 0;
    max-width: 100%;
  }
}

@media (max-width: 560px) {
  .site-footer .footer-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 380px) {
  .header-actions .icon-btn.header-icon-btn,
  .header-actions .mobile-toggle,
  .auth-slot .auth-mobile.icon-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* Hide leftover Malayalam footer CTA paragraph if an old HTML extract remains. */
.site-footer .footer-cta-text {
  display: none;
}
