/* Health Boat responsive foundation
   ------------------------------------------------------------
   This file sits after the main frontend styles and acts as a
   mobile-first safety layer for shared layouts, media, forms,
   tables, modals, and the most-used custom page sections.
   ------------------------------------------------------------ */

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  font-size: 1rem;
  line-height: 1.6;
  word-wrap: break-word;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

img,
video,
canvas {
  height: auto;
  display: block;
}

iframe {
  width: 100%;
  border: 0;
}

a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="reset"],
.btn,
.hb-btn,
.home-btn,
.career-btn,
.csr-btn {
  min-height: 44px;
}

button,
select {
  touch-action: manipulation;
}

p,
li,
label,
input,
textarea,
select {
  overflow-wrap: break-word;
}

.container,
.container-fluid,
.hb-nav-inner,
.site-footer__inner {
  width: 100%;
}

.container,
.container-fluid {
  padding-left: max(1rem, env(safe-area-inset-left));
  padding-right: max(1rem, env(safe-area-inset-right));
}

.row {
  --bs-gutter-x: 1.25rem;
  --bs-gutter-y: 1.25rem;
}

/* Shared cards, sections, and custom shells */
.home-hero__card,
.career-hero,
.csr-hero,
.career-section-card,
.csr-panel,
.donation-card,
.donation-side-card,
.hb-baaz-hero,
.hb-baaz-form,
.hb-baaz-side,
.hb-baaz-card,
.contact-card,
.site-footer,
.modal-content {
  max-width: 100%;
}

.home-section-head,
.career-filter__head,
.csr-projects__header,
.site-footer__bottom,
.site-footer__social-wrap,
.hero-content,
.hero-icons {
  flex-wrap: wrap;
}

.home-hero__card,
.home-hero__card--editorial,
.home-hero__card--luxury,
.home-hero__card--minimal,
.career-hero,
.csr-hero,
.career-intro,
.career-values,
.csr-intro,
.donation-ui__layout,
.hb-baaz-hero,
.hb-baaz-section__head,
.hb-baaz-grid {
  min-width: 0;
}

.home-hero__copy,
.home-hero__dashboard,
.career-hero__copy,
.career-hero__visual,
.csr-hero__copy,
.csr-hero__media,
.career-intro__copy,
.career-intro__media,
.csr-intro__copy,
.csr-intro__media,
.hb-baaz-hero__copy,
.hb-baaz-hero__visual {
  min-width: 0;
}

/* Typography safety */
h1,
h2,
h3,
h4,
h5,
h6 {
  word-break: break-word;
}

.home-section-head h2,
.career-jobs__header h2,
.csr-projects__header h2,
.career-intro h2,
.csr-intro h2,
.career-hero h1,
.csr-hero h1,
.hb-baaz-hero h1 {
  max-width: 100%;
}

/* Forms */
input,
select,
textarea,
.form-control,
.form-select {
  max-width: 100%;
}

input,
select,
textarea,
.form-control,
.form-select,
.country-select__toggle,
.country-select__search {
  font-size: 1rem !important;
}

textarea {
  min-height: 120px;
}

.donation-grid,
.purpose-grid,
.campaign-foot,
.benefit-box,
.hb-baaz-highlights,
.hb-baaz-criteria,
.hb-baaz-process,
.career-highlights,
.career-values__list,
.career-jobs-grid,
.csr-principles,
.csr-grid,
.home-services-grid,
.home-domain-grid,
.home-most-grid {
  min-width: 0;
}

/* Tables and embedded media */
.hb-table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1rem 0;
  border-radius: 12px;
}

.hb-table-scroll table {
  min-width: 640px;
  margin-bottom: 0;
}

table {
  width: 100%;
}

/* Modal usability */
.modal-dialog {
  width: auto;
  max-width: min(96vw, 760px);
  margin: 1rem auto;
}

.modal-content {
  max-height: calc(100vh - 2rem);
}

