
/* Portfolio Gallery Fixes */
.portfolio-items .col {
  display: inline-block;
  vertical-align: top;
  margin-bottom: 30px;
}

.portfolio-items[data-col-num="3"] .col {
  width: 31.333%;
  margin-right: 3%;
}

.portfolio-items[data-col-num="3"] .col:nth-child(3n) {
  margin-right: 0;
}

.portfolio-items .inner-wrap {
  position: relative;
  overflow: hidden;
}

.portfolio-items .portfolio-image {
  display: block;
  width: 100%;
  height: auto;
}

/* Fix overlapping issues */
.wpb_row .portfolio-items {
  clear: both;
}

.portfolio-items::after {
  content: "";
  display: table;
  clear: both;
}

/* Ensure proper spacing */
.portfolio-items[data-gutter-size="3"] .col {
  padding: 0 15px;
}

@media only screen and (max-width: 768px) {
  .portfolio-items[data-col-num="3"] .col {
    width: 48%;
    margin-right: 4%;
  }
  
  .portfolio-items[data-col-num="3"] .col:nth-child(2n) {
    margin-right: 0;
  }
  
  .portfolio-items[data-col-num="3"] .col:nth-child(3n) {
    margin-right: 4%;
  }
}

@media only screen and (max-width: 480px) {
  .portfolio-items[data-col-num="3"] .col {
    width: 100%;
    margin-right: 0;
  }
}