header {
    background-color: #4CAF50;
    color: white;
    padding: 1em 0;
    text-align: center;
}

h1 {
    margin: 0; /* Removes default margins */
}

/* Apply flexbox to the entire page */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure the body covers the full viewport height */
    margin: 0; /* Remove default body margins */
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    background: linear-gradient(to bottom, #f9f9f9, #ffffff);
    color: #333;
}

/* Main content grows to fill available space */
main {
    flex: 1; /* Allows the main content to take up remaining space */
}

/* Footer styling */
footer {
    text-align: center; /* Center the text */
    padding: 10px 0;
    background-color: #f1f1f1; /* Optional: Light background color */
    border-top: 1px solid #ddd; /* Optional: Top border for separation */
}

/* Default styles for larger screens */
.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 cards per row by default */
    gap: 20px; /* Space between cards */
    padding: 20px;
    justify-items: center; /* Centers the cards within their columns */
}

.card {
    background: white;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 90%; /* Limits the card width */
    max-width: 300px; /* Ensures cards aren't too wide */
}

.card img {
    max-width: 100%;
    border-bottom: 1px solid #ddd;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.card h2 {
    margin: 10px 0;
    font-size: 1.1em; /* Adjusted font size for smaller cards */
}

/* Medium screens (tablets): 2 cards per row */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr); /* 2 cards per row */
    }
}

/* Small screens (mobile): 1 card per row */
@media (max-width: 480px) {
    .gallery {
        grid-template-columns: 1fr; /* 1 card per row */
    }
}

.card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

a:hover {
    color: #007BFF; /* Add a distinct hover color */
    text-decoration: underline;
}

.card {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-in-out forwards;
}
@keyframes fadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
