/* ============================================================
   Cartão de Opinião — CSS Completo
   VERSÃO 2.0.0: Inclui ocultação de "Author SEO" para contribuidores
   ============================================================ */

/* ------------------------------------------------------------
   Wrapper principal
------------------------------------------------------------ */
.co-wrapper {
    width: 100%;
}

/* ------------------------------------------------------------
   Barra de Filtro de Autores
------------------------------------------------------------ */
.co-autores-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Posições */
.co-autores-bar--esquerda {
    justify-content: flex-start;
}

.co-autores-bar--centro {
    justify-content: center;
}

.co-autores-bar--direita {
    justify-content: flex-end;
}

/* Título ao lado do dropdown */
.co-autores-titulo {
    font-size: 22px;
    font-weight: 700;
    color: #1a1a1a;
    white-space: nowrap;
}

/* Wrapper do select (para customizar a seta) */
.co-autores-select-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
}

/* Select */
.co-autores-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 40px 10px 16px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background: #ffffff;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    min-width: 180px;
    transition: border-color 0.2s ease;
    outline: none;
}

.co-autores-select:hover,
.co-autores-select:focus {
    border-color: #1a1a1a;
}

/* Seta customizada */
.co-autores-select-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #1a1a1a;
    display: flex;
    align-items: center;
}

.co-autores-select-arrow svg {
    display: block;
    fill: currentColor;
}

/* ------------------------------------------------------------
   Filtros de Categoria (botões)
------------------------------------------------------------ */
.co-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 30px;
}

.co-fbtn {
    padding: 8px 20px;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    background: transparent;
    color: #1a1a1a;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    line-height: 1.4;
}

.co-fbtn:hover,
.co-fbtn.ativo {
    background: #1a1a1a;
    color: #ffffff;
}

/* ------------------------------------------------------------
   Loading
------------------------------------------------------------ */
.co-loading {
    text-align: center;
    padding: 30px 0;
}

.co-spinner {
    display: inline-block;
    width: 36px;
    height: 36px;
    border: 4px solid #eeeeee;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: co-spin 0.7s linear infinite;
}

@keyframes co-spin {
    to { transform: rotate(360deg); }
}

/* ------------------------------------------------------------
   Grelha
------------------------------------------------------------ */
.co-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    width: 100%;
    transition: opacity 0.3s ease;
}

.co-grid.co-busy {
    opacity: 0.4;
    pointer-events: none;
}

.co-vazio {
    grid-column: 1 / -1;
    text-align: center;
    color: #888888;
    padding: 40px 0;
    font-size: 16px;
}

/* ------------------------------------------------------------
   Card
------------------------------------------------------------ */
.co-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    padding: 30px 20px;
    box-sizing: border-box;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.co-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.co-card__link {
    display: flex;
    flex-direction: column;
    align-items: inherit;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.co-card__link:hover {
    text-decoration: none;
    color: inherit;
}

/* ------------------------------------------------------------
   Avatar
------------------------------------------------------------ */
.co-avatar {
    width: 182px;
    height: 182px;
    margin-bottom: 18px;
    border: 20px solid #efefef;
    border-radius: 100px;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
}

.co-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    border-radius: 100px;
}

.co-avatar__inicial {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: #888888;
    background: #dddddd;
    border-radius: 100px;
}

/* Elementor Author Box */
.elementor-10106
.elementor-element.elementor-element-41b2816
.elementor-author-box__avatar img {
    width: 182px;
    height: 182px;
    border-style: solid;
    border-color: #efefef;
    border-width: 20px;
    border-radius: 100px;
}

/* ------------------------------------------------------------
   Subcategoria
------------------------------------------------------------ */
.co-subcat {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888888;
    margin: 0 0 10px 0;
    width: 100%;
}

/* ------------------------------------------------------------
   Título
------------------------------------------------------------ */
.co-titulo {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0 0 10px 0;
    width: 100%;
}

.co-titulo-inner {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    justify-content: flex-start;
}

.co-quote {
    flex-shrink: 0;
    margin-top: 2px;
    line-height: 1;
    display: inline-flex;
}

.co-quote svg {
    display: block;
    fill: #1a1a1a;
}

/* ------------------------------------------------------------
   Autor
------------------------------------------------------------ */
.co-autor {
    font-size: 15px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 12px 0;
    width: 100%;
}

/* ------------------------------------------------------------
   Excerto
------------------------------------------------------------ */
.co-excerto {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 16px;
    font-style: italic;
    line-height: 1.65;
    color: #333333;
    width: 100%;
}

