/* 1. The Lightbox Container */
.lightbox-container {
  /* Hidden by default, using display for easy toggling */
  display: none; 
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;

  /* Black background with 90% opacity as requested */
  background: rgba(0, 0, 0, 0.9);

  /* Use flexbox for perfect vertical and horizontal centering */
  display: flex;
  align-items: center;
  justify-content: center;
  
  /* Hide it by default with a fade effect */
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* The state when the lightbox is active */
.lightbox-container.is-visible {
  opacity: 1;
  visibility: visible;
}

/* 2. The Lightbox Content Wrapper */
.lightbox-content {
  position: relative;
  
  /* Responsive sizing */
  max-width: 90vw;   /* 90% of viewport width */
  max-height: 90vh; /* 90% of viewport height */
  
  /* A subtle zoom-in animation */
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

.is-visible .lightbox-content {
  transform: scale(1);
}

/* The image itself */
.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  border-radius: 4px; /* A touch of softness */
}


/* 3. The Close Button */
.lightbox-close {
  /* Positioning */
  position: absolute;
  top: -1rem;
  right: -1rem;
  
  /* Sizing */
  width: 2.1rem;
  height: 2.1rem;
  
  /* Reset button styles */
  border: none;
  padding: 0;
  
  /* iOS-style appearance */
  background-color: rgba(60, 60, 67, 0.8); /* System Gray with translucency */
  backdrop-filter: blur(10px); /* Frosted glass effect for modern browsers */
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%; /* Perfect circle */
  cursor: pointer;
  
  /* Ensure it's on top */
  z-index: 10;
  
  /* Smooth transitions */
  transition: transform 0.2s ease, background-color 0.2s ease;
}

/* The 'X' glyph inside the button */
.lightbox-close::before {
  content: '×'; /* The 'times' character */
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 2rem;
  font-weight: 300;
  color: white;
  
  /* Centering the glyph */
  display: block;
  line-height: 0.5rem;
  text-align: center;
  position: relative;
  bottom: 0.1rem;
}

/* A subtle hover/active effect */
.lightbox-close:hover {
  transform: scale(1.1);
  background-color: rgba(80, 80, 87, 0.8);
}