/**
 * onOrbit Marketing - Blog Article Styles
 * Versão: 1.0
 * Estilos para a página de artigo do blog: tipografia, tabelas, FAQ accordion
 */

/* =============================================
   ARTIGO: HEADER - Remove espaço em branco
   entre o menu fixo e o início do artigo
   ============================================= */

.single-post .site-main {
    padding-top: 0;
}

.single-post .entry-header {
    padding-top: calc(6rem + 1rem) !important; /* altura do header fixo + espaço visual reduzido 50% */
    padding-bottom: 1rem !important;
}

@media (max-width: 767px) {
    .single-post .entry-header {
        padding-top: calc(5rem + 0.75rem) !important;
        padding-bottom: 0.75rem !important;
    }
}

/* =============================================
   ARTIGO: TIPOGRAFIA DO CONTEÚDO
   Hierarquia visual clara: H2 (título), H3 (subtítulo)
   ============================================= */

.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    letter-spacing: -0.02em;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid hsl(var(--primary) / 0.15);
}

.entry-content h2:first-child {
    margin-top: 0;
}

.entry-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    letter-spacing: -0.01em;
}

.entry-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.entry-content p {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.25rem;
}

.entry-content ul,
.entry-content ol {
    margin: 1rem 0 1.5rem 1.5rem;
    line-height: 1.8;
    color: hsl(var(--muted-foreground));
    font-size: 1.0625rem;
}

.entry-content ul li,
.entry-content ol li {
    margin-bottom: 0.4rem;
}

.entry-content blockquote {
    margin: 2rem 0;
    padding: 1.25rem 1.5rem;
    border-left: 4px solid hsl(var(--primary));
    background-color: hsl(var(--primary) / 0.05);
    border-radius: 0 0.5rem 0.5rem 0;
    font-style: italic;
    color: hsl(var(--foreground));
    font-size: 1.0625rem;
    line-height: 1.7;
}

.entry-content blockquote p {
    margin: 0;
    color: inherit;
}

.entry-content a {
    color: hsl(var(--primary));
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.entry-content a:hover {
    color: hsl(var(--primary) / 0.75);
}

.entry-content strong,
.entry-content b {
    font-weight: 600;
    color: hsl(var(--foreground));
}

.entry-content code {
    font-family: 'Courier New', monospace;
    font-size: 0.875em;
    background-color: hsl(var(--secondary));
    color: hsl(var(--primary));
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
}

.entry-content pre {
    background-color: hsl(var(--secondary));
    border-radius: 0.5rem;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.7;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.75rem;
    margin: 1.5rem 0;
}

/* =============================================
   ARTIGO: TABELAS
   Estilo limpo e legível para tabelas de comparação
   ============================================= */

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    font-size: 0.9375rem;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 1px 3px hsl(var(--foreground) / 0.08);
}

.entry-content table thead tr {
    background-color: hsl(var(--primary));
    color: #ffffff;
}

.entry-content table thead th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.entry-content table tbody tr {
    border-bottom: 1px solid hsl(var(--border));
    transition: background-color 0.15s ease;
}

.entry-content table tbody tr:nth-child(even) {
    background-color: hsl(var(--secondary) / 0.4);
}

.entry-content table tbody tr:last-child {
    border-bottom: none;
}

.entry-content table tbody tr:hover {
    background-color: hsl(var(--primary) / 0.05);
}

.entry-content table tbody td {
    padding: 0.875rem 1rem;
    color: hsl(var(--muted-foreground));
    vertical-align: top;
    line-height: 1.6;
}

.entry-content table tbody td:first-child {
    font-weight: 500;
    color: hsl(var(--foreground));
}

/* Tabela responsiva - scroll horizontal em mobile */
.entry-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
    .entry-content table {
        display: table;
        overflow-x: visible;
    }
}

/* =============================================
   ARTIGO: SECÇÃO FAQ COM EFEITO CASCATA
   Accordion - abre apenas um item de cada vez
   ============================================= */

.faq-section {
    margin: 2.5rem 0;
}

.faq-section h2,
.faq-section > h3 {
    margin-bottom: 1.5rem;
    border-bottom: none;
}

.faq-item {
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    margin-bottom: 0.625rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 2px 8px hsl(var(--foreground) / 0.08);
}

.faq-item.is-active {
    border-color: hsl(var(--primary) / 0.4);
    box-shadow: 0 2px 12px hsl(var(--primary) / 0.1);
}

