/* =========================================================
   ROASTER IMAGE FIT FIX v1.0
   Coaches = square + fill/crop
   Blog    = square + contain/no crop
========================================================= */

/* -------------------------
   COACHES
------------------------- */
body.page-slug-coaches .rb-coach-photo,
body.page-id-0 .rb-coach-photo,
.rb-coaches-team-section .rb-coach-photo,
.rb-coach-grid-photos .rb-coach-photo {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
  background: #111 !important;
}

.rb-coaches-team-section .rb-coach-photo img,
.rb-coach-grid-photos .rb-coach-photo img,
.rb-coach-card .rb-coach-photo img {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* If a coach image widget/card is using a plain img wrapper */
.rb-coach-card > img,
.rb-coach-card figure img {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  display: block !important;
  object-fit: cover !important;
  object-position: center center !important;
}

/* -------------------------
   BLOG LANDING PAGE
   Entire photo visible inside square.
------------------------- */
.rbbl-featured-image,
.rbbl-story-image {
  aspect-ratio: 1 / 1 !important;
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #f3f0e9 !important;
}

.rbbl-featured-image img,
.rbbl-story-image img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block !important;
  object-fit: contain !important;
  object-position: center center !important;
}

/* Older Roaster blog grid fallback selectors */
.rb-blog-image,
.rb-blog-card .rb-blog-image {
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  background-size: contain !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-color: #f3f0e9 !important;
}

.rb-blog-card img,
.rb-blog-image img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  background: #f3f0e9 !important;
}

/* WordPress-generated featured image wrappers sometimes override dimensions */
body.blog .post-thumbnail,
body.page .rbbl-featured-image,
body.page .rbbl-story-image {
  overflow: hidden !important;
}

@media (max-width: 640px) {
  .rb-coaches-team-section .rb-coach-photo,
  .rb-coach-grid-photos .rb-coach-photo,
  .rb-coach-card .rb-coach-photo {
    aspect-ratio: 1 / 1 !important;
  }
}
