/* Harden Custom Homes — Gallery (single-source, no competing blocks)
   Applies to: <div data-gallery><div class="gallery">...</div></div>
*/

/* ===== Grid layout ===== */
.project-photos div[data-gallery] > .gallery{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  align-items: start;
  width: 100%;
}

/* Responsive */
@media (max-width: 980px){
  .project-photos div[data-gallery] > .gallery{
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}
@media (max-width: 560px){
  .project-photos div[data-gallery] > .gallery{
    grid-template-columns: 1fr;
  }
}

/* ===== Thumbnails ===== */
.project-photos div[data-gallery] > .gallery > a.thumb{
  display: block;
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: #f3f4f6;
  box-shadow: 0 6px 18px rgba(17,24,39,.08);
  text-decoration: none;
}

.project-photos div[data-gallery] > .gallery > a.thumb > img{
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
  transition: transform .25s ease;
}

.project-photos div[data-gallery] > .gallery > a.thumb:hover img{
  transform: scale(1.03);
}

/* ===== Actions ===== */
.project-photos .gallery-actions{
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

.project-photos .load-more{
  appearance: none;
  border: 1px solid rgba(15,23,42,.18);
  border-radius: 999px;
  padding: 10px 14px;
  font-weight: 600;
  background: #fff;
  cursor: pointer;
}

/* ===== Lightbox (gallery.js) ===== */
.lb{
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15,23,42,.72);
  z-index: 9999;
}

.lb.open{ display: flex; }

.lb img{
  max-width: min(1100px, 94vw);
  max-height: 86vh;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(0,0,0,.35);
}

.lb .close,
.lb .prev,
.lb .next{
  position: absolute;
  appearance: none;
  border: 0;
  background: rgba(255,255,255,.92);
  color: #111827;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 22px;
  display: grid;
  place-items: center;
}

.lb .close{ top: 18px; right: 18px; }
.lb .prev{ left: 18px; top: 50%; transform: translateY(-50%); }
.lb .next{ right: 18px; top: 50%; transform: translateY(-50%); }

.lb .cap{
  position: absolute;
  bottom: 18px;
  left: 18px;
  right: 18px;
  text-align: center;
  color: rgba(255,255,255,.92);
  font-weight: 600;
  text-shadow: 0 2px 10px rgba(0,0,0,.35);
}

/* === HCH DATA-GALLERY WIDTH FIX (START) === */
/* data-gallery is shrinking to ~345px; force it to be a full-width block */
.project-photos div[data-gallery]{
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  justify-self: stretch !important;
  align-self: stretch !important;
}

/* Ensure the grid wrapper also fills */
.project-photos div[data-gallery] > .gallery{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}
/* === HCH DATA-GALLERY WIDTH FIX (END) === */

/* === LOAD MORE CENTER (FORCE) (START) === */
.project-photos .gallery-actions{
  width: 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 22px !important;
}
.project-photos .gallery-actions .load-more{
  margin-left: auto !important;
  margin-right: auto !important;
  display: inline-flex !important;
}
/* === LOAD MORE CENTER (FORCE) (END) === */

/* === LOAD MORE FULL WIDTH (START) === */
.project-photos .gallery-actions{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 24px !important;
}

.project-photos .gallery-actions .load-more{
  margin: 0 auto !important;
}
/* === LOAD MORE FULL WIDTH (END) === */

/* === LOAD MORE FULL WIDTH (START) === */
.project-photos .gallery-actions{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 24px !important;
}

.project-photos .gallery-actions .load-more{
  margin: 0 auto !important;
}
/* === LOAD MORE FULL WIDTH (END) === */

/* === LOAD MORE FULL WIDTH (START) === */
.project-photos .gallery-actions{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  flex: 1 1 100% !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 24px !important;
}

.project-photos .gallery-actions .load-more{
  margin: 0 auto !important;
}
/* === LOAD MORE FULL WIDTH (END) === */

/* === LOAD MORE SPAN FULL ROW (START) === */
/* If gallery-actions is being treated like a grid/flex item in a narrow column (~345px), force it to span/stretch */
.project-photos .gallery-actions{
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;

  /* Grid contexts */
  grid-column: 1 / -1 !important;
  justify-self: stretch !important;
  align-self: stretch !important;

  /* Flex contexts */
  flex: 1 1 100% !important;

  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  margin-top: 24px !important;
}

.project-photos .gallery-actions .load-more{
  margin: 0 auto !important;
}
/* === LOAD MORE SPAN FULL ROW (END) === */

/* === LOAD MORE CENTER FINAL (START) === */
/* Center the button regardless of wrapper sizing quirks */
.project-photos .gallery-actions{
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  text-align: center !important;
  margin-top: 24px !important;
}

.project-photos .gallery-actions .load-more,
.project-photos .gallery-actions [data-load-more]{
  display: inline-block !important;
  margin: 0 auto !important;
}
/* === LOAD MORE CENTER FINAL (END) === */
