/* =========================================================
   MUSICALWORLD — INDEX
   Arquivo unificado: 01-base-app-conteudo.css

   Reúne:
   - base.css
   - 02-app.css
   - 03-conteudo.css

   RESPONSABILIDADES:
   - Reset global e tipografia.
   - Aparência básica do HTML e BODY.
   - Estrutura principal do aplicativo.
   - Conteúdo principal do INDEX.
   - Layout do feed e do aviso lateral.
   - Hero, cabeçalho, contador e botão de filtro.
   - Responsividade para celular, tablet e desktop.
   - Área segura do dispositivo.
   - Redução de movimento.

   PADRONIZAÇÃO COM O FINANCEIRO:
   - Fonte Inter.
   - Fundo global #f5f7fb.
   - Texto principal #172033.
   - Texto secundário #667085.
   - Reset com box-sizing: border-box.
   - Rolagem horizontal oculta.
   - Suavização de fontes.

   IMPORTANTE:
   - O visual interno dos cards continua no feed.css.
   - O cabeçalho continua controlado pelo CSS próprio.
   - As regras de área segura permanecem no conteúdo.
   - Este arquivo não adiciona espaço superior ao container.
========================================================= */


/* =========================================================
   1. VARIÁVEIS BÁSICAS
========================================================= */

:root {
    --mw-fundo: #f5f7fb;
    --mw-superficie: #ffffff;

    --mw-texto: #172033;
    --mw-texto-secundario: #667085;
    --mw-texto-terciario: #98a2b3;

    --mw-borda: rgba(23, 32, 51, 0.08);
    --mw-borda-forte: rgba(23, 32, 51, 0.12);

    --mw-fonte:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    --safe-top:
        var(--safe-area-inset-top, env(safe-area-inset-top, 0px));

    --safe-bottom:
        var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
}


/* =========================================================
   2. RESET GLOBAL
========================================================= */

*,
*::before,
*::after {
    box-sizing: border-box;
}


/* =========================================================
   3. HTML — TIPOGRAFIA E FUNDO
========================================================= */

html {
    width: 100%;
    min-height: 100%;

    margin: 0;
    padding: 0;

    font-family: var(--mw-fonte);

    background: var(--mw-fundo);
    /* overflow removido: html/body com overflow criam um
       contêiner de rolagem no iOS e prendem o topo.
       Igual à teste-topo.html, que funciona. */

    scroll-behavior: smooth;

    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}


/* =========================================================
   4. BODY — APARÊNCIA GLOBAL
========================================================= */

