/* ==========================================================================
   CSS Globais e Variáveis
   ========================================================================== */

:root {
    --soft-sage-green: #A8C3B0;
    --warm-sand: #E8DCC6;
    --deep-forest-green: #3E5C4E;
    --off-white: #FAF9F7;
    --warm-taupe: #C2A994;
    --shadow: 0 15px 30px rgba(0,0,0,0.1);
    --shadow-hover: 0 25px 50px rgba(0,0,0,0.15);
}

/* Reset Básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Lato', sans-serif;
}

/* Estilos Base do Body */
body {
    background: var(--off-white);
    min-height: 100vh;
    font-family: 'Lato', sans-serif;
    line-height: 1.6;
    color: var(--deep-forest-green);
}

/* ==========================================================================
   Layout Principal e Estrutura
   ========================================================================== */

/* Wrapper do Conteúdo Principal */
.main-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Container Principal do Post */
.container {
    width: 100%;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out; /* Animação aplicada aqui para o container */
}

/* ==========================================================================
   Navegação
   ========================================================================== */

/* Seção Voltar para o Site */
.back-to-site-nav {
    padding: 15px 0;
    margin-bottom: 0;
}

.back-to-site-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: left;
}

.btn-voltar {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--soft-sage-green);
    color: var(--deep-forest-green);
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(168, 195, 176, 0.3);
}

.btn-voltar:hover {
    background: var(--warm-taupe);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(168, 195, 176, 0.4);
}

/* ==========================================================================
   Seção Hero do Post
   ========================================================================== */

.post-hero-section {
    position: relative;
    background-color: #556b2f; /* Cor de fallback */
    background-size: cover;
    background-position: center center;
    padding: 80px 20px;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.post-cover-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.post-cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-hero-no-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--deep-forest-green), var(--soft-sage-green));
    z-index: 1;
}

.post-hero-content {
    position: relative;
    z-index: 3;
    text-align: center;
    color: white;
    padding: 60px 40px;
    max-width: 900px;
}

.post-title {
    font-family: 'Lato', sans-serif;
    font-size: 2.8em;
    font-weight: 700;
    margin-bottom: 30px;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
    color: white;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center;
    position: relative;
    z-index: 3;
}

.post-meta span {
    display: flex;
    align-items: center;
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.95em;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    gap: 8px;
    white-space: nowrap;
    color: white;
}

/* Estilos para o Autor e Data */
.post-meta .author,
.post-meta .date {
    background: linear-gradient(135deg, rgba(60, 60, 60, 0.9), rgba(30, 30, 30, 0.9)); /* Fundo escuro mais opaco */
    color: white; /* Mantém o texto branco */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: none; /* Remove a borda clara original */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4); /* Sombra mais escura e pronunciada */
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8); /* Adiciona sombra no texto para maior contraste */
}

/* Estilos para Status do Post */
.post-meta .status.status-publicado {
    background-color: #4CAF50;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.post-meta .status.status-rascunho {
    background-color: #ff9800;
    border: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    color: white;
}

/* ==========================================================================
   Área de Conteúdo do Post
   ========================================================================== */

.post-content-area {
    padding: 60px 50px;
    background: white;
    text-align: justify;
    word-wrap: break-word;
}

/* Embeds do YouTube */
.youtube-embed {
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 56.25%; /* Proporção 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    border: none;
}

/* Estilos do Conteúdo Principal do Post */
.post-content {
    font-size: 1.2rem;
    color: var(--deep-forest-green);
    text-align: justify;
    margin-bottom: 40px;
    font-family: 'Lato', sans-serif;
}

.post-content p {
    font-family: 'Lato', sans-serif;
    margin-bottom: 0;
}

.post-content p:first-of-type {
    font-size: 1.1em;
    font-weight: 400;
}

.post-content img {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
    border-radius: 15px !important;
    margin: 25px 0 !important;
    box-shadow: var(--shadow) !important;
    transition: transform 0.3s ease !important;
}

.post-content img:hover {
    transform: scale(1.02) !important;
}

/* Estilos para Títulos no Conteúdo */
.post-content h1, 
.post-content h2, 
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--deep-forest-green);
    margin-top: 2.5em;
    margin-bottom: 1em;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    position: relative;
    padding-left: 20px;
}

