/* ARETAVA LIMITED - Comprehensive Mobile & Responsive Refinements */

html,
body {
  max-width: 100%;
}

img,
video,
iframe {
  max-width: 100%;
  height: auto;
}

/* Horizontal carousels should not trap the page scroll */
#pillars-slider-track,
.marquee-container {
  touch-action: pan-y pinch-zoom;
}

#pillars-slider-track {
  overscroll-behavior-x: contain;
}

@media (max-width: 1023px) {

  /* Header container padding on tablet & mobile */
  header .max-w-7xl {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  #mobile-menu-toggle {
    display: inline-flex !important;
  }

  /* Mobile menu drawer touch handling */
  #mobile-menu {
    -webkit-overflow-scrolling: touch;
  }

  main,
  section,
  header,
  footer {
    max-width: 100%;
  }

  h1,
  h2,
  h3,
  p,
  a,
  li {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 767px) {

  /* Compact mobile header spacing */
  header {
    border-bottom-width: 1px;
  }

  .institutional-stats > div > span:first-child {
    font-size: 1.35rem !important;
    line-height: 1.6rem !important;
  }

  .institutional-stats > div > span:last-child {
    font-size: 0.6875rem !important;
    line-height: 1rem !important;
  }

  /* Keep large editorial type readable on phones */
  .hero-headline,
  h1.font-display-hero,
  .text-display-hero,
  .text-display-hero-mobile {
    font-size: 1.85rem !important;
    line-height: 2.2rem !important;
  }

  h2,
  .text-headline-xl,
  .text-headline-xl-mobile {
    font-size: 1.55rem !important;
    line-height: 1.95rem !important;
  }

  h3,
  .text-headline-lg,
  .text-headline-md {
    font-size: 1.2rem !important;
    line-height: 1.55rem !important;
  }

  .text-title-editorial {
    font-size: 1.05rem !important;
    line-height: 1.4rem !important;
  }

  .text-body-lg,
  p.font-body-lg {
    font-size: 0.95rem !important;
    line-height: 1.45rem !important;
  }

  .text-body-md,
  p.font-body-md {
    font-size: 0.875rem !important;
    line-height: 1.35rem !important;
  }

  /* Bento grid single column on mobile */
  .bento-grid {
    grid-template-columns: 1fr !important;
  }

  /* Responsive tables with smooth horizontal scroll */
  .table-responsive,
  .overflow-x-auto {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Touch-friendly controls without stretching every text link */
  button,
  a.inline-flex,
  #mobile-menu a,
  input[type="submit"] {
    min-height: 44px;
  }

  section.py-space-xl,
  section.lg\:py-28 {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }

  .grid-cols-3 {
    grid-template-columns: 1fr !important;
  }

  footer {
    padding-bottom: 6rem;
  }

  /* Form controls easy to tap */
  input,
  select,
  textarea {
    font-size: 16px !important;
    /* Prevents auto-zoom on iOS Safari */
  }
}

@media (max-width: 480px) {

  /* Ultra-compact screens (iPhone SE, smaller Androids) */
  .hero-headline,
  h1.font-display-hero,
  .text-display-hero,
  .text-display-hero-mobile {
    font-size: 1.65rem !important;
    line-height: 2rem !important;
  }

  h2,
  .text-headline-xl,
  .text-headline-xl-mobile {
    font-size: 1.4rem !important;
    line-height: 1.75rem !important;
  }

  h3,
  .text-headline-lg,
  .text-headline-md {
    font-size: 1.1rem !important;
    line-height: 1.4rem !important;
  }

  #mobile-menu {
    width: 100vw !important;
    max-width: 100vw !important;
  }
}
