/*
 * A Musical Salto — overrides
 * Tailwind cobre 95% do tema. Aqui vão apenas regras de componentes
 * gerados pelo framework (paginator, trigger, owl-carousel) e tipografia
 * para conteúdo HTML vindo do CMS.
 */

/* =====================================================================
 * Reset basico
 * ===================================================================== */
* { box-sizing: border-box; }
body { font-family: inherit; line-height: 1.5; color: #1e293b; background: #fff; margin: 0; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* =====================================================================
 * TRIGGERS — mensagens do framework: Erro() / AjaxErro()
 * ===================================================================== */
.trigger {
    position: relative;
    padding: 12px 36px 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    margin: 12px 0;
    border: 1px solid transparent;
}
.trigger_success { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.trigger_info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }
.trigger_alert   { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.trigger_error   { background: #fef2f2; color: #991b1b; border-color: #fecaca; }
.trigger .ajax_close {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: rgba(0,0,0,0.08);
    color: inherit;
}
.trigger .ajax_close::before { content: "×"; line-height: 1; }

/* =====================================================================
 * PAGINATOR — gerado por Pager::getPaginator()
 * Markup: <ul class="paginator"><li><a>...</a></li><li><span class="active">N</span></li></ul>
 * ===================================================================== */
.paginator {
    list-style: none;
    margin: 0;
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    background: #f1f5f9;
    border-radius: 999px;
    padding: 4px;
}
.paginator li { display: inline-flex; }
.paginator li a,
.paginator li span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #527dbe;
    transition: all .15s ease;
}
.paginator li a:hover {
    background: #002666;
    color: #fff;
    box-shadow: 0 2px 6px rgba(0,38,102,0.3);
}
.paginator li span.active {
    background: #003895;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,56,149,0.4);
    transform: scale(1.05);
}

/* =====================================================================
 * OWL CAROUSEL — botoes de nav e dots
 * ===================================================================== */
.owl-carousel .owl-stage-outer { padding: 8px 0; }
.owl-carousel .owl-item { padding: 0 6px; }

.owl-carousel .owl-nav button.owl-prev,
.owl-carousel .owl-nav button.owl-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 999px;
    background: #fff !important;
    color: #003895 !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    font-size: 20px !important;
    transition: all .15s ease;
}
.owl-carousel .owl-nav button.owl-prev { left: -8px; }
.owl-carousel .owl-nav button.owl-next { right: -8px; }
.owl-carousel .owl-nav button:hover {
    background: #003895 !important;
    color: #fff !important;
    transform: translateY(-50%) scale(1.05);
}
.owl-carousel .owl-nav button.owl-prev::before { content: "‹"; line-height: 0; }
.owl-carousel .owl-nav button.owl-next::before { content: "›"; line-height: 0; }
.owl-carousel .owl-nav button i { display: none; }
.owl-carousel .owl-dots { margin-top: 16px; }
.owl-carousel .owl-dots .owl-dot span {
    width: 8px; height: 8px;
    background: #cbd5e1;
    transition: all .15s ease;
}
.owl-carousel .owl-dots .owl-dot.active span,
.owl-carousel .owl-dots .owl-dot:hover span {
    background: #003895;
    width: 24px;
    border-radius: 4px;
}

/* =====================================================================
 * HTMLCHARS / PROSE — conteudo HTML vindo do CMS
 * ===================================================================== */
.htmlchars,
.prose {
    color: #334155;
    line-height: 1.7;
    font-size: 16px;
}
.htmlchars h1, .prose h1 { font-size: 2em;   font-weight: 800; margin: 1em 0 .5em; color: #0f172a; }
.htmlchars h2, .prose h2 { font-size: 1.5em; font-weight: 700; margin: 1em 0 .5em; color: #0f172a; }
.htmlchars h3, .prose h3 { font-size: 1.25em;font-weight: 700; margin: 1em 0 .5em; color: #0f172a; }
.htmlchars h4, .prose h4 { font-size: 1.1em; font-weight: 700; margin: 1em 0 .5em; color: #0f172a; }
.htmlchars p, .prose p { margin: 1em 0; }
.htmlchars ul, .htmlchars ol,
.prose ul, .prose ol { margin: 1em 0; padding-left: 1.5em; }
.htmlchars ul, .prose ul { list-style: disc; }
.htmlchars ol, .prose ol { list-style: decimal; }
.htmlchars li, .prose li { margin: .3em 0; }
.htmlchars a, .prose a { color: #003895; text-decoration: underline; }
.htmlchars a:hover, .prose a:hover { color: #002666; }
.htmlchars img, .prose img { border-radius: 12px; margin: 1.5em auto; }
.htmlchars blockquote, .prose blockquote {
    border-left: 4px solid #003895;
    padding: 8px 16px;
    margin: 1.5em 0;
    background: #f8fafc;
    border-radius: 0 8px 8px 0;
    color: #475569;
    font-style: italic;
}
.htmlchars table, .prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
}
.htmlchars th, .htmlchars td,
.prose th, .prose td {
    border: 1px solid #e2e8f0;
    padding: 8px 12px;
    text-align: left;
}
.htmlchars th, .prose th { background: #f1f5f9; font-weight: 600; }
.htmlchars iframe, .prose iframe {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5em 0;
}

/* =====================================================================
 * LINE-CLAMP fallback
 * ===================================================================== */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* =====================================================================
 * WORKCONTROL — manutencao
 * ===================================================================== */
.workcontrol_maintenance {
    background: #fbbf24;
    color: #78350f;
    padding: 12px 20px;
    text-align: center;
    font-weight: 600;
}

/* =====================================================================
 * SCROLLBAR
 * ===================================================================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #f1f5f9; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* =====================================================================
 * FLOAT CLEAR — HTML legado do CMS (pdt_content) usa <div class="clear">
 * e o widget de comentarios tambem. Tailwind nao tem essa regra.
 * ===================================================================== */
.clear { clear: both; display: block; width: 100%; height: 0; }

/* Contem o HTML "selvagem" vindo do CMS dentro do .htmlchars/.prose
   para que floats nao escapem e quebrem o layout do footer. */
.htmlchars::after,
.prose::after {
    content: "";
    display: block;
    clear: both;
}
.htmlchars, .prose { overflow: hidden; }

/* =====================================================================
 * COMMENTS WIDGET — neutraliza o CSS antigo e re-estiliza com Tailwind
 * (o widget importa _cdn/widgets/comments/comments.css que usa floats)
 * ===================================================================== */
.comments {
    float: none !important;
    width: 100% !important;
    padding: 0 !important;
    text-align: left;
}
.comments > header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}
.comments > header h1 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    text-transform: none !important;
    color: #0f172a !important;
    line-height: 1.3;
}
.comments > header h1 span {
    display: block;
    font-size: 0.85rem;
    font-weight: 400;
    color: #64748b;
    text-transform: none;
    margin-top: 4px;
}
.comments_count {
    float: none !important;
    background: #eff6ff !important;
    color: #1e40af !important;
    padding: 12px 16px !important;
    border-radius: 12px;
    text-align: center;
    font-size: 0.875rem !important;
    text-transform: none !important;
    margin: 16px 0 24px;
    border: 1px solid #bfdbfe;
}
.comments_single {
    float: none !important;
    width: 100% !important;
    display: flex;
    gap: 16px;
    padding: 20px 0 !important;
    border-top: 1px solid #e2e8f0 !important;
}
.comments_single.comment_response {
    margin-left: 40px;
    border-top-color: #f1f5f9 !important;
}
.comments_single_avatar {
    float: none !important;
    width: 56px !important;
    flex-shrink: 0;
}
.comments_single_avatar img {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}
.comments_single_content {
    float: none !important;
    width: auto !important;
    padding-left: 0 !important;
    flex: 1;
    min-width: 0;
}
.comments_single header h1 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #0f172a !important;
    margin: 0;
}
.comments_single_comment {
    float: none !important;
    margin: 8px 0 12px !important;
    color: #334155 !important;
    line-height: 1.6;
    font-size: 0.95rem !important;
}
.comments_single_ui {
    display: flex !important;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.8rem !important;
    color: #64748b;
    align-items: center;
}
.comments_single_ui span {
    display: inline-flex !important;
    align-items: center;
    margin: 0 !important;
}
.comments_single_ui .stars { color: #f59e0b; font-size: 0.95rem; }
.comments_single_ui .date  { color: #94a3b8; }
.comments_single_ui .like,
.comments_single_ui .response {
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 999px;
    font-weight: 500;
    transition: background .15s ease;
}
.comments_single_ui .like     { color: #003895; background: #eff2fb; }
.comments_single_ui .like:hover    { background: #d5deef; text-decoration: none; }
.comments_single_ui .response { color: #059669; background: #ecfdf5; }
.comments_single_ui .response:hover{ background: #d1fae5; text-decoration: none; }
.comments_single_ui .liked {
    color: #003895;
    padding: 4px 10px;
    background: #d5deef;
    border-radius: 999px;
    font-weight: 500;
}
.comments_single_likes {
    margin-top: 8px;
    font-size: 0.75rem;
    color: #94a3b8;
}
.comments_single_likes span { color: #64748b; }
.comments_single_likes .na { color: #cbd5e1; }

/* Clearfix para conter floats internos do widget */
.comments::after,
.comments_single::after,
.comments > form::after,
.comments_single form::after {
    content: "";
    display: block;
    clear: both;
}

/* Formulario de comentario */
.comments > form,
.comments_single form,
.comments form[name="add_comment"],
.comments form[name="response_comment"] {
    float: none !important;
    width: 100% !important;
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-top: 1px solid #e2e8f0 !important;
    border-radius: 16px;
    box-sizing: border-box;
}
.comments_single form { display: none; }
.comments_single form.wc_active { display: block !important; }
.comments form label {
    display: block;
    margin-bottom: 12px;
}
.comments form label span {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}
.comments form textarea,
.comments form input[type="text"],
.comments form input[type="email"],
.comments form select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #fff;
    font-size: 0.95rem;
    color: #1e293b;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.comments form textarea:focus,
.comments form input:focus,
.comments form select:focus {
    border-color: #003895;
    box-shadow: 0 0 0 3px rgba(0,56,149,0.15);
}
.comments form textarea { min-height: 100px; resize: vertical; }
.comments form select { min-width: 200px; width: auto !important; }
.comments form > .clear { display: block; clear: both; }
.comments form .btn_blue,
.comments form button.btn_blue,
.comments form .btn_red,
.comments form img.load {
    float: none !important;
    margin-top: 12px;
}
.comments form button,
.comments form .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 0;
    cursor: pointer;
    transition: background .15s ease;
}
.comments form .btn_blue,
.comments form button.btn_blue { background: #003895; color: #fff; }
.comments form .btn_blue:hover { background: #002666; }
.comments form .btn_red {
    background: transparent;
    color: #64748b;
    margin-left: 8px;
}
.comments form .btn_red:hover { background: #f1f5f9; color: #1e293b; }
.comments form .load { vertical-align: middle; margin-right: 8px; }

/* =====================================================================
 * RESET CSS DO FRAMEWORK CONFLICTS
 * O index.php raiz importa _cdn/bootcss/reset.css que pode aplicar
 * regras conflitantes. Aqui sobrescrevemos o necessario.
 * ===================================================================== */
button { font: inherit; }
input, textarea, select { font: inherit; }