.post-content h1::before,
.post-content h2::before,
.post-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 70%;
    background: var(--soft-sage-green);
    border-radius: 2px;
}

.post-content h1 { font-size: 1.8em; }
.post-content h2 { font-size: 1.5em; }
.post-content h3 { font-size: 1.3em; }

/* Listas e Blockquotes */
.post-content ul, 
.post-content ol {
    margin-left: 2em;
    margin-bottom: 1.5em;
    font-family: 'Lato', sans-serif;
}

.post-content li {
    margin-bottom: 8px;
    font-family: 'Lato', sans-serif;
}

.post-content blockquote {
    background: var(--warm-sand);
    padding: 25px;
    border-left: 5px solid var(--soft-sage-green);
    border-radius: 10px;
    font-style: italic;
    color: var(--deep-forest-green);
    font-family: 'Lato', sans-serif;
}

/* Garante a fonte Lato para elementos inline */
.post-content a,
.post-content strong,
.post-content b,
.post-content em,
.post-content i {
    font-family: 'Lato', sans-serif;
}

/* Alinhamento de Imagens do Quill Editor */
.post-content .ql-align-center img,
.post-content p[style*="text-align: center"] img,
.post-content div[style*="text-align: center"] img {
    margin-left: auto !important;
    margin-right: auto !important;
}

.post-content .ql-align-right img,
.post-content p[style*="text-align: right"] img,
.post-content div[style*="text-align: right"] img {
    margin-left: auto !important;
    margin-right: 0 !important;
}

.post-content .ql-align-left img,
.post-content p[style*="text-align: left"] img,
.post-content div[style*="text-align: left"] img {
    margin-left: 0 !important;
    margin-right: auto !important;
}

