* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f9f9f9;
    padding: 140px 0 0; /* remove bottom padding so footer sits flush to page bottom */
}

.gallery-title {
    text-align: center;
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 40px;
}

.gallery-title span {
    color: #f05a22; /* AIC-SOA Orange */
}

/* The Grid Layout */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    max-width: 1300px;
    margin: 0 auto 48px; /* add bottom space so footer doesn't crowd images */
    padding: 0 20px;
}

/* Individual Image Card */
.gallery-card {
    position: relative;
    height: 220px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* FIXES RESOLUTION: All images fill the box perfectly */
    transition: transform 0.5s ease;
}

/* THE HOVER OVERLAY (Matches Video) */
.hover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(240, 90, 34, 0.85); /* Orange background with transparency */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transform: translateY(100%); /* Start below the card */
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-overlay span {
    color: white;
    font-weight: bold;
    border: 2px solid white;
    padding: 8px 15px;
    letter-spacing: 1px;
}

/* Caption Bar at bottom */
.caption-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-size: 0.8rem;
    text-align: center;
}

/* Hover States */
.gallery-card:hover {
    transform: translateY(-5px);
}

.gallery-card:hover .hover-overlay {
    opacity: 1;
    transform: translateY(0); /* Slides up into view */
}

.gallery-card:hover img {
    transform: scale(1.1);
}

/* --- LIGHTBOX STYLES --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
}

#lightbox-img {
    max-width: 90%;
    max-height: 80vh;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
    animation: zoomIn 0.3s ease;
}

.close-btn {
    position: absolute;
    top: 30px;
    right: 40px;
    color: white;
    font-size: 50px;
    cursor: pointer;
}

@keyframes zoomIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}