/* =================================================== */
/* ESTÁGIO 1: CELULAR E TABLET (BASE)                  */
/* =================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    overflow-x: hidden; 
}

body {
    margin: 0;
    font-family: sans-serif;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem; 
    overflow-x: hidden; 
}

.background-image {
    background-image: url('images/fundomobile1.jpg');
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.container {
    width: 100%;
    max-width: 600px; 
    margin: 0 auto;
}

.top-banners-wrapper {
    display: block; 
    margin-bottom: 0.5rem;
    width: 100%; 
}

.top-banner-link {
    display: block;
    margin-bottom: 0.5rem; 
    overflow: hidden; 
    border-radius: 1.25rem; 
}

.top-banner-link img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.2s ease;
}

/* --- SOLUÇÃO PARA COLUNAS IDÊNTICAS --- */
.links-grid {
    display: grid;
    /* 1fr 1fr divide o espaço em duas partes rigorosamente iguais */
    grid-template-columns: 1fr 1fr; 
    /* O gap é a única forma de dar espaço sem quebrar o tamanho das colunas */
    gap: 0.5rem; 
    width: 100%;
}

.links-grid a {
    display: block;
    width: 100%; /* Garante que o link ocupe toda a coluna do grid */
    overflow: hidden; 
    border-radius: 0.625rem;
    /* Forçamos a remoção de qualquer margem manual que venha de outros códigos */
    margin: 0 !important; 
}

.links-grid img {
    width: 100%;
    /* Aspect-ratio garante que a altura também seja igual em todos */
    aspect-ratio: 16 / 9; 
    object-fit: cover;
    display: block;
    transition: transform 0.2s ease;
}

.top-banner-link:hover img,
.links-grid a:hover img {
    transform: scale(1.05);
}

.pc-photo {
    display: none;
}

/* =================================================== */
/* ESTÁGIO 2: PC / TELAS LARGAS                        */
/* =================================================== */
@media (min-width: 64rem) { 
    .background-image {
        background-image: url('images/fundonovo.jpg');
        background-position: center right; 
    }

    .pc-photo {
        display: block;
        position: fixed;
        right: 0;
        top: 0;
        width: 50vw;
        height: 100vh;
        background-image: url('images/pc-photo.jpg');
        background-size: cover;
    }

    .container {
        position: absolute;
        left: 5%;
        top: 50%;
        transform: translateY(-50%);
        width: 60vw; 
        max-width: none; 
        display: flex;
        flex-direction: column;
    }

    .top-banners-wrapper {
        display: flex; 
        flex-direction: row; 
        gap: 0.75rem; 
        margin-bottom: 0.75rem;
    }

    .top-banner-link {
        flex: 1;
        margin-bottom: 0;
    }

    .links-grid {
        /* Grid 4x3 no PC conforme solicitado */
        grid-template-columns: repeat(4, 1fr); 
        gap: 0.75rem; 
    }

    .links-grid img {
        aspect-ratio: 16 / 9; 
    }
}