
a.lightbox img {
    margin: 20px 0;

    border: 3px solid white;
    box-shadow: 0 0 8px rgba(0,0,0,.3);
}

/* Styles the lightbox, removes it from sight and adds the fade-in transition */

.lightbox-target {
    position: fixed;
    top: -100%;
    left: 0;
    z-index: 9999;

    width: 100%;
    width: 100%;
    overflow: hidden;

    -webkit-transition: opacity .5s ease-in-out;
       -moz-transition: opacity .5s ease-in-out;
         -o-transition: opacity .5s ease-in-out;
            transition: opacity .5s ease-in-out;

    opacity: 0;
    background: rgba(0,0,0,.7);
}

/* Styles the lightbox image, centers it vertically and horizontally, adds the zoom-in transition and makes it responsive using a combination of margin and absolute positioning */

.lightbox-target img {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    max-width: 0;
    max-height: 0;
    margin: auto;
    box-sizing: border-box;

    -webkit-transition: .5s ease-in-out;
       -moz-transition: .5s ease-in-out;
         -o-transition: .5s ease-in-out;
            transition: .5s ease-in-out;

    border: 3px solid white;
    box-shadow: 0 0 8px rgba(0,0,0,.3);
}

/* Styles the close link, adds the slide down transition */

a.lightbox-close {
    position: absolute;
    top: -80px;
    right: 0;

    display: block;
    width: 50px;
    height: 50px;
    box-sizing: border-box;

    -webkit-transition: .5s ease-in-out;
       -moz-transition: .5s ease-in-out;
         -o-transition: .5s ease-in-out;
            transition: .5s ease-in-out;
    text-decoration: none;

    color: black;
    background: white;
}

/* Provides part of the "X" to eliminate an image from the close link */

a.lightbox-close:before {
    position: absolute;
    top: 10px;
    left: 26px;

    display: block;
    width: 1px;
    height: 30px;

    content: "";
    -webkit-transform: rotate(45deg);
       -moz-transform: rotate(45deg);
         -o-transform: rotate(45deg);
            transform: rotate(45deg);

    background: black;
}

/* Provides part of the "X" to eliminate an image from the close link */

a.lightbox-close:after {
    position: absolute;
    top: 10px;
    left: 26px;

    display: block;
    width: 1px;
    height: 30px;

    content: "";
    -webkit-transform: rotate(-45deg);
       -moz-transform: rotate(-45deg);
         -o-transform: rotate(-45deg);
            transform: rotate(-45deg);

    background: black;
}

/* Uses the :target pseudo-class to perform the animations upon clicking the .lightbox-target anchor */

.lightbox-target:target {
    top: 0;
    bottom: 0;

    opacity: 1;
}

.lightbox-target:target img {
    max-width: 100%;
    max-height: 100%;
}

.lightbox-target:target a.lightbox-close {
    top: 0;
}
