/* Gallery fallback: photographs remain visible while Elementor initializes or if it fails. */
.elementor-gallery__container:not(.e-gallery-container){
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
}
.elementor-gallery__container:not(.e-gallery-container) .e-gallery-item{
  position:relative !important;
  display:block;
  width:auto !important;
  height:auto !important;
  min-width:0;
  transform:none !important;
}
.elementor-gallery__container:not(.e-gallery-container) .e-gallery-image{
  position:relative !important;
  display:block;
  width:100% !important;
  height:auto !important;
  inset:auto !important;
}
.elementor-gallery__container .e-gallery-image > img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
@media(max-width:1024px){
  .elementor-gallery__container:not(.e-gallery-container){grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
}
@media(max-width:767px){
  .elementor-gallery__container:not(.e-gallery-container){grid-template-columns:1fr;gap:10px}
}

/* Project galleries: native columns pack unequal image heights without empty grid cells. */
@media(min-width:1025px){
  body.single-obra .elementor-319 .elementor-element.elementor-element-8303cfc{
    --min-height:145px;
  }
}
body.single-obra .elementor-gallery__container{
  display:block !important;
  columns:3;
  column-gap:5px;
  height:auto !important;
  padding-bottom:0 !important;
}
body.single-obra .elementor-gallery__container .e-gallery-item{
  display:block !important;
  position:relative !important;
  top:auto !important;
  left:auto !important;
  width:100% !important;
  height:auto !important;
  margin:0 0 5px !important;
  break-inside:avoid;
  transform:none !important;
}
body.single-obra .elementor-gallery__container .e-gallery-image{
  display:block !important;
  position:relative !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:auto !important;
  padding:0 !important;
  min-height:0 !important;
  background:none !important;
}
body.single-obra .elementor-gallery__container .e-gallery-image > img{
  display:block;
  width:100%;
  height:auto !important;
  object-fit:contain;
}
@media(max-width:1024px){
  body.single-obra .elementor-gallery__container{columns:2;column-gap:10px}
  body.single-obra .elementor-gallery__container .e-gallery-item{margin-bottom:10px !important}
}
@media(max-width:767px){
  body.single-obra .elementor-gallery__container{columns:1}
}

/* Static, balanced masonry for project pages. */
.ocda-project-gallery{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:5px;
  align-items:start;
}
.ocda-project-column{
  display:flex;
  flex-direction:column;
  gap:5px;
  min-width:0;
}
.ocda-project-item,.ocda-project-image{display:block;position:relative;min-width:0}
.ocda-project-image>img{display:block;width:100%;height:auto;max-width:100%}
@media(max-width:1024px){
  .ocda-project-gallery{display:block;columns:2;column-gap:10px}
  .ocda-project-column{display:contents}
  .ocda-project-item{break-inside:avoid;margin-bottom:10px}
}
@media(max-width:767px){
  .ocda-project-gallery{columns:1}
}
