/*
 * Projetos PROEX - consulta pública
 * Base visual inspirada no style-proex.css do modelo enviado,
 * com layout fluido e responsivo para desktop, tablet e celular.
 */

.proex-public {
    --proex-blue: #1363d6;
    --proex-blue-light: #deecfc;
    --proex-text: #000;
    --proex-muted: #a2a2a2;
    font-family: "Montserrat", sans-serif;
    overflow: hidden;
}

.proex-public-container {
    width: min(1200px, calc(100% - 32px));
    margin-inline: auto;
}

#pesquisa.proex-public {
    margin-top: clamp(32px, 5vw, 72px);
}

.proex-public .titulo {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    width: 100%;
    position: relative;
    margin-bottom: clamp(20px, 3vw, 36px);
}

.proex-public .titulo h2 {
    margin: 0;
    font-size: clamp(19px, 2vw, 24px);
    line-height: 1.25;
    font-weight: 700;
    color: var(--proex-text);
    text-transform: uppercase;
    padding-right: 16px;
    position: relative;
    z-index: 2;
    background: #fff;
}

.proex-public .titulo::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    height: 2px;
    background: var(--proex-blue);
    width: 100%;
    z-index: 1;
}

.proex-search-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr)) minmax(130px, .7fr);
    gap: 12px;
    align-items: end;
}

.proex-field label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.proex-public .form-select {
    width: 100%;
    min-height: 48px;
    background-color: var(--proex-blue-light);
    border: 2px solid var(--proex-blue);
    border-radius: 4px;
    color: #1b1b1b;
    font-size: .78rem;
    font-weight: 600;
    font-style: italic;
    padding: .75rem 2.25rem .75rem .75rem;
    box-sizing: border-box;
}

.proex-public .form-select:focus {
    outline: 0;
    box-shadow: 0 0 0 .2rem rgba(19, 99, 214, .18);
}

.proex-field-button {
    min-width: 0;
}

.proex-public .btn-pesquisar {
    width: 100%;
    min-height: 48px;
    background: var(--proex-blue);
    color: #fff;
    border: 2px solid var(--proex-blue);
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    padding: .75rem;
    font-size: .78rem;
    cursor: pointer;
    transition: transform .15s ease, filter .15s ease;
}

.proex-public .btn-pesquisar:hover {
    filter: brightness(.94);
    transform: translateY(-1px);
}

#lista-projetos.proex-public {
    margin-top: clamp(42px, 6vw, 78px);
}

.proex-result-group + .proex-result-group {
    margin-top: clamp(38px, 5vw, 64px);
}

.proex-result-group .itens-projetos a {
  text-decoration:none;
}
.proex-result-group .itens-projetos a:hover {
  color:#203116;
}

.proex-result-group .titulo {
    margin-bottom: clamp(20px, 3vw, 32px);
}

.proex-result-group .titulo h2 {
    font-size: clamp(17px, 1.7vw, 20px);
    font-weight: 800;
}

.proex-result-group .itens-projetos {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
}

.proex-project-card {
    display: block;
    color: #000;
    text-decoration: none;
    border: 0;
    min-width: 0;
    transition: transform .18s ease;
}

.proex-project-card:hover {
    color: #000;
    transform: translateY(-3px);
}

.proex-project-card img,
.proex-card-placeholder {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 2px;
}

.proex-card-placeholder {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--proex-cor, #1363d6), #f4f7fb);
    color: #fff;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.proex-project-card .card-body {
    padding: 14px 0 0;
}

.proex-project-card .card-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
    font-weight: 600;
}

.proex-public-empty {
    margin: 28px 0;
    padding: 24px;
    background: #f6f7f9;
    color: #ff0000;
    border-left: 4px solid var(--proex-blue);
    font-size: .95rem;
}

/* Página interna */
#projetos.proex-project-detail {
    margin-top: clamp(34px, 5vw, 64px);
}

.proex-project-detail .titulo {
    display: block;
    text-align: center;
    margin-bottom: clamp(22px, 3vw, 36px);
}

.proex-project-detail .titulo h2 {
    background: transparent;
    padding: 0;
    font-size: clamp(18px, 2vw, 20px);
    font-weight: 800;
}

.proex-project-detail .titulo::before {
    display: none;
}

.proex-project-overview {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.proex-project-image-wrap {
    min-width: 0;
    margin: 0;
}

.proex-project-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 560px;
    object-fit: cover;
}

.proex-project-infos {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    min-width: 0;
}

.proex-info-card {
    display: flex;
    align-items: center;
    gap: 16px;
    border: 0;
    text-align: left;
    min-width: 0;
}

.proex-info-copy {
    min-width: 0;
}

