/* === Calidumpedia — Knowledge Base Styles === */

.cpedia-archive, .cpedia-single {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
}

/* === Grid === */
.cpedia-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* === Card === */
.cpedia-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    position: relative;
}
.cpedia-card:hover {
    border-color: #c4b5fd;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.cpedia-card h3 {
    font-size: 17px;
    margin: 0 0 8px;
    color: #1a1a1a;
    font-weight: 700;
    line-height: 1.4;
}
.cpedia-card p {
    font-size: 14px;
    color: #666;
    margin: 0;
    flex-grow: 1;
    line-height: 1.5;
}
.cpedia-card-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border-radius: 6px;
    margin-bottom: 12px;
    width: fit-content;
}
.cpedia-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 12px;
}
.cpedia-card-tags span {
    font-size: 11px;
    color: #888;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 4px;
}
.cpedia-card-arrow {
    position: absolute;
    right: 20px;
    bottom: 20px;
    font-size: 18px;
    color: #ccc;
    transition: all 0.2s;
}
.cpedia-card:hover .cpedia-card-arrow {
    color: #764ba2;
    transform: translateX(3px);
}
.cpedia-card-lock {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
}
.cpedia-card-locked {
    opacity: 0.75;
}
.cpedia-card-locked:hover {
    opacity: 1;
}

/* === Tool cards === */
.cpedia-tool-card {
    padding: 24px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    transition: box-shadow 0.2s;
}
.cpedia-tool-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.cpedia-tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
}
.cpedia-tool-card h3 {
    font-size: 16px;
    margin: 0 0 6px;
    color: #1a1a1a;
}
.cpedia-tool-card p {
    font-size: 13px;
    color: #666;
    margin: 0 0 10px;
    line-height: 1.5;
}
.cpedia-tool-status {
    font-size: 12px;
    color: #999;
    font-style: italic;
}
.cpedia-tool-pro {
    color: #2980b9;
    font-style: normal;
    font-weight: 600;
}

/* === CTA button === */
.calidumpedia-cta {
    display: inline-block;
    background: #25D366;
    color: #fff !important;
    padding: 14px 28px;
    border-radius: 10px;
    font-size: 17px;
    text-decoration: none !important;
    font-weight: 700;
    transition: background 0.2s;
}
.calidumpedia-cta:hover {
    background: #1fb855;
    color: #fff !important;
}

/* === Single article layout === */
.cpedia-article {
    min-width: 0;
}
.cpedia-content {
    line-height: 1.8;
    color: #333;
    font-size: 16px;
}
.cpedia-content p { margin: 0 0 14px; }
.cpedia-content ul, .cpedia-content ol { margin: 0 0 14px; padding-left: 24px; }
.cpedia-content li { margin-bottom: 6px; }
.cpedia-content strong { color: #1a1a1a; }
.cpedia-content a { color: #1a73e8; }

/* === TOC === */
.cpedia-toc-link.active {
    color: #764ba2 !important;
    border-left-color: #764ba2 !important;
    font-weight: 600;
}

/* === Explain button === */
.cpedia-explain-btn:hover {
    background: #f5f3ff !important;
    border-color: #c4b5fd !important;
}
.cpedia-explain-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* === FAQ accordion === */
.cpedia-faq-item[open] summary span {
    transform: rotate(45deg);
}
.cpedia-faq-item summary::-webkit-details-marker { display: none; }
.cpedia-faq-item summary::marker { display: none; content: ''; }

/* === Search === */
#cpedia-search:focus {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15), 0 0 0 3px rgba(118,75,162,0.3);
}

/* === Responsive === */
@media (max-width: 768px) {
    .cpedia-layout {
        grid-template-columns: 1fr !important;
    }
    .cpedia-sidebar {
        position: static !important;
        order: -1;
    }
    .cpedia-toc { display: none; }
    .cpedia-grid {
        grid-template-columns: 1fr !important;
    }
    .cpedia-explain-btn span:last-child {
        display: none;
    }
}

/* === GLOSSARIO === */
.cpedia-page-title { font-size: 2rem; margin: 1.5rem 0 0.5rem; }
.cpedia-page-intro { color: #666; font-size: 1.05rem; margin-bottom: 1.5rem; max-width: 700px; }

.cpedia-glossario-filter {
    display: flex; align-items: center; gap: 1rem;
    margin-bottom: 1rem; flex-wrap: wrap;
}
.cpedia-glossario-filter input {
    flex: 1; min-width: 200px; padding: 10px 14px;
    border: 2px solid #e0e0e0; border-radius: 8px; font-size: 1rem;
    transition: border-color .2s;
}
.cpedia-glossario-filter input:focus { border-color: #0073aa; outline: none; }
.cpedia-glossario-count { color: #888; font-size: 0.9rem; white-space: nowrap; }

.cpedia-az-nav {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 2rem; padding: 12px 0; border-bottom: 2px solid #f0f0f0;
}
.cpedia-az-link {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border-radius: 6px;
    background: #f5f5f5; color: #333; font-weight: 700; font-size: 0.95rem;
    text-decoration: none; transition: background .2s, color .2s;
}
.cpedia-az-link:hover { background: #0073aa; color: #fff; }

.cpedia-letter-group { margin-bottom: 2rem; }
.cpedia-letter-heading {
    font-size: 1.6rem; color: #0073aa; border-bottom: 2px solid #0073aa;
    padding-bottom: 4px; margin-bottom: 1rem;
}

.cpedia-term-card {
    background: #fff; border: 1px solid #eee; border-radius: 8px;
    padding: 16px 20px; margin-bottom: 12px;
    transition: box-shadow .2s;
}
.cpedia-term-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cpedia-term-name { font-size: 1.1rem; margin: 0 0 6px; color: #222; }
.cpedia-term-def { margin: 0 0 8px; color: #555; line-height: 1.6; }
.cpedia-term-links { font-size: 0.85rem; color: #888; }
.cpedia-term-links span { margin-right: 6px; }
.cpedia-term-links a {
    color: #0073aa; text-decoration: none; margin-right: 10px;
}
.cpedia-term-links a:hover { text-decoration: underline; }

.cpedia-glossario-empty { text-align: center; padding: 3rem 1rem; color: #999; }

@media (max-width: 768px) {
    .cpedia-az-link { width: 30px; height: 30px; font-size: 0.85rem; }
    .cpedia-term-card { padding: 12px 14px; }
}
