/* GHA responsive inside-page styles, v1.1.0.
   Complements (does not replace) the site's Breakdance header #60 and footer #104.
   All changes are presentation-only; hotel/partner/news content stays in WordPress. */

/* Content should not be wider than the mobile viewport because of embedded media. */
.breakdance .bde-rich-text img,
.breakdance .bde-text img,
.breakdance .bde-image img,
.breakdance .bde-gallery img,
.breakdance .bde-post-loop img,
.breakdance .bde-posts-list img,
.breakdance .bde-woo-product-images img,
.breakdance .woocommerce img,
.breakdance .wp-block-image img,
.breakdance video,
.breakdance picture,
.breakdance svg,
.breakdance figure {
  max-width: 100%;
  height: auto;
}
.breakdance .bde-rich-text iframe,
.breakdance .bde-video iframe,
.breakdance .bde-google-map iframe,
.breakdance .woocommerce iframe,
.breakdance iframe[src*="maps.google"] {
  max-width: 100%;
  border: 0;
}
.breakdance .bde-rich-text,
.breakdance .bde-text,
.breakdance .bde-heading,
.breakdance .bde-post-loop,
.breakdance .bde-posts-list,
.breakdance .woocommerce,
.breakdance .bde-form-builder,
.breakdance .bde-wpforms {
  min-width: 0;
  overflow-wrap: break-word;
}
.breakdance a,
.breakdance p,
.breakdance h1,
.breakdance h2,
.breakdance h3,
.breakdance h4 {
  overflow-wrap: break-word;
}
/* Long partner/hotel URLs wrap instead of producing a horizontal scrollbar. */
.breakdance a[href^="mailto:"],
.breakdance a[href^="https://"],
.breakdance a[href^="http://"] { overflow-wrap: anywhere; }

/* Tables retain their columns while their own container scrolls. */
.breakdance .bde-rich-text table,
.breakdance .bde-text table,
.breakdance .woocommerce table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 1023px) {
  /* Responsive builder containers. Don't force the site's branded header to change. */
  .breakdance .bde-section:not(.bde-section-60-100) > .section-container,
  .breakdance .bde-section:not(.bde-section-60-100) .bde-columns,
  .breakdance .bde-section:not(.bde-section-60-100) .bde-column,
  .breakdance .bde-section:not(.bde-section-60-100) .bde-grid,
  .breakdance .bde-section:not(.bde-section-60-100) .bde-div {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }
  .breakdance .bde-section:not(.bde-section-60-100) > .section-container {
    padding-left: max(18px, env(safe-area-inset-left)) !important;
    padding-right: max(18px, env(safe-area-inset-right)) !important;
  }
  /* Prevent older product and news listing templates from forcing three columns. */
  .breakdance .bde-posts-list,
  .breakdance .bde-post-loop .bde-loop,
  .breakdance .bde-post-loop .bde-posts-list,
  .breakdance .bde-posts-list .ee-posts,
  .breakdance .woocommerce ul.products {
    min-width: 0;
    max-width: 100%;
  }
  .breakdance .bde-advanced-tabs .bde-tabs__tabslist-container,
  .breakdance .bde-isotope-filter-bar .bde-tabs__tabslist-container {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
  }
  .breakdance .bde-button,
  .breakdance .bde-button__button,
  .breakdance .wp-block-button__link {
    max-width: 100%;
  }
  /* Embedded map stays usable rather than becoming a very short iframe. */
  .breakdance .bde-google-map iframe,
  .breakdance iframe[src*="maps.google"] { width: 100%; min-height: 280px; }
}

