/* =========================================================
   BERGMANN – Categories Editorial Collage (FULL REPLACEMENT)
   Scope: #categories-editorial only
   ========================================================= */

#categories-editorial{
  background: var(--berg-primary);
  padding: 120px 0;
}

/* Center the block + keep a consistent max width */
#categories-editorial .et_pb_row{
  /* max-width: var(--berg-content-width); */
  margin-left: auto;
  margin-right: auto;
}

/* Space between top and bottom rows */
/* #categories-editorial .et_pb_row + .et_pb_row{
  margin-top: 24px;
} */

/* ---------------------------------------------------------
   Card: warm frame container
   --------------------------------------------------------- */
#categories-editorial .berg-cat-card{
  position: relative;
  /* background: var(--berg-bg-warm);
  border-radius: var(--berg-radius-md);
  padding: 22px;        */
  overflow: hidden;
}

/* Remove Divi’s default module bottom spacing inside card */
#categories-editorial .berg-cat-card .et_pb_module{
  margin-bottom: 0 !important;
}

/* ---------------------------------------------------------
   Image fill (stable crop window)
   --------------------------------------------------------- */
#categories-editorial .berg-cat-image,
#categories-editorial .berg-cat-image a,
#categories-editorial .berg-cat-image .et_pb_image_wrap{
  width: 100% !important;
  height: 100% !important;
  display: block;
}

#categories-editorial .berg-cat-image .et_pb_image_wrap{
  position: relative;
  overflow: hidden;
  /* border-radius: var(--berg-radius-sm);
  background: var(--berg-bg-warm); */
}

#categories-editorial .berg-cat-image img{
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  background: var(--berg-bg-warm);
}

/* ---------------------------------------------------------
   Row-based height control (edit these two numbers only)
   --------------------------------------------------------- */
#categories-editorial .et_pb_row:first-of-type .berg-cat-card{
  height: 420px;
}

#categories-editorial .et_pb_row:last-of-type .berg-cat-card{
  height: 420px; 
}

/* ---------------------------------------------------------
   Editorial asymmetry
   - bottom-left slightly inset to mimic the reference
   - bottom-right feels like the hero tile
   --------------------------------------------------------- */
#categories-editorial .berg-cat--bottom-left{
  transform: translateX(40px);
}

#categories-editorial .berg-cat--bottom-right{
  transform: translateX(-10px);
}

/* ---------------------------------------------------------
   Pill overlay – position the BUTTON MODULE WRAPPER
   --------------------------------------------------------- */
#categories-editorial .berg-cat-card .et_pb_button_module_wrapper{
  position: absolute;
  z-index: 20;
}

/* Pill styling */
#categories-editorial .berg-cat-card .et_pb_button{
  background: var(--berg-bg-warm) !important;
  color: var(--berg-text-muted) !important;
  border: none !important;
  border-radius: var(--berg-radius-full) !important;
  padding: 10px 18px !important;
  font-family: var(--berg-font-primary);
  font-weight: var(--berg-weight-semibold);
  font-size: var(--berg-text-xs);
  letter-spacing: var(--berg-tracking-wide);
  text-transform: uppercase;
  box-shadow: var(--berg-shadow-sm);
}

#categories-editorial .berg-cat-card .et_pb_button:hover{
    background-color: var(--berg-primary-light) !important;
    border-color: var(--berg-primary-light) !important;
}

#categories-editorial .berg-cat-card .et_pb_button:after{
  display: none !important;
}


/* ---------------------------------------------------------
   Pill positioning (match reference)
   - top row: top-right
   - bottom row: bottom-left
   --------------------------------------------------------- */
#categories-editorial .berg-cat--top-left  .et_pb_button_module_wrapper,
#categories-editorial .berg-cat--top-right .et_pb_button_module_wrapper{
  top: 24px;
  right: 24px;
  left: auto;
  bottom: auto;
}

#categories-editorial .berg-cat--bottom-left  .et_pb_button_module_wrapper,
#categories-editorial .berg-cat--bottom-right .et_pb_button_module_wrapper{
  left: 24px;
  bottom: 24px;
  right: auto;
  top: auto;
}

/* ---------------------------------------------------------
   Crop focus (small tweaks per tile)
   Adjust these if faces are off-center
   --------------------------------------------------------- */
#categories-editorial .berg-cat--top-left .berg-cat-image img{
  object-position: 65% 45%;
}

#categories-editorial .berg-cat--top-right .berg-cat-image img{
  object-position: 55% 35%;
}

#categories-editorial .berg-cat--bottom-left .berg-cat-image img{
  object-position: 55% 45%;
}

#categories-editorial .berg-cat--bottom-right .berg-cat-image img{
  object-position: 55% 45%;
}


.berg-cat-card.berg-cat--top-left{
  margin-right: 24px !important;
}
 #categories-editorial .et_pb_row{
  padding: 1% 0 !important;
 }
/* ---------------------------------------------------------
   Responsive
   --------------------------------------------------------- */
@media (max-width: 980px){
  #categories-editorial{
    padding: 60px 0;
  }

  #categories-editorial .et_pb_row + .et_pb_row{
    margin-top: 40px;
  }

  #categories-editorial .et_pb_row:first-of-type .berg-cat-card{
    height: 280px;
  }

  #categories-editorial .et_pb_row:last-of-type .berg-cat-card{
    height: 320px;
  }

  #categories-editorial .berg-cat--bottom-left,
  #categories-editorial .berg-cat--bottom-right{
    transform: none;
  }
}

@media (max-width: 767px){
  #categories-editorial{
    padding: 40px 0;
  }

  #categories-editorial .et_pb_row .berg-cat-card{
    height: 260px;
  }

  /* On mobile, keep pills top-right for consistency */
  #categories-editorial .et_pb_button_module_wrapper{
    top: 14px !important;
    right: 14px !important;
    left: auto !important;
    bottom: auto !important;
  }
}