/* ============================================================
   Banner Carousel — Slide (Individual slide structure)
   Full-bleed: no border-radius, no shadow, no max-width
   Background: vivid cyan-to-green gradient
   ============================================================ */
.c-banner-carousel-slide {
  width: 100%;
  box-sizing: border-box;
  background: linear-gradient(90deg, #009de0 0%, #00ac41 100%);
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  margin: 0;
  aspect-ratio: 147 / 37;
  height: 350px;
}

/* Inner layout wrapper — constrained to header width and centered */
.c-banner-carousel-slide__inner {
  display: flex;

  /* Image on LEFT, text on RIGHT (row-reverse so image comes first in DOM) */
  flex-direction: row-reverse;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: 1110px;
  margin: 0 auto;
  gap: 3rem;
}

/* Text content column (right side on desktop) */
.c-banner-carousel-slide__content {
  flex: 1;
  max-width: 55%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
}

.c-banner-carousel-slide__content .a-eyebrow {
  color: #fff;
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
  font-family: var(--font-family);
}

/* Title override — already white from title.css, reinforce */
.c-banner-carousel-slide__content .a-title {
  color: #fff;
  font-family: var(--font-family-mmc-bold);
  font-size: 28px;
  line-height: 36px;
  margin: 0;
}

/* Per-heading-tag font sizes inside the banner slide */
.c-banner-carousel-slide__content h1.a-title {
  font-size: 38px;
  line-height: 46px;
}

.c-banner-carousel-slide__content h2.a-title {
  font-size: 28px;
  line-height: 36px;
}

.c-banner-carousel-slide__content h3.a-title {
  font-size: 22px;
  line-height: 30px;
}

.c-banner-carousel-slide__content h4.a-title {
  font-size: 18px;
  line-height: 26px;
}

.c-banner-carousel-slide__content h5.a-title {
  font-size: 16px;
  line-height: 24px;
}

.c-banner-carousel-slide__content h6.a-title {
  font-size: 14px;
  line-height: 22px;
}

/* ============================================================
   READ MORE pill button
   ============================================================ */
.a-button-read-more {
  cursor: pointer;
  letter-spacing: 0.1em;
  position: relative;
  display: inline-block;
  background-color: #fff;
  border-radius: 50px;
  font-size: 14px;
  line-height: 20px;
  padding: 10px 45px 10px 15px;
  font-family: var(--font-family);
  text-transform: uppercase;
  color: #00ac41;
  text-decoration: none;
  outline: 0;
  width: fit-content;
  transition: all 0.3s ease;
}

.a-button-read-more--primary {
  background-color: #fff;
  color: #00ac41;
}

.a-button-read-more::after {
  transition: all 0.3s;
  background-repeat: no-repeat;
  content: "";
  position: absolute;
  right: 20px;
  background-image: url("/themes/custom/mercer_blog/assets/images/icons/arrow-right-green.svg");
  height: 16px;
  width: 18px;
  background-size: 18px 16px;
  top: 0;
  bottom: 0;
  margin: auto;
}

.a-button-read-more:hover::after {
  right: 15px;
}

/* ============================================================
   Image column (left side on desktop)
   ============================================================ */
.c-banner-carousel-slide__image-wrapper {
  flex: 0 0 40%;
  max-width: 40%;
  align-self: stretch;
  overflow: hidden;
  position: relative;

  /* containing block for .a-image */
}

/* .a-image is our own div — make it fill the wrapper absolutely
   so its height is definite (350px) regardless of intermediate Drupal divs. */
.c-banner-carousel-slide__image-wrapper .a-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* The outer anonymous field <div> (direct child of .a-image) must fill it. */
.c-banner-carousel-slide__image-wrapper .a-image > div {
  width: 100%;
  height: 100%;
}

/* Drupal's contextual module wraps each media entity in .contextual-region and
   sets position:relative on it — this becomes the img's containing block.
   Give it full dimensions so the absolutely-positioned img fills it correctly. */
.c-banner-carousel-slide__image-wrapper .contextual-region {
  width: 100%;
  height: 100%;
}

/* img anchors to .contextual-region (nearest position:relative ancestor).
   When contextual module is inactive (anonymous users) it anchors to .a-image.
   Either way the containing block is 350px × 40%-column-width. */
.c-banner-carousel-slide__image-wrapper img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  border-radius: 0;
  box-shadow: none;
}

/* ============================================================
   Carousel Wrapper Structure (injected by JS when > 1 slide)
   Full-bleed: no border-radius, no max-width constraint
   ============================================================ */
.c-banner-carousel {
  position: relative;
  width: 100%;
  max-width: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  aspect-ratio: 147 / 37;
  height: 350px;
}