.co-excerto p {
    margin: 0;
}

/* ------------------------------------------------------------
   Botão Mais Artigos
------------------------------------------------------------ */
.co-pag {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 36px;
}

.co-mais-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 30px;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    background: transparent;
    color: #1a1a1a;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    line-height: 1.4;
}

.co-mais-btn:hover {
    background: #1a1a1a;
    color: #ffffff;
}

.co-mais-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.co-mais-btn .co-btn-spinner {
    display: inline-block;
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: co-spin 0.7s linear infinite;
    flex-shrink: 0;
}

/* ------------------------------------------------------------
   Capa do post = avatar do autor
------------------------------------------------------------ */
.co-cover {
    text-align: center;
}

.co-cover__img {
    width: 182px;
    height: 182px;
    border: 20px solid #efefef;
    border-radius: 100px;
    object-fit: cover;
    object-position: center top;
    display: block;
    margin: 0 auto;
}

/* ------------------------------------------------------------
   Responsivo
------------------------------------------------------------ */
@media (max-width: 1024px) {
    .co-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .co-grid {
        grid-template-columns: 1fr;
    }

    .co-avatar {
        width: 130px;
        height: 130px;
    }

    .co-titulo {
        font-size: 18px;
    }

    .co-excerto {
        font-size: 15px;
    }

    .co-filtros {
        gap: 8px;
    }

    .co-fbtn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .co-mais-btn {
        width: 100%;
        justify-content: center;
    }

    .co-autores-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .co-autores-bar--centro,
    .co-autores-bar--direita {
        align-items: center;
    }

    .co-autores-select {
        width: 100%;
        min-width: unset;
    }

    .co-autores-select-wrapper {
        width: 100%;
    }
}

/* ============================================================
   Select2 — Filtro de Autores Customizado
   ============================================================ */

/* Container do select2 */
.co-autores-bar .select2-container {
    min-width: 200px;
}

/* Caixa de seleção */
.co-autores-bar .select2-container--default .select2-selection--single {
    height: auto;
    padding: 10px 40px 10px 16px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    background: #ffffff;
    display: flex;
    align-items: center;
    transition: border-color 0.2s ease;
}

.co-autores-bar .select2-container--default .select2-selection--single:hover,
.co-autores-bar .select2-container--default.select2-container--focus
    .select2-selection--single,
.co-autores-bar .select2-container--default.select2-container--open
    .select2-selection--single {
    border-color: #1a1a1a;
    outline: none;
    box-shadow: none;
}

/* Texto renderizado (placeholder e valor) */
.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    line-height: 1.4;
    padding: 0;
}

