/* ==========================================================================
       HOMEPAGE: TOP EDITORIAL TEXT + BOTTOM HORIZONTAL CAROUSEL (BOXED DERMATO)
       ========================================================================== */
    :root {
      --b-card-width: 420px;
      --b-card-height: clamp(358px, 45.8vh, 495px);
      --b-card-gap: 1.75rem;
      --b-card-radius: 30px 30px 0 0;
      --b-marquee-duration: 115s;
      --b-edge-fade: 150px;
    }

    @media (max-width: 1200px) {
      :root {
        --b-card-width: 370px;
        --b-card-height: clamp(332px, 43.8vh, 436px);
        --b-card-gap: 1.35rem;
        --b-card-radius: 26px 26px 0 0;
        /* Duration scaled to keep px/sec speed consistent with desktop's pace
           (card+gap shrinks at smaller breakpoints, so duration must grow,
           not just carry over the same seconds — otherwise the marquee
           visibly speeds up on smaller screens). */
        --b-marquee-duration: 140s;
        --b-edge-fade: 125px;
      }
    }

    @media (max-width: 1024px) {
      :root {
        --b-card-width: 330px;
        --b-card-height: clamp(322px, 41.8vh, 396px);
        --b-card-gap: 1.25rem;
        --b-card-radius: 26px 26px 0 0;
        --b-marquee-duration: 125s;
        --b-edge-fade: 96px;
      }
    }

    @media (max-width: 768px) {
      :root {
        --b-card-width: clamp(280px, 68vw, 350px);
        --b-card-height: 100%;
        --b-card-gap: 1.15rem;
        --b-card-radius: 26px 26px 0 0;
        --b-marquee-duration: 130s;
        --b-edge-fade: 50px;
      }
    }

    @media (max-width: 480px) {
      :root {
        --b-card-width: clamp(260px, 72vw, 320px);
        --b-card-height: 100%;
        --b-card-gap: 1rem;
        --b-card-radius: 24px 24px 0 0;
        --b-marquee-duration: 120s;
        --b-edge-fade: 40px;
      }
    }

    html,
    body {
      height: 100%;
      margin: 0;
      padding: 0;
    }

    body {
      overflow-x: hidden;
    }

    .viewport-hero-wrap {
      min-height: 100vh;
      min-height: 100dvh;
      display: flex;
      flex-direction: column;
    }

    .hero-version-b {
      flex: 1 1 auto;
      padding: clamp(2rem, 5vh, 4.5rem) 0 0;
      background: transparent;
      overflow: hidden;
      display: flex;
      flex-direction: column;
      justify-content: flex-end;
      gap: clamp(0.78rem, 1.95vh, 1.35rem);
      position: relative;
      z-index: 1;
      margin: 0;
    }

    .hero-b-container {
      width: 100%;
      max-width: 1380px;
      margin: auto auto 0;
      padding: 0 2rem;
      display: flex;
      flex-direction: column;
      justify-content: flex-start;
      flex: 0 0 auto;
    }

    /* Top Editorial Info (Positioned closer to the carousel) */
    .hero-b-header {
      max-width: 1200px;
      margin-bottom: 0;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
      margin-top: clamp(0.75rem, 1.8vh, 1.2rem);
    }

    .hero-b-title {
      font-family: var(--font-heading);
      font-weight: 400;
      font-size: clamp(2.35rem, 3.6vw, 4.1rem);
      line-height: 1.08;
      letter-spacing: -0.025em;
      color: var(--color-primary-navy);
      text-transform: none;
    }

    .hero-b-line-1 {
      display: block;
    }

    .hero-b-line-2,
    .hero-b-line-3 {
      display: inline;
    }

    .hero-b-desc {
      font-family: var(--font-body);
      font-size: 1.1rem;
      line-height: 1.55;
      color: var(--color-text-body);
      max-width: 720px;
      letter-spacing: -0.01em;
    }

    /* Boxed Bottom Horizontal Photo Carousel (Touching the exact bottom of the section) */
    .hero-b-gallery-wrap {
      width: 100%;
      max-width: 1380px;
      margin: 0 auto;
      padding: 0 2rem;
      box-sizing: border-box;
      position: relative;
      overflow: hidden;
      contain: layout paint style;
      line-height: 0;
      cursor: grab;
      user-select: none;
      -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 1) var(--b-edge-fade), rgba(0, 0, 0, 1) calc(100% - var(--b-edge-fade)), transparent 100%);
      mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 1) var(--b-edge-fade), rgba(0, 0, 0, 1) calc(100% - var(--b-edge-fade)), transparent 100%);
    }

    @media (min-width: 1025px) {
      :root {
        --b-card-height: clamp(388px, 48.4vh, 532px);
      }

      .hero-b-container,
      .hero-b-gallery-wrap {
        max-width: 1520px;
        padding-left: 1.25rem;
        padding-right: 1.25rem;
      }

      .hero-b-header {
        max-width: 1320px;
      }
    }

    @media (min-width: 1025px) and (max-width: 1440px) and (max-height: 760px) {
      :root {
        --b-card-height: clamp(320px, 48.4vh, 388px);
      }
    }

    .hero-b-gallery-wrap:active {
      cursor: grabbing;
    }

    .hero-b-track {
      display: flex;
      align-items: flex-end;
      gap: var(--b-card-gap);
      width: max-content;
      user-select: none;
      transform: translate3d(0, 0, 0);
      animation: seamlessInfiniteMarquee var(--b-marquee-duration) linear infinite;
      margin: 0;
      padding: 0;
      line-height: 0;
    }

    @media (min-width: 1025px) {
      .hero-b-track {
        animation-duration: 150s;
      }
    }

    .hero-b-gallery-wrap:hover .hero-b-track {
      animation-play-state: paused;
    }

    @keyframes seamlessInfiniteMarquee {
      0% {
        transform: translate3d(0, 0, 0);
      }
      100% {
        transform: translate3d(calc(-9 * (var(--b-card-width) + var(--b-card-gap))), 0, 0);
      }
    }

    /* Dermato photo cards: flush with bottom edge */
    .hero-b-photo-card {
      flex: 0 0 var(--b-card-width);
      width: var(--b-card-width);
      height: var(--b-card-height);
      border-radius: var(--b-card-radius);
      overflow: hidden;
      contain: paint;
      background: transparent;
      box-shadow: none;
      transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
      margin: 0;
      padding: 0;
      display: block;
    }

    .hero-b-photo-card:hover {
      transform: translateY(-8px);
    }

    .hero-b-photo-img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      object-position: center center;
      transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
      display: block;
    }

    .hero-b-photo-card:hover .hero-b-photo-img {
      transform: scale(1.05);
    }

    .trust-section-b {
      width: 100%;
      padding: clamp(3.5rem, 8vh, 5.5rem) 0 clamp(2.75rem, 5.5vh, 4.5rem);
      background: transparent;
      position: relative;
      z-index: 2;
    }

    .trust-section-b-container {
      width: 100%;
      max-width: 900px;
      margin: 0 auto;
      padding: 0 1.25rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      text-align: center;
      gap: 1.1rem;
    }

    .trust-section-b-badge-row {
      display: flex;
      align-items: center;
      gap: 0.9rem;
    }

    .trust-section-b-logo {
      height: 26px;
      width: auto;
      display: block;
      object-fit: contain;
    }

    .trust-section-b-stars {
      display: block;
      flex: none;
      width: 109.2px;
      height: 18px;
      color: #C28A2D;
      background-color: currentColor;
      -webkit-mask: url('/Assets/rating-stars-soft.svg') center / 100% 100% no-repeat;
      mask: url('/Assets/rating-stars-soft.svg') center / 100% 100% no-repeat;
    }

    .trust-section-b-title {
      margin: 0;
      font-family: var(--font-heading);
      font-size: clamp(1.5rem, 2.4vw, 2.05rem);
      line-height: 1.28;
      font-weight: 400;
      letter-spacing: -0.015em;
      color: var(--color-primary-navy);
      max-width: 760px;
    }

    .trust-section-b-link {
      display: inline-flex;
      align-items: center;
      gap: 0.45rem;
      font-family: var(--font-body);
      font-size: 0.98rem;
      font-weight: 600;
      color: var(--color-terracotta, #8C532B);
      text-decoration: none;
      margin-top: 0.2rem;
      transition: color 0.25s ease, transform 0.25s ease;
      cursor: pointer;
    }

    .trust-section-b-link svg {
      transition: transform 0.25s ease;
    }

    .trust-section-b-link:hover {
      color: var(--color-primary-navy);
    }

    .trust-section-b-link:hover svg {
      transform: translateX(4px);
    }

    @media (max-width: 768px) {
      html,
      body {
        height: auto;
        min-height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
      }

      .viewport-hero-wrap {
        height: 100svh;
        height: 100dvh;
        min-height: 100svh;
        min-height: 100dvh;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        overflow: hidden;
        position: relative;
      }

      .hero-version-b {
        flex: 1 1 0;
        height: 100%;
        min-height: 0;
        padding: 5.6rem 0 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 0.65rem;
        overflow: hidden;
      }

      .hero-b-container {
        padding: 0 1.25rem;
        max-width: 100%;
        margin: 0;
        flex: 0 0 auto;
        box-sizing: border-box;
      }

      .hero-b-header {
        margin-bottom: 0;
        gap: 0.55rem;
      }

      .hero-b-header .pre-top-badge {
        padding: 0.28rem 0.8rem;
        border-radius: 100px;
        background: rgba(239, 232, 223, 0.85);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border: 1px solid rgba(255, 255, 255, 0.85);
        max-width: 100%;
        display: inline-flex;
        align-self: flex-start;
        margin-bottom: 0.1rem;
      }

      .pre-badge-text {
        font-size: 0.65rem;
        font-weight: 700;
        letter-spacing: 0.08em;
        text-transform: uppercase;
        color: #5C4333;
      }

      .hero-b-title {
        font-family: var(--font-heading);
        font-size: clamp(2.15rem, 8.5vw, 2.85rem);
        font-weight: 400;
        line-height: 1.08;
        letter-spacing: -0.025em;
        color: var(--color-primary-navy);
        margin: 0;
      }

      .hero-b-line-1 {
        display: block;
      }

      .hero-b-line-2 {
        display: block;
      }

      .hero-b-line-3 {
        display: block;
      }

      .hero-b-desc {
        font-size: 0.92rem;
        line-height: 1.46;
        color: #475569;
        margin: 0;
      }

      .hero-b-gallery-wrap {
        flex: 1 1 0;
        min-height: 280px;
        margin-top: 0.65rem;
        margin-bottom: 0;
        padding: 0;
        max-width: 100%;
        line-height: 0;
        display: flex;
        align-items: flex-end;
        -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 1) var(--b-edge-fade), rgba(0, 0, 0, 1) calc(100% - var(--b-edge-fade)), transparent 100%);
        mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 1) var(--b-edge-fade), rgba(0, 0, 0, 1) calc(100% - var(--b-edge-fade)), transparent 100%);
      }

      .hero-b-track {
        height: 100%;
        animation-duration: 130s;
        align-items: flex-end;
        display: flex;
      }

      .hero-b-photo-card {
        height: 100%;
        max-height: 100%;
      }

      .hero-b-photo-img {
        height: 100%;
        width: 100%;
        object-fit: cover;
      }

      .hero-b-photo-img-5 {
        object-position: 38% 42%;
        transform: none;
      }

      .trust-section-b {
        padding: 2.75rem 0 2.4rem;
      }

      .trust-section-b-container {
        padding: 0 1.25rem;
        gap: 0.9rem;
      }

      .trust-section-b-logo {
        height: 21px;
      }

      .trust-section-b-stars {
        width: 94.2px;
        height: 15px;
      }

      .trust-section-b-title {
        font-size: 1.28rem;
        line-height: 1.32;
      }

    }

    @media (max-width: 480px) {
      .hero-version-b {
        padding: 5.75rem 0 0;
        gap: 0.65rem;
      }

      .hero-b-container {
        padding: 0 1rem;
        margin: 0;
      }

      .pre-badge-text {
        font-size: 0.62rem;
        letter-spacing: 0.07em;
      }

      .hero-b-title {
        font-size: clamp(2.1rem, 9.2vw, 2.75rem);
        line-height: 1.08;
      }

      .hero-b-desc {
        font-size: 0.88rem;
        line-height: 1.44;
      }

      .hero-b-photo-img-5 {
        object-position: 38% 42%;
        transform: none;
      }
    }

    @media (max-width: 360px) {
      .hero-b-header .pre-top-badge {
        gap: 0.4rem;
        padding: 0.26rem 0.65rem;
      }

      .pre-badge-text {
        font-size: 0.56rem;
        letter-spacing: 0.055em;
        white-space: nowrap;
      }
    }

    @media (prefers-reduced-motion: reduce) {
      .glass-orb {
        animation: none !important;
      }

      .hero-b-track {
        animation: none !important;
      }

      .hero-b-photo-card:hover,
      .hero-b-photo-card:hover .hero-b-photo-img {
        transform: none !important;
      }
    }

