/* Loaded last on purpose: definitive mobile layout overrides. */
@media (max-width: 767px) {
  html,
  body,
  #wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden !important;
  }

  /* Header menu: draw three bars without depending on the icon font colour. */
  #header-main .mobile-button {
    position: relative;
    display: inline-flex !important;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: #fff !important;
    opacity: 1 !important;
  }

  #header-main .mobile-button .icon-menu {
    display: block;
    width: 25px;
    height: 18px;
    border-top: 3px solid #fff;
    border-bottom: 3px solid #fff;
  }

  #header-main .mobile-button .icon-menu::before {
    display: block;
    width: 25px;
    height: 3px;
    margin-top: 5px;
    background: #fff;
    color: transparent !important;
    content: "" !important;
  }

  /* Breadcrumb: remove desktop's large bottom gap and keep one scrollable row. */
  .flat-title {
    margin: 0 0 24px !important;
    padding: 0 !important;
  }

  .flat-title .title-inner,
  .flat-title.style-2 .title-inner {
    min-height: 0 !important;
    margin: 0 !important;
    padding: 12px 14px !important;
  }

  .flat-title .breadcrumb,
  .flat-title .breadcrumbs {
    display: flex !important;
    flex-wrap: nowrap !important;
    min-height: 24px;
    margin: 0 !important;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .flat-title .breadcrumb::-webkit-scrollbar,
  .flat-title .breadcrumbs::-webkit-scrollbar {
    display: none;
  }

  /* Service carousel: natural height and a complete single card on phones. */
  .section-categories.hemorrhoid-service-section {
    position: relative;
    z-index: 1;
    clear: both;
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 44px !important;
    overflow: hidden !important;
  }

  .hemorrhoid-service-section .tf-container,
  .hemorrhoid-service-section .wrap-categories-sw,
  .hemorrhoid-service-section .tf-sw-categories {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
  }

  .hemorrhoid-service-section .tf-sw-categories {
    box-sizing: border-box;
    padding: 8px 0 38px !important;
    margin: -8px 0 0 !important;
  }

  .hemorrhoid-service-section .swiper-wrapper {
    align-items: stretch !important;
    height: auto !important;
  }

  .hemorrhoid-service-section .swiper-slide {
    display: flex !important;
    box-sizing: border-box;
    height: auto !important;
    min-height: 220px;
  }

  .hemorrhoid-service-section .categories-item,
  .hemorrhoid-service-section .hemorrhoid-service-card {
    box-sizing: border-box;
    width: 100%;
    height: 100% !important;
    min-height: 220px;
    margin: 0 !important;
    padding: 22px 16px 20px !important;
    overflow: hidden;
  }

  .hemorrhoid-service-section .sw-pagination-category {
    position: absolute;
    right: 0;
    bottom: 4px;
    left: 0;
    margin: 0 !important;
  }

  .section-categories.hemorrhoid-service-section + .section-box-team {
    position: relative;
    z-index: 0;
    clear: both;
    margin-top: 0 !important;
  }

  /* Every listing thumbnail uses the same ratio as its server-generated file. */
  .section-blog-grid .image-wrap,
  .section-blog-grid .image-wrap-last-blog,
  .section-property-layout .box-house .image-wrap,
  .section-property-layout .box-house .image-wrap-last-blog,
  .section-medicines .image-wrap {
    aspect-ratio: 640 / 420 !important;
    height: auto !important;
    overflow: hidden !important;
  }

  .section-blog-grid .image-wrap img,
  .section-blog-grid .image-wrap-last-blog img,
  .section-property-layout .box-house .image-wrap img,
  .section-property-layout .box-house .image-wrap-last-blog img,
  .section-medicines .image-wrap img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
  }
}

@media (max-width: 574px) {
  .hemorrhoid-service-section .swiper-slide {
    width: 100% !important;
  }
}

/* Article typography: CKEditor content must not inherit hero heading sizes. */
.section-blog-details .heading .title-heading {
  margin: 0 0 18px !important;
  font-size: clamp(34px, 4vw, 48px) !important;
  line-height: 1.18 !important;
  letter-spacing: -0.025em;
  overflow-wrap: break-word;
}

.section-blog-details .wrap-content {
  color: #40506a;
  font-size: 17px;
  line-height: 1.75;
}

.section-blog-details .wrap-content h1,
.section-blog-details .wrap-content h2,
.section-blog-details .wrap-content h3,
.section-blog-details .wrap-content h4,
.section-blog-details .wrap-content h5,
.section-blog-details .wrap-content h6 {
  margin: 30px 0 14px !important;
  color: #082754 !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.015em;
}

.section-blog-details .wrap-content h1 {
  font-size: 34px !important;
}

.section-blog-details .wrap-content h2 {
  font-size: 30px !important;
}

.section-blog-details .wrap-content h3 {
  font-size: 24px !important;
}

.section-blog-details .wrap-content h4,
.section-blog-details .wrap-content h5,
.section-blog-details .wrap-content h6 {
  font-size: 20px !important;
}

.section-blog-details .wrap-content p {
  margin: 0 0 16px !important;
  font-size: inherit !important;
  line-height: inherit !important;
}

.section-blog-details .wrap-content ul,
.section-blog-details .wrap-content ol {
  display: block !important;
  margin: 0 0 20px !important;
  padding-left: 28px !important;
}

.section-blog-details .wrap-content ul {
  list-style: disc outside !important;
}

.section-blog-details .wrap-content ol {
  list-style: decimal outside !important;
}

.section-blog-details .wrap-content li {
  display: list-item !important;
  margin-bottom: 8px;
  padding-left: 4px;
  line-height: 1.65;
}

.section-blog-details .wrap-content blockquote {
  margin: 24px 0;
  padding: 18px 20px;
  border-left: 4px solid #0894e6;
  border-radius: 0 14px 14px 0;
  background: #f1f9ff;
}

.section-blog-details > .tf-container > .row > .col-lg-8 > .image-wrap {
  width: 100%;
  aspect-ratio: 640 / 420;
  overflow: hidden;
  border-radius: 20px;
}

.section-blog-details > .tf-container > .row > .col-lg-8 > .image-wrap img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767px) {
  .section-blog-details .heading .title-heading {
    font-size: clamp(30px, 8.5vw, 36px) !important;
    line-height: 1.2 !important;
  }

  .section-blog-details .wrap-content {
    font-size: 16px;
    line-height: 1.7;
  }

  .section-blog-details .wrap-content h1,
  .section-blog-details .wrap-content h2 {
    font-size: 26px !important;
  }

  .section-blog-details .wrap-content h3 {
    font-size: 22px !important;
  }
}
