/* Single Dog Profile Styles */
.single-dog-profile {
    max-width: 1160px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
    gap: 32px;
    display: flex;
    flex-direction: column;
    padding: 0 0 16px 0;

}
.profile-masonry-photos {
    background-color: var(--wp--preset--color--drsg-offwhite);
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
    border-radius: 24px;
    min-height: 40px;
    display: flex;
    padding: 16px;
    gap: 12px;
    overflow: hidden;
    position: relative;
}
.main-listing-picture {
    width: 50%;
    -webkit-box-sizing: border-box;
            box-sizing: border-box;
    height: 400px;
}
.main-listing-picture img {
    width: 100%;
    min-height: 100%;
    max-height: 100%;
    -o-object-fit: cover;
       object-fit: cover;
    border-radius: 16px 0 0 16px;
}
.w100 {
    width: 100%;
}
#listing-picture-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, 1fr);
  width: 100%;
  height: 400px;
  gap: 12px;
  overflow: hidden;
  border-radius: 0 16px 16px 0;
}

#listing-picture-grid > img {
  width: 0;
  height: 0;
  min-height: 100%;
  min-width: 100%;
  object-fit: cover;
}
/* 1 image: spans entire grid */
#listing-picture-grid > img:first-child:nth-last-child(1) {
  grid-column: 1 / -1;
  grid-row: 1 / -1;
}
/* 2 images: stack vertically (each takes one row, spanning both columns) */
#listing-picture-grid > img:first-child:nth-last-child(2) {
  grid-column: 1 / -1;
  grid-row: 1;
}
#listing-picture-grid > img:first-child:nth-last-child(2) ~ img:nth-child(2) {
  grid-column: 1 / -1;
  grid-row: 2;
}
/* 3 images: two on top row, one on bottom row spanning both columns */
#listing-picture-grid > img:first-child:nth-last-child(3) {
  grid-column: 1;
  grid-row: 1;
}
#listing-picture-grid > img:first-child:nth-last-child(3) ~ img:nth-child(2) {
  grid-column: 2;
  grid-row: 1;
}
#listing-picture-grid > img:first-child:nth-last-child(3) ~ img:nth-child(3) {
  grid-column: 1 / -1;
  grid-row: 2;
}
.profile-masonry-photos > p {
    display: none;
}
.profile-bio-flex {
    display: flex;
    gap: 32px;
}
.listing-info-pane {
    display: flex;;
    flex-direction: column;
    background-color: var(--wp--preset--color--drsg-offwhite);
    box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.25);
    padding: 24px;
    min-width: clamp(300px, 30vw, 360px);
    border-radius: 24px;
}
.center-text {
  text-align: center;
}
.profile-bio-application-status {
  text-align: center;
  padding: 12px 0;
}
.profile-bio-list-item {
  display: flex;
  align-items: center;
  line-height: 1.5;
  padding: 12px 0;
}
.profile-bio-adoption-link {
  display: block;
  width: 100%;
  text-align: center;
  padding: 16px 0;
  margin: 12px 0;
  text-decoration: none;
  color: var(--wp--preset--color--drsg-offwhite);
  border-radius: 16px;
  background: var(--DRSG-Red, #E4123A);
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.20);
}
.profile-bio-adoption-link:hover {
  background-color: var(--wp--preset--color--drsg-hover-red);
  color: var(--wp--preset--color--drsg-offwhite);
}
.profile-bio-list-item::before {
  content: '';
  display: inline-block;
  height: 24px;
  width: 24px;
  margin: 0 16px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}