@media (max-width: 767px) {
  /* Inner pages: About, The Gambia, Partners, Hotel details, News, Contact, Careers. */
  .breakdance .bde-section:not(.bde-section-60-100) > .section-container {
    padding-left: max(16px, env(safe-area-inset-left)) !important;
    padding-right: max(16px, env(safe-area-inset-right)) !important;
  }
  /* Ensure side-by-side editorial sections stack, leaving header template intact. */
  .breakdance .bde-section:not(.bde-section-60-100):not(.bde-section-104-100) .bde-columns {
    flex-direction: column;
    align-items: stretch;
  }
  .breakdance .bde-section:not(.bde-section-60-100):not(.bde-section-104-100) .bde-columns > .bde-column {
    width: 100% !important;
    max-width: 100% !important;
    flex-basis: auto !important;
  }
  /* Breakdance dynamic news/post cards and hotel grids. */
  .breakdance .bde-posts-list,
  .breakdance .bde-post-loop .bde-posts-list,
  .breakdance .bde-post-loop .bde-loop,
  .breakdance .bde-posts-list .ee-posts,
  .breakdance .bde-grid .bde-posts-list,
  .breakdance .woocommerce ul.products {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .breakdance .woocommerce ul.products li.product,
  .breakdance .woocommerce-page ul.products li.product {
    float: none;
    width: 100% !important;
    max-width: 100%;
    margin: 0 0 22px !important;
  }
  /* Individual hotels: gallery, summary, map and contact details. */
  .breakdance .woocommerce div.product div.images,
  .breakdance .woocommerce div.product div.summary,
  .breakdance .woocommerce-page div.product div.images,
  .breakdance .woocommerce-page div.product div.summary {
    float: none;
    width: 100% !important;
    max-width: 100%;
    margin-left: 0;
  }
  .breakdance .woocommerce div.product .woocommerce-product-gallery,
  .breakdance .woocommerce div.product .woocommerce-product-gallery__wrapper,
  .breakdance .bde-woo-product-images,
  .breakdance .bde-product-builder {
    max-width: 100%;
    min-width: 0;
  }
  /* Contact form fields: keep labels, inputs and submit buttons readable. */
  .breakdance .wpforms-container .wpforms-field-row,
  .breakdance .wpforms-container .wpforms-field-row-block,
  .breakdance .wpforms-container .wpforms-one-half,
  .breakdance .wpforms-container .wpforms-one-third,
  .breakdance .wpforms-container .wpforms-two-thirds {
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
  }
  .breakdance .wpforms-container input:not([type="checkbox"]):not([type="radio"]),
  .breakdance .wpforms-container select,
  .breakdance .wpforms-container textarea,
  .breakdance .bde-form-builder input:not([type="checkbox"]):not([type="radio"]),
  .breakdance .bde-form-builder select,
  .breakdance .bde-form-builder textarea,
  .breakdance .woocommerce input.input-text,
  .breakdance .woocommerce select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .breakdance .wpforms-container input:not([type="checkbox"]):not([type="radio"]),
  .breakdance .wpforms-container select,
  .breakdance .bde-form-builder input:not([type="checkbox"]):not([type="radio"]),
  .breakdance .bde-form-builder select { min-height: 44px; }
  .breakdance .wpforms-container button[type="submit"],
  .breakdance .wpforms-container input[type="submit"] {
    min-height: 44px;
    max-width: 100%;
  }
  /* Career listings: filters and buttons shouldn't extend beyond the screen. */
  .job-postings,
  .job-postings .job-postings-filter,
  .job-postings .job-postings-post,
  .job-postings .job-postings-list,
  .job-postings .job-postings-filters,
  .job-postings .job-postings-search,
  .breakdance .job-postings input {
    max-width: 100%;
    box-sizing: border-box;
  }
  .job-postings input[type="search"],
  .job-postings input[type="text"] { width: 100%; }
  /* Page headings and long article titles fit without overflow. */
  .breakdance .bde-section:not(.bde-section-60-100) h1,
  .breakdance .bde-section:not(.bde-section-60-100) .bde-heading h1 {
    max-width: 100%;
    font-size: clamp(32px, 9vw, 56px);
    line-height: 1.15;
  }
  .breakdance .bde-section:not(.bde-section-60-100) h2 {
    max-width: 100%;
    font-size: clamp(26px, 7vw, 44px);
  }
  /* Preserve old footer design, but allow its content to stack. */
  .breakdance .bde-section-104-100 .section-container {
    flex-wrap: wrap;
  }
  .breakdance .bde-section-104-100 .bde-div,
  .breakdance .bde-section-104-100 .bde-columns {
    max-width: 100%;
    min-width: 0;
  }
}

@media (max-width: 359px) {
  .breakdance .bde-section:not(.bde-section-60-100) > .section-container {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .breakdance .bde-section:not(.bde-section-60-100) .bde-button__button,
  .breakdance .bde-section:not(.bde-section-60-100) .button-atom {
    white-space: normal !important;
    overflow-wrap: anywhere;
    text-align: center;
  }
  .breakdance .bde-section:not(.bde-section-60-100) h1 {
    font-size: 30px;
  }
  .breakdance .bde-section:not(.bde-section-60-100) h2 {
    font-size: 26px;
  }
}

/* Keep multi-image galleries and their controls usable on phones, including
   the hotel detail swiper and the About The Gambia image slideshow. */
.breakdance .bde-gallery,
.breakdance .swiper,
.breakdance .swiper-container,
.breakdance .bde-gallery .swiper-slide,
.breakdance .bde-image-gallery {
  max-width: 100%;
  min-width: 0;
}
@media (max-width: 767px) {
  .breakdance .bde-gallery .swiper-button-prev,
  .breakdance .bde-gallery .swiper-button-next,
  .breakdance .bde-image-gallery .swiper-button-prev,
  .breakdance .bde-image-gallery .swiper-button-next {
    width: 40px;
    height: 40px;
    max-width: 13vw;
    max-height: 13vw;
    box-sizing: border-box;
  }
  .breakdance .bde-gallery .swiper-button-prev,
  .breakdance .bde-image-gallery .swiper-button-prev { left: 6px; }
  .breakdance .bde-gallery .swiper-button-next,
  .breakdance .bde-image-gallery .swiper-button-next { right: 6px; }
  .breakdance .swiper-pagination { max-width: 100%; }
}
