/* ==========================================================================
   MOBILE / TABLET RESPONSIVE OVERRIDES
   Desktop styles (1366px+) are unchanged. All rules use max-width media queries.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Tablet & mobile nav (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  :root {
    --header-h: 88px;
  }

  .header__inner {
    gap: 16px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header__logo img {
    width: min(200px, 42vw);
    height: auto;
  }

  .header__nav {
    max-height: calc(100vh - var(--header-h) - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .header__menu-dropdown-btn img {
    width: 18px;
    height: auto;
  }

  /* Solutions dropdown — full-width mobile panel */
  .solutions-nav {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    left: 16px;
    right: 16px;
    width: auto;
    height: auto;
    max-height: calc(100vh - var(--header-h) - 24px);
    overflow-x: hidden;
    overflow-y: auto;
    transform: translateX(0) translateY(-8px);
    border-radius: 20px;
    z-index: 120;
  }

  .solutions-nav.is-open {
    transform: translateX(0) translateY(0);
  }

  .solutions-nav__inner {
    flex-direction: column;
    height: auto;
    min-height: 0;
    padding: 16px;
    gap: 20px;
  }

  .solutions-nav__main {
    padding: 0;
  }

  .solutions-nav__heading {
    font-size: clamp(22px, 5vw, 30px);
    line-height: 1.2;
  }

  .solutions-nav__grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .solutions-nav__item {
    padding: 12px;
  }

  .solutions-nav__approach {
    width: 100%;
    min-height: 0;
    padding: 20px;
    border-radius: 16px;
  }

  .solutions-nav__approach-title {
    font-size: clamp(22px, 5vw, 28px);
  }

  /* Shared hero actions */
  .page-hero__actions,
  .mainhome-hero__actions,
  .about-hero .page-hero__actions {
    flex-wrap: wrap;
    gap: 12px;
  }

  .page-hero__actions .btn,
  .mainhome-hero__actions .btn {
    min-width: 0;
  }

  /* Reports page extra container padding fix */
  body[data-active-nav="reports"] .container {
    padding-left: var(--gutter);
    padding-right: var(--gutter);
  }

  /* Grids with fixed min columns */
  .why-matters__grid,
  .what-is__grid,
  .quality-approach__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .industries__grid,
  .reports-industries__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .industries__grid .industry-card,
  .industries__grid .industry-card:nth-child(n+5),
  .reports-industries__grid .reports-industry-card,
  .reports-industries__grid .reports-industry-card:nth-child(n+5) {
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Main Home — tablet (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .mainhome-hero {
    padding-bottom: 64px;
  }

  .mainhome-hero__bg {
    height: auto;
    min-height: 620px;
    bottom: 0;
  }

  .mainhome-hero__grid {
    padding-top: 32px;
    gap: 32px;
  }

  .mainhome-hero__title {
    white-space: normal;
    font-size: clamp(28px, 7vw, 40px);
    line-height: 1.15;
  }

  .mainhome-hero__desc {
    font-size: clamp(17px, 4vw, 20px);
    margin-bottom: 28px;
  }

  .mainhome-hero__actions {
    margin-bottom: 40px;
  }

  .mainhome-hero__visual {
    width: 100%;
    max-width: 380px;
    height: auto;
    margin: 0 auto;
    transform: none;
    overflow: hidden;
  }

  .mainhome-hero__photo {
    width: 100%;
    height: auto;
    aspect-ratio: 432 / 484;
  }

  /* Decorative hero overlays — hide on tablet/mobile to prevent overflow */
  .hero-pill,
  .hero-card,
  .hero-services {
    display: none;
  }

  .mainhome-solutions__title,
  .mainhome-trust__title,
  .mainhome-insights__title,
  .mainhome-industries__title,
  .mainhome-brands__title {
    font-size: clamp(28px, 6vw, 45px);
    line-height: 1.15;
  }

  .mainhome-solutions__desc,
  .mainhome-trust__desc,
  .mainhome-insights__desc,
  .mainhome-industries__desc {
    font-size: clamp(17px, 4vw, 22px);
  }

  /* Solution cards — text only on mobile, hide chart widgets */
  .solution-card__visual {
    display: none;
  }

  .solution-card {
    min-height: 0 !important;
    height: auto !important;
    padding: 28px 24px 24px;
  }

  .solution-card h3 {
    font-size: clamp(22px, 5vw, 30px);
    padding-top: 0;
  }

  .solution-card > p {
    max-width: none !important;
  }

  .mainhome-insights__grid {
    padding-left: 0;
    gap: 32px;
  }

  .insight-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 534 / 314;
  }

  .mainhome-trust__panel {
    padding: 32px 24px 28px;
    border-radius: 24px;
  }

  .trust-item__text h3 {
    font-size: clamp(18px, 4.5vw, 24px);
  }
}