.profile-bio-list-item.profile-male::before {
  background-image: url('./icons/male.svg');
}
.profile-bio-list-item.profile-female::before {
  background-image: url('./icons/female.svg');
}
.profile-bio-list-item.profile-birthday::before {
  background-image: url('./icons/cake.svg');
}
.profile-bio-list-item.profile-location::before {
  background-image: url('./icons/pin.svg');
}
.profile-bio-list-item.profile-weight::before {
  background-image: url('./icons/weight.svg');
}
.profile-bio-list-item.profile-child::before {
  background-image: url('./icons/child.svg');
}
.profile-bio-list-item.profile-garden::before {
  background-image: url('./icons/garden.svg');
}
.profile-bio-list-item.profile-cat::before {
  background-image: url('./icons/cat.svg');
}
.profile-bio-list-item.profile-dog::before {
  background-image: url('./icons/dog.svg');
}
@media screen and (max-width: 660px) {
  .profile-bio-flex {
    flex-wrap: wrap;
    flex-direction: column-reverse;
  }
  #listing-picture-grid {
    display: none;
  }
  .main-listing-picture {
    width: 100%;
  }
  .main-listing-picture img {
    border-radius: 16px;
  }
}
#show-photos-button {
  position: absolute;
  bottom: 26px;
  left: 26px;
  box-sizing: border-box;
  padding: 5px 12px 7px 12px;
  font-size: 16px;
  background-color: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.20);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
#show-photos-button::before {
  content: '';
  width: 16px;
  height: 12px;
  background-image: url('./icons/gallery.svg');
  background-repeat: no-repeat;
  background-size: contain;
  transform: translateY(1px);
}
.expanded-gallery {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  display: none;
  z-index: 999;
  background-color: #f7f7f7f2;
  backdrop-filter: blur(6px);
  min-height: 100dvh;
  position: fixed;
  top: 0;
  left: 0;
  box-sizing: border-box;
  padding: 64px 0 0 0;
  justify-content: center;
  align-items: center;
}
.no-scroll {
  overflow: hidden; /* disable page scroll */
}
.expanded-gallery-inner {
  max-height: calc(100dvh - 64px);
  width: calc(100% - 40px);
  max-width: 960px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: scroll;
  gap: 32px;
  align-items: center;
  margin: 0 auto;   
  position: relative;
  scrollbar-gutter: stable;
}
#expanded-gallery-close {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  box-sizing: border-box;
  padding: 5px 12px 7px 12px;
  font-size: 16px;
  background-color: #f7f7f7;
  border-radius: 8px;
  box-shadow: 0px 2px 8px 0px rgba(0, 0, 0, 0.20);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
#show-photos-button:hover, #expanded-gallery-close:hover {
  background-color: #f2f2f2;
}
#expanded-gallery-close::before {
  content: '';
  width: 18px;
  height: 18px;
  background-image: url('./icons/close.svg');
  background-repeat: no-repeat;
  background-size: contain;
  transform: translateY(1px);
  margin-right: 6px;
}
@media screen and (max-width: 660px) {
  .expanded-gallery-inner {
    gap: 20px;
  }
}
.expanded-gallery-inner img {
  width: 100%;
  height: auto;
  max-height: 60dvh;
  object-fit: contain;
  object-position: center;
}
.expanded-gallery-inner img:last-of-type {
  margin-bottom: 20px;
}
/* Scollbar styles */
.expanded-gallery-inner {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* smooth scroll on iOS */
  
  /* Firefox scrollbar style */
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.25) transparent;
}

/* WebKit browsers (Chrome, Safari, Edge) */
.expanded-gallery-inner::-webkit-scrollbar {
  width: 6px; /* thin scrollbar */
  transition: opacity 0.2s ease;
}

.expanded-gallery-inner::-webkit-scrollbar-track {
  background: transparent;
}

.expanded-gallery-inner::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.25);
  border-radius: 3px;
}

.expanded-gallery-inner::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, 0.35);
}

/* Optional: make scrollbar fade in/out on desktop hover */
.expanded-gallery-inner::-webkit-scrollbar {
  opacity: 0;
}

.expanded-gallery-inner:hover::-webkit-scrollbar,
.expanded-gallery-inner:focus::-webkit-scrollbar,
.expanded-gallery-inner:active::-webkit-scrollbar {
  opacity: 1;
}
