/* =========================================================
   COMPONENTE: POSTS DENTRO DAS TAGS
   ========================================================= */

: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 PRINCIPAL
   ========================================================= */

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

    margin-left: auto;
    margin-right: auto;

    box-sizing: border-box;
}


.catalogo-tag-content {
    width: 100%;
}


/* =========================================================
   ESPAÇAMENTO SUPERIOR
   ========================================================= */

.catalogo-tag-spacer {
    height: 2rem;
}


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

.catalogo-tag-title {
    margin: 0 0 1rem;

    color: var(--progepe-texto);

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


/* =========================================================
   GRADE DOS POSTS
   ========================================================= */

.catalogo-tag-posts {
    display: grid;

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

    gap: 20px;

    width: 100%;

    margin: 2rem 0 0;
    padding: 0;
}


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

.post-assunto-tags {
    position: relative;

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

    width: 100%;
    min-width: 0;
    min-height: 150px;

    padding: 1.25rem 3rem 1.25rem 1.25rem;

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

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

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

    box-shadow:
        0 2px 5px rgba(24, 61, 82, 0.04),
        0 5px 14px 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: 20px;
    bottom: 20px;

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

    width: 34px;
    height: 34px;

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

    border-radius: 50%;

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

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


/* =========================================================
   TÍTULO DO POST
   ========================================================= */

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

    margin: 0;

    padding:
        0
        1.5rem
        1.5rem
        0;

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

    text-align: center;
}


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

    text-decoration: none;

    transition:
        color 180ms ease;
}


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

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

    position: absolute;
    inset: 0;

    z-index: 2;
}


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

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

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

    font-size: 0.95rem;
    line-height: 1.5;
}


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

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

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

    box-shadow:
        0 4px 8px rgba(24, 61, 82, 0.06),
        0 10px 20px rgba(0, 84, 142, 0.10);
}


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


.post-assunto-tags:hover::after {
    color: #ffffff;

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

    transform:
        translateX(2px);
}


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

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

    outline-offset: 3px;
}


/*
 * Mantém outros links ou botões internos acima
 * da área clicável principal.
 */

.post-assunto-tags
a:not(.post-assunto-tags__title a),
.post-assunto-tags button {
    position: relative;

    z-index: 3;
}


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

.catalogo-tag-return {
    display: block;

    width: 100%;

    margin-top: 2rem;
    margin-bottom: 2rem;
}


.catalogo-tag-return .catalogo-retornar {
    display: flex;

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

    width: 100%;

    box-sizing: border-box;

    gap: 0.6rem;

    padding: 12px 22px;

    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;
}


/* Seta */

.catalogo-tag-return
.catalogo-retornar::before {
    content: "←";

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


/* Hover */

.catalogo-tag-return
.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);
}


/* Clique */

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


/* Teclado */

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

    outline-offset: 3px;
}


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

/*
 * Tablet:
 * 2 cards por linha.
 */

@media (max-width: 750px) {

    .catalogo-tag-posts {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }

}


/*
 * Celular:
 * 1 card por linha.
 */

@media (max-width: 500px) {

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


    .catalogo-tag-title {
        font-size: 1.7rem;
    }


    .catalogo-tag-posts {
        grid-template-columns: 1fr;

        gap: 1rem;
    }


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

        padding:
            1rem
            3rem
            1rem
            1rem;
    }


    .post-assunto-tags__title {
        font-size: 1.05rem;
    }


    .post-assunto-tags::after {
        right: 14px;
        bottom: 14px;

        width: 30px;
        height: 30px;
    }


    .catalogo-tag-return {
        margin-top: 1.5rem;
        margin-bottom: 1.5rem;
    }

}


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

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

    .post-assunto-tags,
    .post-assunto-tags::after,
    .post-assunto-tags__title a,
    .catalogo-tag-return .catalogo-retornar {
        transition: none;
    }

}