/* Styling for auto internal links */
.bri-content a.auto-internal-link {
    color: #2563eb !important;
    text-decoration: underline !important;
    text-underline-offset: 3px;
    text-decoration-color: rgba(37, 99, 235, 0.4) !important;
    transition: all 0.2s ease;
}
.bri-content a.auto-internal-link:hover {
    color: #1d4ed8 !important;
    text-decoration-color: #1d4ed8 !important;
    background-color: rgba(37, 99, 235, 0.05);
}

/* Vericath AI Module UI */
.vericath-ai-box { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 12px; padding: 20px; margin-bottom: 30px; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05); }
.vai-header { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; }
.vai-header h3 { margin: 0; font-family: 'Playfair Display', serif !important; font-size: 21px !important; color: #1e293b; display: flex; align-items: center; gap: 8px; font-weight: bold; }
.vai-header svg { color: #2563eb; }
.vai-actions { display: flex; gap: 10px; margin-bottom: 15px; flex-wrap: wrap; }
.vai-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: all 0.2s; border: none; font-family: sans-serif; }
.vai-btn-primary { background: #2563eb; color: white; }
.vai-btn-primary:hover { background: #1d4ed8; }
.vai-btn-primary:disabled { opacity: 0.7; cursor: not-allowed; }
.vai-btn-secondary { background: #e2e8f0; color: #334155; }
.vai-btn-secondary:hover { background: #cbd5e1; }
.vai-summary-content { font-family: 'Source Serif 4', serif !important; font-size: 17px !important; line-height: 1.7 !important; color: #334155; margin-bottom: 15px; display: none; background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #e2e8f0; }
.vai-summary-content ul { margin: 0; padding-left: 20px; }
.vai-accordion { border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; display: none; background: #fff; }
.vai-acc-item { border-bottom: 1px solid #e2e8f0; }
.vai-acc-item:last-child { border-bottom: none; }
.vai-acc-header { width: 100%; text-align: left; padding: 12px 15px; background: #f8fafc; border: none; font-size: 0.95rem; font-weight: 600; color: #1e293b; cursor: pointer; display: flex; justify-content: space-between; align-items: center; font-family: sans-serif; }
.vai-acc-header:hover { background: #f1f5f9; }
.vai-acc-body { padding: 0 15px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease-out, padding 0.3s ease-out; font-family: 'Source Serif 4', serif !important; font-size: 17px !important; line-height: 1.7 !important; color: #475569; }
.vai-acc-body.active { padding: 15px; max-height: 800px; }
.vai-acc-icon { transition: transform 0.3s ease; }
.vai-acc-header.active .vai-acc-icon { transform: rotate(180deg); }
.vai-loading { display: none; align-items: center; gap: 5px; color: #64748b; font-size: 0.9rem; }
.vai-dot { width: 6px; height: 6px; background: #cbd5e1; border-radius: 50%; animation: vai-bounce 1.4s infinite ease-in-out both; }
.vai-dot:nth-child(1) { animation-delay: -0.32s; }
.vai-dot:nth-child(2) { animation-delay: -0.16s; }
@keyframes vai-bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } }

/* Chat Modal UI */
.vai-chat-modal { display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 999999; align-items: center; justify-content: center; backdrop-filter: blur(3px); opacity: 0; transition: opacity 0.3s ease; }
.vai-chat-modal.active { display: flex; opacity: 1; }
.vai-chat-content { background: #fff; width: 90%; max-width: 700px; border-radius: 16px; display: flex; flex-direction: column; height: 85vh; max-height: 800px; box-shadow: 0 20px 40px rgba(0,0,0,0.2); transform: translateY(20px); transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275); overflow: hidden; }
.vai-chat-modal.active .vai-chat-content { transform: translateY(0); }
.vai-chat-header { padding: 16px 20px; border-bottom: 1px solid #f1f5f9; display: flex; justify-content: space-between; align-items: center; background: #fff; }
.vai-chat-title-wrapper { display: flex; align-items: center; gap: 8px; font-family: sans-serif; }
.vai-chat-title-main { font-weight: 700; font-size: 1.1rem; color: #1e293b; display: flex; align-items: center; gap: 6px; }
.vai-chat-title-main svg { color: #2563eb; }
.vai-chat-title-sep { color: #94a3b8; font-size: 1.2rem; line-height: 1; margin-bottom: 2px; }
.vai-chat-title-sub { font-weight: 500; font-size: 0.95rem; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.vai-chat-close { cursor: pointer; width: 32px; height: 32px; border-radius: 50%; background: #f1f5f9; color: #475569; display: flex; align-items: center; justify-content: center; transition: all 0.2s; font-size: 1.2rem; line-height: 1; }
.vai-chat-close:hover { background: #e2e8f0; color: #0f172a; }
.vai-chat-body { flex: 1; overflow-y: auto; padding: 24px; display: flex; flex-direction: column; gap: 16px; background: #f8fafc; scroll-behavior: smooth; }
.vai-msg { max-width: 85%; padding: 12px 18px; border-radius: 16px; font-size: 1rem; line-height: 1.6; font-family: 'Source Serif 4', serif !important; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }
.vai-msg p { margin: 0 0 10px 0; }
.vai-msg p:last-child { margin: 0; }
.vai-msg ul { padding-left: 20px; margin: 0; }
.vai-msg-user { background: #2563eb; color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.vai-msg-ai { background: #fff; color: #334155; border: 1px solid #e2e8f0; align-self: flex-start; border-bottom-left-radius: 4px; }
.vai-chat-footer-wrapper { background: #fff; border-top: 1px solid #f1f5f9; padding: 16px 20px 12px 20px; display: flex; flex-direction: column; gap: 8px; }
.vai-chat-input-box { position: relative; display: flex; align-items: center; }
.vai-chat-input { width: 100%; padding: 14px 55px 14px 20px; border: 1px solid #cbd5e1; border-radius: 30px; outline: none; font-size: 1rem; font-family: sans-serif; color: #1e293b; background: #f8fafc; transition: border-color 0.2s, box-shadow 0.2s; }
.vai-chat-input:focus { border-color: #2563eb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.vai-chat-send { position: absolute; right: 8px; bottom: 8px; background: #2563eb; color: #fff; border: none; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background 0.2s; padding: 0; }
.vai-chat-send:hover { background: #1d4ed8; }
.vai-chat-footnote { text-align: center; font-size: 0.75rem; color: #94a3b8; font-family: sans-serif; }

/* RELATED SECTIONS */
.related-sections {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}
.related-sections h3 {
    font-family: 'Playfair Display', serif !important;
    font-size: 21px !important;
    margin-bottom: 20px;
    color: #1a1a1a;
    text-transform: uppercase;
    font-weight: bold;
}
.related-grid-3cols {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}
.related-col {
    display: flex;
    flex-direction: column;
}
.related-post-image {
    margin-bottom: 12px;
}
.related-post-image .related-thumb img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #eee;
}
.related-post-image .related-title {
    font-family: 'Playfair Display', serif !important;
    font-size: 18px !important;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.4;
    display: block;
}
.related-post-noimage {
    padding-top: 10px;
    padding-bottom: 10px;
    border-top: 1px dashed #e1e1e1;
}
.related-post-noimage .related-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #34495e;
    text-decoration: none;
    line-height: 1.4;
    display: block;
}
.related-post-noimage .related-title:hover, .related-post-image .related-title:hover {
    color: #3498db;
}

.interest-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.interest-post .interest-thumb img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 10px;
    background: #eee;
}
.interest-post .interest-title {
    font-family: 'Playfair Display', serif !important;
    font-size: 18px !important;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
    line-height: 1.4;
    display: block;
}
.interest-post .interest-title:hover {
    color: #3498db;
}

@media (max-width: 768px) {
    .related-grid-3cols, .interest-grid {
        grid-template-columns: 1fr;
    }
    .vai-chat-modal { align-items: flex-end; }
    .vai-chat-content { width: 100%; max-width: 100%; height: 90vh; border-radius: 20px 20px 0 0; transform: translateY(100%); }
    .vai-chat-title-sub { max-width: 150px; }
    .vai-msg { max-width: 90%; }
}