.post-content .ql-align-justify img,
.post-content p[style*="text-align: justify"] img,
.post-content div[style*="text-align: justify"] img {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Alinhamento de Texto do Quill Editor */
.post-content p[style*="text-align: center"],
.post-content div[style*="text-align: center"],
.post-content .ql-align-center {
    text-align: center !important;
    text-indent: 0 !important;
}

.post-content p[style*="text-align: right"],
.post-content div[style*="text-align: right"],
.post-content .ql-align-right {
    text-align: right !important;
}

.post-content p[style*="text-align: left"],
.post-content div[style*="text-align: left"],
.post-content .ql-align-left {
    text-align: left !important;
}

.post-content p[style*="text-align: justify"],
.post-content div[style*="text-align: justify"],
.post-content .ql-align-justify {
    text-align: justify !important;
}

/* Correções de Espaçamento para o Editor Quill */
.ql-editor p {
    margin-bottom: 8px !important;
    font-family: 'Lato', sans-serif !important;
}

.ql-editor p + p {
    margin-top: 0 !important;
}

.ql-editor p:not(:empty) {
    line-height: 1.5;
}

.ql-editor ul li,
.ql-editor ol li {
    margin-bottom: 16px !important; 
    font-family: 'Lato', sans-serif !important;
    line-height: 1.6;
}

.ql-editor strong + p,
.ql-editor em + p {
    margin-top: 5px;
}

.ql-editor p:first-child {
    margin-top: 0;
}

.ql-editor p:last-child {
    margin-bottom: 15px;
}

.ql-editor h1 + p,
.ql-editor h2 + p,
.ql-editor h3 + p {
    margin-top: 15px !important;
}

.ql-editor blockquote {
    margin: 20px 0 !important;
    font-family: 'Lato', sans-serif !important;
}

.ql-editor blockquote p {
    margin-bottom: 10px !important;
}

.ql-editor h1,
.ql-editor h2,
.ql-editor h3,
.ql-editor h4,
.ql-editor h5,
.ql-editor h6 {
    font-family: 'Lato', sans-serif !important;
}

/* Força Fonte Lato para elementos de formulário e editor */
input, textarea, select, button {
    font-family: 'Lato', sans-serif !important;
}

.ql-editor * {
    font-family: 'Lato', sans-serif !important;
}

/* ==========================================================================
   Ações e Compartilhamento
   ========================================================================== */

/* Seção de Ações na Parte Inferior do Post */
.post-actions-bottom {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 50px;
    flex-wrap: wrap;
    border-top: 3px solid var(--soft-sage-green);
    background: var(--off-white);
}

.post-actions-bottom a {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: 10px;
    font-weight: 600;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.post-actions-bottom .btn-secondary {
    background: var(--warm-sand);
    color: var(--deep-forest-green);
}

.post-actions-bottom .btn-primary {
    background: var(--soft-sage-green);
    color: var(--deep-forest-green);
}

.post-actions-bottom .btn-secondary:hover,
.post-actions-bottom .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

/* Botões de Compartilhamento */
.share-buttons {
    margin: 0;
    padding: 30px;
    background: linear-gradient(135deg, var(--warm-sand), var(--soft-sage-green));
    text-align: center;
    box-shadow: var(--shadow);
}

.share-buttons h4 {
    margin-bottom: 25px;
    color: var(--deep-forest-green);
    font-family: 'Lato', sans-serif;
    font-size: 1.2em;
    font-weight: 600;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    margin: 5px;
    text-decoration: none;
    border-radius: 25px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    font-family: 'Lato', sans-serif;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.share-whatsapp { background: linear-gradient(135deg, #25D366, #128C7E); }
.share-facebook { background: linear-gradient(135deg, #1877F2, #166FE5); }
.share-twitter { background: linear-gradient(135deg, #000000, #000000); }
.share-linkedin { background: linear-gradient(135deg, #0077B5, #005885); }

/* ==========================================================================
   Responsividade
   ========================================================================== */

@media (max-width: 768px) {
    .back-to-site-nav { padding: 10px 0; }
    .back-to-site-container { padding: 0 15px; }
    .main-page-wrapper { padding: 0 15px; }
    .post-hero-section {
        padding: 60px 15px;
        min-height: 400px;
    }
    .post-title {
        font-size: 2em;
        margin-bottom: 25px;
    }
    .post-meta {
        flex-direction: column;
        gap: 10px;
    }
    .post-meta span {
        width: fit-content;
        margin: 0 auto;
    }
    .post-content-area { padding: 40px 25px; }
    .post-actions-bottom {
        flex-direction: column;
        align-items: center;
        padding: 40px 25px;
    }
    .post-actions-bottom a {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
    .post-content {
        font-size: 16px;
        text-align: left;
        word-wrap: break-word;
    }
    .share-btn {
        padding: 10px 15px;
        font-size: 13px;
        margin: 3px;
    }
    .btn-voltar {
        padding: 10px 18px;
        font-size: 13px;
    }
    .youtube-embed { margin-bottom: 30px; }
}

@media (max-width: 480px) {
    .post-title {
        font-size: 1.6em;
        margin-bottom: 20px;
    }
    .post-meta span {
        font-size: 0.85em;
        padding: 8px 15px;
    }
    .post-content { font-size: 1.1rem; }
    .post-hero-section {
        min-height: 350px;
        padding: 30px 20px;
    }
    .post-content-area { padding: 30px 20px; }
    .share-buttons { padding: 20px 15px; }
    .share-btn {
        display: block;
        margin: 8px auto; /* Centraliza os botões */
        text-align: center;
    }
}

/* ==========================================================================
   Animações
   ========================================================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Acessibilidade
   ========================================================================== */

.btn-voltar:focus,
.share-btn:focus {
    outline: 3px solid var(--soft-sage-green);
    outline-offset: 2px;
}

::selection {
    background: var(--soft-sage-green);
    color: var(--deep-forest-green);
}

::-moz-selection {
    background: var(--soft-sage-green);
    color: var(--deep-forest-green);
}