
/* boxes & flex */
:root {
.box {
    padding: var(--spacing);
    border: var(--border);
    margin: var(--spacing) auto;
    border-radius: var(--border-radius);
    break-inside:avoid;
}

.flex {
    display: flex;
    flex-flow: row wrap;
    gap: var(--halfspacing) var(--spacing)
}

.flex > * {
    flex: 1 2 200px;
    margin:0 auto;
}
/* image gallery */
#gallery {
    margin: 5px;
    display: block;
    text-align: center;
    line-height: 1.2em;
    font-size: .9em;
}
#gallery.columns {
    columns: var(--minimum-img-width) var(--maximum-columns);
    gap: var(--column-gap);
}

#gallery img {
    margin: 5px;
    max-width: min(var(--maximum-img-width), 100%);
    display:block;
    background-color:var(--image-background)
}

#gallery img:first-of-type {
  margin-top: 0;
}

figure {
    margin: var(--spacing) auto;
    break-inside: avoid;
}

/* lightbox */
#gallery img:hover {
    border-radius: var(--border-radius);
    cursor: pointer;
    outline: var(--border)
}

#lightbox {
    border: none;
    outline: none;
}
#lightbox img {
  max-height:90vh;
  max-width:90vw;
}

::backdrop {
    backdrop-filter: blur(2px) brightness(80%);
}
#gallery:has(~ #lightbox:popover-open) {
    pointer-events: none;
}
/* makes the lightbox work on small screens, like phones */
@media only screen and (min-width: 600px) {
    #lightbox button {
        display: none;
    }
} 
@media only screen and (max-width: 600px) {
    #lightbox button {
        display: block;
        width:30px;
        height:30px;
        margin:10px auto;
    }
  
} 
css.moving-image {
  transition: transform 0.3s ease;
}

.moving-image:hover {
  /* Rotates the image 5 degrees clockwise */
  transform: rotate(5deg); 
}