.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: 100%;
    padding: 1.125rem 1.25rem;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.4;
    transition: background-color 0.15s ease;
}

.faq-question:hover {
    background-color: hsl(var(--secondary) / 0.5);
}

.faq-item.is-active .faq-question {
    background-color: hsl(var(--primary) / 0.05);
    color: hsl(var(--primary));
}

.faq-icon {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background-color: hsl(var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, background-color 0.2s ease;
}

.faq-icon::before {
    content: '';
    display: block;
    width: 0.625rem;
    height: 0.625rem;
    border-right: 2px solid hsl(var(--muted-foreground));
    border-bottom: 2px solid hsl(var(--muted-foreground));
    transform: rotate(45deg) translate(-1px, -2px);
    transition: border-color 0.2s ease, transform 0.3s ease;
}

.faq-item.is-active .faq-icon {
    transform: rotate(180deg);
    background-color: hsl(var(--primary) / 0.1);
}

.faq-item.is-active .faq-icon::before {
    border-color: hsl(var(--primary));
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.25s ease;
    padding: 0 1.25rem;
}

.faq-item.is-active .faq-answer {
    max-height: 800px;
    padding: 0 1.25rem 1.25rem;
}

.faq-answer p {
    font-size: 0.9375rem;
    line-height: 1.75;
    color: hsl(var(--muted-foreground));
    margin: 0;
}

.faq-answer p + p {
    margin-top: 0.75rem;
}

.faq-answer ul,
.faq-answer ol {
    margin: 0.75rem 0 0 1.25rem;
    color: hsl(var(--muted-foreground));
    font-size: 0.9375rem;
    line-height: 1.75;
}

/* =============================================
   ARTIGO: BLOCO FAQ - Shortcode / Gutenberg
   Usa classe .wp-block-onorbit-faq ou .faq-section
   ============================================= */

/* Instrução de uso no editor:
   Envolve o bloco de FAQs com a classe CSS "faq-section"
   e cada pergunta/resposta com "faq-item", "faq-question", "faq-answer"
   O JavaScript no blog-article.js trata do accordion automaticamente.
*/

/* =============================================
   WORDPRESS: Preserva estilos do editor
   Evita que o conteúdo "compacte" ao guardar
   ============================================= */

/* Garante que parágrafos vazios não colapsam o layout */
.entry-content p:empty {
    display: none;
}

/* Evita que o WordPress remova <br> relevantes */
.entry-content .wp-block-spacer {
    display: block;
}

/* Compatibilidade com blocos Gutenberg */
.entry-content .wp-block-paragraph,
.entry-content .wp-block-heading,
.entry-content .wp-block-list {
    max-width: 100%;
}

/* =============================================
   ARTIGO: RESPONSIVE
   ============================================= */

@media (max-width: 640px) {
    .entry-content h2 {
        font-size: 1.4rem;
    }

    .entry-content h3 {
        font-size: 1.125rem;
    }

    .faq-question {
        font-size: 0.9375rem;
        padding: 1rem;
    }

    .faq-item.is-active .faq-answer {
        padding: 0 1rem 1rem;
    }
}

/* =============================================
   ARTIGO: NAVEGAÇÃO ANTERIOR / PRÓXIMO
   Com imagem em miniatura e data do artigo
   ============================================= */

.post-navigation {
    padding: 3rem 0 !important;
    background-color: hsl(var(--secondary) / 0.3);
    border-top: 1px solid hsl(var(--border));
}

.post-nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.post-nav-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-decoration: none;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.post-nav-card:hover {
    box-shadow: 0 4px 20px hsl(var(--foreground) / 0.1);
    transform: translateY(-2px);
    border-color: hsl(var(--primary) / 0.3);
}

.post-nav-card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    background-color: hsl(var(--secondary));
}

.post-nav-card-image-placeholder {
    width: 100%;
    height: 120px;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.08), hsl(var(--primary) / 0.18));
    display: flex;
    align-items: center;
    justify-content: center;
    color: hsl(var(--primary) / 0.4);
    font-size: 2rem;
}