.homepage-page .doctor-profile-container {
  align-items: start;
}

.homepage-page .doc-profile-info {
  gap: 0.95rem;
}

.homepage-page .doc-name {
  font-size: clamp(2.1rem, 3.3vw, 3rem);
}

@media (max-width: 600px) {
  .homepage-page .doctor-profile-section {
    padding: 2.25rem 0 2.75rem;
  }

  .homepage-page .doctor-profile-container {
    padding: 0 1rem;
    gap: 1.4rem;
  }

  .homepage-page .doc-photo-wrapper {
    max-width: none;
    aspect-ratio: 1 / 1.15;
    border-radius: 20px;
    box-shadow: 0 16px 34px -14px rgba(60, 40, 25, 0.2);
  }

  .homepage-page .doc-photo-img {
    object-position: center 15%;
  }

  .homepage-page .doc-photo-badge {
    bottom: 0.65rem;
    left: 0.65rem;
    right: 0.65rem;
    padding: 0.65rem 0.8rem;
    border-radius: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .homepage-page .doc-badge-title {
    font-size: 0.84rem;
  }

  .homepage-page .doc-badge-icon {
    width: 19px;
    height: 19px;
  }

  .homepage-page .doc-profile-info {
    gap: 0.8rem;
  }

  .homepage-page .doc-name {
    font-size: clamp(1.8rem, 8vw, 2.12rem);
    line-height: 1.05;
  }

  .homepage-page .doc-specialty {
    margin: -0.25rem 0 0;
    font-size: 0.94rem;
    line-height: 1.35;
  }

  .homepage-page .doc-bio-paragraphs {
    gap: 0.65rem;
  }

  .homepage-page .doc-bio-text {
    font-size: 0.93rem;
    line-height: 1.5;
  }

  .homepage-page .doc-highlights-list {
    gap: 0.6rem;
    margin-top: 0.35rem;
  }

  .homepage-page .doc-highlight-item {
    align-items: flex-start;
    gap: 0.7rem;
    padding: 0.72rem 0.75rem;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(140, 83, 43, 0.13);
    border-radius: 14px;
  }

  .homepage-page .doc-highlight-icon-wrap {
    width: 34px;
    height: 34px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .homepage-page .doc-highlight-icon-wrap svg {
    width: 16px;
    height: 16px;
  }

  .homepage-page .doc-highlight-text {
    gap: 0.1rem;
  }

  .homepage-page .doc-highlight-title {
    font-size: 0.88rem;
    line-height: 1.3;
  }

  .homepage-page .doc-highlight-sub {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .homepage-page .doc-credentials-footer {
    margin-top: 0.2rem;
    font-size: 0.72rem;
    line-height: 1.45;
    letter-spacing: 0;
    text-transform: none;
  }

  .homepage-page .doc-profile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 0.65rem;
  }

  .homepage-page .doc-profile-action {
    min-height: 44px;
    padding: 0.65rem 0.55rem;
    font-size: 0.86rem;
  }
}

@media (max-width: 350px) {
  .homepage-page .doc-profile-actions {
    grid-template-columns: 1fr;
  }
}
