/*
 * assets/css/editorjs-render-styles.css
 * Estilos para o conteúdo HTML renderizado a partir do JSON do Editor.js
 * Versão 3.2 - Correções de Botões, Lightbox e Estilos Gerais.
 */

/* --- Container Geral e Ritmo Vertical --- */
.editorjs-rendered-content {
    font-family: var(--familia-fonte-textos, sans-serif);
    color: var(--cor-texto-principal, #222);
    font-size: 1rem;
    line-height: 1.7;
    max-width: 740px;
    margin: 0 auto;
    padding: 1rem 1rem;
}

.editorjs-rendered-content > * + * {
    margin-top: 1.2em;
}


/* --- Tipografia Base --- */
.editorjs-rendered-content h1,
.editorjs-rendered-content h2,
.editorjs-rendered-content h3,
.editorjs-rendered-content h4,
.editorjs-rendered-content h5,
.editorjs-rendered-content h6 {
    font-family: var(--familia-fonte-titulos, sans-serif);
    line-height: 1.3;
    font-weight: 700;
    margin: 0.5em 0;
    color: var(--cor-primaria) !important;
}

.editorjs-rendered-content h1 { font-size: 2.25rem; border-bottom: 2px solid var(--cor-borda-muito-suave); padding-bottom: 0.3em; }
.editorjs-rendered-content h2 { font-size: 1.75rem; }
.editorjs-rendered-content h3 { font-size: 1.4rem; }
.editorjs-rendered-content h4 { font-size: 1.2rem; }
.editorjs-rendered-content h5 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.5px; }
.editorjs-rendered-content h6 { font-size: 1rem; font-weight: 500; }

.editorjs-rendered-content p:not(:empty) { margin-bottom: 1em; }
.editorjs-rendered-content p:last-child { margin-bottom: 0; }

.editorjs-rendered-content a:not([class*="editorjs-button"]):not(.glightbox) {
    color: var(--cor-secundaria);
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--cor-secundaria) 40%, transparent);
    transition: color 0.2s, border-color 0.2s;
    font-weight: 600;
}
.editorjs-rendered-content a:not([class*="editorjs-button"]):not(.glightbox):hover {
    border-bottom-color: var(--cor-secundaria);
}

