/* GLightbox close button — hide the default SVG icon, use custom image via ::after */
.gclose svg {
  display: none;
}

.gclose {
  position: absolute;
  top: 25px;
  right: 0;
  cursor: pointer;
  width: 61px;
  height: 35px;
  background: none;
  border: none;
  display: block;
}

.gclose::after {
  background: url(/themes/custom/tbc_custom/images/close-button.png) no-repeat 0 0;
  background-size: cover;
  width: 11px;
  height: 11px;
  color: white;
  content: "";
  position: absolute;
  top: 50%;
  right: 35px;
  margin-top: -5.5px;
}

.gclose::before {
  content: "";
  display: block;
  height: 85px;
  margin: -85px 0 0;
}

/* Constrain images to fit within the viewport */
.gslide-image img {
  max-height: 85vh !important;
  max-width: 90vw !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain;
}

/* Video gallery — thumbnail with play button overlay */
.magnific-video-gallery .field-type-video-embed-field,
.paragraph-4-column .field-type-video-embed-field {
  position: relative;
  display: inline-block;
}

.magnific-video-gallery .field-type-video-embed-field a,
.paragraph-4-column .field-type-video-embed-field a {
  display: block;
  position: relative;
}

.magnific-video-gallery .field-type-video-embed-field a img,
.paragraph-4-column .field-type-video-embed-field a img {
  display: block;
  width: 100%;
  height: auto;
}

.magnific-video-gallery .field-type-video-embed-field a::after,
.paragraph-4-column .field-type-video-embed-field a::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 80'%3E%3Ccircle cx='40' cy='40' r='38' fill='rgba(0,0,0,0.55)' stroke='white' stroke-width='2'/%3E%3Cpolygon points='30,22 62,40 30,58' fill='white'/%3E%3C/svg%3E") center/60px no-repeat;
  transition: background-color 0.2s;
}

.magnific-video-gallery .field-type-video-embed-field a:hover::after,
.paragraph-4-column .field-type-video-embed-field a:hover::after {
  background-color: rgba(0, 0, 0, 0.45);
}

/* People/faculty profile card in inline lightbox.
   .profileOverlay is display:none on the page — override it inside GLightbox. */
.glightbox-container .profileOverlay {
  display: block !important;
  background: #fff;
  padding: 20px;
  max-width: min(700px, 90vw);
  max-height: 85vh;
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  border-radius: 4px;
}

.glightbox-container .profileOverlay::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* ── PROFILE CARD SCROLL INDICATOR ──────────────────────────────
   JS injects .profile-scroll-indicator as the last child of .profileOverlay.
   A real div (not ::after) works reliably with position:sticky inside an
   overflow-y:auto container. margin-top pulls it up to overlap content.
   The ::after on the div holds the bouncing arrow, separate from the
   gradient background so only the arrow animates.                     */
.profile-scroll-indicator {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 80px;
  background: linear-gradient(to top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 10px;
  opacity: 1;
  transition: opacity 0.4s ease;
  /* Isolate completely from surrounding layout so animation cannot trigger
     reflow of the profile card text */
  contain: layout style paint;
}

.profile-scroll-indicator.hidden {
  opacity: 0;
}

.profile-scroll-indicator::after {
  content: "";
  display: block;
  width: 44px;
  height: 26px;
  /* SVG chevron pointing down — no CSS rotation, no layout overflow */
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='26' viewBox='0 0 44 26'%3E%3Cpolyline points='2%2C2 22%2C24 42%2C2' fill='none' stroke='%23ee4024' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  will-change: transform;
  backface-visibility: hidden;
  animation: profileScrollBounce 1.5s ease-in-out infinite;
}

.profile-scroll-indicator.hidden::after {
  animation: none;
}

@keyframes profileScrollBounce {
  0%, 100% { transform: translateY(0);   }
  50%       { transform: translateY(6px); }
}

/* Align image column to the top of the flex row (not stretched to full row height) */
.glightbox-container .group-profile-top {
  display: flex !important;
  flex-direction: row !important;
  align-items: flex-start !important;
  gap: 1rem;
  margin: 0 !important;
}

.glightbox-container .group-profile-top-left {
  flex: 0 0 auto !important;
  width: auto !important;
  max-width: none !important;
  padding: 0 !important;
  align-self: flex-start !important;
}

.glightbox-container .group-profile-top-left img {
  display: block !important;
  width: 120px !important;
  height: 120px !important;
  object-fit: cover !important;
  margin: 0 !important;
}

.glightbox-container .group-profile-top-right {
  flex: 1 !important;
  padding: 0 !important;
  align-self: flex-start !important;
}

/* Remove default heading top margin so name aligns with top of image */
.glightbox-container .group-profile-top-right h2 {
  margin-top: 0 !important;
}

.glightbox-container .group-profile-top-right h4 {
  margin-top: 0 !important;
}

/* Contact link icons (phone, email, website) — inline row matching social icons */
.glightbox-container .profile-contact-links {
  display: flex;
  flex-direction: row;
  gap: 0.75rem;
  margin: 0.4rem 0;
}

.glightbox-container .profile-contact-link {
  font-size: 1.1rem;
  color: #555;
  text-decoration: none;
  transition: color 0.2s;
}

.glightbox-container .profile-contact-link:hover {
  color: #000;
}

/* On mobile stack the profile image above the text */
@media (max-width: 767px) {
  .glightbox-container .group-profile-top-left,
  .glightbox-container .group-profile-top-right {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    float: none;
  }

  .glightbox-container .group-profile-top-left img {
    max-width: 160px;
    margin: 0 auto 10px;
  }

  /* Larger, easier-to-tap contact icons on mobile */
  .glightbox-container .profile-contact-links {
    gap: 1.25rem;
    margin: 0.6rem 0;
  }

  .glightbox-container .profile-contact-link {
    font-size: 1.5rem;
    /* 44×44px minimum tap target (Apple HIG / WCAG 2.5.5) */
    display: inline-flex;
    align-items: center;
    justify-content: left;
    min-width: 44px;
    min-height: 44px;
  }
}
