/* Reset and base styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Georgia', serif;
  margin: 0;
  padding: 0;
}

/* Container */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Gallery container */
.gal-container {
  padding: 75px 12px;
}

/* Grid system replacement */
.col-md-4, .col-sm-6, .co-xs-12 {
  float: left;
  padding: 0 3px;
}

.col-md-4 {
  width: 33.333333%;
}

.col-md-8 {
  width: 66.666667%;
}

.col-md-12 {
  width: 100%;
}

/* Gallery items */
.gal-item {
  overflow: hidden;
  padding: 3px;
  margin-bottom: 6px;
}

.gal-item .box {
  height: 500px;
  overflow: hidden;
  position: relative;
}

.box img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.box img:hover {
  transform: scale(1.05);
}

/* Modal styles */
.modal {
  visibility: hidden;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  opacity: 0;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
  visibility: visible;
  opacity: 1;
}

.modal-dialog {
  position: relative;
  width: 90%;
  max-width: 90vw;
  max-height: 90vh;
  margin: 50px auto;
  transform: scale(0.1);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.show .modal-dialog {
  transform: scale(1);
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  width: fit-content;
  max-width: 100%;
}

.modal-body {
  padding: 0;
  position: relative;
}

.modal-body img {
  width: auto;
  height: auto;
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

/* Close button */
.close {
  position: absolute;
  width: 30px;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  z-index: 1001;
  right: -0px;
  top: -0px;
  box-shadow: 0 0 1px 1px rgba(0,0,0,0.35);
  transition: background-color 0.3s ease;
}

.close:hover {
  background-color: rgba(0, 0, 0, 0.5);
}

/* Navigation arrows */
.modal-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  background-color: rgba(0, 0, 0, 0.2);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  font-size: 20px;
  line-height: 15px;
  text-align: center;
  cursor: pointer;
  z-index: 1001;
  transition: background-color 0.3s ease;
  user-select: none;
}

.modal-nav:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.modal-nav.prev {
  left: 20px;
}

.modal-nav.next {
  right: 20px;
}

.modal-nav.hidden {
  display: none;
}

/* Description */
.description {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px 25px;
  background-color: rgba(0, 0, 0, 0.5);
  color: #fff;
}

.description h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.4;
}

/* Responsive design */
@media (max-width: 960px) {
  .col-md-4, .col-md-8, .col-md-12 {
    width: 100%;
  }
  
  .col-sm-6 {
    width: 50%;
  }
  
  .modal-dialog {
    width: 95%;
    margin: 20px auto;
  }
  
  .modal-content {
    height: auto;
  }
  
  .gal-item .box {
    height: 250px;
  }
}

@media (max-width: 600px) {
  .col-sm-6 {
    width: 100%;
  }
  
  .gal-container {
    padding: 50px 8px;
  }
}

/* Clear floats */
.gal-container::after {
  content: "";
  display: table;
  clear: both;
}