/* ==========================================================================
   Gallery page
   Tile styling mirrors .header_hero_con .block from the homepage hero.
   ========================================================================== */

/* The shared page header emits a default hero and a 600px min-height for
   interior pages. This template starts at the tiles, so collapse it here
   rather than branching the header part every other page depends on. */
.page-template-page-gallery-php .page_header_img {
  display: none;
}

.page-template-page-gallery-php .header_con,
.page-template-page-gallery-php .header_inner_con {
  min-height: 0 !important;
  height: auto !important;
}

.gallery_page_con {
  padding: 50px 0 60px;
}

.gallery_tile_row {
  display: flex;
  flex-wrap: wrap;
  padding-top: 75px;
}

.gallery_tile_col {
  margin-bottom: 30px;
}

.gallery_tile {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 440px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #d4d4d4;
  background: #6c6c6c;
}

.gallery_tile:focus {
  outline: 2px solid #edbb00;
  outline-offset: 2px;
}

.gallery_tile--empty {
  cursor: default;
}

.gallery_tile_img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  transition: transform .4s ease;
}

.gallery_tile:hover .gallery_tile_img {
  transform: scale(1.04);
}

/* Tint over the background image, under the title and button. Also keeps the
   white text legible over a light photo. */
.gallery_tile:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: rgba(112, 112, 112, .75);
  pointer-events: none;
  transition: background .3s ease;
}

.gallery_tile:hover:after,
.gallery_tile:focus:after {
  background: rgba(113, 21, 23, .75);
}

.gallery_tile_overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 85%;
  text-align: center;
  transform: translate(-50%, -50%);
  font-family: "din-condensed";
  color: #ffffff;
}

.gallery_tile_title {
  font-size: calc(2.2vw + 16px);
  font-weight: 500;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 1px 1px 4px rgba(0, 0, 0, .5);
}

.gallery_tile_btn {
  display: inline-block;
  margin-top: 18px;
  padding: 0;
  width: 180px;
  height: 40px;
  line-height: 40px;
  font-family: "din-condensed";
  font-size: 22px;
  text-align: center;
  text-transform: uppercase;
  color: #ffffff;
  border: 1px solid #ffffff;
  background: rgba(158, 27, 27, .8);
  transition: background .2s ease, color .2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.gallery_tile:hover .gallery_tile_btn,
.gallery_tile:focus .gallery_tile_btn {
  background: rgba(255, 255, 255, .75);
  color: #911819;
}

/* PhotoSwipe reads these links; the tile is the visible trigger. */
.gallery_tile_source {
  display: none;
}

.gallery_page_intro {
  padding: 10px 0 0;
  text-align: center;
  font-family: "open-sans";
  font-size: 15px;
  line-height: 24px;
  color: #9e1b1b;
}

.gallery_page_intro p:last-child {
  margin-bottom: 0;
}

@media screen and (max-width: 991px) {
  .gallery_tile {
    min-height: 300px;
  }

  .gallery_tile_title {
    font-size: calc(3.5vw + 14px);
  }
}

@media screen and (max-width: 767px) {
  .gallery_page_con {
    padding: 25px 0 30px;
  }

  .gallery_tile {
    min-height: 240px;
  }

  .gallery_tile_title {
    font-size: 30px;
  }

  .gallery_tile_btn {
    width: 150px;
    height: 36px;
    line-height: 36px;
    font-size: 18px;
  }
}

/* ==========================================================================
   PhotoSwipe popup - matches the gallery mockup
   ========================================================================== */

.pswp--ptw_gallery {
  --pswp-bg: #3d3d3d;
  --pswp-icon-color: #ffffff;
  --pswp-icon-color-secondary: #3d3d3d;
  --pswp-thumbs-wrapper-height: 80px;
  --pswp-thumbs-wrapper-gap: 8px;
  --pswp-thumb-width: 108px;
  --pswp-thumb-border-radius: 0;
  /* Uniform strip: active thumb is marked by outline, not by growing. */
  --pswp-thumb-active-width: 108px;
}

/* The plugin hardcodes calc(100vh - 86px) for its default 72px strip. Ours is
   80px tall plus 8px margin top and bottom, so reserve 96px instead. */
.pswp--ptw_gallery .pswp__scroll-wrap {
  height: calc(100vh - 96px);
}

.pswp--ptw_gallery .pswp__thumb {
  opacity: .55;
  transition: opacity .2s ease;
}

.pswp--ptw_gallery .pswp__thumb:hover {
  opacity: .85;
}

.pswp--ptw_gallery .pswp__thumb--active {
  opacity: 1;
  margin-right: 0;
  margin-left: 0;
  box-shadow: inset 0 0 0 2px #ffffff;
}

/* Plugin pins the img to --pswp-thumb-active-width; fill the button instead so
   thumbnails crop rather than stretch. */
.pswp--ptw_gallery .pswp__thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pswp--ptw_gallery .pswp__counter {
  margin-left: 20px;
  font-family: "din-condensed";
  font-size: 22px;
  opacity: 1;
  text-shadow: none;
}

.pswp--ptw_gallery .pswp__button--arrow .pswp__icn {
  background: none;
}

@media screen and (max-width: 767px) {
  .pswp--ptw_gallery {
    --pswp-thumbs-wrapper-height: 56px;
    --pswp-thumb-width: 74px;
    --pswp-thumb-active-width: 74px;
  }
}
