body {
    margin: 0;
    padding: 20px;
    background-color: #f4f4f4;
}

figcaption {
  text-align: center;
}

.gallery-container {
    display: grid;
    /* Creates as many columns as possible with a minimum width of 250px */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); /*was auto-fit, 200px */
    gap: 15px; /* Adds space between grid items */
    max-width: 1200px; /* was 1200 */
    margin: 0 auto; /* Centers the gallery container */
}

.gallery-item {
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: #fff;
}

.gallery-item:hover {
    transform: scale(1.05); /* Subtle hover effect 1.03 */
}

.gallery-item img,
.gallery-item video,
.gallery-item iframe {
    width: 100%;
    height: 250px; /* Makes media fill the item container, was 200px */
    object-fit: cover; /* Ensures images and videos cover the area without stretching */
    display: block;
}

/* Specific styling for embedded videos to maintain aspect ratio */
.gallery-item iframe {
    aspect-ratio: 4 / 3; /* Common aspect ratio for videos */
    height: auto;
}
