/* Custom fix for Cinema section biographical text */
#works .post-block {
  overflow: visible !important;
}

#works .post-block h6 {
  position: relative !important;
  display: block !important;
  overflow: visible !important;
  left: 0 !important;
  right: auto !important;
  font-size: 11px !important;
  line-height: 1.7 !important;
  color: #2e2e2e !important;
  margin: 0 !important;
  padding: 0 !important;
  text-align: left !important;
  font-weight: 400 !important;
  letter-spacing: 0.03em !important;
  text-transform: none !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* Fix Magnific Popup z-index to be above Bootstrap modals */
.mfp-bg,
.mfp-wrap {
  z-index: 100005 !important;
}

.mfp-arrow {
  z-index: 100006 !important;
}

/* Ensure the close button is on top */
.mfp-close {
  z-index: 100006 !important;
}

/* Force removal of lingering popup elements immediately */
.mfp-removing .mfp-container,
.mfp-removing.mfp-bg {
  opacity: 0 !important;
  transition: none !important;
}

/* Desktop Only Close Button (X) */
/* Desktop Only Close Button (X) */
.desktop-close-btn {
  position: absolute;
  /* Relative to page-title-content */
  top: 0;
  right: 0;
  font-size: 24px;
  color: #333;
  z-index: 9999;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none !important;
  display: none;
  /* Hidden by default (mobile) */
}

/* Ensure parent has relative positioning */
.page-title-content {
  position: relative !important;
  padding-right: 40px;
  /* Make space for the X so it doesn't overlap text */
}

.desktop-close-btn:hover {
  color: #000;
  transform: scale(1.1);
}

@media only screen and (min-width: 1024px) {
  .desktop-close-btn {
    display: block;
    /* Visible only on desktop */
  }
}

/* Centered Flexbox Grid for Editorial Images */
.editorial-grid {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 15px !important;
  column-count: auto !important;
  /* Override inline styles */
  margin-bottom: 40px !important;
}

.editorial-item {
  margin-bottom: 0 !important;
  /* Managed by gap */
  break-inside: auto !important;
  width: 100%;
  /* Default mobile */
}

@media (min-width: 768px) {
  .editorial-item {
    width: calc(25% - 15px) !important;
    /* 4 columns approx */
  }
}