/* Cross-site responsive hardening layer.
   Loaded last so it can safely override earlier legacy skins. */

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

body {
  overflow-x: clip;
}

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

.cms-page-content,
.html-embed-fullbleed,
.html-embed-root {
  max-width: 100%;
  overflow-x: clip;
}

.html-embed-root table {
  display: block;
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.html-embed-root pre,
.html-embed-root code {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Keep forms and utility controls from collapsing awkwardly on mobile */
.search-box-premium,
.insights-toolbar-search {
  min-width: 0;
}

.v5-btn-outline,
.v5-btn-primary {
  white-space: normal;
}

/* Insights archive pages: toolbars, cards, and pagination */
@media (max-width: 991.98px) {
  .insights-main-section .container.py-5 {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .insights-toolbar-panel {
    align-items: stretch !important;
    gap: 0.9rem !important;
    padding: 0.9rem !important;
  }

  .insights-toolbar-panel .btn-group {
    width: 100%;
    gap: 0.45rem;
  }

  .insights-toolbar-panel .v5-btn-outline.v5-btn-sm {
    flex: 1 1 auto;
    min-height: 2.6rem;
    padding-inline: 0.9rem !important;
  }

  .search-box-premium {
    width: 100%;
  }

  .search-box-premium input {
    min-height: 2.8rem;
  }
}

@media (max-width: 767.98px) {
  .insights-main-section .container.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }

  .glass-blog-card-featured {
    padding: 1rem !important;
  }

  .glass-blog-card-featured .display-6 {
    font-size: clamp(1.35rem, 6.2vw, 1.95rem);
    margin-bottom: 0.9rem !important;
  }

  .glass-blog-card-featured .v5-btn-primary {
    width: 100%;
    justify-content: center;
  }

  .insights-list-title {
    font-size: 1rem !important;
  }

  .blog-pagination {
    flex-wrap: wrap;
    gap: 0.75rem !important;
  }

  .blog-pagination .v5-btn-outline {
    width: 100%;
    justify-content: center;
  }
}

/* Inner hero + breadcrumbs */
@media (max-width: 767.98px) {
  .inner-page-hero {
    min-height: 460px !important;
    height: auto !important;
    padding-top: 6rem !important;
    padding-bottom: 3rem !important;
  }

  .dark-breadcrumb {
    flex-wrap: wrap;
    row-gap: 0.35rem;
  }

  .inner-hero-subtitle {
    font-size: 1rem !important;
    line-height: 1.55 !important;
  }
}

/* Service-detail pages and migrated inner pages */
@media (max-width: 991.98px) {
  .sd-section-header {
    margin-bottom: 1.5rem !important;
  }

  .sd-section-header .text-lg-end {
    text-align: left !important;
  }

  .sd-section-header .v5-btn-outline {
    width: auto;
  }

  .sd-industry-grid {
    gap: 0.65rem !important;
  }

  .sd-case-body,
  .sd-insight-body {
    padding: 1rem !important;
  }
}

@media (max-width: 767.98px) {
  .sd-section-title {
    font-size: clamp(1.35rem, 6vw, 2rem) !important;
  }

  .sd-eyebrow {
    font-size: 0.62rem !important;
    letter-spacing: 0.13em !important;
  }

  .sd-cases-section .v5-btn-outline,
  .sd-insights-section .v5-btn-outline,
  .sd-industries-section .v5-btn-outline {
    width: 100%;
    justify-content: center;
  }

  .sd-case-title,
  .sd-insight-title {
    min-height: 0 !important;
  }

  body.page-servicedel-v5 .services-parallax-section {
    padding-top: 2.75rem !important;
    padding-bottom: 2.75rem !important;
  }

  body.page-servicedel-v5 .parallax-stack {
    gap: 1rem !important;
  }

  body.page-servicedel-v5 .parallax-card {
    padding: 1rem !important;
    border-radius: 16px !important;
  }

  body.page-servicedel-v5 .parallax-title {
    font-size: clamp(1.15rem, 5.3vw, 1.5rem) !important;
  }

  body.page-servicedel-v5 .parallax-visual-badge {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.68rem !important;
  }
}

/* Home (page-index-v5) — mobile clarity and overflow safety */
@media (max-width: 991.98px) {
  body.page-index-v5 .hero-banner-new,
  body.page-index-v5 .inner-page-hero {
    min-height: 560px !important;
  }

  body.page-index-v5 .hero-title-main {
    font-size: clamp(1.7rem, 5.5vw, 2.35rem) !important;
    line-height: 1.3 !important;
  }

  body.page-index-v5 .text-blue-highlight {
    font-size: clamp(2.2rem, 8.5vw, 3.25rem) !important;
    letter-spacing: -0.04em !important;
  }

  body.page-index-v5 .hero-trusted-by {
    position: relative !important;
    bottom: auto !important;
    margin-top: 1.5rem;
    padding-bottom: 0.25rem;
  }

  body.page-index-v5 .trusted-logos-track {
    gap: 2rem !important;
  }
}

@media (max-width: 767.98px) {
  body.page-index-v5 .hero-content-container {
    padding-top: 0 !important;
  }

  body.page-index-v5 .hero-title-main {
    font-size: clamp(1.35rem, 6.5vw, 1.75rem) !important;
    margin-bottom: 0.8rem !important;
  }

  body.page-index-v5 .text-blue-highlight {
    font-size: clamp(1.95rem, 10vw, 2.45rem) !important;
    margin-top: 0.35rem !important;
  }

  body.page-index-v5 .ip-showcase-panels-container {
    border-radius: 1rem !important;
  }
}

/* Detail page sidebars and sticky elements on mobile */
@media (max-width: 991.98px) {
  .insights-page .case-sidebar-fixed-wrap {
    position: static !important;
    top: auto !important;
  }

  .insights-page .detail-section {
    padding-top: 2.25rem !important;
    padding-bottom: 2.5rem !important;
  }

  .insights-page .detail-sidebar-card {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }

  .insights-page .case-tech-stack {
    padding: 1rem !important;
  }
}

/* Legacy content blocks */
@media (max-width: 767.98px) {
  .legacy-inner-section {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
  }

  .legacy-inner-panel {
    padding: 1rem !important;
    border-radius: 12px !important;
  }
}

/* Mega menu compactness on tablet/mobile */
@media (max-width: 991.98px) {
  .site-mega-navbar .mega-menu-white__top {
    gap: 1.25rem !important;
  }

  .site-mega-navbar .mega-menu-white__partner-row {
    gap: 0.55rem !important;
  }
}

/* Focus polish: 390px mega menu readability */
@media (max-width: 430px) {
  .site-mega-navbar .mega-menu-white__inner {
    padding: 0.85rem !important;
  }

  .site-mega-navbar .mega-menu-white__panel-title {
    font-size: 0.95rem !important;
  }

  .site-mega-navbar .mega-menu-white__subhead {
    font-size: 0.76rem !important;
    margin-bottom: 0.35rem !important;
  }

  .site-mega-navbar .mega-menu-white__bullet-list li {
    margin-bottom: 0.2rem !important;
  }

  .site-mega-navbar .mega-menu-white__bullet-list a {
    font-size: 0.82rem !important;
    line-height: 1.3 !important;
  }

  .site-mega-navbar .mega-menu-white__card {
    min-height: 5.35rem !important;
    border-radius: 7px !important;
  }

  .site-mega-navbar .mega-menu-white__card-img {
    max-width: 88px !important;
    height: 32px !important;
  }

  .site-mega-navbar .mega-menu-white__partner-card {
    min-height: 2.8rem !important;
    padding: 0.45rem 0.5rem !important;
    border-radius: 7px !important;
  }

  .site-mega-navbar .mega-menu-white__partner-img {
    height: 1.35rem !important;
  }
}

/* Focus polish: 768px services spacing and CTA consistency */
@media (max-width: 768px) {
  body.page-servicedel-v5 .services-parallax-section .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  body.page-servicedel-v5 .services-parallax-section .sd-section-title {
    margin-bottom: 0.4rem !important;
  }

  body.page-servicedel-v5 .parallax-card .row {
    --bs-gutter-y: 0.9rem;
  }

  body.page-servicedel-v5 .parallax-card .sd-pane-cta {
    width: 100%;
    justify-content: center;
  }

  .sd-cases-section .row.g-4,
  .sd-insights-section .row.g-4 {
    --bs-gutter-y: 0.9rem;
  }
}

/* Focus polish: 360px archive card density */
@media (max-width: 390px) {
  .insights-toolbar-panel {
    padding: 0.75rem !important;
  }

  .insights-toolbar-panel .v5-btn-outline.v5-btn-sm {
    min-height: 2.35rem;
    padding-inline: 0.7rem !important;
    font-size: 0.75rem !important;
  }

  .glass-blog-card,
  .insights-list-card {
    border-radius: 14px !important;
  }

  .insights-list-card .p-4 {
    padding: 0.85rem !important;
  }

  .insights-list-title {
    font-size: 0.95rem !important;
    line-height: 1.35 !important;
  }

  .insights-list-excerpt {
    margin-bottom: 0.7rem !important;
    min-height: 0 !important;
    -webkit-line-clamp: 2 !important;
    line-clamp: 2 !important;
  }

  .blog-pagination span {
    width: 100%;
    text-align: center;
  }
}

/* Generic utility safety for deeply nested bootstrap rows */
.row > [class*='col-'] {
  min-width: 0;
}

