* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* PALETA */
:root {
    --creme: #ece6db;
    --azul: #445f87;
    --vermelho: #b62025;
}

/* LIGHT MODE (default) */
body {
    --fundo: var(--creme);
    --texto: var(--azul);
    --porta: var(--creme);

    background: var(--fundo);
    color: var(--texto);
    font-family: 'Source Sans Pro', sans-serif;
}

/* DARK MODE */
body.dark {
    --fundo: var(--azul);
    --texto: var(--creme);
    --porta: var(--azul);
    background: var(--fundo);
    color: var(--texto);
}

/* FRAME */
.frame {
    position: fixed;
    inset: 0;
    border: 20px solid var(--azul);
    pointer-events: none;
    z-index: 1000;
}

/* MENU */
.menu {
    position: fixed;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 24px;
    z-index: 500;
}

.menu.aberto {
    display: flex;
    flex-direction: column;
    background: var(--fundo);
    padding: 10px;
    border-radius: 4px;
    top: 60px;
}

/* MENU ITENS */
.menu-item {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 13px;
}

/* SWITCH */
.modo-switch {
    position: fixed;
    top: 30px;
    right: 40px;
    cursor: pointer;
    z-index: 500;
    font-size: 18px;
    color: var(--texto);
    user-select: none;
}

/* HAMBURGUER MOBILE */
.hamburguer {
    display: none;
    position: fixed;
    top: 30px;
    right: 80px;
    font-size: 24px;
    cursor: pointer;
    z-index: 500;
}

/* LOGOS */
.logo-area {
    position: fixed;
    top: 25px;
    left: 60px;
    z-index: 500;
}

.logo {
    width: 60px;
    height: auto;
    display: block;
    margin-top: 10px;
    cursor: pointer;
}

.logo.ativo {
    display: block;
}

/* SALAS */
.sala {
    position: absolute;
    inset: 0;
    padding: 80px;
    display: none;
    background: var(--fundo);
    overflow-y: auto;
}

.sala.ativa {
    display: block;
}

/* PÓRTICO */
.portico {
    display: block;
}

/* PORTAS */
.porta {
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    background: var(--porta);
    transition: transform 1.5s ease, background 0.5s ease;
    z-index: 200;
}

.portico.aberto .porta {
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0);
}

.portico.aberto .esquerda {
    transform: translateX(-100%);
    box-shadow: inset 0 0 0 2px var(--azul);
}

.portico.aberto .direita {
    transform: translateX(100%);
    box-shadow: inset 0 0 0 2px var(--azul);
}

.porta.esquerda { left: 0; }
.porta.direita { right: 0; }

/* MANIFESTO */
.manifesto {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    z-index: 300;
    transition: opacity 1s ease;
}

.portico.aberto .manifesto {
    opacity: 0;
    pointer-events: none;
}

/* CONTEÚDO PÓRTICO */
.conteudo-portico {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.portico.ativa.aberto .conteudo-portico {
    opacity: 1;
}

.portico:not(.ativa) .conteudo-portico {
    opacity: 0;
}

/* TÍTULOS */
.titulo-principal,
.titulo {
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    margin-top: 40px;
}

.titulo-principal {
    font-size: 36px;
    margin-bottom: 20px;
}

.titulo {
    font-size: 26px;
    margin-bottom: 30px;
}

/* BOTÃO */
.botao-entrar {
    margin-top: 30px;
    padding: 14px 36px;
    border: 2px solid var(--azul);
    color: var(--azul);
    background: transparent;
    cursor: pointer;
    opacity: 0;
    animation: surgir 1.5s ease forwards;
    animation-delay: 0.8s;
}

.botao-entrar:hover {
    background: var(--azul);
    color: var(--creme);
    border-color: var(--vermelho);
}

body.dark .botao-entrar {
    border-color: var(--creme);
    color: var(--creme);
}

body.dark .botao-entrar:hover {
    background: var(--creme);
    color: var(--azul);
    border-color: var(--vermelho);
}

@keyframes surgir {
    to { opacity: 0.7; }
}

/* GALERIA */
.sub-menu-galeria {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
}

.sub-item {
    cursor: pointer;
    font-family: 'Montserrat', sans-serif;
    text-transform: uppercase;
    font-size: 12px;
    opacity: 0.6;
}

.sub-item.ativo {
    opacity: 1;
}

.sub-sala {
    display: none;
}

.sub-sala.ativo {
    display: block;
}

/* GRID PROJETOS RESPONSIVO */
.grid-galeria {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 por linha desktop */
    gap: 30px;
    justify-items: center;
    grid-auto-rows: auto;
}

/* Tablet médio: 1 projeto por linha */
@media (max-width: 1024px) {
    .grid-galeria {
        grid-template-columns: 1fr;
    }
}

/* Mobile: 1 projeto por linha */
@media (max-width: 768px) {
    .grid-galeria {
        grid-template-columns: 1fr;
    }
}

/* Obras */
.obra {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--fundo);
    border: 1px solid var(--texto);
    padding: 8px;
    cursor: pointer;
    width: 100%;
}

/* Containers de mídia */
.media {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Imagens */
.media.imagem img {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: cover;
}

/* Vídeos */
.media.video video {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
}

/* PDFs */
.media.pdf iframe {
    width: 100%;
    height: 65vh; /* altura consistente */
    max-height: 70vh;
    border: none;
    display: block;
}

/* PREVIEWS PÓRTICO */
.preview-sala {
    display: inline-block;
    margin: 15px;
    cursor: pointer;
}

/* RESPONSIVO GERAL */
@media (max-width: 768px) {
    .frame { border-width: 10px; }
    .sala { padding: 40px; }
    .menu {
        display: none;
        position: fixed;
        top: 60px;
        right: 20px;
        flex-direction: column;
        background: var(--fundo);
        padding: 10px;
        border-radius: 4px;
    }
    .hamburguer { display: block; }

    .titulo-principal,
    .titulo { margin-top: 80px; }
}

@media (max-width: 480px) {
    .titulo-principal,
    .titulo { margin-top: 60px; }
}

/* MODAL */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.6s ease;

    justify-content: center;
    align-items: center;
}

.modal.ativo {
    display: flex;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.modal-conteudo {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--fundo);
    padding: 20px;
    border: 2px solid var(--azul);

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    transform: scale(0.95);
    transition: transform 0.6s ease;
}

.modal.ativo .modal-conteudo {
    transform: scale(1);
}

.modal-media img,
.modal-media video {
    max-width: 90vw;
    max-height: 80vh;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
}

.modal-media iframe {
    width: 90vw;
    height: 85vh;
    border: none;
}

.modal-fechar {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 20px;
}

.modal-legenda {
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
}