body {
    width: 100%;
    min-width: 0;
    min-height: 100vh;

    margin: 0;
    padding: 0;

    background: var(--mw-fundo);
    color: var(--mw-texto);

    font-family: var(--mw-fonte);
    font-size: 16px;
    line-height: 1.5;
    /* overflow removido: html/body com overflow criam um
       contêiner de rolagem no iOS e prendem o topo.
       Igual à teste-topo.html, que funciona. */

    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* =========================================================
   5. CONTROLES E CAMPOS
========================================================= */

button,
a,
input,
textarea,
select {
    font: inherit;
    font-family: var(--mw-fonte);
}


button {
    margin: 0;
    border: 0;
}


button,
a {
    -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   6. LINKS
========================================================= */

a {
    color: inherit;
    text-decoration: none;
}


/* =========================================================
   7. SVGs
========================================================= */

svg {
    display: block;
    flex-shrink: 0;
}


/* =========================================================
   8. IMAGENS E VÍDEOS
========================================================= */

img,
video {
    display: block;
    max-width: 100%;
}


/* =========================================================
   9. CONTAINER PRINCIPAL DO APLICATIVO
========================================================= */

.app-container {
    width: 100%;
    max-width: none;
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    /*
     * A rolagem pertence à página.
     * Não criar uma área de rolagem interna.
     */
    overflow: visible;

    position: relative;

    box-shadow: none;
    background: var(--mw-superficie);
}


/* =========================================================
   10. CAMADA VISUAL ANTIGA — DESATIVADA
========================================================= */

.app-container::before {
    /*
     * Não criar uma camada absoluta cobrindo a aplicação.
     * Evita interferências na composição visual da viewport.
     */
    content: none;
}


/* =========================================================
   11. CONTEÚDO ACIMA DO CONTAINER
========================================================= */

.app-container > * {
    position: relative;
    z-index: 1;
}


/* =========================================================
   12. DESKTOP — CONTAINER SEM BORDAS
========================================================= */

@media (min-width: 481px) {
    .app-container {
        border: none;
        border-radius: 0;
        box-shadow: none;
    }
}


/* =========================================================
   13. MOBILE — SAFARI / IPHONE
========================================================= */

@media (max-width: 480px) {
    .app-container {
        width: 100%;
        max-width: none;
        min-height: 100vh;

        overflow: visible;
        position: relative;

        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .app-container::before {
        display: none;
        content: none;
    }
}


/* =========================================================
   14. VIEWPORT / ÁREA SEGURA DO CONTAINER
========================================================= */

@supports (padding: env(safe-area-inset-top)) {
    .app-container {
        /*
         * Não adicionar espaçamento superior neste container.
         * O cabeçalho e a viewport são tratados separadamente.
         */
        padding-top: 0;
    }
}


/* =========================================================
   15. CONTEÚDO PRINCIPAL
========================================================= */

.main-content {
    flex: 1;

    /*
     * A rolagem acontece na própria página.
     * Não existe scroll interno no conteúdo principal.
     */
    overflow: visible;

    padding: 16px 10px 10px 10px;

    /*
     * Mantém o fundo visual atual do Index.
     * O fundo geral do documento segue o padrão Financeiro.
     */
    background:
        linear-gradient(
            180deg,
            rgba(248, 250, 252, 0.76),
            rgba(248, 250, 252, 0.84)
        );

    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
}


/* =========================================================
   16. LAYOUT PRINCIPAL DO FEED
========================================================= */

.feed-layout {
    width: 100%;

    display: flex;
    align-items: flex-start;
    justify-content: center;

    gap: 20px;

    margin: 0;
    padding: 0;
}


/* =========================================================
   17. COLUNA PRINCIPAL DO FEED
========================================================= */

.feed-main-column {
    width: 100%;
    min-width: 0;

    display: flex;
    flex-direction: column;

    margin: 0;
    padding: 0;
}


/* =========================================================
   18. COLUNA LATERAL DO AVISO
========================================================= */

.feed-sidebar {
    width: 300px;
    flex: 0 0 300px;

    margin: 0;
    padding: 0;
}


/* =========================================================
   19. AVISO DENTRO DA COLUNA LATERAL
========================================================= */

.feed-sidebar .feed-aviso {
    width: 100%;
    margin: 0;
}


/* =========================================================
   20. HERO
========================================================= */

.hero-section {
    text-align: center;
    margin-bottom: 24px;
    padding: 10px 0;
}


.hero-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--mw-texto);
    margin-bottom: 6px;
}


.hero-subtitle {
    font-size: 13px;
    color: var(--mw-texto-secundario);
}


/* =========================================================
   21. AVISO DISCRETO DO FEED
========================================================= */

.feed-aviso {
    width: 100%;
    min-height: 58px;

    display: flex;
    align-items: center;
    gap: 11px;

    margin: 0;
    padding: 10px 10px 10px 12px;

    background-color: var(--mw-superficie);
    border: 1px solid #dfe5ec;
    border-radius: 12px;

    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.06);

    overflow: hidden;
    opacity: 1;
    transform: translateY(0);

    transition:
        opacity 0.2s ease,
        transform 0.2s ease,
        height 0.2s ease,
        margin 0.2s ease,
        padding 0.2s ease;
}


/* =========================================================
   22. ESTADO DE OCULTAÇÃO DO AVISO
========================================================= */

.feed-aviso.ocultando {
    opacity: 0;
    transform: translateY(-4px);
}


