/* =====================================================================
   ext.css - the few things the original theme got from jQuery plugins
   (CubePortfolio runtime classes + Fancybox overlay). Loaded after the
   original stylesheet so it can only add, never reset.
   ===================================================================== */

/* CubePortfolio: original .cbp-item is position:absolute inside .cbp */
.cbp-wrapper {
  position: relative;
  display: block;
  width: 100%;
}

#grid-container .cbp-item {
  float: none;
  /* the site's own cubeportfolio config uses gapHorizontal/gapVertical: 0 */
  margin: 0;
  padding: 0;
  transition: opacity 0.2s ease;
}

#grid-container .cbp-item-off {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

#grid-container img {
  display: block;
  width: 100%;
  height: auto;
}

/* CubePortfolio caption overlay: the plugin hides the active wrap until
   hover (.cbp-ready + .cbp-caption-zoom rules in the original stylesheet).
   Do NOT force opacity here, or every tile shows its blue overlay. */
#grid-container .cbp-caption {
  position: relative;
  overflow: hidden;
}

/* Lightbox (replacement for fancybox used by .cbp-lightbox) */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.85);
  padding: 40px;
}

.lightbox-overlay.open {
  display: flex;
}

.lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
}

.lightbox-inner img {
  display: block;
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
}

.lightbox-close {
  position: absolute;
  top: -34px;
  right: -6px;
  color: #fff;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  font-family: Arial, sans-serif;
}

body.lightbox-lock {
  overflow: hidden;
}

/* Modal used by the contact form result (original used jquery-modal) */
#modal1 {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 99999;
  background: #fff;
  padding: 40px 60px;
  border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.35);
  max-width: 90vw;
}

#modal1 h1 {
  font-size: 22px;
  margin: 0;
}
