/* ==========================================================================
   REAL SATHI / REAL BANDHAN — FINAL MOBILE RESPONSIVE OVERRIDE
   Loaded last on public pages. Visual/layout only; no PHP or DB logic.
   ========================================================================== */

html, body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

img, svg, video, canvas, iframe {
  max-width: 100%;
}

.container {
  width: 100%;
}

@media (max-width: 991.98px) {
  .container {
    padding-left: 18px;
    padding-right: 18px;
  }

  /* Main navbar */
  .navbar-heritage {
    min-height: 68px;
    padding: 8px 0;
  }

  .navbar-heritage > .container {
    flex-wrap: wrap;
  }

  .navbar-heritage .navbar-brand {
    max-width: calc(100% - 58px);
    min-width: 0;
  }

  .navbar-heritage .brand-text-wrap {
    min-width: 0;
  }

  .navbar-heritage .brand-mark .marathi {
    font-size: 1rem;
  }

  .navbar-heritage .brand-tagline {
    font-size: .5rem;
    letter-spacing: .11em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .navbar-heritage .navbar-toggler {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--brand-border, #e9e3f6);
    border-radius: 13px;
    background: rgba(255,255,255,.92);
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .navbar-heritage .navbar-collapse {
    width: 100%;
    margin-top: 10px;
    padding: 12px;
    background: rgba(255,255,255,.98);
    border: 1px solid var(--brand-border, #e9e3f6);
    border-radius: 18px;
    box-shadow: 0 18px 45px rgba(70,50,100,.12);
  }

  .navbar-heritage .navbar-nav {
    width: 100%;
    margin: 0 !important;
    gap: 3px;
  }

  .navbar-heritage .navbar-nav .nav-item {
    width: 100%;
  }

  .navbar-heritage .navbar-nav .nav-link {
    width: 100%;
    padding: 11px 13px;
    border-radius: 11px;
  }

  .navbar-heritage .navbar-collapse > .d-flex {
    width: 100%;
    flex-direction: column;
    align-items: stretch !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  .navbar-heritage .language-nav-wrapper,
  .navbar-heritage .language-nav-btn,
  .navbar-heritage .navbar-collapse .btn-outline-heritage,
  .navbar-heritage .navbar-collapse .btn-heritage {
    width: 100%;
  }

  .navbar-heritage .language-nav-btn {
    justify-content: center;
  }

  /* General headings/sections */
  .section-pad {
    padding-top: 58px;
    padding-bottom: 58px;
  }

  .section-title,
  h1.display-5 {
    font-size: clamp(1.85rem, 7vw, 2.65rem);
    line-height: 1.15;
  }

  .page-header {
    padding-top: 95px !important;
  }

  .page-header .container {
    padding-top: 35px !important;
    padding-bottom: 35px !important;
  }

  /* Generic Bootstrap rows/forms */
  .row {
    --bs-gutter-x: 1rem;
  }

  .form-control,
  .form-select,
  input,
  select,
  textarea {
    max-width: 100%;
  }

  .btn {
    max-width: 100%;
  }

  /* Profile cards */
  .card-profile__image {
    height: 270px;
  }

  .card-profile__body {
    padding: 16px;
  }

  /* Long tags/text must not force horizontal overflow */
  .chip,
  .badge,
  .tag,
  .profile-tag {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  /* Tables */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-responsive > .table {
    min-width: 650px;
  }
}

@media (max-width: 767.98px) {
  .container {
    padding-left: 14px;
    padding-right: 14px;
  }

  body {
    font-size: 14px;
  }

  .eyebrow {
    font-size: .64rem;
    letter-spacing: 1.8px;
  }

  .section-lede,
  .lead {
    font-size: .92rem;
    line-height: 1.65;
  }

  /* Navbar */
  .navbar-heritage {
    min-height: 62px;
  }

  .navbar-heritage .arch-icon {
    width: 34px;
    height: 34px;
  }

  .navbar-heritage .brand-mark .marathi {
    font-size: .94rem;
  }

  .navbar-heritage .brand-tagline {
    font-size: .44rem;
    letter-spacing: .08em;
  }

  /* Hero */
  .hero {
    padding-top: 92px !important;
    padding-bottom: 34px !important;
  }

  .hero .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-intro {
    text-align: center;
  }

  .hero h1 {
    font-size: clamp(2rem, 9vw, 2.75rem);
    line-height: 1.08;
  }

  .hero p {
    font-size: .93rem;
    line-height: 1.65;
  }

  .hero-actions,
  .hero-stat-row,
  .hero-trust-row {
    flex-wrap: wrap;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .hero-slider-wrap {
    width: calc(100% - 20px) !important;
    margin-top: 1.25rem !important;
  }

  .hero-photo-carousel.hero-photo-carousel--full {
    height: 285px !important;
    min-height: 285px;
    border-radius: 18px !important;
  }

  .hero-photo-carousel.hero-photo-carousel--full .swiper-slide img {
    object-position: center center;
  }

  .hero-slider-arrow {
    width: 34px !important;
    height: 34px !important;
  }

  .hero-slider-prev { left: 9px !important; }
  .hero-slider-next { right: 9px !important; }

  .hero-slide-caption {
    left: 13px !important;
    bottom: 13px !important;
    right: 55px;
    font-size: .85rem !important;
  }

  /* Homepage scrolling gallery */
  .gallery-strip-section {
    padding: 34px 0 40px !important;
  }

  .gallery-strip-heading {
    padding: 0 10px;
  }

  .photo-marquee-item {
    width: 150px !important;
    height: 105px !important;
    border-radius: 14px !important;
  }

  .photo-marquee-track {
    gap: 11px !important;
  }

  /* Generic cards/sections */
  .glass-card,
  .card-profile,
  .pricing-card,
  .testimonial-card,
  .story-card {
    border-radius: 17px;
  }

  .py-lg-6 {
    padding-top: 2.8rem !important;
    padding-bottom: 2.8rem !important;
  }

  /* Search/filter areas */
  .search-panel,
  .advanced-search,
  .filter-card,
  .search-filters {
    padding: 14px !important;
    border-radius: 16px !important;
  }

  /* Make action rows stack instead of overflowing */
  .d-flex.justify-content-between.align-items-center {
    gap: 12px;
    flex-wrap: wrap;
  }

  /* Contact/footer */
  .footer-heritage {
    padding-top: 42px;
  }

  .footer-heritage .row > [class*="col-"] {
    margin-bottom: 22px;
  }

  /* Prevent long URLs/emails/labels from breaking the viewport */
  a, p, h1, h2, h3, h4, h5, h6, span, td, th, label {
    overflow-wrap: anywhere;
  }
}

@media (max-width: 575.98px) {
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  .page-header {
    padding-top: 84px !important;
  }

  .page-header h1 {
    font-size: 1.85rem;
  }

  .page-header .glass-card {
    margin-top: 4px;
  }

  /* Profile listing: one clean card per row */
  .card-profile__image {
    height: 245px !important;
  }

  .card-profile__body h3 {
    font-size: 1.05rem;
  }

  /* Pricing */
  .pricing-card {
    padding: 18px !important;
  }

  /* Buttons become touch friendly */
  .btn {
    min-height: 42px;
  }

  /* Modal */
  .modal-dialog {
    margin: 10px;
  }

  .modal-content {
    border-radius: 18px;
  }
}

@media (max-width: 390px) {
  .navbar-heritage .brand-tagline {
    display: none;
  }

  .hero-photo-carousel.hero-photo-carousel--full {
    height: 250px !important;
    min-height: 250px;
  }

  .hero h1 {
    font-size: 1.9rem;
  }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* Real Sathi homepage: stack newest-member profile cards vertically on phones */
@media (max-width: 767.98px) {
  #latest-profiles .members-wrap > .d-flex {
    display: block !important;
    width: 100%;
  }

  #latest-profiles #membersScroll.members-scroll {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    gap: 18px;
    overflow-x: visible !important;
    overflow-y: visible;
    padding: 0.4rem 0 1rem;
    scroll-snap-type: none;
  }

  #latest-profiles #membersScroll .member-card,
  #latest-profiles #membersScroll .member-card-modern {
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    flex: none !important;
    scroll-snap-align: none;
  }

  #latest-profiles #membersScroll .public-profile-card {
    width: 100%;
  }

  #latest-profiles #membersScroll .public-profile-card__media {
    height: min(112vw, 440px);
    min-height: 300px;
  }
}
