:root {
  --gallery_primary-heading-text-color: #2b2b2b;
  --gallery_text-color: #3a2f24;
  --gallery_button-text-color: #1f3a32;
  --gallery_golden-border-color-1: #b67e04;
  --gallery_golden-border-color-2: #e0b860;
  --gallery_bg-paper-texture1: url("../assets/backgroundImage/body_bg_1.avif");
  --gallery_bg-button: url("../assets/backgroundImage/buttonBackground.avif");
  --gallery_font-home-heading: "Pirata One", serif;
  --gallery_font-heading: "Cinzel", serif;
  --gallery_font-text: "Inter", sans-serif;
}

body {
  background: var(--gallery_bg-paper-texture1) no-repeat top/cover;
}
/* Calander Page Styles  */
.gallery_page {
  position: relative;
}

/* Top Icons  */
.gallery_page .top_left_icon {
  position: absolute;
  top: 0;
  left: 0;
  width: 100px;
  height: auto;
}
.gallery_page .top_center_icon {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 250px;
  height: auto;
}
.gallery_page .top_right_icon {
  position: absolute;
  top: 0;
  right: 0;
  width: 100px;
  height: auto;
}

/* Responsive icon sizes*/
@media (max-width: 768px) {
  .gallery_page .top_left_icon {
    width: 80px;
    height: auto;
  }
  .gallery_page .top_center_icon {
    width: 200px;
    height: auto;
    top: -20px;
  }
  .gallery_page .top_right_icon {
    width: 80px;
    height: auto;
  }
}

/* Titles */
.gallery_page_title {
  padding-top: 40px;
  font-family: var(--gallery_font-heading);
  font-size: 42px;
  text-align: center;
  margin-bottom: 20px;
}

/* divider  */
.divider {
  width: 100%;
  margin: 0px 0px 1px 0px;
  padding-bottom: 2px;
  border: 4px ridge var(--gallery_golden-border-color-1);
  box-shadow: 5px 5px 10px var(--gallery_primary-heading-text-color);
}

/* Gallery page first section  */
.gallery_first_sec {
  height: 150px;
  background: url("../assets/gallery-page/documents-hero-img.avif");
  background-position-y: -450px;
  background-size: cover;
}
.gallery_background_overly {
  background-color: #724e004e;
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
}
.gallery_page_text {
  font-family: var(--gallery_font-text);
  font-size: large;
  font-weight: bold;
  text-align: center;
  text-shadow: 2px 2px 10px white;
}


/* Grid */
.photo_gallery_div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  padding: 50px 20px;
}

/* Tablet */
@media (max-width: 992px) {
  .photo_gallery_div {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Mobile */
@media (max-width: 576px) {
  .photo_gallery_div {
    grid-template-columns: repeat(1, 1fr);
  }
}

/* Gallery Image */
.gallery_img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  border: 4px ridge var(--gallery_golden-border-color-1);
  border-radius: 5px;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.gallery_img:hover {
  transform: scale(1.01);
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  justify-content: center;
  align-items: center;

  opacity: 0;
  visibility: hidden;

  /* visibility delay added */
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}

/* Show Lightbox */
.lightbox.show {
  opacity: 1;
  visibility: visible;

  /* remove delay when showing */
  transition: opacity 0.3s ease;
}

/* Hide Animation */
.lightbox.hide {
  opacity: 0;
  visibility: hidden;

  /* delay visibility so fade-out works */
  transition:
    opacity 0.3s ease,
    visibility 0s linear 0.3s;
}

/* Lightbox Image */
.lightbox_img {
  max-width: 90%;
  max-height: 85%;
  border: 4px ridge var(--gallery_golden-border-color-1);
  border-radius: 5px;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.lightbox_img.fade-out {
  opacity: 0;
}

/* Buttons */
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: var(--gallery_golden-border-color-2);
  cursor: pointer;
  user-select: none;
}

.prev,
.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: var(--gallery_golden-border-color-2);
  cursor: pointer;
  user-select: none;
}

.prev {
  left: 30px;
}
.next {
  right: 30px;
}

.prev:hover,
.next:hover,
.close:hover {
  color: #ddd;
}


/* Dated community photos */
.recent_gallery { padding: 36px 20px 20px; }
.recent_gallery h2, .gallery_archive_heading { font-family: var(--gallery_font-heading); text-align: center; font-size: clamp(23px, 3vw, 32px); }
.gallery_date_note { max-width: 780px; margin: 16px auto 24px; font: 15px/1.6 var(--gallery_font-text); text-align: center; color: var(--gallery_text-color); }
.recent_photo_grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.gallery_card { margin: 0; min-width: 0; background: #fff4d6; border: 2px solid #b67e04; border-radius: 6px; overflow: hidden; }
.gallery_card .gallery_img { display: block; height: 300px; border: 0; border-radius: 0; object-position: center 60%; }
.gallery_card figcaption { padding: 18px; font: 14px/1.6 var(--gallery_font-text); color: #352817; }
.gallery_card figcaption strong { display: block; margin-bottom: 8px; font-size: 17px; }
.gallery_card figcaption span { display: block; }
.gallery_card .photo_credit { font-size: 12px; margin: 5px 0 10px; }
.gallery_card figcaption a { color: #1f4a39; text-decoration: underline; }
.gallery_archive_heading { margin-top: 32px; }
.gallery_img:focus-visible, .lightbox button:focus-visible { outline: 3px solid #e0b860; outline-offset: 4px; }
.lightbox { z-index: 1000; }
.lightbox_figure { margin: 0; max-width: calc(100% - 110px); display: flex; flex-direction: column; align-items: center; }
.lightbox_figure .lightbox_img { max-width: 100%; max-height: 76vh; object-fit: contain; }
#lightboxCaption { color: #fff4d6; font: 14px/1.5 var(--gallery_font-text); text-align: center; max-width: 720px; padding: 14px 0 0; }
.lightbox button { background: transparent; border: 0; padding: 6px; font-family: inherit; }
.lightbox .prev { left: 8px; }
.lightbox .next { right: 8px; }
.lightbox .close { top: 8px; right: 12px; }
@media (max-width: 700px) {
  .recent_photo_grid { grid-template-columns: 1fr; gap: 20px; }
  .gallery_card .gallery_img { height: 320px; }
  .lightbox_figure { max-width: calc(100% - 72px); }
  .lightbox_figure .lightbox_img { max-height: 65vh; }
  .lightbox .prev, .lightbox .next { font-size: 26px; padding: 3px; }
  #lightboxCaption { font-size: 12px; }
}


/* Browse community albums by date. */
.gallery_date_nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 24px 0 36px; }
.gallery_date_nav a { padding: 9px 15px; border: 1px solid #b67e04; border-radius: 4px; background: #fff4d6; color: #1f4a39; font: 14px/1.5 var(--gallery_font-text); }
.recent_gallery h3, .dated_gallery h3 { margin: 16px 0 24px; font: 600 clamp(19px, 2.2vw, 26px)/1.4 var(--gallery_font-heading); text-align: center; scroll-margin-top: 25px; }
.dated_gallery { padding: 28px 20px 20px; }
.gallery_grid_four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gallery_card .gallery_img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
@media (max-width: 700px) {
  .gallery_grid_four { grid-template-columns: 1fr; }
  .gallery_date_nav { margin-bottom: 24px; }
}


/* Keep the original portraits and landscape photos fully visible. */
.original_gallery .gallery_card .gallery_img { object-fit: contain; object-position: center; background: #e9d3a2; }
.original_gallery figcaption a { display: inline-block; margin-top: 10px; }
