/**
 * LAYOUTS.CSS - Header, Nav, Grids
 */

/* ===== HEADER ===== */
.app-header {
    background: white;
    box-shadow: var(--shadow-sm);
    height: var(--header-height);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-weight: 700;
    font-size: var(--font-lg);
    color: var(--gray-900);
}

.logo .material-symbols-outlined {
    color: var(--primary);
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - var(--header-height) - var(--bottom-nav-height));
    padding-bottom: var(--space-4);
}

/* ===== MASONRY GRID - CORRIGIDO (Com Largura de Coluna) ===== */
.masonry-grid {
    /* --- MOBILE-FIRST (1 Coluna) --- */
    column-count: 1;
    column-gap: var(--space-4);
    padding-top: var(--space-8); /* Mantém o espaço para a bolinha */
    min-height: 200px;

    /* Regra para 1 coluna: centraliza e limita a 290px */
    width: 100%;
    max-width: 350px; 
    margin-left: auto;
    margin-right: auto;
}

.masonry-item {
    width: 100%;
    break-inside: avoid;
    margin-bottom: var(--space-8);
    display: inline-block; /* Mantém a correção do bug da bolinha */
}

/* --- MULTI-COLUNA (Tablet e Desktop) --- */
@media (min-width: 640px) {
    .masonry-grid {
        /* Remove a restrição mobile de 290px */
        max-width: none; 
        margin-left: 0;
        margin-right: 0;

        /* * Define a LARGURA MÍNIMA da coluna.
         * O navegador irá criar o número de colunas automaticamente.
         */
        column-count: auto;
        column-width: 290px;
    }
}

/* Aspect Ratios - Ciclo de 12 */
.masonry-item:nth-child(12n+1) .image-container {
    aspect-ratio: 3/4;
}
.masonry-item:nth-child(12n+2) .image-container {
    aspect-ratio: 4/3;
}
.masonry-item:nth-child(12n+3) .image-container {
    aspect-ratio: 1/1;
}
.masonry-item:nth-child(12n+4) .image-container {
    aspect-ratio: 9/16;
}
.masonry-item:nth-child(12n+5) .image-container {
    aspect-ratio: 3/4;
}
.masonry-item:nth-child(12n+6) .image-container {
    aspect-ratio: 16/9;
}
.masonry-item:nth-child(12n+7) .image-container {
    aspect-ratio: 1/1;
}
.masonry-item:nth-child(12n+8) .image-container {
    aspect-ratio: 4/3;
}
.masonry-item:nth-child(12n+9) .image-container {
    aspect-ratio: 3/4;
}
.masonry-item:nth-child(12n+10) .image-container {
    aspect-ratio: 9/16;
}
.masonry-item:nth-child(12n+11) .image-container {
    aspect-ratio: 1/1;
}
.masonry-item:nth-child(12n) .image-container {
    aspect-ratio: 16/9;
}

/* ===== SCROLL SUAVE ===== */
html {
    scroll-behavior: smooth;
}

/* ===== SCROLL INFINITO - OTIMIZADO ===== */

#scroll-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
}

/* ===== SCROLL SENTINEL ===== */
.scroll-sentinel {
    height: 1px;
    width: 100%;
    visibility: hidden;
    pointer-events: none;
}


/* ===== BOTTOM NAV - FIXO ABSOLUTO ===== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: white;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: var(--space-2) var(--space-3);
    height: var(--bottom-nav-height);
    z-index: 100;
}

.bottom-nav.nav-actions {
    justify-content: center;
    gap: var(--space-3);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: var(--space-2);
    min-width: 64px;
    color: var(--gray-600);
    font-size: var(--font-xs);
    background: none;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item .material-symbols-outlined {
    font-size: 1.5rem;
}