/* Placeholder */
.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__placeholder {
    color: #1a1a1a;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* Seta */
.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__arrow {
    height: 100%;
    top: 0;
    right: 12px;
    display: flex;
    align-items: center;
}

.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__arrow b {
    border-color: #1a1a1a transparent transparent transparent;
    border-width: 6px 5px 0 5px;
    margin-top: 0;
    top: auto;
    left: auto;
    position: static;
}

/* Seta quando aberto */
.co-autores-bar .select2-container--default.select2-container--open
    .select2-selection--single
    .select2-selection__arrow b {
    border-color: transparent transparent #1a1a1a transparent;
    border-width: 0 5px 6px 5px;
}

/* Botão de limpar (×) */
.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__clear {
    font-size: 18px;
    font-weight: 400;
    color: #888;
    margin-right: 8px;
    line-height: 1;
}

.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__clear:hover {
    color: #1a1a1a;
}

/* Dropdown */
.co-autores-bar .select2-dropdown {
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    background: #ffffff;
    overflow: hidden;
    margin-top: 2px;
}

/* Opções */
.co-autores-bar .select2-results__option {
    padding: 10px 16px;
    font-size: 14px;
    color: #1a1a1a;
    cursor: pointer;
    transition: background 0.15s ease;
}

.co-autores-bar .select2-results__option:hover,
.co-autores-bar .select2-results__option--highlighted {
    background: #f5f5f5 !important;
    color: #1a1a1a !important;
}

/* Opção selecionada */
.co-autores-bar .select2-results__option[aria-selected="true"] {
    background: #1a1a1a !important;
    color: #ffffff !important;
    font-weight: 600;
}

/* Responsivo */
@media (max-width: 600px) {
    .co-autores-bar .select2-container {
        width: 100% !important;
        min-width: unset;
    }
}

/* ============================================================
   Responsivo — Correção de alinhamento no mobile
   ============================================================ */

@media (max-width: 1024px) {
    .co-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .co-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .co-card {
        width: 100%;
        max-width: 360px;
        margin: 0 auto;
    }

    .co-avatar {
        width: 130px;
        height: 130px;
        margin-left: auto;
        margin-right: auto;
    }

    .co-subcat,
    .co-titulo,
    .co-autor,
    .co-excerto {
        width: 100%;
        text-align: center;
    }

    .co-titulo-inner {
        justify-content: center;
    }

    .co-titulo {
        font-size: 18px;
    }

    .co-excerto {
        font-size: 15px;
    }

    .co-filtros {
        gap: 8px;
    }

    .co-fbtn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .co-mais-btn {
        width: 100%;
        justify-content: center;
    }

    .co-autores-bar {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .co-autores-bar--esquerda {
        align-items: flex-start;
    }

    .co-autores-bar--direita {
        align-items: flex-end;
    }

    .co-autores-select-wrapper {
        width: 100%;
    }

    .co-autores-bar .select2-container {
        width: 100% !important;
        min-width: unset;
    }
}

@media (max-width: 600px) {

    .elementor .co-grid,
    .elementor-widget .co-grid,
    .co-wrapper .co-grid {
        grid-template-columns: 1fr !important;
        justify-items: center !important;
        width: 100% !important;
    }

    .elementor .co-card,
    .elementor-widget .co-card,
    .co-wrapper .co-card {
        max-width: 360px !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    .elementor .co-avatar,
    .co-wrapper .co-avatar {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

/* ============================================================
   Select2 — Correção do placeholder no mobile
   ============================================================ */

/* Garante que o placeholder aparece sempre */
.co-autores-bar .select2-container {
    width: 100% !important;
}

.co-autores-bar .select2-container--default
    .select2-selection--single {
    height: auto !important;
    min-height: 44px;
    display: flex !important;
    align-items: center !important;
    padding: 10px 40px 10px 16px !important;
}

.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__rendered {
    display: block !important;
    padding: 0 !important;
    line-height: normal !important;
    color: #1a1a1a !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__placeholder {
    color: #1a1a1a !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    text-transform: uppercase !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Seta sempre visível */
.co-autores-bar .select2-container--default
    .select2-selection--single
    .select2-selection__arrow {
    height: 100% !important;
    top: 0 !important;
    right: 12px !important;
    display: flex !important;
    align-items: center !important;
}

@media (max-width: 600px) {

    .co-autores-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 20px;
    }

    .co-autores-select-wrapper {
        width: 100%;
    }

    .co-autores-bar .select2-container {
        width: 100% !important;
        min-width: unset !important;
    }

    .co-autores-bar .select2-container--default
        .select2-selection--single {
        width: 100% !important;
        min-height: 44px !important;
    }

    .co-autores-bar .select2-container--default
        .select2-selection--single
        .select2-selection__rendered {
        font-size: 13px !important;
        display: block !important;
        visibility: visible !important;
    }

    .co-autores-bar .select2-container--default
        .select2-selection--single
        .select2-selection__placeholder {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #1a1a1a !important;
    }
}

/* ============================================================
   OCULTAR "AUTHOR SEO" DE AIOSEO - v2.0.0
   ============================================================ */

/* Ocultar o link "Author SEO" da metabox de AIOSEO */
a.active[href*="aioseo"] svg.aioseo-logo-gear,
a.active svg.aioseo-logo-gear,
a[href*="author"][href*="seo"] {
    display: none !important;
}

/* Fallback: Ocultar qualquer elemento que contenha "Author SEO" */
a:has(> svg.aioseo-logo-gear) {
    display: none !important;
}

/* Ocultar a metabox inteira se ainda aparecer */
#aioseo-settings,
.aioseo-post-settings,
.aioseo-author-settings {
    display: none !important;
}
/* ============================================================
   "MAIS ARTIGOS DO AUTOR" - Fim do artigo - v2.1.0
   ============================================================ */

.co-related-author {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid #e5e5e5;
}

.co-related-author__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

.co-related-author__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.co-related-author__item {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.co-related-author__thumb {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 8px;
}

.co-related-author__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.co-related-author__item-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

@media (max-width: 767px) {
    .co-related-author__grid {
        grid-template-columns: 1fr;
    }
}