/* =========================================================
   23. ÍCONE DO AVISO
========================================================= */

.feed-aviso-icone {
    width: 32px;
    height: 32px;
    min-width: 32px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;
    background-color: #f1f5f9;
    color: #64748b;

    flex-shrink: 0;
}


.feed-aviso-icone svg {
    display: block;
    width: 18px;
    height: 18px;
}


/* =========================================================
   24. CONTEÚDO DO AVISO
========================================================= */

.feed-aviso-conteudo {
    flex: 1;
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 2px;

    overflow: hidden;
}


/* =========================================================
   25. TÍTULO DO AVISO
========================================================= */

.feed-aviso-conteudo strong {
    display: block;
    margin: 0;

    color: #3f444b;
    font-size: 12px;
    line-height: 1.3;
    font-weight: 700;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   26. DESCRIÇÃO DO AVISO
========================================================= */

.feed-aviso-conteudo span {
    display: block;
    margin: 0;

    color: #8a9098;
    font-size: 10.5px;
    line-height: 1.35;
    font-weight: 400;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* =========================================================
   27. BOTÃO FECHAR DO AVISO
========================================================= */

.feed-aviso-fechar {
    width: 28px;
    height: 28px;
    min-width: 28px;

    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    margin: 0;
    padding: 0;

    border: 0;
    border-radius: 8px;

    background-color: transparent;
    color: #9aa0a8;

    cursor: pointer;

    appearance: none;
    -webkit-appearance: none;

    transition:
        background-color 0.18s ease,
        color 0.18s ease,
        transform 0.15s ease;
}


.feed-aviso-fechar svg {
    display: block;
    width: 15px;
    height: 15px;
}


.feed-aviso-fechar:hover {
    background-color: #f1f5f9;
    color: #525860;
}


.feed-aviso-fechar:active {
    transform: scale(0.9);
}


.feed-aviso-fechar:focus-visible {
    outline: 2px solid #bfdbfe;
    outline-offset: 1px;
}


/* =========================================================
   28. CABEÇALHO DO FEED
========================================================= */

.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 16px;
    margin-bottom: 8px;
}


.feed-header-content {
    min-width: 0;
}


.feed-header h2 {
    margin: 0;

    color: var(--mw-texto);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.4px;
}


.feed-header p {
    margin: 5px 0 0;

    color: var(--mw-texto-secundario);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
}


/* =========================================================
   29. CONTADOR DE PROFISSIONAIS
========================================================= */

#contador-profissionais {
    display: block;
    width: 100%;

    margin: 0;
    padding: 0;

    color: var(--mw-texto-terciario);
    font-size: 11px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;

    text-align: left;
}


/* =========================================================
   30. BOTÃO DE FILTRO DO FEED
========================================================= */

.feed-filtro-btn {
    height: 38px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;
    padding: 0 13px;

    flex-shrink: 0;

    border: 1px solid #dfe5ec;
    border-radius: 10px;

    background: var(--mw-superficie);
    color: #475467;

    font-family: inherit;
    font-size: 12px;
    font-weight: 700;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.15s ease;
}


.feed-filtro-btn svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
}


.feed-filtro-btn:hover {
    background: #f5f8fc;
    border-color: #cbd5e1;
    color: var(--mw-texto);
}


.feed-filtro-btn:active {
    transform: scale(0.96);
}


.feed-filtro-btn:focus-visible {
    outline: 3px solid rgba(109, 74, 255, 0.18);
    outline-offset: 2px;
}


/* =========================================================
   31. TABLET / IPAD
   601px → 1199px

   - Uma única coluna.
   - Aviso acima do feed.
   - Sem coluna lateral ao lado do feed.
========================================================= */

