/* Floating frame page - masonry gallery for the portfolio examples section */

/* Container is measured by Masonry.js; negative margins offset the item gutters */
.masonry-gallery {
  position: relative;
  margin-left: -10px;
  margin-right: -10px;
}

/* Items are absolutely positioned by Masonry.js; width defines the column count.
   The float is a graceful fallback grid if JS fails to load. */
.masonry-gallery .masonry-item {
  float: left;
  width: 100%;
  padding-left: 10px;
  padding-right: 10px;
  margin-bottom: 20px;
}

/* Bootstrap sm breakpoint: 2 columns */
@media (min-width: 576px) {
  .masonry-gallery .masonry-item {
    width: 50%;
  }
}

/* Bootstrap md breakpoint: 3 columns */
@media (min-width: 768px) {
  .masonry-gallery .masonry-item {
    width: 33.3333%;
  }
}

/* Bootstrap xl breakpoint: 4 columns */
@media (min-width: 1200px) {
  .masonry-gallery .masonry-item {
    width: 25%;
  }
}

/* Card: self-contained styling (page does not load Bootstrap card CSS) */
.masonry-gallery .card {
  background: #fff;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: box-shadow 0.35s ease;
}

.masonry-gallery .masonry-item:hover .card {
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
}

/* Image fills the card; gentle zoom on hover */
.masonry-gallery .card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.masonry-gallery .masonry-item:hover .card img {
  transform: scale(1.05);
}

/* Image links must clip the zoomed image */
.masonry-gallery .card a,
.masonry-gallery .card .video-container {
  display: block;
  overflow: hidden;
}

/* Placeholder ratio while the image is lazy-loading, so the initial
   masonry layout is realistic; the class is removed once the image loads
   and the natural aspect ratio takes over */
.masonry-gallery .card img.lazy-load {
  aspect-ratio: 4 / 3;
  background: #ececec;
}

/* Caption below the image */
.masonry-gallery .card-body {
  padding: 12px 14px 14px;
  text-align: center;
}

.masonry-gallery .card-title {
  margin: 0 0 2px;
  font-size: 15px;
  line-height: 1.35;
  color: #222;
}

.masonry-gallery .card-body p {
  margin: 0;
  font-size: 13px;
  color: #888;
}

/* Hide empty credit lines so they don't add dead space */
.masonry-gallery .card-body p:empty {
  display: none;
}
