/* Before/After List Styles */
.before-after-list-item {
  margin-bottom: 20px;
  /* border: 1px solid #eee; */
  padding: 15px;
  display: block; /* Ensure the anchor tag behaves like a block for layout */
  text-decoration: none;
  color: inherit;
  background-color: white;
  max-width: 800px;
  margin-inline: auto;
  border-radius: 20px;
}

.before-after-list-item:hover {
  border-color: #ccc;
}

.before-after-list-item__link {
  display: flex; /* Align thumbnail and title */
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.before-after-list-item__thumbnail {
  width: 300px; /* Adjust as needed */
  max-width: 48%;
  /* height: 200px; */ /* Adjust as needed */
  aspect-ratio: 1.5/1;
  margin-right: 25px;
  position: relative; /* For absolute positioning of after-image */
  overflow: hidden; /* Hide parts of images if they are larger than the container */
  border: 1px solid #ddd;
  border-radius: 10px;
}

.before-after-list-item__thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Ensure images cover the area, might crop */
  position: absolute;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease-in-out; /* Smooth transition for opacity change */
}

.before-after-list-item__thumbnail .after-image {
  opacity: 0;
}

/* PC Hover Effect */
@media (hover: hover) and (pointer: fine) {
  .before-after-list-item__link:hover
    .before-after-list-item__thumbnail
    .before-image {
    opacity: 0;
  }
  .before-after-list-item__link:hover
    .before-after-list-item__thumbnail
    .after-image {
    opacity: 1;
  }
}

.before-after-list-item__title {
  font-size: 1.2rem;
  margin: 0; /* Reset margin if any from theme */
  flex: 1;
  min-width: 0;
}

@media screen and (max-width: 767.98px) {
.before-after-list-item__title {
  font-size: 0.9rem;
}


/* SP Auto Slideshow (JavaScript will toggle a class, e.g., 'show-after') */
.before-after-list-item__thumbnail.show-after .before-image {
  opacity: 0;
}

.before-after-list-item__thumbnail.show-after .after-image {
  opacity: 1;
}