.proex-info-icon {
    flex: 0 0 48px;
    width: 48px;
    min-height: 48px;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 38px;
    color: var(--proex-cor, #1363d6);
}

.proex-info-icon i {
    font-style: normal;
}

.proex-macro-icon-image {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.proex-info-card .card-text {
    color: var(--proex-muted);
    font-size: .95rem;
    font-style: italic;
    font-weight: 300;
    margin: 0;
}

.proex-info-card .card-title {
    color: #000;
    font-size: 1rem;
    line-height: 1.35;
    font-weight: 700;
    margin: 4px 0 0;
}

.proex-tabs-wrap {
    display: grid;
    grid-template-columns: minmax(210px, 310px) minmax(0, 1fr);
    gap: 28px;
    margin-top: clamp(36px, 6vw, 68px);
    align-items: start;
}

.proex-tabs {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.proex-tab {
    display: block;
    width: 100%;
    padding: .75rem 1rem;
    font-size: 17px;
    line-height: 1.25;
    font-weight: 700;
    color: var(--proex-texto-inativo, #111);
    text-align: left;
    text-transform: uppercase;
    border: 0;
    border-radius: 0;
    background: var(--proex-cor-clara, rgba(19, 99, 214, .18));
    cursor: pointer;
}

.proex-tab.active {
    background: var(--proex-cor, #1363d6);
    color: var(--proex-texto-ativo, #fff);
}

/* Garante que as cores configuradas na Macroárea prevaleçam sobre o tema. */
.proex-tabs-wrap .proex-tab {
    background: var(--proex-cor-clara, rgba(19, 99, 214, .18)) !important;
    color: var(--proex-texto-inativo, #111) !important;
}

/* Ao passar o mouse, destaca o botão com a cor principal da Macroárea. */
.proex-tabs-wrap .proex-tab:hover,
.proex-tabs-wrap .proex-tab:focus-visible {
    background: var(--proex-cor, #1363d6) !important;
    color: var(--proex-texto-ativo, #fff) !important;
}

/* O botão selecionado conserva as cores de estado ativo. */
.proex-tabs-wrap .proex-tab.active,
.proex-tabs-wrap .proex-tab.active:hover,
.proex-tabs-wrap .proex-tab.active:focus-visible {
    background: var(--proex-cor, #1363d6) !important;
    color: var(--proex-texto-ativo, #fff) !important;
}

.proex-tab-panels {
    min-width: 0;
    padding: 4px 0 0;
}

.proex-tab-panel {
    color: #202020;
    font-size: 1rem;
    line-height: 1.75;
}

.proex-tab-panel p:last-child {
    margin-bottom: 0;
}

.proex-repository-list {
    margin: 0;
    padding-left: 1.2rem;
}

.proex-repository-list li + li {
    margin-top: 8px;
}

.proex-repository-list a {
    color: var(--proex-cor, #1363d6);
    font-weight: 600;
}

@media (min-width: 992px) {
    .proex-project-overview.has-image {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
        gap: clamp(24px, 3vw, 42px);
    }

    .proex-project-overview.has-image .proex-project-infos {
        align-content: start;
        padding-top: 4px;
    }

    .proex-project-overview.no-image .proex-project-infos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .proex-search-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .proex-field-button {
        grid-column: span 1;
    }

    .proex-result-group .itens-projetos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .proex-project-overview.has-image .proex-project-image-wrap {
        max-width: 800px;
        margin-inline: auto;
    }

    .proex-project-infos {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 8px;
    }
}

@media (max-width: 760px) {
    .proex-public-container {
        width: min(100% - 24px, 620px);
    }

    .proex-search-grid {
        grid-template-columns: 1fr 1fr;
    }

    .proex-field-button {
        grid-column: 1 / -1;
    }

    .proex-result-group .itens-projetos {
        grid-template-columns: 1fr;
        gap: 26px;
    }

    .proex-tabs-wrap {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .proex-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .proex-tab {
        font-size: 14px;
        min-height: 52px;
    }
}

@media (max-width: 480px) {
    #pesquisa.proex-public {
        margin-top: 28px;
    }

    .proex-public-container {
        width: min(100% - 20px, 620px);
    }

    .proex-search-grid,
    .proex-project-infos,
    .proex-tabs {
        grid-template-columns: 1fr;
    }

    .proex-public .titulo h2 {
        font-size: 18px;
    }

    .proex-info-card {
        padding: 4px 0;
    }

    .proex-tab {
        min-height: auto;
        font-size: 14px;
    }

    .proex-project-image {
        max-height: none;
    }
}


/* Oculta o título automático do tema somente nas páginas que exibem o PROEX. */
body.proex-public-page h1.entry-title,
body.proex-public-page .entry-header .entry-title,
body.proex-public-page .page-header .page-title,
body.proex-public-page h1.page-title,
body.proex-public-page .wp-block-post-title,
body.proex-public-page .elementor-page-title {
    display: none !important;
}


/* Espaçamento entre o conteúdo público do PROEX e o rodapé.
   Aplicado somente à última seção pública da página. */
body.proex-public-page section.proex-public:last-of-type {
    padding-bottom: 50px;
}

@media (max-width: 991.98px) {
    body.proex-public-page section.proex-public:last-of-type {
        padding-bottom: 40px;
    }
}

@media (max-width: 575.98px) {
    body.proex-public-page section.proex-public:last-of-type {
        padding-bottom: 30px;
    }
}

/* Estado dos filtros durante a atualização */
.proex-search-form select:disabled,
.proex-search-form .btn-pesquisar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.proex-search-form .proex-filter-status {
    margin-top: 12px;
    font-size: 0.95rem;
}

.proex-search-form .proex-filter-status.is-error {
    color: #b42318;
}
