/* ============================= */
/* Global Container */
/* ============================= */
.container {
  width: 90%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ============================= */
/* Header */
/* ============================= */
.header {
  background: var(--color-primary-dark);
  padding: 1rem 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ============================= */
/* Main Content */
/* ============================= */
.main-content {
  padding: 3rem 0 6rem;
}

/* ============================= */
/* Intro Section */
/* ============================= */
.intro-section {
  text-align: center;
  margin-bottom: 3rem;
}

.intro-title {
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  letter-spacing: 2px;
}

.intro-text {
  font-size: 1.125rem;
  color: var(--color-grey-dark);
  max-width: 700px;
  margin: 0 auto;
  font-weight: 500;
}

/* ============================= */
/* Subfolder Title */
/* ============================= */
.subfolder-title {
  margin-top: 3rem;
  margin-bottom: 1rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
  border-bottom: 3px solid var(--color-primary-light);
  padding-bottom: 0.5rem;
  user-select: none;
}

/* ============================= */
/* Masonry Grid */
/* ============================= */
.masonry-grid {
  column-count: 3;
  column-gap: 1.5rem;
  max-width: 1200px;
  margin: 0 auto 4rem;
  padding: 0 1rem;
}

@media (max-width: 992px) {
  .masonry-grid {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .masonry-grid {
    column-count: 1;
  }
}

/* ============================= */
/* Portfolio Card */
/* ============================= */
.portfolio-card {
  background-color: var(--color-bg-light);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 8px var(--shadow-light);
  margin-bottom: 1.5rem;
  overflow: hidden;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
  outline-offset: 4px;
}

.portfolio-card:hover,
.portfolio-card:focus-visible {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 8px 16px var(--shadow-strong);
  outline: none;
}

.portfolio-image,
.portfolio-video {
  width: 100%;
  display: block;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  object-fit: contain;
  transition: transform var(--transition-speed);
}

.portfolio-card:hover .portfolio-image,
.portfolio-card:hover .portfolio-video {
  transform: scale(1.05);
}

.portfolio-video {
  max-height: 300px;
  object-fit: cover;
  cursor: pointer;
}

.portfolio-info {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
}

.portfolio-name {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--color-primary-dark);
  margin-bottom: 0.5rem;
  user-select: none;
}

.portfolio-title {
  font-size: 0.95rem;
  color: var(--color-grey-dark);
  user-select: none;
}

/* ============================= */
/* Lightbox */
/* ============================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  user-select: none;
}

.lightbox.active {
  display: flex;
}

.lightbox-img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain; /* ✅ Ensures entire image is visible, keeps aspect ratio */
  border-radius: var(--border-radius, 12px); /* fallback if --border-radius not defined */
  box-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
  display: block;
  margin: 0 auto;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.3);
  border: none;
  color: var(--color-text-dark);
  font-size: 2.5rem;
  padding: 0.3rem 0.8rem;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.lightbox-close {
  top: 1rem;
  right: 1rem;
  transform: none;
  font-size: 2rem;
  color: var(--color-text-light);
  background: rgba(0, 0, 0, 0.5);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-text-dark);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

/* ============================= */
/* Image Grid */
/* ============================= */
.image-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.image-card {
  background: var(--color-bg-light);
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  max-width: 320px;
  flex: 1 1 320px;
  transition: transform var(--transition-speed);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
}

.image-card:hover {
  transform: scale(1.04);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-card img,
.image-card video {
  width: 100%;
  display: block;
  border-bottom: 4px solid var(--color-primary-light);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  background: var(--color-grey-light);
}

.image-caption {
  padding: 1rem 1rem 0.5rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  font-size: 1.1rem;
  text-align: center;
}

.image-description {
  padding: 0 1rem 1rem;
  font-size: 0.96rem;
  color: var(--color-grey-dark);
  text-align: center;
}

/* ============================= */
/* Fullscreen Overlay */
/* ============================= */
.image-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: grab;
}

.image-overlay.active {
  display: flex;
}

.image-overlay img {
  display: block;
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain; /* ✅ Keeps full image visible without distortion */
  border-radius: var(--border-radius, 12px); /* Fallback value for robustness */
  user-select: none;
  cursor: grab; /* Good for drag interactions or zoom features */
  margin: 0 auto; /* Center the image horizontally */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5); /* Optional: adds visual separation from background */
}

.image-overlay .close-btn {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--color-text-light);
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10000;
}

/* ============================= */
/* Responsive */
/* ============================= */
@media (max-width: 900px) {
  .image-grid {
    gap: 1rem;
  }

  .image-card {
    max-width: 47%;
  }
}

@media (max-width: 600px) {
  .image-grid {
    gap: 1rem;
  }

  .image-card {
    max-width: 100%;
  }

  .intro-title {
    font-size: 2.25rem;
  }

  .subfolder-title {
    font-size: 1.5rem;
  }
}



