/* Styling for gallery.php page */

body {
    background-color: #f8f9fa; /* A slightly off-white background */
}

.gallery-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
}

.gallery-title {
    text-align: center;
    margin-bottom: 3rem;
}

.gallery-title h1 {
    font-size: 2.8rem;
    color: #1e3a8a; /* Dark Blue */
    margin-bottom: 0.5rem;
}

.gallery-title p {
    font-size: 1.1rem;
    color: #6c757d; /* Muted gray text */
}

.gallery-grid {
    display: grid;
    /* Create 3 columns, or 2 on smaller screens, or 1 on mobile */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-item {
    background-color: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.07);
    overflow: hidden; /* Important for the border-radius on the image */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
}

.image-container {
    position: relative; /* Needed for the overlay */
    height: 250px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image covers the area without distortion */
    display: block;
}

.gallery-item h3 {
    padding: 1rem 1.25rem;
    margin: 0;
    font-size: 1.1rem;
    color: #333;
    background-color: #ffffff;
    text-align: center;
}

/* --- The Hover Overlay --- */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 58, 138, 0.85); /* Dark blue with transparency */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Hidden by default */
    transition: opacity 0.4s ease;
}

.gallery-item:hover .overlay {
    opacity: 1; /* Becomes visible on hover */
}

.view-button {
    background-color: #ffffff;
    color: #1e3a8a;
    font-weight: bold;
    padding: 10px 30px;
    border-radius: 50px; /* Pill shape */
    text-decoration: none;
    transform: scale(0.9);
    transition: transform 0.4s ease;
}

.gallery-item:hover .view-button {
    transform: scale(1); /* Scales up on hover */
}

/* --- Modal (Pop-up) Styles --- */

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0, 0, 0, 0.9); /* Black w/ opacity */
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex; /* Shown when active */
}

.modal-content {
    margin: auto;
    display: block;
    max-width: 80%;
    max-height: 80%;
    animation: zoomIn 0.4s ease;
}

.close-button {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close-button:hover,
.close-button:focus {
    color: #bbb;
    text-decoration: none;
}

/* Animation for the pop-up */
@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}