/* Slide overrides when inside JS carousel wrapper */
.c-banner-carousel .c-banner-carousel-slide {
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  flex-shrink: 0;
  width: 100%;
}

.c-banner-carousel__track-wrapper {
  overflow: hidden;
  width: 100%;
}

.c-banner-carousel__track {
  display: flex;
  width: 100%;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

/* ============================================================
   Arrow Navigation — hidden per design spec
   ============================================================ */
.c-banner-carousel__arrow {
  display: none !important;
}

/* ============================================================
   Dot Pagination — rendered BELOW the carousel in normal flow
   White background, hollow outline dots, filled active dot
   ============================================================ */
.c-banner-carousel__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px 0 0;
  background-color: #fff;
  z-index: 10;
}

.c-banner-carousel__dot {
  height: 12px;
  width: 12px;
  background-color: #cfcfcf;
  border-radius: 50%;
  padding: 3px;
  border: 3px solid #cfcfcf;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.c-banner-carousel__dot:hover {
  border-color: #008793;
}

.c-banner-carousel__dot--active {
  height: 12px;
  width: 12px;
  border-radius: 50%;
  border: 3px solid #008793;
  background-color: #fff;
  padding: 4px;
}

/* ============================================================
   Responsive — Tablet (992px)
   ============================================================ */
@media (width <= 992px) {
  .c-banner-carousel-slide,
  .c-banner-carousel {
    height: 300px;
 
}

  .c-banner-carousel-slide__inner {
    padding: 2rem 1.5rem;
    gap: 1.5rem;
 
}

  .c-banner-carousel-slide__content .a-title {
    font-size: 1.5rem;
    line-height: 2rem;
 
}

  .c-banner-carousel-slide__content h1.a-title {
  font-size: 1.75rem;
  line-height: 2.25rem;
 
}

  .c-banner-carousel-slide__content h2.a-title {
  font-size: 1.5rem;
   line-height: 2rem;
 
}

  .c-banner-carousel-slide__image-wrapper {
    flex: 0 0 35%;
    max-width: 35%;
    align-self: stretch;
 
}
}

/* ============================================================
   Responsive — Mobile (768px)
   Text only, left-aligned — image hidden on mobile
   ============================================================ */
@media (width <= 768px) {
  .c-banner-carousel-slide,
  .c-banner-carousel {
    height: auto;
    min-height: 260px;
 
}

  .c-banner-carousel-slide__inner {
    flex-direction: row;
    padding: 2.5rem 1.5rem;
    gap: 0;
    text-align: left;
    align-items: center;
 
}

  .c-banner-carousel-slide__content {
    max-width: 100%;
    align-items: flex-start;
    gap: 16px;
 
}

  .c-banner-carousel-slide__content .a-title {
    font-size: 1.75rem;
    line-height: 2.25rem;
 
}

  .c-banner-carousel-slide__image-wrapper {
    display: none;
 
}

  .a-button-read-more {
    align-self: auto;
 
}
}

/* ============================================================
   Image-Card Variant
   ─────────────────────────────────────────────────────────────
   DOM structure after JS runs:
     .c-banner-carousel-wrapper[data-carousel-variant="image_card"]  ← Twig wrapper
       .c-banner-carousel.c-banner-carousel--image-card              ← JS carousel
         .c-banner-carousel__track-wrapper > __track > slides
         .c-banner-carousel__arrow (×2, inside carousel)
       .c-banner-carousel__dots                                       ← JS sibling

   Strategy:
   • Wrapper carries the gradient + bottom padding for the nav row.
   • Dots sit in that padded area naturally (normal flow, transparent bg).
   • Arrows stay inside the carousel, positioned at bottom-right within it.
   • Adjacent sibling selector (+) targets dots regardless of JS placement.
   • Image wrapper keeps align-self:stretch so height:100% resolves correctly;
     padding-top + padding-left create the "floating card" breathing room.
   ============================================================ */

