#gallery .grid{
  display: flex;
}
#gallery .grid .layout{
  width: 100%;
  margin: 0px;
}
#gallery .grid .text-overlay{
  font-size: 16px;
}
#gallery .layout{
  cursor: pointer;
}
.modal-bar-close{
  cursor: pointer;
}
#gallery .gallery{
  width: 100%;
}
/* Gallery/Media Page - Complete Modern Redesign */
.gallery-section-modern {
  padding: 100px 0;
  background: linear-gradient(180deg, #fafafa 0%, #ffffff 100%);
}

.gallery-grid-modern {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
  margin-top: 60px;
}

.gallery-item-modern {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(66, 42, 20, 0.12);
  border: 1px solid rgba(66, 42, 20, 0.1);
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  aspect-ratio: 1;
  background: #f5f5f5;
}

.gallery-item-modern:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(66, 42, 20, 0.2);
  border-color: #422A14;
}

.gallery-image-modern {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition);
}

.gallery-item-modern:hover .gallery-image-modern {
  transform: scale(1.1);
}

.gallery-overlay-modern {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(66, 42, 20, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: var(--transition);
}

.gallery-item-modern:hover .gallery-overlay-modern {
  opacity: 1;
}

.gallery-overlay-modern i {
  color: #fff;
  font-size: 40px;
  transform: scale(0.8);
  transition: var(--transition);
}

.gallery-item-modern:hover .gallery-overlay-modern i {
  transform: scale(1);
}

@media (max-width: 768px) {
  .gallery-grid-modern {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }
}

#gallery .grid .layout {
  width: calc(100% / 4 - 2px);
  height: 550px;
  margin: 1px;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(66, 42, 20, 0.1);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid rgba(66, 42, 20, 0.1);
}

#gallery .grid .layout:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 32px rgba(66, 42, 20, 0.2);
  border-color: #422A14;
  z-index: 1;
}
#gallery .grid .grid-item{
  position: absolute;
  top: 50%;
  width: auto;
  height: 100%;
  left: 50%;
  min-width: 100%;
  margin: 0px;
}
#gallery .grid .text-overlay{
  position: absolute;
  width: 100%;
  height: auto;
  background: linear-gradient(0deg, rgba(66, 42, 20, 0.95) 0%, rgba(66, 42, 20, 0.8) 40%, transparent 100%);
  color: #fff;
  bottom: 0;
  padding: 25px 20px;
  text-transform: none;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.5px;
  opacity: 0;
  transition: all ease 0.4s;
  padding-top: 200px;
}

#gallery .grid .layout:hover .text-overlay {
  opacity: 1;
}
#gallery .grid{
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  min-width: 100%;

}
#gallery{
  padding-top: 0px;
  margin-top: 0;
}

@media (max-width: 1024px) {
  #gallery .grid .layout {
    width: calc(100% / 3 - 2px);
    height: 450px;
  }
}

@media (max-width: 768px) {
  #gallery .grid .layout {
    width: calc(100% / 2 - 2px);
    height: 400px;
  }
}

@media (max-width: 480px) {
  #gallery .grid .layout {
    width: 100%;
    height: 350px;
    margin: 5px 0;
  }
}
.materialboxed{
  transform: translate(-50%, -50%);
}
.materialboxed.active{
  transform: none;
}