@media (min-width: 601px) and (max-width: 1199px) {
    .feed-layout {
        width: 100%;

        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;

        gap: 0;
        margin: 0;
        padding: 0;
    }

    .feed-main-column {
        width: 100%;
        min-width: 0;
        max-width: 760px;

        margin: 0;
        padding: 0;

        flex: 0 1 auto;
    }

    .feed-sidebar {
        order: -1;

        width: 100%;
        min-width: 0;
        max-width: 760px;

        flex: 0 0 auto;

        margin: 0;
        padding: 0;
    }

    .feed-sidebar .feed-aviso {
        width: 100%;

        margin: 45px 0 16px 0;

        position: relative;
        top: 0;
    }
}


/* =========================================================
   32. TABLET MENOR
   601px → 900px
========================================================= */

@media (min-width: 601px) and (max-width: 900px) {
    .feed-main-column {
        max-width: 680px;
    }

    .feed-sidebar {
        max-width: 680px;
    }

    .feed-sidebar .feed-aviso {
        margin: 45px 0 14px 0;
    }
}


/* =========================================================
   33. IPAD / TABLET GRANDE
   901px → 1199px
========================================================= */

@media (min-width: 901px) and (max-width: 1199px) {
    .feed-main-column {
        max-width: 760px;
    }

    .feed-sidebar {
        max-width: 760px;
    }

    .feed-sidebar .feed-aviso {
        margin: 45px 0 18px 0;
    }
}


/* =========================================================
   34. DESKTOP
   1200px+

   Feed: 500px
   Espaçamento: 20px
   Aviso: 300px
   Total: 820px
========================================================= */

@media (min-width: 1200px) {
    .feed-layout {
        width: 100%;
        max-width: 820px;

        margin: 0 auto;
        padding: 0;

        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;

        gap: 20px;
    }

    .feed-main-column {
        width: 500px;
        min-width: 500px;
        max-width: 500px;

        margin: 0;
        padding: 0;

        flex: 0 0 500px;
    }

    .feed-sidebar {
        order: 0;

        width: 300px;
        min-width: 300px;
        max-width: 300px;

        flex: 0 0 300px;

        margin: 0;
        padding: 0;
    }

    .feed-sidebar .feed-aviso {
        width: 100%;

        margin: 0;

        position: relative;
        top: 0;
    }
}


/* =========================================================
   35. MOBILE
   Até 600px

   - Uma única coluna.
   - Aviso antes do feed.
   - Feed ocupa a largura disponível.
========================================================= */

@media (max-width: 600px) {
    .feed-layout {
        width: 100%;

        display: flex;
        flex-direction: column;

        gap: 0;
        margin: 0;
        padding: 0;
    }

    .feed-main-column {
        width: 100%;
        min-width: 0;
        max-width: none;

        margin: 0;
        padding: 0;

        flex: 0 1 auto;
    }

    .feed-sidebar {
        order: -1;

        width: 100%;
        min-width: 0;
        max-width: none;

        flex: 0 0 auto;

        margin: 0;
        padding: 0;
    }

    .feed-sidebar .feed-aviso {
        width: 100%;
        margin: 45px 0 14px 0;
    }
}


/* =========================================================
   36. MOBILE — CARD DE COMPOSIÇÃO EM LARGURA TOTAL

   O .main-content possui 20px de espaçamento lateral.
   O card ultrapassa esse espaçamento para encostar nas
   bordas da tela.

   O restante do conteúdo preserva os 20px laterais.
========================================================= */

@media (max-width: 600px) {
    .anuncio-composicao {
        width: calc(100% + 40px);
        margin-left: -20px;
        margin-right: 0;
        border-radius: 0;
    }
}


/* =========================================================
   37. ÁREA SEGURA — MOBILE / TABLET / CAPACITOR

   Mantém o espaçamento atual do conteúdo principal.
   Não adiciona padding superior ao body ou ao container.
========================================================= */

@media (max-width: 1199px) {
    .main-content {
        padding-top:
            calc(
                16px +
                var(--safe-top, env(safe-area-inset-top, 0px))
            );

        padding-bottom:
            calc(
                90px +
                var(--safe-bottom, env(safe-area-inset-bottom, 0px))
            );
    }
}


/* =========================================================
   38. REDUÇÃO DE MOVIMENTO
========================================================= */

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .app-container,
    .main-content {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}