/* ── Wrapper: gradient background + positioning context for arrows ── */
[data-carousel-variant="image_card"] {
  position: relative;
  background: linear-gradient(90deg, #009de0 0%, #00ac41 100%);
}

/* ── JS carousel height (no overflow change needed) ── */
.c-banner-carousel--image-card {
  height: 400px;
}

.c-banner-carousel--image-card .c-banner-carousel-slide {
  height: 400px;
}

/* ── Image wrapper: contains the inset floating image ── */
.c-banner-carousel--image-card .c-banner-carousel-slide__image-wrapper {
  box-sizing: border-box;
  align-self: stretch;
  overflow: visible;

  /* allow shadow to bleed outside */
}

/* Override base inset — fixed 30px top/bottom breathing room.
   height: calc(100% - 60px) keeps the 30px constant as slide height changes. */
.c-banner-carousel--image-card .c-banner-carousel-slide__image-wrapper .a-image {
  inset: 48px 0 auto 24px;
  width: auto;
  height: calc(100% - 96px);

  /* 48px top + 48px bottom */
  transform: none;
}

.c-banner-carousel--image-card .c-banner-carousel-slide__image-wrapper .a-image img {
  border-radius: 14px;
  object-fit: cover;
  object-position: center top;
  box-shadow: 0 4px 24px rgb(0 0 0 / 22%);
}

/* ── Dots: JS always places as next sibling;
  wrapper gradient shows through ── */
.c-banner-carousel--image-card + .c-banner-carousel__dots {
  background: transparent;
  padding: 10px 0 0;
  justify-content: center;
  gap: 8px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 33px;
}

.c-banner-carousel--image-card + .c-banner-carousel__dots .c-banner-carousel__dot {
  background-color: transparent;
  border: 1px solid rgb(255 255 255 / 85%);
}

.c-banner-carousel--image-card + .c-banner-carousel__dots .c-banner-carousel__dot:hover {
  border: 1px solid #fff;
  background-color: rgb(255 255 255 / 25%);
}

.c-banner-carousel--image-card + .c-banner-carousel__dots .c-banner-carousel__dot--active {
  background-color: #fff;
  border: 1px solid #fff;
}

/* ── Arrows: direct children of wrapper, positioned in the gradient padding row ── */
[data-carousel-variant="image_card"] > .c-banner-carousel__arrow {
  display: flex !important;
  position: absolute;
  bottom: 26px;

  /* inside the 52px padding-bottom gradient area */
  transform: none;
  width: 36px;
  height: 36px;
  background: rgb(255 255 255 / 15%);
  border: 2px solid rgb(255 255 255 / 85%);
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  z-index: 20;
}

/* Align with the right edge of the 1110px content container */
[data-carousel-variant="image_card"] > .c-banner-carousel__arrow--next {
  right: max(12px, calc(50% - 543px));
}

[data-carousel-variant="image_card"] > .c-banner-carousel__arrow--prev {
  right: max(58px, calc(50% - 497px));
}

[data-carousel-variant="image_card"] > .c-banner-carousel__arrow svg {
  stroke: #fff;
  fill: none;
  width: 16px;
  height: 16px;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[data-carousel-variant="image_card"] > .c-banner-carousel__arrow:hover {
  background: rgb(255 255 255 / 35%);
  border-color: #fff;
}

/* ── Secondary button: arrow stays green on hover ── */
.c-banner-carousel--image-card .a-button-read-more--secondary::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300ac41' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'/%3E%3C/svg%3E");
  filter: none;
}

.c-banner-carousel--image-card .a-button-read-more--secondary:hover {
  background-color: #fff;
  color: #00ac41;
}

.c-banner-carousel--image-card .a-button-read-more--secondary:hover::after {
  filter: none;
}

/* ── Responsive: tablet ── */
@media (width <= 992px) {
  .c-banner-carousel--image-card,
  .c-banner-carousel--image-card .c-banner-carousel-slide {
    height: 320px;
 
}
}

/* ── Responsive: mobile ── */
@media (width <= 768px) {
  .c-banner-carousel--image-card,
  .c-banner-carousel--image-card .c-banner-carousel-slide {
    height: auto;
    min-height: 260px;
 
}
}

/* ============================================================
   Flat Variant (.c-banner-carousel--flat)
   Solid per-slide background color (set inline via field_bg_color).
   Image: full-height, no rounded corners (same as default layout).
   Button: transparent outline with green text.
   ============================================================ */

[data-carousel-variant="flat"] .c-banner-carousel-slide {
  /* Gradient is overridden by inline style="background-color: #hex;"
     Fall back to a neutral teal if no color is set. */
  background: #3aab9c;
}

/* ── Responsive: mobile ── */
@media (width <= 768px) {
  .c-banner-carousel--flat,
  .c-banner-carousel--flat .c-banner-carousel-slide {
    height: auto;
    min-height: 260px;
 
}
}

/* ============================================================
   Image Top Variant (.c-banner-carousel-wrapper[data-carousel-variant="image_top"])
   Image attaches at the top of the container.
   ============================================================ */

[data-carousel-variant="image_top"] .c-banner-carousel-slide__image-wrapper img {
  object-position: center top;
}

/* Description text inside the content column */
.c-banner-carousel-slide__content .a-description {
  color: #fff;
  font-family: var(--font-family, sans-serif);
  font-size: 14px;
  line-height: 22px;
  margin: 0;
}

.c-banner-carousel-slide__content .a-description p {
  margin: 0 0 10px;
}

.c-banner-carousel-slide__content .a-description p:last-child {
  margin: 0;
}