/* --- Estilo de Tooltip Corrigido --- */
.editorjs-rendered-content .cdx-tooltip {
    position: relative; /* Essencial para o posicionamento do tooltip */
    border-bottom: 1px dashed var(--cor-texto-terciario, #6c757d);
    cursor: help;
    display: inline-block; /* Garante que a posição relativa funcione corretamente */
}

/* O conteúdo do tooltip (o balão) */
.editorjs-rendered-content .cdx-tooltip .rendered-tooltip-content {
    visibility: hidden; /* Escondido por padrão */
    width: max-content;
    max-width: 250px; /* Largura máxima para não ficar muito grande */
    background-color: var(--cor-texto-principal, #333);
    color: var(--cor-fundo-pagina, #fff);
    text-align: center;
    border-radius: var(--border-radius-padrao, 6px);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.4;

    /* Posicionamento */
    position: absolute;
    z-index: 10;
    bottom: 140%; /* Posiciona acima do texto */
    left: 50%;
    transform: translateX(-50%); /* Centraliza o balão */

    /* Efeito de transição */
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    box-shadow: var(--box-shadow-padrao, 0 2px 8px rgba(0,0,0,0.15));
}

/* Setinha do balão */
.editorjs-rendered-content .cdx-tooltip .rendered-tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%; /* Na base do balão */
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: var(--cor-texto-principal, #333) transparent transparent transparent;
}

/* Exibe o tooltip ao passar o mouse */
.editorjs-rendered-content .cdx-tooltip:hover .rendered-tooltip-content {
    visibility: visible;
    opacity: 1;
}


/* --- Listas (Ordenadas, Não Ordenadas e Checklist) --- */
.editorjs-rendered-content .editorjs-list { padding-left: 2em; }
.editorjs-rendered-content .editorjs-list li { margin-bottom: 0.6em; padding-left: 0.8em; }
.editorjs-rendered-content .editorjs-list--unordered li::marker { color: var(--cor-secundaria); font-weight: bold; }

.editorjs-rendered-content .editorjs-checklist { list-style: none; padding-left: 0.5em; }
.editorjs-rendered-content .editorjs-checklist__item { display: flex; align-items: flex-start; gap: 0.8em; margin-bottom: 0.5em; cursor: pointer; user-select: none; }
.editorjs-rendered-content .editorjs-checklist__item-checkbox { flex-shrink: 0; width: 1.2em; height: 1.2em; margin-top: 0.25em; background-color: var(--cor-fundo-elemento); border: 2px solid var(--cor-borda-input); border-radius: var(--border-radius-padrao); display: inline-block; position: relative; transition: background-color 0.2s, border-color 0.2s; }
.editorjs-rendered-content .editorjs-checklist__item--checked .editorjs-checklist__item-checkbox { background-color: var(--cor-primaria); border-color: var(--cor-primaria); }
.editorjs-rendered-content .editorjs-checklist__item--checked .editorjs-checklist__item-checkbox::after { content: ''; position: absolute; top: 1px; left: 5px; width: 6px; height: 11px; border: solid var(--cor-fundo-elemento); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.editorjs-rendered-content .editorjs-checklist__item-text { transition: color 0.2s, opacity 0.2s; }
.editorjs-rendered-content .editorjs-checklist__item--checked .editorjs-checklist__item-text { text-decoration: line-through; color: var(--cor-texto-secundario); opacity: 0.8; }

/* --- Blocos de Destaque --- */
.editorjs-rendered-content .editorjs-quote { padding: 1.5em 2em; margin: 1.5em 0; border: 1px solid color-mix(in srgb, var(--cor-secundaria) 50%, transparent); background-color: color-mix(in srgb, var(--cor-secundaria) 15%, transparent); border-radius: var(--border-radius-padrao); }
.editorjs-rendered-content .editorjs-quote__text { font-size: 1.1em; font-style: italic; color: var(--cor-texto-secundario); text-align: center; }
.editorjs-rendered-content .editorjs-quote__caption { margin-top: 1em; text-align: center; font-size: 0.9em; font-weight: 500; color: var(--cor-texto-terciario); }
.editorjs-rendered-content .editorjs-quote__caption::before { content: '— '; }
.editorjs-rendered-content .editorjs-delimiter { border: 0; margin: 2.5em auto; background: none; line-height: 1; height: auto; }
.editorjs-rendered-content .editorjs-delimiter--default::before { content: '***'; color: var(--cor-borda-suave); font-size: 1.5em; letter-spacing: 0.5em; text-align: center; display: block; }
.editorjs-rendered-content .editorjs-delimiter--solid { height: 0; border-top: 1px solid var(--cor-borda-suave); }
.editorjs-rendered-content .editorjs-delimiter--dashed { height: 0; border-top: 2px dashed var(--cor-borda-suave); }
.editorjs-rendered-content .editorjs-delimiter--dotted { height: 0; border-top: 2px dotted var(--cor-borda-suave); }

.editorjs-rendered-content .bloco-aviso { padding: 1.5em; border-left: 5px solid; border-radius: var(--border-radius-padrao); display: flex; gap: 1.2em; align-items: flex-start; }
.editorjs-rendered-content .bloco-aviso::before { content: ''; flex-shrink: 0; width: 24px; height: 24px; background-repeat: no-repeat; background-position: center; background-size: contain; margin-top: 0.2em; }
.editorjs-rendered-content .bloco-aviso__container { flex-grow: 1; }
.editorjs-rendered-content .bloco-aviso__legenda { font-family: var(--familia-fonte-titulos); font-weight: 700; font-size: 1.1em; margin-bottom: 0.5em; display: block; }
.editorjs-rendered-content .bloco-aviso--info { border-color: var(--cor-primaria); background-color: color-mix(in srgb, var(--cor-primaria) 10%, transparent); }
.editorjs-rendered-content .bloco-aviso--info .bloco-aviso__legenda { color: var(--cor-primaria); }
.editorjs-rendered-content .bloco-aviso--info::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23284093' viewBox='0 0 16 16'%3E%3Cpath d='M8 16A8 8 0 1 0 8 0a8 8 0 0 0 0 16zm.93-9.412-1 4.705c-.07.34.029.533.304.533.194 0 .487-.07.686-.246l-.088.416c-.287.346-.92.598-1.465.598-.703 0-1.002-.422-.808-1.319l.738-3.468c.064-.293.006-.399-.287-.47l-.451-.081.082-.381 2.29-.287zM8 5.5a1 1 0 1 1 0-2 1 1 0 0 1 0 2z'/%3E%3C/svg%3E"); }
.editorjs-rendered-content .bloco-aviso--warning { border-color: var(--cor-secundaria); background-color: color-mix(in srgb, var(--cor-secundaria) 12%, transparent); }
.editorjs-rendered-content .bloco-aviso--warning .bloco-aviso__legenda { color: var(--cor-secundaria); }
.editorjs-rendered-content .bloco-aviso--warning::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' fill='%23f7a02a' viewBox='0 0 16 16'%3E%3Cpath d='M8.982 1.566a1.13 1.13 0 0 0-1.96 0L.165 13.233c-.457.778.091 1.767.98 1.767h13.713c.889 0 1.438-.99.98-1.767L8.982 1.566zM8 5c.535 0 .954.462.9.995l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 5.995A.905.905 0 0 1 8 5zm.002 6a1 1 0 1 1 0 2 1 1 0 0 1 0-2z'/%3E%3C/svg%3E"); }

/* --- Mídia (Imagens, Vídeos, Galerias) --- */
/* ATUALIZADO: Remove a borda inferior dos links de imagem para o lightbox */
.editorjs-rendered-content .editorjs-image a,
.editorjs-rendered-content .editorjs-image-gallery__item a {
    border-bottom: none;
    line-height: 0;
}
.editorjs-rendered-content .editorjs-image img { display: block; margin-left: auto; margin-right: auto; max-width: 100%; height: auto; border-radius: var(--border-radius-padrao); transition: transform 0.3s ease; }
.editorjs-rendered-content .editorjs-image a:hover img { transform: scale(1.03); }
.editorjs-rendered-content .editorjs-image:not(.editorjs-image--stretched) { max-width: 85%; margin-left: auto; margin-right: auto; }
.editorjs-rendered-content .editorjs-image--stretched { width: 100%; margin-left: auto; margin-right: auto; }
.editorjs-rendered-content .editorjs-image--stretched img { border-radius: 12px; }
.editorjs-rendered-content .editorjs-image--with-border img { border: 1px solid var(--cor-borda-suave); padding: 5px; background: var(--cor-fundo-elemento); }
.editorjs-rendered-content .editorjs-image--with-background { padding: 2em; background: var(--cor-fundo-pagina-alternativo); border-radius: var(--border-radius-padrao); }
.editorjs-rendered-content .editorjs-image--with-background img { box-shadow: var(--box-shadow-padrao); }

.editorjs-rendered-content .editorjs-image-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.editorjs-rendered-content .editorjs-image-gallery__item { border: 1px solid var(--cor-borda-muito-suave); border-radius: var(--border-radius-padrao); overflow: hidden; display:flex; flex-direction: column; background-color: var(--cor-fundo-elemento); transition: box-shadow 0.2s ease; }
.editorjs-rendered-content .editorjs-image-gallery__item:hover { box-shadow: var(--box-shadow-padrao); }
.editorjs-rendered-content .editorjs-image-gallery__item img { width: 100%; height: 160px; object-fit: cover; transition: transform 0.3s ease; }
.editorjs-rendered-content .editorjs-image-gallery__item a:hover img { transform: scale(1.05); }
.editorjs-rendered-content .editorjs-image-gallery__caption { font-size: 0.85rem; padding: 0.8em; background: var(--cor-fundo-pagina-alternativo); text-align: center; margin-top: auto; color: var(--cor-texto-secundario); }

.editorjs-rendered-content .editorjs-video-player,
.editorjs-rendered-content .editorjs-video-responsive,
.editorjs-rendered-content .editorjs-audioplayer audio { display: flex; margin-left: auto; margin-right: auto; width: 100%; border-radius: var(--border-radius-padrao); box-shadow: var(--box-shadow-leve); }
.editorjs-rendered-content .editorjs-image__caption,
.editorjs-rendered-content .editorjs-video__caption,
.editorjs-rendered-content .editorjs-audioplayer__caption,
.editorjs-rendered-content .editorjs-embed__caption { display: block; margin-top: 0.8em; font-size: 0.9rem; color: var(--cor-texto-terciario); line-height: 1.5; text-align: center; }
.editorjs-rendered-content .editorjs-audioplayer__title { font-family: var(--familia-fonte-titulos); font-weight: 600; color: var(--cor-texto-principal); margin-bottom: 0.5em; font-size: 1.1em; text-align: center; }
.editorjs-rendered-content .editorjs-video-responsive { position: relative; overflow: hidden; padding-top: 56.25%; background: #000; }
.editorjs-rendered-content .editorjs-video-responsive iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }

/* --- Blocos Interativos e de Dados --- */
.editorjs-rendered-content .editorjs-table-wrapper { overflow-x: auto; border: 1px solid var(--cor-borda-input); border-radius: var(--border-radius-padrao); }
.editorjs-rendered-content .editorjs-table { width: 100%; border-collapse: collapse; }
.editorjs-rendered-content .editorjs-table th,
.editorjs-rendered-content .editorjs-table td { padding: 0.8em 1em; border: 1px solid var(--cor-borda-suave); }
.editorjs-rendered-content .editorjs-table thead th { background-color: var(--cor-fundo-pagina-alternativo); font-family: var(--familia-fonte-titulos); font-weight: 600; }
.editorjs-rendered-content .editorjs-table tbody tr:nth-child(even) { background-color: var(--cor-fundo-pagina-alternativo); }

.editorjs-rendered-content .editorjs-code { background-color: #2d2d2d; color: #f8f8f2; padding: 1.5em; border-radius: var(--border-radius-padrao); overflow-x: auto; font-family: 'Menlo', 'Consolas', monospace; font-size: 0.9rem; line-height: 1.6; }

.editorjs-rendered-content .editorjs-raw-html {border-radius: var(--border-radius-padrao, 20px); overflow: hidden; }

/* ATUALIZADO: Botões */
.editorjs-rendered-content .editorjs-button-container { text-align: center; margin: 1.5em 0; }
.editorjs-rendered-content .editorjs-button,
.editorjs-rendered-content .editorjs-file-button {
    display: inline-flex; align-items: center; gap: 0.6em; padding: 0.8em 1.8em;
    font-family: var(--familia-fonte-textos); font-weight: 700;
    border-radius: var(--border-radius-padrao);
    cursor: pointer; transition: all 0.2s ease;
    text-decoration: none !important; /* Remove qualquer decoração de link */
    border: 1px solid; /* Define que haverá uma borda sólida de 1px */
    border-color: transparent; /* A cor específica será definida abaixo */
}
.editorjs-rendered-content .editorjs-button:hover,
.editorjs-rendered-content .editorjs-file-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-padrao);
}

.editorjs-rendered-content .editorjs-button--primary { background-color: var(--cor-primaria); color: var(--btn-primario-texto) !important; border-color: var(--btn-primario-fundo) !important; }
.editorjs-rendered-content .editorjs-button--primary:hover { background-color: var(--btn-primario-hover-fundo); border-color: var(--btn-primario-hover-fundo) !important; }
.editorjs-rendered-content .editorjs-button--secondary { background-color: var(--btn-secundario-fundo); color: var(--btn-secundario-texto) !important; border-color: var(--btn-secundario-fundo) !important; }
.editorjs-rendered-content .editorjs-button--secondary:hover { background-color: var(--btn-secundario-hover-fundo, color-mix(in srgb, var(--cor-secundaria) 85%, black)); border-color: var(--btn-secundario-hover-fundo, color-mix(in srgb, var(--cor-secundaria) 85%, black)) !important; }
.editorjs-rendered-content .editorjs-file-button { background-color: var(--cor-fundo-pagina-alternativo); color: var(--cor-texto-principal) !important; border-color: var(--cor-borda-input) !important; }
.editorjs-rendered-content .editorjs-file-button:hover { background-color: var(--cor-fundo-hover); border-color: var(--cor-borda-hover) !important; }
.editorjs-rendered-content .editorjs-file-button__icon { width: 1.1em; height: 1.1em; stroke: currentColor; fill: none; stroke-width: 2px; }
.editorjs-rendered-content .editorjs-file-button__size { font-size: 0.85em; opacity: 0.8; margin-left: 0.2em; }

.editorjs-rendered-content .editorjs-render-error { background-color: var(--feedback-erro-fundo); color: var(--feedback-erro-texto); border: 1px solid var(--feedback-erro-borda); padding: 1em; border-radius: var(--border-radius-padrao); font-family: monospace; }

/* --- Estilos para GLightbox --- */
.goverlay {
    background: rgba(20, 22, 25, 0.75) !important; /* Um fundo um pouco mais suave que preto puro */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

/* Tira o fundo do contêiner do slide */
.gslide-inner-content {
    background: none !important;
    border-radius: var(--border-radius-padrao, 6px);
}

/* Tira o fundo pontilhado da imagem */
.gslide-image {
    background: #fff;
    border-radius: var(--border-radius-padrao, 6px);
}

/* Estilo da imagem principal */
.gslide-image img {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25); /* Sombra suave e neutra */
    border-radius: var(--border-radius-padrao, 6px);
    border: none; /* Remove a borda anterior */
    display: block; /* Garante que a imagem se comporte como bloco */
    max-height: 80vh !important; /* Limita a altura para deixar espaço para descrição */
}

/* Container da descrição (título + texto) */
.gslide-description {
    background: none !important; /* Remove qualquer fundo da descrição */
    text-align: left; /* Alinha o texto à esquerda */
    padding: 20px 0 0 0 !important; /* Apenas espaçamento superior */
    max-width: 700px; /* Limita a largura do texto para melhor leitura */
    margin: 0 auto; /* Centraliza o container da descrição */
}

/* Título da imagem */
.gslide-title {
    font-family: var(--familia-fonte-titulos, sans-serif);
    font-size: 1.1rem !important; /* Tamanho discreto */
    font-weight: 600 !important;
    color: #ffffff !important; /* Branco puro para contraste */
    text-shadow: none !important; /* Sem sombra no texto */
    margin-bottom: 0.25rem !important;
}

/* Texto da descrição */
.gslide-desc {
    font-family: var(--familia-fonte-textos, sans-serif);
    font-size: 0.95rem !important;
    color: rgba(255, 255, 255, 0.7) !important; /* Cinza claro para o texto */
    text-shadow: none !important;
    line-height: 1.6;
}

/* Botões de Navegação e Fechar */
.gnext, .gprev, .gclose {
    background: rgba(255, 255, 255, 0.1) !important; /* Fundo sutil */
    border: none;
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: 40px !important;
    height: 40px !important;
}

.gnext:hover, .gprev:hover, .gclose:hover {
    background: rgba(255, 255, 255, 0.2) !important; /* Hover um pouco mais claro */
    transform: scale(1.05);
}

/* Ícones SVG dentro dos botões */
.gnext svg, .gprev svg, .gclose svg {
    width: 22px !important;
    height: 22px !important;
    color: #fff !important;
}

    color: var(--cor-secundaria, #f7a02a) !important; /* Título com a cor secundária da marca */
    text-shadow: 0px 1px 5px rgba(0,0,0,0.8);
    margin-bottom: 0.5rem !important;
}

.gslide-desc {
    font-family: var(--familia-fonte-textos, sans-serif);
    font-size: 1rem !important;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0px 1px 3px rgba(0,0,0,0.7);
}

/* Botões de navegação e fechar com a identidade da marca */
.gnext, .gprev, .gclose {
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: background-color 0.2s ease, transform 0.2s ease;
    width: 45px !important;
    height: 45px !important;
}

.gnext:hover, .gprev:hover, .gclose:hover {
    background: var(--cor-secundaria, #f7a02a) !important; /* Cor secundária no hover */
    transform: scale(1.1);
}

/* Ícones dentro dos botões */
.gnext svg, .gprev svg, .gclose svg {
    width: 25px !important;
    height: 25px !important;
    color: #fff !important;
}

/* --- Estilos para o Bloco de Formulário Renderizado --- */
.editorjs-rendered-content .editorjs-form-embed {
    margin: 2.5em 0;
    display: flex;
    justify-content: center; /* Centraliza o iframe se ele for menor que o container */
}

.editorjs-rendered-content .editorjs-form-embed__wrapper {
    width: 100%;
    height: auto;
    max-width: 740px; /* Largura máxima para o formulário, um pouco maior que o player */
    min-height: 400px; /* Altura mínima inicial */
    border: 1px solid var(--cor-borda-suave, #e0e0e0);
    border-radius: var(--border-radius-padrao, 8px);
    box-shadow: var(--box-shadow-media, 0 4px 12px rgba(0,0,0,0.08));
    overflow: hidden; /* Garante que o iframe respeite o border-radius */
    transition: height 0.3s ease-in-out;
}

.editorjs-rendered-content .editorjs-form-embed iframe {
    display: block;
    width: 100%;
    height: 400px; /* Altura inicial que será ajustada pelo script */
    border: none;
}

/* Componente Click to Copy */
.ctc-component {
    margin: 1.5em 0;
    font-family: var(--familia-fonte-textos, sans-serif);
    max-width: 500px; /* Limita largura para ficar parecido com o design */
}

.ctc-label {
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--cor-texto-principal, #222);
    font-size: 0.95rem;
}

.ctc-box {
    display: flex;
    align-items: center;
    background-color: #fff;
    border: 1px solid var(--cor-borda-input, #ddd);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    position: relative; /* Para contexto de posicionamento se necessário */
}

.ctc-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: #555;
    outline: none;
    width: 100%;
    text-overflow: ellipsis;
}

.ctc-button {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    background-color: var(--cor-primaria, #3b82f6); /* Azul estilo referência */
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s, transform 0.1s;
    position: relative; /* Para o tooltip */
}

.ctc-button:hover {
    background-color: color-mix(in srgb, var(--cor-primaria, #3b82f6) 85%, black);
}

.ctc-button:active {
    transform: scale(0.96);
}

.ctc-button svg {
    width: 20px;
    height: 20px;
}

/* Tooltip "Copiado" */
.ctc-tooltip {
    visibility: hidden;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 4px 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%; /* Posiciona acima do botão */
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.75rem;
    white-space: nowrap;
}

.ctc-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

/* Classe que ativa o tooltip e muda a cor do botão */
.ctc-button.copied .ctc-tooltip {
    visibility: visible;
    opacity: 1;
}

.ctc-button.copied {
    background-color: var(--cor-sucesso, #10b981); /* Verde sucesso */
}

/* Estilos específicos do modo de edição */
.accordion-tool {
    border: 1px solid var(--cor-borda-input, #ced4da);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
    margin: 1em 0;
}
.accordion-tool__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background-color: #fff;
    border-bottom: 1px solid var(--cor-borda-suave, #eee); /* Linha sutil separando título e conteúdo */
}

/* Conteúdo limpo no editor */
.accordion-tool__content {
    padding: 15px;
    min-height: 40px;
    outline: none;
    margin: 0;
    background-color: #fff; /* Fundo branco */
    color: var(--cor-texto-principal, #222);
    line-height: 1.6;
}
.accordion-tool__content[data-placeholder]:empty::before {
    content: attr(data-placeholder);
    color: #aaa;
    font-style: italic;
}

/* --- Estilos Renderizados (Front-end) --- */
.cdx-accordion {
    border: 1px solid var(--cor-borda-input, #ced4da);
    border-radius: var(--border-radius-padrao, 6px);
    background-color: #fff;
    margin: 1em 0;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    overflow: hidden;
}

.cdx-accordion[open] {
    box-shadow: var(--box-shadow-leve, 0 2px 8px rgba(0,0,0,0.05));
}

.cdx-accordion__summary {
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    cursor: pointer;
    background-color: #fff;
    transition: background-color 0.2s;
    font-weight: 600; /* Destaque para o título */
    color: var(--cor-texto-titulo, #333);
}

.cdx-accordion__summary::-webkit-details-marker {
    display: none;
}

.cdx-accordion__summary:hover {
    background-color: var(--cor-fundo-pagina-alternativo, #f9f9f9);
}

.cdx-accordion__arrow {
    color: var(--cor-texto-terciario, #777);
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
}

/* Rotação da seta quando aberto */
.cdx-accordion[open] .cdx-accordion__arrow {
    transform: rotate(180deg);
}

/* Conteúdo limpo no front-end */
.cdx-accordion__body {
    padding: 0 1.2rem 1.2rem 1.2rem;
    animation: accordionFadeIn 0.3s ease-in-out;
    color: var(--cor-texto-secundario, #555);
    line-height: 1.6;
    border-top: 1px solid var(--cor-borda-suave, #f0f0f0); /* Separação sutil */
}

@keyframes accordionFadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}