/* =========================================================
   PROFEON — LAYOUT SYSTEM
   Responsável apenas por ESTRUTURA e ORGANIZAÇÃO
========================================================= */
body {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* ===============================
   PAGE / ROOT STRUCTURE
   =============================== */
.page {
    flex: 1;
    display: flex;
    /* ocupa a altura útil da viewport (descontando o header) */
    min-height: calc(100vh - var(--header-h));

}

/* ===============================
   CONTAINER
   ===============================
   Limita largura e centraliza conteúdo
   NÃO define grid, flex ou espaçamento interno */
.container {
    width: 100%;
    max-width: 1600px;
    margin-inline: 0;
    box-sizing: border-box;
    /* permite à row interna esticar o aside até o rodapé visual */
    flex: 1;
}

.aside {
    padding: var(--s-6);
    /* estica junto com o conteúdo ao longo da página */
    align-self: stretch;
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* empurra o rodapé do aside (ex.: marca da página) para a base */
.aside > .stack { flex: 1; }

/* ===============================
   LAYOUT PRIMITIVES
   ===============================
   São os únicos responsáveis por organizar */
/* Linha horizontal */
.row {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: var(--s-4);
}

/* Lista vertical (stack) */
.stack {
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
}

/* Grid genérico */
.grid {
    display: grid;
    gap: var(--s-5);
}

/* Grid presets */
.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Grid fluido: ajusta número de colunas conforme espaço disponível */
.grid-fluid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Width helpers (pontuais) */
.w-full {
    width: 100%;
}

.w-auto {
    width: auto;
}

/* ===============================
   WRAPPING & FLOW
   ===============================
   Controle de quebra de linha */
.wrap {
    flex-wrap: wrap;
}

/* ===============================
   ALIGNMENT HELPERS
   ===============================
   Alinhamento vertical e horizontal */
.align-start {
    align-items: flex-start;
}

.align-center {
    align-items: center;
}

.align-end {
    align-items: flex-end;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-end {
    justify-content: flex-end;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

/* ===============================
   COLUMN SYSTEM
   ===============================
   Usado SOMENTE dentro de row */
/* Coluna fluida (padrão) */
.col {
    flex: 1 0 32%;
    min-width: 380px;

    /* evita overflow invisível */
}

/* Coluna com largura mínima fixa */
.col-sm {
    flex: 0 0 240px;
}

.col-md {
    flex: 0 0 320px;
}

.col-lg {
    flex: 0 0 420px;
}

/* Coluna ocupa linha inteira */
.col-full {
    flex: 0 0 100%;
}

.col-fluid {
    flex: 1 0 auto;
    box-sizing: border-box;
}

.col-fit {
    flex: 1 0 fit-content;
}

/* ===============================
   GAP HELPERS
   ===============================
   Espaçamento controlado por tokens */
.gap-1 {
    gap: var(--s-1);
}

.gap-2 {
    gap: var(--s-2);
}

.gap-3 {
    gap: var(--s-3);
}

.gap-4 {
    gap: var(--s-4);
}

.gap-5 {
    gap: var(--s-5);
}

.gap-6 {
    gap: var(--s-6);
}

.gap-7 {
    gap: var(--s-7);
}

.gap-8 {
    gap: var(--s-8);
}

.pad {
    padding: var(--s-4);
}

/* ===============================
   RESPONSIVE HELPERS
   ===============================
   Comportamento padrão mobile-first */
@media (max-width: 768px) {
    
    body {
    display:flex;
}
    
    .container {
        width: 50%;
        flex-direction: column;
        display:flex;
    }
    

    .aside {padding: var(--s-10);}

    .aside > .stack { flex: initial; }

}
