.gallery {
  overflow: hidden;
  background-color: #333;
  border: 4px solid #000;
  width: 28%;
  height: auto;
  float: left;
  position: relative;
  margin: 2%;
}

.gallery p {
  margin: 0;
}

.gallery.end {
  margin-right: 0;
}

.gallery .thmb {
  overflow: hidden;
  width: 100%;
  height: auto;
  background: #fff;
}

.gallery .thmb img {
  float: none;
  margin: 0;
  padding: 0;
  width: 100%;
  height: auto;
}

.gallery .title {
  margin-top: 2px;
  background-color: #333;
  position: absolute;
  bottom: 0;
  margin-bottom: 0;
  padding: 5px;
  border-top: 1px solid #313131;
  display: block;
  width: 100%;
}

.gallery .title a {
  color: #ccc;
  text-decoration: none;
}

.gallery .title a:hover {
  background-color: transparent;
  text-decoration: none;
  color: #fff;
}

.photo {
  position: relative;
  width: 23%;
  height: auto;
  overflow: hidden;
  float: left;
  margin-right: 2.5%;
  margin-bottom: 2.5%;
  background: #222;
}
.photo img {
  width: 100%;
  height: auto;
}

.photo.end {
  margin-right: 0;
}

.photo a {
  display: block;
}

.photo img {
  float: none;
  margin: 0;
  padding: 0;
}

.photo .title {
  position: absolute;
  bottom: 0;
  left: 0;
  background-color: #000;
  color: #fffeff;
  padding: 5px;
  display: block;
  width: 100%;
  margin: 0;
}

/* =Override
---------------------------------------------------------------------
*/
.content {
  position: relative;
}

/* Medium Break */
@media (max-width: 58.75em) {
  .photo {
    width: 28%;
    height: auto;
    margin: 2.5% !important;
  }
  .photo img {
    width: 100%;
    height: auto;
  }
}
/* Small Break */
@media (max-width: 40em) {
  .photo {
    width: 100%;
    height: auto;
    margin: 0 0 10px 0 !important;
  }
  .photo img {
    width: 100%;
    height: auto;
  }

  .gallery {
    width: 95%;
    margin: 5px auto;
  }
  .gallery img {
    width: 100%;
    height: auto;
  }
}
