/* ================================================================
   Academy CPTs – Estilos dos Widgets
   ================================================================ */

/* ── Grids base (colunas controladas pelo Elementor via selectors) ─ */
.academy-posts-grid,
.academy-solucoes-grid,
.academy-ferramentas-grid,
.academy-categorias-grid {
    display: grid;
}

/* Fallback para renderização fora do Elementor */
.academy-posts-grid     { grid-template-columns: repeat(3, 1fr); gap: 24px; }
.academy-solucoes-grid  { grid-template-columns: repeat(3, 1fr); }
.academy-ferramentas-grid { grid-template-columns: repeat(3, 1fr); }
.academy-categorias-grid  { grid-template-columns: repeat(6, 1fr); }

.academy-posts--list { grid-template-columns: 1fr !important; }

/* ================================================================
   Categorias
   ================================================================ */
.academy-categoria-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    background: #fff;
    text-decoration: none;
    color: inherit;
    gap: 12px;
    transition: border-color .15s, box-shadow .15s;
}

.academy-categoria-card:hover {
    border-color: #D1D5DB;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
}

.academy-categoria-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: #EAB308;
    line-height: 1;
}

.academy-categoria-card__icon img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: block;
}

.academy-categoria-card__name {
    font-size: .875rem;
    font-weight: 500;
    color: #111827;
    line-height: 1.3;
}

/* ================================================================
   Posts
   ================================================================ */
.academy-post-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: box-shadow .2s ease, transform .2s ease;
    display: flex;
    flex-direction: column;
}

.academy-post-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

.academy-post-card__thumb {
    display: block;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.academy-post-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.academy-post-card:hover .academy-post-card__thumb img {
    transform: scale(1.04);
}

.academy-post-card__body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.academy-post-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
}

.academy-post-card__title a {
    color: inherit;
    text-decoration: none;
}

.academy-post-card__title a:hover {
    text-decoration: underline;
}

.academy-post-card__excerpt {
    font-size: .875rem;
    color: #6b7280;
    margin: 0;
    flex: 1;
}

.academy-post-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .75rem;
    color: #9ca3af;
    margin-top: auto;
}

.academy-post-card__read-time::before {
    content: '·';
    margin-right: 4px;
}

/* ── Lista ────────────────────────────────────────────────────── */
.academy-posts--list .academy-post-card {
    flex-direction: row;
}

.academy-posts--list .academy-post-card__thumb {
    width: 180px;
    flex-shrink: 0;
    aspect-ratio: auto;
}

@media (max-width: 640px) {
    .academy-posts--list .academy-post-card { flex-direction: column; }
    .academy-posts--list .academy-post-card__thumb { width: 100%; }
}

/* ================================================================
   Glossário
   ================================================================ */
.academy-glossario {
    display: flex;
    flex-direction: column;
}

.academy-gloss-empty {
    color: #6b7280;
    font-size: .875rem;
    grid-column: 1 / -1;
}

/* ── Filtro A-Z ───────────────────────────────────────────────── */
.academy-gloss-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.academy-gloss-filter__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #D1D5DB;
    border-radius: 12px;
    background: #ffffff;
    font-size: .875rem;
    font-weight: 400;
    color: #111827;
    cursor: pointer;
    line-height: 1;
    transition: background-color .15s, color .15s, border-color .15s;
    flex-shrink: 0;
}

.academy-gloss-filter__btn:hover:not(.is-active) {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.academy-gloss-filter__btn.is-active {
    background: #111827;
    border-color: #111827;
    color: #ffffff;
    font-weight: 500;
}

/* ── Linha divisória ─────────────────────────────────────────── */
.academy-gloss-divider {
    display: block;
    border: none !important;
    border-top: 1px solid #E5E7EB !important;
    margin: 42px 0 !important;
    height: 0;
}

/* ── Grid (column-gap e row-gap controlados pelo Elementor) ──── */
.academy-gloss-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* fallback — Elementor sobrescreve via selectors */
    column-gap: 20px;
    row-gap: 32px;
    transition: opacity .18s ease;
    min-height: 60px;
    max-width: 606px;
}

.academy-gloss-grid.is-loading {
    opacity: .35;
    pointer-events: none;
}

/* ── Card: sem bg, sem borda, sem sombra, sem padding ─────────── */
.academy-gloss-term {
    /* wrapper vazio — sem estilo */
}

.academy-gloss-term__card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

/* Thumbnail: segue a proporção natural da imagem */
.academy-gloss-term__thumb {
    width: 100%;
    overflow: hidden;
    border-radius: 12px;
    background: none;
}

.academy-gloss-term__thumb img {
    width: 100%;
    height: auto;
    display: block;
}

/* Título: 18px abaixo da imagem, tipografia do Figma */
.academy-gloss-term__title {
    margin-top: 18px;
    font-size: 18px;
    font-style: normal;
    font-weight: 500;
    line-height: 120%;
    color: #0C111D;
    font-family: var(--family-heading, 'Inter', sans-serif);
    font-feature-settings: 'salt' on;
}

