/* =========================================
   BUILDING PLUS - LANDSCAPE THUMB GALLERY
   Breakpoints: 1200 / 700 / 481
   No flexbox used
   Update:
   - Modal label now aligns to the PHOTO left edge at all sizes
     (requires wrapping modal image + label in .bp-modal-stage in HTML)
   ========================================= */

.bp-gallery-wrap{
  margin-top: 10px;
}

.bp-gallery{
  font-size:0;
  line-height:0;
  text-align:left;
}

/* =========================
   Thumbnails
   ========================= */

.bp-tile{
  display:inline-block;
  vertical-align:top;
  text-decoration:none;
  box-sizing:border-box;
  margin: 12px;
  overflow:hidden;
  background:#eee;
  box-shadow: 0 6px 18px rgba(0,0,0,0.10);
  border-radius:0;
  width: calc(33.333% - 24px);
}

.bp-tile-media{
  display:block;
  position:relative;
  width:100%;
  height: 280px;
  overflow:hidden; /* masks portrait images */
}

.bp-tile img{
  width:100%;
  height:100%;
  display:block;
  object-fit:cover;
  object-position:center;
  transform: scale(1.01);
  transition: transform 220ms ease;
}

.bp-tile:hover img{
  transform: scale(1.05);
}

.bp-tile-label{
  position:absolute;
  top: 12px;
  left: 0;
  display:inline-block;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.2px;
  color:#fff;
  background: rgba(0,0,0,0.65);
  border-radius:0;
  z-index:2;
}

/* =========================
   Modal (fixed + centered + label on photo edge)
   ========================= */

.bp-modal{
  display:none;
  position:fixed;
  left:0; top:0;
  width:100%;
  height:100%;
  background: rgba(0,0,0,0.86);
  z-index:9999;
}

.bp-modal.open{
  display:block;
}

/* Center the modal content */
.bp-modal-inner{
  position:absolute;
  left:50%;
  top:50%;
  transform: translate(-50%, -50%);
  width: 92%;
  max-width: 1200px;
  text-align:center;
  box-sizing:border-box;
}

/* Stage shrink-wraps to the image width, and is centered by text-align */
.bp-modal-stage{
  display:inline-block;  /* shrink-wrap */
  position:relative;
  max-width:100%;
  text-align:left;
}

/* Image defines the stage width */
.bp-modal-img{
  display:block;
  width:auto;            /* IMPORTANT: keeps stage shrink-wrapped */
  max-width:100%;
  height:auto;
  max-height:80vh;
  object-fit:contain;
  background: rgba(0,0,0,0.25);
  box-shadow: 0 18px 50px rgba(0,0,0,0.45);
}

/* Label ALWAYS on photo left edge */
.bp-modal-label{
  position:absolute;
  top:14px;
  left:0;
  z-index:30;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1;
  color:#fff;
  background: rgba(0,0,0,0.65);
  border-radius:0;
  max-width: 70%;
}

/* Close always above */
.bp-modal-close{
  position:absolute;
  top: 10px;
  right: 10px;
  text-decoration:none;
  font-size:42px;
  line-height:42px;
  width:42px;
  height:42px;
  color:#fff;
  opacity:0.9;
  z-index:40;
}

.bp-modal-close:hover{
  opacity:1;
}

/* Arrows always above */
.bp-modal-arrow{
  position:absolute;
  top:50%;
  margin-top:-30px;
  width:60px;
  height:60px;
  background:#000;
  color:#fff;
  text-decoration:none;
  font-size:34px;
  line-height:60px;
  text-align:center;
  opacity:0.9;
  z-index:40;
}

.bp-modal-arrow:hover{
  opacity:1;
}

.bp-modal-prev{ left: 10px; }
.bp-modal-next{ right: 10px; }

.bp-noscroll, .bp-noscroll body{
  overflow:hidden;
}


/* =========================
   Breakpoints
   ========================= */
@media (max-width:1200px){
  .bp-tile{ margin: 10px; width: calc(50% - 20px); }
  .bp-tile-media{ height: 240px; }

  .bp-modal-arrow{
    width:56px;
    height:56px;
    line-height:56px;
    font-size:32px;
    margin-top:-28px;
  }
}

@media (max-width:700px){
  .bp-tile{ margin: 9px; width: calc(100% - 18px); }
  .bp-tile-media{ height: 240px; }

  .bp-modal-inner{ width: 94%; }
  .bp-modal-img{ max-height: 74vh; }

  .bp-modal-arrow{
    width:52px;
    height:52px;
    line-height:52px;
    font-size:30px;
    margin-top:-26px;
  }

  .bp-modal-prev{ left: 6px; }
  .bp-modal-next{ right: 6px; }
  .bp-modal-label{ max-width: 78%; }
}

@media (max-width:481px){
  .bp-tile{ margin: 8px; width: calc(100% - 16px); }
  .bp-tile-media{ height: 210px; }

  .bp-tile-label{ font-size: 12px; padding: 7px 9px; }
  .bp-modal-label{ font-size: 12px; padding: 7px 9px; max-width: 82%; }

  .bp-modal-arrow{
    width:48px;
    height:48px;
    line-height:48px;
    font-size:28px;
    margin-top:-24px;
  }

  .bp-modal-close{ top: 6px; right: 6px; }
}