.modal-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Videos and maps */
.embed-responsive,
.video-container,
.map-responsive {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.embed-responsive::before,
.video-container::before,
.map-responsive::before {
  content: "";
  display: block;
  padding-top: 56.25%;
}

.embed-responsive > iframe,
.video-container > iframe,
.map-responsive > iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Fix page-specific inline width issues */
#contact-otp,
#otp {
  width: 100% !important;
  max-width: 260px !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.country-select__dropdown {
  max-width: min(100%, 100vw - 2rem);
}

/* Keep floating actions from blocking content */
.floating-donate-btn,
.back-to-top-btn {
  bottom: max(18px, env(safe-area-inset-bottom));
}

/* -------- Tablet and below -------- */
@media (max-width: 1024px) {
  .home-hero__card,
  .home-hero__card--editorial,
  .home-hero__card--luxury,
  .home-hero__card--minimal,
  .career-hero,
  .csr-hero,
  .career-intro,
  .career-values,
  .csr-intro,
  .donation-ui__layout,
  .hb-baaz-hero,
  .hb-baaz-section__head,
  .contact-card .row {
    grid-template-columns: 1fr !important;
  }

  .home-hero__card,
  .career-hero,
  .csr-hero,
  .career-section-card,
  .csr-panel,
  .donation-card,
  .donation-side-card,
  .hb-baaz-hero,
  .hb-baaz-form,
  .hb-baaz-side,
  .hb-baaz-card {
    padding: 24px !important;
    border-radius: 24px !important;
  }

  .career-values__list,
  .csr-principles,
  .csr-grid,
  .career-jobs-grid,
  .hb-baaz-highlights,
  .hb-baaz-criteria {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .home-section-head,
  .career-filter__head,
  .csr-projects__header,
  .site-footer__bottom {
    align-items: stretch !important;
  }

  .campaign-foot,
  .purpose-grid,
  .donation-amounts {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .site-footer__panel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 30px;
  }

  .hb-baaz-hero__image,
  .career-hero__image,
  .csr-hero__media,
  .home-hero__minimal-media {
    min-height: 320px !important;
  }
}

/* -------- Tablets -------- */
@media (min-width: 481px) and (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .container,
  .container-fluid {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .home-section-head h2,
  .career-jobs__header h2,
  .csr-projects__header h2,
  .career-intro h2,
  .csr-intro h2 {
    font-size: clamp(1.9rem, 4.4vw, 2.5rem) !important;
  }

  .career-hero h1,
  .csr-hero h1,
  .hb-baaz-hero h1,
  .home-hero h1 {
    font-size: clamp(2.3rem, 6vw, 3.4rem) !important;
  }

  .site-footer__inner {
    padding: 34px 18px 18px;
  }
}

/* -------- Mobile -------- */
@media (max-width: 480px) {
  html {
    font-size: 16px;
  }

  body {
    line-height: 1.55;
  }

  .container,
  .container-fluid {
    padding-left: 0.9rem;
    padding-right: 0.9rem;
  }

  .row {
    --bs-gutter-x: 1rem;
    --bs-gutter-y: 1rem;
  }

  h1 {
    font-size: clamp(2rem, 9vw, 2.8rem) !important;
    line-height: 1.05 !important;
  }

  h2 {
    font-size: clamp(1.55rem, 7vw, 2.2rem) !important;
    line-height: 1.12 !important;
  }

  h3 {
    font-size: clamp(1.2rem, 5vw, 1.5rem) !important;
    line-height: 1.2 !important;
  }

  p,
  li,
  label {
    font-size: 1rem !important;
  }

  .home-hero,
  .donation-ui,
  .career-page,
  .csr-page,
  .hb-baaz-page {
    padding-top: 28px !important;
    padding-bottom: 48px !important;
  }

  .home-hero__card,
  .career-hero,
  .csr-hero,
  .career-section-card,
  .csr-panel,
  .donation-card,
  .donation-side-card,
  .hb-baaz-hero,
  .hb-baaz-form,
  .hb-baaz-side,
  .hb-baaz-card,
  .contact-card {
    padding: 20px !important;
    border-radius: 22px !important;
  }

  .career-highlights,
  .career-values__list,
  .career-jobs-grid,
  .csr-principles,
  .csr-grid,
  .hb-baaz-highlights,
  .hb-baaz-criteria,
  .hb-baaz-process,
  .donation-grid,
  .purpose-grid,
  .campaign-foot,
  .benefit-box,
  .donation-amounts,
  .site-footer__panel-grid {
    grid-template-columns: 1fr !important;
  }

  .home-section-head,
  .career-filter__head,
  .csr-projects__header {
    margin-bottom: 22px !important;
    gap: 14px !important;
  }

  .home-btn,
  .career-btn,
  .csr-btn,
  .hb-btn,
  .donation-submit button,
  .sidebar-cta {
    width: 100%;
    min-height: 48px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .home-hero__actions,
  .career-hero__actions,
  .csr-actions,
  .career-job-card__actions,
  .csr-card__actions,
  .site-footer__social-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .home-hero__minimal-media,
  .hb-baaz-hero__image,
  .career-hero__image,
  .csr-hero__media,
  .csr-intro__media,
  .career-intro__media,
  .campaign-panel__cover,
  .event-detail-image,
  .custom-image {
    min-height: 220px !important;
    height: auto !important;
  }

  .site-footer__inner {
    padding: 30px 16px 16px;
  }

  .site-footer__trigger,
  .site-footer__single {
    padding: 16px 0;
  }

  .site-footer__bottom {
    margin-top: 28px;
    padding-top: 18px;
  }

  .modal-dialog {
    max-width: calc(100vw - 1rem);
    margin: 0.5rem auto;
  }

  .modal-content {
    max-height: calc(100vh - 1rem);
    border-radius: 18px !important;
  }

  .recaptcha-block .g-recaptcha {
    transform: scale(0.88);
    transform-origin: center top;
  }

  .floating-donate-btn,
  .back-to-top-btn {
    right: 12px !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 16px !important;
  }

  .floating-donate-btn.is-shifted,
  .show-scroll-buttons .floating-donate-btn {
    --donate-shift: -62px;
  }
}

/* -------- iPhone SE / 320px narrow devices -------- */
@media (max-width: 360px) {
  .container,
  .container-fluid,
  #main-navbar .hb-nav-inner {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  .home-hero__card,
  .career-hero,
  .csr-hero,
  .career-section-card,
  .csr-panel,
  .donation-card,
  .donation-side-card,
  .hb-baaz-hero,
  .hb-baaz-form,
  .hb-baaz-side,
  .hb-baaz-card {
    padding: 18px !important;
  }

  .country-select__toggle,
  .form-control,
  .form-select,
  input,
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* -------- Landscape tablets / 1024px -------- */
@media (min-width: 769px) and (max-width: 1024px) {
  .home-hero__card--luxury,
  .home-hero__card--editorial,
  .career-hero,
  .csr-hero {
    gap: 24px !important;
  }

  .career-jobs-grid,
  .csr-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