/* --------------------------------------------------------------------------
   Shared page heroes — tablet (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .page-hero,
  .reports-hero.page-hero,
  .about-hero,
  .blog-hero {
    min-height: 0;
    padding-bottom: 48px;
  }

  .page-hero__bg,
  .reports-hero .page-hero__bg,
  .about-hero .page-hero__bg,
  .blog-hero .page-hero__bg {
    height: auto;
    min-height: 100%;
  }

  .hero__title,
  .reports-hero__title,
  .about-hero__title,
  .blog-hero__title {
    font-size: clamp(28px, 7vw, 40px);
    line-height: 1.15;
  }

  .hero__desc,
  .reports-hero__desc,
  .about-hero__desc,
  .blog-hero__desc {
    font-size: clamp(16px, 4vw, 20px);
  }

  .breadcrumb {
    flex-wrap: wrap;
    gap: 6px;
  }
}

/* --------------------------------------------------------------------------
   About Us — tablet (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .about-impact__bg,
  .about-values__bg {
    width: 100%;
    max-width: 100%;
    left: 0;
    right: 0;
  }

  .about-impact__decor,
  .about-values__decor {
    overflow: hidden;
  }

  .about-impact__title,
  .about-story__content h2,
  .about-values__title {
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.15;
  }
}

/* --------------------------------------------------------------------------
   Contact — tablet (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .contact-info__title {
    font-size: clamp(28px, 7vw, 42px);
    line-height: 1.15;
  }

  .contact-form__row {
    flex-direction: column;
    gap: 24px;
  }

  .contact-form__field,
  .contact-form__field--full {
    width: 100%;
  }

  .contact-form-panel {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Reports — tablet (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .reports-latest__title,
  .reports-industries__title,
  .reports-trending__title {
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.15;
  }

  .report-featured {
    padding: 24px;
  }

  .report-card {
    max-width: none;
  }
}

/* --------------------------------------------------------------------------
   Data Collection — tablet (992px)
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .quality-approach__title,
  .quality-approach__subtitle {
    font-size: clamp(28px, 6vw, 40px);
    line-height: 1.15;
  }

  .quality-approach__bg {
    width: 100%;
    max-width: calc(100vw - var(--gutter) * 2);
    left: 50%;
    transform: translateX(-50%);
  }
}

/* --------------------------------------------------------------------------
   Mobile phones (640px)
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root {
    --header-h: 76px;
  }

  .header__logo img {
    width: min(168px, 46vw);
  }

  .header.is-open .header__nav {
    padding: 20px 16px;
  }

  .header.is-open .header__actions {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }

  .solutions-nav {
    left: 12px;
    right: 12px;
    top: calc(var(--header-h) + 6px);
    border-radius: 16px;
  }

  .solutions-nav__desc {
    font-size: 12px;
    line-height: 1.35;
  }

  /* Stack hero CTAs full width */
  .page-hero__actions,
  .mainhome-hero__actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .page-hero__actions .btn,
  .mainhome-hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* MainHome stats */
  .mainhome-stat {
    min-width: 0;
    flex: 1 1 calc(50% - 8px);
  }

  .mainhome-stat strong {
    font-size: clamp(28px, 8vw, 40px);
  }

  .mainhome-stat span {
    max-width: none;
    font-size: 13px;
  }

  /* Solution pages section titles */
  .why-matters__title,
  .what-is__title,
  .process__title,
  .industries__title,
  .quality-approach__title {
    font-size: 32px;
    line-height: 1.15;
  }

  .why-matters__desc,
  .what-is__desc,
  .process__desc,
  .industries__desc {
    font-size: 17px;
  }

  .why-matters__grid,
  .what-is__grid,
  .quality-approach__grid,
  .industries__grid,
  .reports-industries__grid {
    grid-template-columns: 1fr;
  }

  .why-card,
  .what-card,
  .quality-card {
    width: 100%;
  }

  /* Process steps */
  .process__item {
    grid-template-columns: 48px 1fr;
    gap: 16px;
  }

  .process__num {
    font-size: 40px;
  }

  /* Blog */
  .blog-filters {
    gap: 12px;
  }

  .blog-filter-btn {
    font-size: 14px;
    padding: 8px 14px;
  }

  .blog-card__title {
    font-size: clamp(20px, 5vw, 26px);
  }

  /* Footer */
  .footer__copy {
    font-size: 15px;
  }

  .footer__links h3,
  .footer__contact h3 {
    font-size: 18px;
  }

  .footer__links a,
  .footer__contact li,
  .footer__brand p {
    font-size: 15px;
  }

  /* Brands / CTA shared */
  .brands__title,
  .cta__title {
    font-size: clamp(28px, 7vw, 40px);
    line-height: 1.15;
  }

  .brands__desc,
  .cta__desc {
    font-size: 17px;
  }

  .cta__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cta__actions .btn {
    width: 100%;
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Small phones (480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .header__menu a,
  .header__menu-dropdown-btn {
    font-size: 16px;
  }

  .footer__newsletter {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
  }

  .footer__newsletter input {
    width: 100%;
  }

  .footer__newsletter .btn {
    width: 100%;
    justify-content: center;
  }

  .contact-newsletter__form,
  .blog-newsletter__form {
    flex-direction: column;
    align-items: stretch;
  }

  .contact-newsletter__form input,
  .blog-newsletter__form input,
  .contact-newsletter__form .btn,
  .blog-newsletter__form .btn {
    width: 100%;
  }

  .insight-card h3 {
    font-size: clamp(22px, 6vw, 30px);
  }

  .report-card__title {
    font-size: clamp(18px, 5vw, 24px);
  }

  .trending-card h3 {
    font-size: clamp(20px, 5.5vw, 28px);
  }

  .about-impact__stats {
    grid-template-columns: 1fr;
    row-gap: 20px;
  }

  .mainhome-industries__grid .mainhome-industry-card {
    height: 240px;
  }
}

/* --------------------------------------------------------------------------
   Overflow safety — targeted, not global body hidden
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .mainhome-hero,
  .page-hero,
  .about-impact,
  .about-values,
  .quality-approach,
  .reports-latest,
  .reports-industries,
  .blog-listing {
    overflow-x: clip;
  }

  .solution-card,
  .insight-card,
  .report-card,
  .blog-card,
  .value-card,
  .contact-form-panel {
    min-width: 0;
  }

  .container {
    min-width: 0;
  }

  .btn,
  .header__menu-dropdown-btn {
    min-height: 44px;
  }

  .what-card,
  .why-card,
  .quality-card {
    overflow: hidden;
  }
}

/* --------------------------------------------------------------------------
   Blog & reports featured blocks — mobile polish
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .blog-featured,
  .blog-featured__image {
    width: 100%;
    max-width: none;
  }

  .blog-featured__image {
    width: 100%;
    margin-left: 0;
  }

  .report-featured__media {
    max-width: none;
    width: 100%;
  }

  .report-featured__media img {
    width: 100%;
    height: auto;
  }

  .trending-media img {
    width: 100%;
    height: auto;
  }
}
