/*
 * CSS para o plugin Anúncios FC
 * Versão com Grelha Responsiva (Grid Layout)
 */

.anuncios-fc-container {
    display: grid; /* 1. Transforma o container numa grelha CSS */
    
    /* 2. Define que teremos 4 colunas de fração igual (1fr) do espaço disponível */
    grid-template-columns: repeat(4, 1fr); 
    
    gap: 20px; /* 3. Mantém o espaço de 20px entre todos os itens da grelha */
    margin: 20px 0;
}

.anuncio-item {
    /* Já não precisamos de uma largura fixa (width), a grelha controla isso agora */
    text-align: center;
    border: 1px solid #eee;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.anuncio-item img {
    max-width: 100%;
    width: 160px;
    height: 160px;
    object-fit: cover;
    margin-bottom: 15px;
    align-self: center;
}

.anuncio-item .anuncio-titulo {
    font-size: 16px;
    margin: 0 0 10px 0;
    line-height: 1.3;
}

.anuncio-item .anuncio-titulo a {
    text-decoration: none;
    color: #2162a1;
    transition: color 0.2s ease-in-out;
}

.anuncio-item .anuncio-titulo a:hover {
    color: red;
}

.anuncio-item .anuncio-preco {
    font-size: 12px;
    font-weight: bold;
    color: #222;
    margin: 0;
}

/* MEDIA QUERY ATUALIZADA E SIMPLIFICADA */
/* Estas regras aplicam-se a ecrãs com largura MÁXIMA de 992px (tablets e telemóveis) */
@media (max-width: 992px) {
    .anuncios-fc-container {
        /* Define 2 colunas para tablets e telemóveis */
        grid-template-columns: repeat(2, 1fr);
    }
}