/* --- LAYOUT DA PÁGINA --- */
.na-midia-page {
    padding: 80px 20px 60px;
    background-color: var(--bg-color);
    min-height: 100vh;
}

.container {
    max-width: 1350px;
    margin: 0 auto;
}

.page-header {
    margin-bottom: 50px;
    text-align: center;
}

.title-main {
    font-family: var(--font-title);
    font-size: 3.5rem;
    color: var(--secondary-color);
    margin-top: 0px;
    margin-bottom: 15px;
    line-height: 1.1;
}

.media-subtitle {
    font-size: 16px;
    font-weight: bold;
    color: #2b2b2b;
    line-height: 1.4;
    text-transform: uppercase;
    max-width: 510px;
    margin: 0 auto;
}

/* --- BARRA DE FILTROS (ALINHAMENTO DO BANCO) --- */
.media-filters-bar {
    display: flex;
    gap: 20px;
    margin-bottom: 60px;
    background: #ffffff;
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.filter-group {
    flex: 1;
}

/* Define larguras máximas iguais para os dois selects ficarem organizados à direita */
.filter-group.select-group {
    max-width: 260px;
}

#filter-search, #filter-veiculo, #filter-ordem {
    width: 100%;
    height: 54px;
    padding: 0 20px;
    border: 2px solid #e2e2e2;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    color: #2b2b2b;
    background-color: #fcfcfc;
    outline: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

#filter-search:focus, #filter-veiculo:focus, #filter-ordem:focus {
    border-color: var(--secondary-color);
    background-color: #ffffff;
}

/* Seta customizada para os selects */
#filter-veiculo, #filter-ordem {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232b2b2b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 16px;
    padding-right: 45px;
}

/* --- GRID E CARDS DE MÍDIA --- */
.news-list-vertical {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 40px;
}

.news-list-vertical .media-card {
    position: relative;
    width: 100%; /* Deixa o grid controlar a largura exata baseada no minmax */
    max-width: 420px;
    min-height: 345px;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    justify-self: center; /* Centraliza o card em resoluções quebradas */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.news-list-vertical .media-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.22);
}

.media-card .card-link {
    text-decoration: none;
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
}

.card-image-mask {
    width: 100%;
    height: 210px;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
    position: relative;
}

.card-image-mask img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Ajuste Fino: Evita que a tag atravesse a tela inteira */
.news-list-vertical .card-tag {
    background-color: var(--secondary-color);
    color: var(--accent-color);
    font-weight: bold;
    font-size: 14px;
    text-transform: uppercase;
    padding: 6px 20px;
    width: 100%;
    position: absolute;
    top: 190px;
    left: 0;
    z-index: 2;
    border-radius: 0 10px 10px 0;
    box-shadow: 2px 2px 8px rgba(0,0,0,0.1);
}

.card-body {
    padding: 30px 20px 25px; /* Aumentado padding superior devido à sobreposição da tag */
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

.news-list-vertical .card-date {
    font-size: 13px;
    color: #6e6e6e;
    display: block;
    margin-bottom: 5px;
}

.news-list-vertical .card-body h3 {
    font-weight: bold;
    font-size: 1.4rem;
    color: var(--secondary-color);
    line-height: 1.2;
    margin: 0;
}

.news-list-vertical .card-body p {
    font-size: 15px; /* Reduzido de 18px para melhor legibilidade em blocos verticais */
    color: #4a4a4a;
    line-height: 1.5;
    margin: 0;
}

/* --- STATUS SEM RESULTADOS --- */
.no-results-global {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    font-weight: bold;
    color: #6e6e6e;
}

/* --- FOOTER / BOTÃO VER MAIS --- */
.news-list-vertical-footer {
    text-align: center;
    margin-top: 50px;
    width: 100%;
}

/* =========================================
   RESPONSIVO / MOBILE (Até 768px)
========================================= */
@media (max-width: 768px) {
    /* --- Layout e Header --- */
    .na-midia-page {
        padding: 40px 15px 50px; /* Reduz o espaçamento nas bordas e no topo */
    }

    .page-header {
        margin-bottom: 30px;
    }

    .title-main {
        font-size: 2.2rem; /* Reduz o impacto do título para não quebrar muitas linhas */
        margin-bottom: 10px;
    }

    .media-subtitle {
        font-size: 14px;
        max-width: 100%;
    }

    /* --- Barra de Filtros --- */
    .media-filters-bar {
        flex-direction: column; /* Empilha os inputs */
        gap: 15px;
        padding: 15px;
        margin-bottom: 40px;
        border-radius: 15px;
    }

    .filter-group.select-group {
        max-width: 100%; /* Libera a largura dos selects */
    }

    #filter-search, #filter-veiculo, #filter-ordem {
        height: 50px;
        font-size: 16px; /* 16px obrigatório para o iPhone não dar zoom automático ao clicar */
    }

    /* --- Grid e Cards --- */
    .news-list-vertical {
        grid-template-columns: 1fr; /* Força exatamente 1 card por linha no mobile */
        gap: 30px;
    }

    .news-list-vertical .media-card {
        max-width: 100%; /* Remove a trava rígida de 420px que quebra a tela */
        min-height: auto;
    }

    /* Ajuste da Tag (origem da publicação) */
    .news-list-vertical .card-tag {
        font-size: 12px;
        padding: 5px 15px;
    }

    .card-body {
        padding: 25px 15px 20px;
    }

    .news-list-vertical .card-body h3 {
        font-size: 1.25rem;
    }

    .news-list-vertical .card-body p {
        font-size: 14px;
    }
}

/* =========================================
   AJUSTE DE RESOLUÇÕES INTERMEDIÁRIAS (Tablets até 1024px)
========================================= */
@media (max-width: 1024px) and (min-width: 769px) {
    /* Barra de filtros fluida */
    .media-filters-bar {
        flex-wrap: wrap; 
    }
    
    .filter-group.search-group {
        min-width: 100%; /* A busca ocupa a linha toda em cima */
    }
    
    .filter-group.select-group {
        max-width: 48%; /* Os dois selects dividem a linha de baixo */
        flex: 1;
    }

    /* Ajusta o grid para forçar 2 colunas no tablet */
    .news-list-vertical {
        grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
        gap: 30px;
    }
    
    .news-list-vertical .media-card {
        max-width: 100%;
    }
}