/* =========================================================
   COMPONENTE: POSTS DENTRO DAS TAGS
   Estrutura PHP nova
   ========================================================= */

:root {
    --progepe-azul: #00548e;
    --progepe-azul-claro: #0079bd;
    --progepe-azul-escuro: #003f6b;

    --progepe-fundo: #f5f8fa;
    --progepe-borda: #d8e4eb;

    --progepe-texto: #26333b;
    --progepe-texto-suave: #5d6b73;
}


/* =========================================================
   CONTAINER DA PÁGINA DE TAG
   Escopo específico para não conflitar com o
   .catalogo-container usado na página inicial.
   ========================================================= */

#lista.catalogo-tag.catalogo-container {
    width: calc(100% - 32px);
    max-width: 800px;

    margin-inline: auto;

    box-sizing: border-box;
}

.catalogo-tag__conteudo {
    width: 100%;
    box-sizing: border-box;
}


/* =========================================================
   ESPAÇAMENTOS
   ========================================================= */

.catalogo-tag__spacer {
    display: block;
    width: 100%;
}

.catalogo-tag__spacer--top {
    height: 2rem;
}

.catalogo-tag__spacer--bottom {
    height: 1rem;
}


/* =========================================================
   TÍTULO DA TAG
   ========================================================= */

.catalogo-tag__titulo {
    margin: 0 0 1rem;

    color: var(--progepe-texto);

    font-size: 2.25rem;
    font-weight: 400;
    line-height: 1.2;
}


/* =========================================================
   GRADE DOS POSTS
   Equivalente à antiga:
   .wp-block-query .wp-block-post-template
   ========================================================= */

.catalogo-tag__posts {
    display: grid !important;

    grid-template-columns:
        repeat(3, minmax(0, 1fr)) !important;

    column-gap: 1.25rem;
    row-gap: 1.25rem;

    align-items: stretch;
    align-content: start;

    width: 100%;
    height: auto;

    margin: 2rem 0 0;
    padding: 0;

    box-sizing: border-box;
}


/* =========================================================
   CARD DO SERVIÇO
   ========================================================= */

.catalogo-tag__posts>.post-assunto-tags {
    margin: 0;
    min-width: 0;
    height: 100%;
}

.post-assunto-tags {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    /* Pode crescer quando o título for maior */
    height: auto;
    min-height: 150px;

    padding: 1.5rem 3.25rem 1.5rem 1.5rem;

    box-sizing: border-box;
    overflow: hidden;

    color: var(--progepe-texto);
    background-color: #ffffff;

    border: 1px solid var(--progepe-borda);
    border-radius: 12px;

    box-shadow:
        0 2px 5px rgba(24, 61, 82, 0.04),
        0 8px 20px rgba(24, 61, 82, 0.06);

    transition:
        transform 180ms ease,
        border-color 180ms ease,
        box-shadow 180ms ease;
}


/* =========================================================
   FAIXA DECORATIVA SUPERIOR
   ========================================================= */

.post-assunto-tags::before {
    content: "";

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 5px;

    background:
        linear-gradient(90deg,
            var(--progepe-azul),
            var(--progepe-azul-claro));
}


/* =========================================================
   SETA DECORATIVA
   ========================================================= */

.post-assunto-tags::after {
    content: "→";

    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 34px;
    height: 34px;

    color: var(--progepe-azul);
    background-color: #edf6fb;

    border-radius: 50%;

    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;

    transition:
        color 180ms ease,
        background-color 180ms ease,
        transform 180ms ease;
}


/* =========================================================
   TÍTULO DO POST
   Equivalente ao antigo .wp-block-post-title,
   incluindo o 1.3rem aplicado pelo bloco Gutenberg.
   ========================================================= */

.post-assunto-tags__titulo {
    width: 100%;

    margin: 0;
    padding: 0 2.25rem 0 0;

    box-sizing: border-box;

    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.35;

    text-align: center;
}

.post-assunto-tags__titulo a {
    color: var(--progepe-azul-escuro);

    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;

    text-decoration: none;

    transition: color 180ms ease;
}