/* ================================================================
   Glossário – Índice A-Z
   ================================================================ */
.academy-gloss-index {
    display: flex;
    flex-direction: column;
}

.academy-gloss-index__titulo {
    margin: 0 0 16px;
}

.academy-gloss-index__intro {
    margin-bottom: 24px;
    color: #374151;
    font-size: .9375rem;
    line-height: 1.6;
}

.academy-gloss-index__nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 32px;
    list-style: none;
    padding: 0;
}

.academy-gloss-index__nav-letter {
    font-weight: 600;
    text-transform: uppercase;
    text-decoration: none;
    transition: color .15s;
}

.academy-gloss-index__nav-letter:hover {
    text-decoration: underline;
}

.academy-gloss-index__nav-letter.is-active {
    font-weight: 700;
    text-decoration: underline;
}

.academy-gloss-index__nav-all {
    font-size: .8125rem;
    text-decoration: none;
    padding: 2px 8px;
    border: 1px solid currentColor;
    border-radius: 4px;
    transition: opacity .15s;
}

.academy-gloss-index__nav-all:hover {
    opacity: .75;
}

.academy-gloss-index__body {
    display: flex;
    flex-direction: column;
}

.academy-gloss-index__grupo + .academy-gloss-index__grupo {
    margin-top: 40px;
}

.academy-gloss-index__heading {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #E5E7EB;
}

.academy-gloss-index__lista {
    list-style: none;
    padding: 0;
    margin: 0;
}

.academy-gloss-index__lista--cols-2 {
    columns: 2;
    column-gap: 32px;
}

.academy-gloss-index__lista--cols-3 {
    columns: 3;
    column-gap: 32px;
}

.academy-gloss-index__item {
    margin-bottom: 6px;
    break-inside: avoid;
}

.academy-gloss-index__link {
    font-size: .9375rem;
    text-decoration: none;
    transition: color .15s;
}

.academy-gloss-index__link:hover {
    text-decoration: underline;
}

/* ── Cards grid no arquivo ───────────────────────────────────── */
.academy-gloss-index__cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.academy-gloss-index__cards--cols-2 { grid-template-columns: repeat(2, 1fr); }
.academy-gloss-index__cards--cols-3 { grid-template-columns: repeat(3, 1fr); }

/* ── Card horizontal (imagem esquerda, título direita) ────────── */
.academy-gloss-term--horizontal .academy-gloss-term__card {
    flex-direction: row !important;
    align-items: center !important;
    gap: 16px !important;
}

.academy-gloss-term--horizontal .academy-gloss-term__thumb {
    width: 80px !important;
    height: 80px !important;
    flex-shrink: 0 !important;
    aspect-ratio: 1 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.academy-gloss-term--horizontal .academy-gloss-term__thumb img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.academy-gloss-term--horizontal .academy-gloss-term__title {
    margin-top: 0 !important;
    font-size: 1rem;
}

/* ── Breadcrumb (Dynamic Tag) ────────────────────────────────── */
.academy-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: .875rem;
    color: #6b7280;
}

.academy-breadcrumb a {
    color: inherit;
    text-decoration: none;
}

.academy-breadcrumb a:hover {
    text-decoration: underline;
}

.academy-breadcrumb [aria-current="page"] {
    color: #111827;
}

/* ================================================================
   Soluções em Destaque
   ================================================================ */
.academy-solucao-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
}

.academy-solucao-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #6366f1;
}

.academy-solucao-card__icon img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
}

.academy-solucao-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.academy-solucao-card__title {
    font-size: .9375rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #111827;
}

.academy-solucao-card__excerpt {
    font-size: .8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Ver mais / Ver menos ────────────────────────────────────── */
.academy-solucao-card--extra {
    display: none !important;
}

.academy-solucoes-grid.is-expanded .academy-solucao-card--extra {
    display: flex !important;
}

.academy-solucoes-loadmore {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

.academy-solucoes-loadmore__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: #ffffff;
    padding: 10px 24px;
    font-size: .9375rem;
    font-weight: 500;
    color: #111827;
    transition: background-color .15s, border-color .15s;
}

.academy-solucoes-loadmore__btn:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

/* ================================================================
   Ferramentas Gratuitas
   ================================================================ */
.academy-ferramenta-card {
    display: flex;
    flex-direction: row;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
}

/* Caixa do ícone com borda */
.academy-ferramenta-card__icon-wrap {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    overflow: hidden;
    font-size: 1.75rem;
    color: #6366f1;
}

.academy-ferramenta-card__icon-wrap img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
}

.academy-ferramenta-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.academy-ferramenta-card__title {
    font-size: .9375rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
    color: #111827;
}

.academy-ferramenta-card__excerpt {
    font-size: .8125rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
