div.gallery {
  border: 2px solid #ccc;
  border-radius: 12px;
  margin-bottom: 12px;
}

div.gallery:hover {
  border: 2px solid #333;
}

div.gallery img {
  width: 100%;
  height: auto;
  border-radius: 10px 10px 0px 0px;
}

div.desc {
  padding: 6px;
  min-height: 70px;
  font-size: 11px;
  text-align: left;
  vertical-align: middle;
}

* {
  box-sizing: border-box;
}

.responsive {
  padding: 0 6px;
  float: left;
  width: 24.99999%;
}

@media only screen and (max-width: 1250px) {
  .responsive {
    width: 33.33333%;
    margin: 6px 0;
  }
}

@media only screen and (max-width: 900px) {
  .responsive {
    width: 49.99999%;
    margin: 6px 0;
  }
}

@media only screen and (max-width: 600px) {
  .responsive {
    width: 100%;
  }
}

.clearfix:after {
  content: "";
  display: table;
  clear: both;
}

/***********************************************************************/

/* for lightbox effect: x > y is child selector, x + y is adjacent sibling */
/* https://milania.de/blog/CSS_lightbox_without_JavaScript_realized_with_a_hidden_input_element */

/* Default state */
.lightbox {
    /* Hide the input element */
    display: none;
    
    /* The input element should not be selectable (would only cause the image to be selected unintentionally) */
    /* https://stackoverflow.com/a/4407335/2762258 */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
.lightbox + label {
    /* Images should appear clickable (like a link) */
    cursor: pointer;
}
.lightbox + label + img {
    /* Background image is hidden on default (since there is already an image shown in the article) */
    display: none;
}

/* Checked state */
.lightbox:checked + label + img {
    /* Show the image in the text (both images should be visible) */
    display: block;
}
.lightbox:checked + label {
    /* Fade out the rest of the site so that the image appears in front */
    background: rgba(0,0,0,0.8);
    outline: none;

    /* Make sure that the lightbox is visible in front and fills the complete screen */
    position: fixed;
    z-index: 999;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;

    display: flex;              /* Allows easy alignment */
    justify-content: center;    /* Align vertically */
    align-items: center;        /* Align horizontally */
    
    /* The label element should also not be selectable */
    -webkit-touch-callout: none; /* iOS Safari */
    -webkit-user-select: none; /* Safari */
    -khtml-user-select: none; /* Konqueror HTML */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* Internet Explorer/Edge */
    user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */
}
.lightbox:checked + label > img {
    /* Show the image on a white background (better for transparent images) */
    background: white;
    border-radius: 10px;

    /* Reset resolution to default */
    width: auto !important;
    height: auto !important;

    /* Don't fill the complete screen with the image, it should always be a bit from the site visible */
    max-width: 90%;
    max-height: 90%;
    
   /* Remove any outer filling which might lead to white borders (due to the background filling) */
    padding: 0;
    margin: 0;
    
    /* Prevent that the title attribute of the image gets shown so that the title attribute of the label can be shown instead */
    pointer-events: none;
}