.post-nav-card-body {
    padding: 0.875rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.post-nav-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: hsl(var(--primary));
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.post-nav-label svg {
    width: 0.75rem;
    height: 0.75rem;
}

.post-nav-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-nav-date {
    font-size: 0.75rem;
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.post-nav-card.post-nav-next .post-nav-label {
    justify-content: flex-end;
}

.post-nav-card.post-nav-next .post-nav-body {
    text-align: right;
}

@media (max-width: 640px) {
    .post-nav-grid {
        grid-template-columns: 1fr;
    }
    .post-nav-card-image,
    .post-nav-card-image-placeholder {
        height: 100px;
    }
}

/* =============================================
   ARTIGO: SECÇÃO DE COMENTÁRIOS
   Design clean, com avatar do utilizador
   ============================================= */

.comment-section-wrapper {
    background-color: hsl(var(--background));
    border-top: 1px solid hsl(var(--border));
    padding: 3rem 0 4rem;
}

/* Título da secção */
#respond h3#reply-title,
#respond .comment-reply-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: hsl(var(--foreground));
    margin-bottom: 0.375rem;
    letter-spacing: -0.02em;
}

/* Subtítulo / descrição */
.comment-section-subtitle {
    font-size: 0.9375rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* Formulário principal */
#commentform {
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1.25rem;
    padding: 2rem;
}

/* Linha com avatar + textarea */
.comment-form-avatar-row {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.comment-form-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid hsl(var(--border));
}

.comment-form-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, hsl(var(--primary) / 0.15), hsl(var(--primary) / 0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 2px solid hsl(var(--border));
    color: hsl(var(--primary));
}

/* Textarea */
#commentform textarea#comment {
    width: 100%;
    min-height: 120px;
    padding: 0.875rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.75rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

#commentform textarea#comment:focus {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.08);
}

#commentform textarea#comment::placeholder {
    color: hsl(var(--muted-foreground) / 0.6);
}

/* Grid de campos Nome/Email/Site */
.comment-form-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form-field-full {
    grid-column: 1 / -1;
}

#commentform p.comment-form-author,
#commentform p.comment-form-email,
#commentform p.comment-form-url,
#commentform p.comment-form-comment {
    margin: 0;
}

#commentform label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: hsl(var(--foreground));
    margin-bottom: 0.375rem;
    letter-spacing: 0.01em;
}

#commentform input[type="text"],
#commentform input[type="email"],
#commentform input[type="url"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--border));
    border-radius: 0.625rem;
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
    font-family: inherit;
    font-size: 0.9375rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
    box-sizing: border-box;
}

#commentform input[type="text"]:focus,
#commentform input[type="email"]:focus,
#commentform input[type="url"]:focus {
    border-color: hsl(var(--primary) / 0.5);
    box-shadow: 0 0 0 3px hsl(var(--primary) / 0.08);
}

/* Checkbox de memória */
#commentform p.comment-form-cookies-consent {
    margin: 0.75rem 0 1.25rem;
}

#commentform p.comment-form-cookies-consent label {
    font-size: 0.8125rem;
    font-weight: 400;
    color: hsl(var(--muted-foreground));
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    cursor: pointer;
    line-height: 1.5;
}

#commentform input[type="checkbox"] {
    margin-top: 0.1rem;
    accent-color: hsl(var(--primary));
    flex-shrink: 0;
}

/* Botão submit */
#commentform input[type="submit"],
#commentform .submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    background-color: hsl(var(--primary));
    color: #ffffff;
    border: none;
    border-radius: 0.625rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.15s ease;
    letter-spacing: 0.01em;
}

#commentform input[type="submit"]:hover,
#commentform .submit:hover {
    background-color: hsl(var(--primary) / 0.88);
    transform: translateY(-1px);
}

/* Lista de comentários existentes */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem;
}

.comment-list .comment {
    padding: 1.5rem;
    background-color: hsl(var(--card));
    border: 1px solid hsl(var(--border));
    border-radius: 1rem;
    margin-bottom: 1rem;
}

.comment-list .comment-author img {
    border-radius: 50%;
    border: 2px solid hsl(var(--border));
}

/* Ocultar o campo "Site" — opcional: remover esta linha se quiser manter */
/* #commentform p.comment-form-url { display: none; } */

/* Nota obrigatório */
#commentform p.comment-notes {
    font-size: 0.8125rem;
    color: hsl(var(--muted-foreground));
    margin-bottom: 1.25rem;
}

/* Responsive */
@media (max-width: 640px) {
    .comment-form-fields-grid {
        grid-template-columns: 1fr;
    }
    #commentform {
        padding: 1.25rem;
    }
    .comment-form-avatar-row {
        gap: 0.75rem;
    }
    .comment-form-avatar,
    .comment-form-avatar-placeholder {
        width: 40px;
        height: 40px;
    }
}
