/* Reset básico */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #1a1a1a;
    color: #f0f0f0;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 300;
    letter-spacing: 2px;
}

header p {
    color: #aaa;
    margin-top: 10px;
}

/* Grid da Galeria */
.gallery-container {
    display: grid;
    /* Cria colunas responsivas automaticamente */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.gallery-item:hover {
    transform: scale(1.02);
}

.gallery-item img {
    width: 100%;
    height: 300px; /* Altura fixa para manter o grid alinhado */
    object-fit: cover; /* Corta a imagem para preencher sem distorcer */
    display: block;
}

/* Efeito de Overlay (Texto sobre a imagem ao passar o mouse) */
.overlay {
    position: absolute;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7); /* Fundo preto semitransparente */
    color: #f1f1f1;
    width: 100%;
    padding: 10px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
    opacity: 1;
}

/* --- Estilos do Modal (Lightbox) --- */
.modal {
    display: none; /* Escondido por padrão */
    position: fixed;
    z-index: 1000;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9); /* Fundo bem escuro */
}

/* Conteúdo do Modal */
.modal-content-wrapper {
    margin: auto;
    display: block;
    width: 80%;
    max-width: 800px;
    text-align: center;
}

.modal-content {
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
    animation-name: zoom;
    animation-duration: 0.6s;
}

/* Legendas no modal */
#caption {
    margin-top: 15px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ccc;
}

#description {
    margin-top: 5px;
    font-size: 1rem;
    color: #888;
    font-style: italic;
}

/* Botão Fechar */
.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #bbb;
}

/* Animação de Zoom ao abrir */
@keyframes zoom {
    from {transform:scale(0)}
    to {transform:scale(1)}
}

/* Responsividade para celulares */
@media only screen and (max-width: 700px){
    .modal-content {
        width: 100%;
    }
}