/* Practice_Solutions/HTML_CSS/Grid_Gallery_Solution.css */

body {
    font-family: Arial, sans-serif;
    margin: 0;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

header {
    text-align: center;
    padding: 40px 20px;
    background-color: #282c34;
    color: #fff;
}

.gallery-container {
    display: grid;
    /* Responsive grid:
       - auto-fit: tries to fit as many columns as possible.
       - minmax: columns will be at least 200px wide, but can grow up to 1fr (equal fraction of available space). */
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px; /* Space between grid items */
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
}

.gallery-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    text-align: center;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: translateY(-5px);
}

.gallery-item img {
    width: 100%;
    height: 200px; /* Fixed height for images */
    object-fit: cover; /* Ensures images fill the space without distortion */
    display: block;
}

.caption {
    padding: 15px;
    font-weight: bold;
    color: #555;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #282c34;
    color: #fff;
    margin-top: 40px;
}
