/**
 * iPhone Duo (iOS 27 foldable) — closed ~466×678, open ~890×626, Split View ~445×626.
 * Safari does not expose hinge APIs; layout follows viewport size and resize.
 */

html {
  overflow-x: clip;
}

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

.mypic,
.cards-layout-content,
.card-list-points {
  min-width: 0 !important;
  max-width: 100%;
}

/* Force wrapping on the 440–500px Duo closed / Split View range */
@media screen and (max-width: 900px) {
  h1 {
    white-space: normal !important;
  }
}

/* Keep chrome out of the inner-display crease (~middle 40px at ~890 wide) */
@media (min-width: 800px) and (max-width: 960px) and (max-height: 720px) {
  .floating-nav-container {
    left: auto;
    right: max(24px, env(safe-area-inset-right, 0px));
    transform: translateY(100px);
  }

  .floating-nav-container.visible {
    transform: translateY(0);
  }

  .hero-cta-row {
    justify-content: flex-start;
  }
}

/* Short inner display: don't lock the hero to a full screen of empty wash */
@media (max-height: 700px) {
  header {
    min-height: 0;
  }

  .archive-item {
    min-height: 0;
  }
}

/* Inner display is a short tablet: tighten desktop nav so it doesn't wrap */
@media (min-width: 769px) and (max-width: 960px) {
  .desk-menu li a:not(.get-in-touch-btn) {
    padding: 0 12px !important;
  }

  .desk-menu .get-in-touch-btn {
    margin-left: 8px !important;
    padding: 12px 18px !important;
  }
}

/* Compact type on Duo closed (~466) — sits between 430 and 768 breakpoints */
@media screen and (max-width: 500px) {
  header .HeaderContent h1 {
    font-size: 1.75rem !important;
    line-height: 1.28 !important;
  }
}

/* Side chat panel is 420px; below ~1024px it crushes Duo open / Split View */
@media (max-width: 1024px) {
  body.chat-open {
    overflow: hidden;
  }

  body.chat-open #site-content-wrap {
    margin-right: 0 !important;
  }

  .chatbot-sidebar {
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    height: 100dvh !important;
    border-radius: 0 !important;
    z-index: 10150 !important;
    transform: translateY(100%);
  }

  body.chat-open .chatbot-sidebar {
    transform: translateY(0) !important;
    pointer-events: auto !important;
  }

  .chatbot-sidebar iframe {
    border-radius: 0 !important;
  }

  body.chat-open .logo-srini {
    visibility: hidden !important;
    pointer-events: none !important;
  }

  body.chat-open .srini-chat-fab {
    display: none !important;
  }
}

@media (max-width: 1024px) and (min-width: 769px) {
  .srini-chat-fab {
    display: flex !important;
    top: auto !important;
    bottom: max(24px, env(safe-area-inset-bottom, 0px)) !important;
    right: max(24px, env(safe-area-inset-right, 0px)) !important;
    width: 75px;
    height: 75px;
  }

  .header-chat-slot {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .srini-chat-fab {
    bottom: max(24px, env(safe-area-inset-bottom, 0px));
    right: max(24px, env(safe-area-inset-right, 0px));
  }
}
