/*
 * Vasishtha - shared mobile-first responsive layer.
 * Loaded last on every page so it can correct layout issues that the
 * per-page inline styles leave on phones and tablets.
 */

/* ---------- base: never scroll sideways, readable text, media fits ---------- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
html,
body {
  max-width: 100%;
  overflow-x: clip;
}
img,
video,
iframe,
svg,
canvas {
  max-width: 100%;
}
img,
video {
  height: auto;
}
a,
button,
summary {
  -webkit-tap-highlight-color: transparent;
}
/* iOS zooms the page when a focused field is under 16px */
input,
select,
textarea {
  font-size: max(16px, 1em);
}
table {
  max-width: 100%;
}
.container {
  width: 100%;
}
:where(section, [id]) {
  scroll-margin-top: 96px;
}

/* ---------- navigation: off-canvas menu up to 1100px ---------- */
.nav-backdrop {
  display: none;
}
@media (max-width: 1100px) {
  .hamburger {
    display: flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: transparent;
    border-radius: 50%;
  }
  .hamburger span {
    transition:
      transform 0.3s ease,
      opacity 0.2s ease;
  }
  .hamburger.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .hamburger.active span:nth-child(2) {
    opacity: 0;
  }
  .hamburger.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 84%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 92px 22px 32px;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 4px;
    background: #fffdf6;
    box-shadow: -12px 0 34px rgba(38, 35, 34, 0.14);
    border-radius: 28px 0 0 28px;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: right 0.35s cubic-bezier(0.2, 0.7, 0.3, 1);
    z-index: 1000;
  }
  .nav-menu.active {
    right: 0;
  }
  .nav-menu > li {
    width: 100%;
  }
  .nav-menu .nav-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 50px;
    padding: 10px 16px;
    font-size: 1.08rem;
    border-radius: 14px;
  }
  .nav-menu .nav-link:hover,
  .nav-menu .nav-link.active {
    background: #eaf6ff;
  }
  .nav-menu .nav-scribble {
    display: none;
  }
  .nav-menu .btn {
    width: 100%;
    min-height: 50px;
    justify-content: center;
    margin-top: 12px;
  }
  .nav-menu .dropdown-menu {
    position: static;
    min-width: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding: 0 0 8px 18px;
    display: none;
    background: transparent;
  }
  .nav-menu .dropdown.open .dropdown-menu {
    display: block;
  }
  .nav-menu .dropdown-menu a {
    min-height: 44px;
    display: flex;
    align-items: center;
    border-radius: 12px;
  }
  .nav-menu .dropdown .fa-chevron-down {
    padding: 12px;
    margin: -12px;
    transition: transform 0.25s ease;
  }
  .nav-menu .dropdown.open .fa-chevron-down {
    transform: rotate(180deg);
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(38, 35, 34, 0.42);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    opacity: 0;
    visibility: hidden;
    transition:
      opacity 0.3s ease,
      visibility 0.3s ease;
  }
  .nav-backdrop.active {
    opacity: 1;
    visibility: visible;
  }
  body.nav-open {
    overflow: hidden;
  }
}

/* ---------- tablets ---------- */
@media (max-width: 900px) {
  .section-header {
    margin-bottom: 40px;
  }
  .section-header h2 {
    font-size: clamp(1.8rem, 6vw, 2.6rem);
  }
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
  .container {
    padding-left: 16px;
    padding-right: 16px;
  }
  .header {
    padding-left: 12px;
    padding-right: 12px;
  }
  .section-header {
    margin-bottom: 32px;
  }
  .section-header h2 {
    font-size: clamp(1.6rem, 8vw, 2.1rem);
  }
  .section-header p {
    font-size: 0.95rem;
  }
  /* comfortable vertical rhythm instead of 100px desktop gaps */
  body > section[class],
  body > section:not([class]),
  main > section[class] {
    padding-top: clamp(48px, 13vw, 64px);
    padding-bottom: clamp(48px, 13vw, 64px);
  }
  body > section.hero {
    padding-top: 28px;
  }
  .btn,
  .cta-buttons .btn {
    min-height: 46px;
  }
  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-buttons .btn {
    justify-content: center;
  }
  /* very long words / URLs wrap instead of pushing the page wide */
  p,
  li,
  h1,
  h2,
  h3,
  h4,
  a,
  span,
  td,
  summary {
    overflow-wrap: break-word;
  }
  .rb-word,
  .rb-letter {
    overflow-wrap: normal;
  }
  iframe {
    width: 100%;
  }
}

/* footer "Popular Searches" links carry inline white-space:nowrap; on phones
   the longest ones (~430px) pushed every page sideways */
@media (max-width: 600px) {
  .footer a[style*="nowrap"] {
    white-space: normal !important;
    display: inline;
  }
  .footer-grid {
    gap: 30px;
  }
}

/* floating call / WhatsApp / chat buttons sit above everything; hide them
   while the mobile menu is open so they don't cover menu items */
body.nav-open .float-stack,
body.nav-open .float-stack-left,
body.nav-open #chatFabBtn,
body.nav-open .chat-window {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* location pages render the breadcrumb twice (a bar above the banner and
   another below it); keep only the one under the banner */
.breadcrumb-bar:has(~ .breadcrumb) {
  display: none;
}
