@font-face {
    font-family: "Majesty";
    src: url("fonts/majesty-black.otf") format("opentype");
}

@font-face {
    font-family: "Satosh";
    src: url("fonts/Satoshi-Bold.otf") format("opentype");
    font-weight: 900;
}

:root {
    --colunas: 4;
    --gap: 16px;
    --margem: clamp(16px, 4vw, 60px);
}

body {
    margin: 0;
    background-color: rgb(12, 12, 12);
    color: white;
}

.topo {
    text-align: center;
    padding: 50px 20px 45px;
}

.topo a {
    text-decoration: none;
    color: white;
}

.topo h1 {
    margin: 0;
    font-family: "Majesty", sans-serif;
    font-weight: normal;
    font-size: clamp(44px, 8vw, 90px);
}

/* o wrapper existe só para medir a largura (cqw) e calcular a altura das linhas */
.galeria-wrap {
    container-type: inline-size;
    margin: 0 var(--margem) 80px;
}

/* grade única com todos os ensaios; a posição de cada foto é definida pelo JavaScript */
.galeria {
    display: grid;
    grid-template-columns: repeat(var(--colunas), 1fr);
    gap: var(--gap);

    /* altura de cada linha = altura de uma foto vertical 3:4 */
    grid-auto-rows: calc((100cqw - (var(--colunas) - 1) * var(--gap)) / var(--colunas) * 4 / 3);
}

.foto {
    overflow: hidden;
}

.foto img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vazio {
    grid-column: 1 / -1;
    text-align: center;
    font-family: "Satosh", sans-serif;
    font-weight: 300;
    font-size: 18px;
    opacity: 0.6;
    padding: 0 20px;
}

/* ===== BOTÃO VOLTAR AO SITE ===== */
.voltar-linha {
    margin: 0 var(--margem) 80px;
}

.voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-family: "Satosh", sans-serif;
    font-weight: 900;
    font-size: 20px;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.voltar:hover {
    opacity: 1;
}

.voltar:hover svg {
    transform: translateX(-4px);
}

.voltar svg {
    transition: transform 0.2s;
}

@media (max-width: 1100px) {
    :root {
        --colunas: 3;
    }
}

@media (max-width: 700px) {
    :root {
        --colunas: 2;
        --gap: 10px;
    }
}

/* ===== TELA CHEIA ===== */
.foto {
    cursor: pointer;
}

body.sem-rolagem {
    overflow: hidden;
}

.visualizador {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.96);
}

.visualizador.aberto {
    display: flex;
}

.vis-foto {
    max-width: 92vw;
    max-height: 92vh;
    object-fit: contain;
}

.vis-fechar,
.vis-seta {
    position: absolute;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1;
}

.vis-fechar {
    top: 20px;
    right: 24px;
}

.vis-seta {
    top: 50%;
    transform: translateY(-50%);
}

.vis-anterior {
    left: 20px;
}

.vis-proxima {
    right: 20px;
}

@media (max-width: 700px) {
    .vis-foto {
        max-width: 100vw;
    }

    .vis-seta {
        background-color: rgba(0, 0, 0, 0.4);
        border-radius: 50%;
        padding: 4px;
    }

    .vis-seta svg {
        display: block;
        width: 34px;
        height: 34px;
    }

    .vis-anterior {
        left: 8px;
    }

    .vis-proxima {
        right: 8px;
    }
}