/* Faz toda a área do card ser clicável. */

.post-assunto-tags__titulo a::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 2;
}


/* =========================================================
   TEXTO / RESUMO OPCIONAL
   ========================================================= */

.post-assunto-tags p,
.post-assunto-tags .post-assunto-tags__resumo {
    margin: 0.75rem 0 2.75rem;

    color: var(--progepe-texto-suave);

    font-size: 0.97rem;
    line-height: 1.6;
}


/* =========================================================
   INTERAÇÕES
   ========================================================= */

.post-assunto-tags:hover {
    transform: translateY(-5px);

    border-color: rgba(0, 84, 142, 0.45);

    box-shadow:
        0 5px 10px rgba(24, 61, 82, 0.06),
        0 14px 30px rgba(0, 84, 142, 0.13);
}

.post-assunto-tags:hover .post-assunto-tags__titulo a {
    color: var(--progepe-azul-claro);
}

.post-assunto-tags:hover::after {
    color: #ffffff;
    background-color: var(--progepe-azul);

    transform: translateX(3px);
}


/* =========================================================
   ACESSIBILIDADE
   ========================================================= */

.post-assunto-tags:focus-within {
    outline: 3px solid rgba(0, 121, 189, 0.28);
    outline-offset: 3px;
}

.post-assunto-tags a:not(.post-assunto-tags__titulo a),
.post-assunto-tags button {
    position: relative;
    z-index: 3;
}


/* =========================================================
   BOTÃO DE RETORNO
   ========================================================= */

.catalogo-tag__retornar {
    display: block;

    width: 100%;

    margin: 1rem 0 2rem;
    padding: 0;

    box-sizing: border-box;
}

.catalogo-tag__retornar .catalogo-retornar {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    min-height: 46px;

    padding: 10px 22px;

    box-sizing: border-box;

    gap: 0.6rem;

    color: #ffffff;
    background-color: var(--progepe-azul);

    border: 1px solid var(--progepe-azul);
    border-radius: 0;

    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;

    text-align: center;
    text-decoration: none;

    box-shadow: none;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.catalogo-tag__retornar .catalogo-retornar::before {
    content: "←";

    font-size: 1rem;
    line-height: 1;
}

.catalogo-tag__retornar .catalogo-retornar:hover {
    color: #ffffff;
    background-color: var(--progepe-azul-escuro);

    border-color: var(--progepe-azul-escuro);

    text-decoration: none;

    transform: translateY(-2px);

    box-shadow:
        0 6px 16px rgba(0, 84, 142, 0.2);
}

.catalogo-tag__retornar .catalogo-retornar:active {
    transform: translateY(0);
}

.catalogo-tag__retornar .catalogo-retornar:focus-visible {
    outline: 3px solid rgba(0, 124, 211, 0.35);
    outline-offset: 3px;
}


/* =========================================================
   RESPONSIVIDADE
   ========================================================= */

@media (max-width: 750px) {

    .catalogo-tag__posts {
        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;
    }

}

@media (max-width: 500px) {

    #lista.catalogo-tag.catalogo-container {
        width: calc(100% - 24px);
    }

    .catalogo-tag__titulo {
        font-size: 1.7rem;
    }

    .catalogo-tag__posts {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    .post-assunto-tags {
        height: 120px;
        min-height: 120px;

        padding: 1.25rem 3rem 1.25rem 1.25rem;
    }

    .post-assunto-tags__titulo {
        padding-right: 2rem;

        font-size: 1.08rem;
    }

    .post-assunto-tags::after {
        right: 1rem;
        bottom: 1rem;

        width: 32px;
        height: 32px;
    }

    .catalogo-tag__retornar {
        margin: 1rem 0 1.5rem;
    }

}


/* =========================================================
   REDUÇÃO DE MOVIMENTO
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .post-assunto-tags,
    .post-assunto-tags::after,
    .post-assunto-tags__titulo a,
    .catalogo-tag__retornar .catalogo-retornar {
        transition: none;
    }

}