/* ======================== */
/* Estilos Globais e Reset */
/* ======================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

/* ======================== */
/* Header e Navegação      */
/* ======================== */
.header-white {
    background-color: #ffffff;
    padding: 1rem 0;
    border-bottom: 2px solid #ddd;
}

.header-container {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo-cobre {
    max-width: 50px;
    height: auto;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    text-transform: uppercase;
}

.menu-bar {
    background-color: #007BFF;
    padding: 0.5rem 0;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.menu-bar a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 0.5rem 1rem;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.menu-bar a:hover {
    background-color: #0056b3;
}

/* ======================== */
/* Post Hero e Meta        */
/* ======================== */
.post-hero {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    text-align: center;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
    padding: 20px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    position: relative;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Aplica a máscara escura sobre o background do hero */
.post-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

/* Regra específica para o post sobre IDR */
.post-hero.idr-hero {
    background-image: url('imagens/idr-painel-eletrico.jpg');
}

/* Regra específica para o post sobre Disjuntor */
.post-hero.disjuntor-hero {
    background-image: url('imagens/disjuntor-quadro-distribuicao.jpg');
}

/* Regra específica para o hero da página principal */
.post-hero.main-page-hero {
    background-image: url('imagens/blog-instalacoes-eletrica.jpeg');
}

.post-meta {
    background: rgba(0, 0, 0, 0.5);
    padding: 10px 20px;
    border-radius: 8px;
    width: 90%;
    margin-bottom: 10px;
    position: relative;
    z-index: 1; /* Garante que o post-meta fique acima da máscara escura */
}

.post-meta h1 {
    font-size: 2.2rem;
    margin-bottom: 5px;
    line-height: 1.2;
    color: #fff;
}

.post-meta p {
    font-size: 1rem;
    margin-bottom: 0;
    color: #fff;
}

/* ======================== */
/* Search Results Page Hero */
/* ======================== */
.post-hero.search-hero {
    background-image: url('imagens/blog-instalacoes-eletrica.jpeg');
    height: 150px;
    align-items: center;
}

.post-hero.search-hero .post-meta {
    background: rgba(255, 255, 255, 0.75);
    width: 90%;
    color: #333;
    text-shadow: none;
    margin-bottom: 0;
    padding: 15px 20px;
}

.post-hero.search-hero .post-meta h1 {
    font-size: 1.8rem;
    color: #007BFF;
}

.post-hero.search-hero .post-meta h1 span {
    color: #333;
}

.no-results-message {
    color: red;
    font-weight: bold;
    text-align: center;
    font-size: 1.2rem;
    margin: 40px 0;
    width: 100%;
}


/* ======================== */
/* Estrutura Principal     */
/* ======================== */
.content-wrapper {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 20px auto;
    gap: 20px;
    padding: 0 20px;
}

.main-posts {
    flex: 3;
    min-width: 300px;
}

.sidebar {
    flex: 1;
    min-width: 250px;
    background-color: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    height: fit-content;
}

/* ======================== */
/* Conteúdo do Post        */
/* ======================== */
.post-content h2, .post-content h3, .post-content p {
    text-align: justify;
}

.post {
    margin-bottom: 20px;
}

.post-content h2 {
    font-size: 1.8rem;
    color: #007BFF;
    margin-top: 25px;
    margin-bottom: 10px;
}

.post-content h3 {
    font-size: 1.4rem;
    color: #333;
    margin-top: 20px;
    margin-bottom: 8px;
    border-left: 3px solid #007BFF;
    padding-left: 10px;
}

.post-content p {
    margin-bottom: 15px;
    font-size: 1rem;
}

.post-content ul {
    list-style-type: disc;
    margin-left: 20px;
    margin-bottom: 15px;
}

.post-content li {
    margin-bottom: 5px;
}

/* ======================== */
/* Post Previews (Index Page) */
/* ======================== */
.post-previews {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.post-card-link {
    flex: 1;
    min-width: 300px;
    text-decoration: none;
    color: inherit;
}

.post-card {
    background-color: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease-in-out;
    height: 100%;
}

.post-card:hover {
    transform: scale(1.03);
}

.post-card-image {
    height: 180px;
    background-size: cover;
    background-position: center;
}

.post-card-image.idr-card {
    background-image: url('imagens/idr-painel-eletrico.jpg');
}

.post-card-image.disjuntor-card {
    background-image: url('imagens/disjuntor-quadro-distribuicao.jpg');
}

.post-card-content {
    padding: 15px;
}

.post-card-content h3 {
    font-size: 1.2rem;
    color: #007BFF;
    margin-top: 0;
    margin-bottom: 10px;
    border-left: none;
    padding-left: 0;
}

.post-card-content p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 0;
    text-align: justify;
}

.post-card-content p span {
    color: #007BFF;
    text-decoration: underline;
    font-weight: bold;
    margin-left: 5px;
}

.post-card-content p span:hover {
    text-decoration: none;
}


/* ======================== */
/* Busca e Sidebar         */
/* ======================== */
.search-box {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.search-box input {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.search-box button {
    padding: 8px 12px;
    border: none;
    background-color: #007BFF;
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.search-box button svg {
    width: 16px;
    height: 16px;
    fill: #fff;
}

.recent-posts {
    margin-top: 20px;
}

.recent-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.recent-posts ul {
    list-style: none;
}

.recent-posts li a {
    display: block;
    padding: 8px 0;
    color: #007BFF;
    text-decoration: none;
    border-bottom: 1px solid #eee;
    transition: color 0.3s ease;
}

.recent-posts li a:hover {
    color: #0056b3;
}

/* ======================== */
/* Seções de Ação          */
/* ======================== */
.share-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    text-align: center;
}

.share-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: #555;
    margin-bottom: 15px;
}

.share-title span {
    display: inline-block;
    margin-right: 5px;
}

.social-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.social-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 15px;
    border-radius: 5px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.social-btn:hover {
    transform: translateY(-2px);
}

.social-btn svg {
    width: 20px;
    height: 20px;
    margin-right: 8px;
}

.social-btn.facebook {
    background-color: #3b5998;
}

.social-btn.twitter {
    background-color: #00aced;
}

.social-btn.whatsapp {
    background-color: #25d366;
}

.social-btn.copy {
    background-color: #6c757d;
}

.social-btn.copy.copied {
    background-color: #28a745;
}

.about-section {
    margin: 30px 0;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
}

.about-section p {
    text-align: justify;
}

.about-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.about-header img {
    max-width: 80px;
    border-radius: 50%;
}

.about-header h2 {
    font-size: 1.8rem;
    color: #007BFF;
}

.comment-section {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
}

.comment-section h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.comment-section form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-section textarea,
.comment-section input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
}

.comment-section textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-section button {
    padding: 10px 15px;
    border: none;
    background-color: #007BFF;
    color: #fff;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.comment-section button:hover {
    background-color: #0056b3;
}

/* Estilos para a mensagem de sucesso do formulário (novo) */
.success-message {
    margin-top: 10px;
    padding: 10px;
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    text-align: center;
    transition: opacity 0.5s ease-in-out;
}

/* ======================== */
/* Rodapé                  */
/* ======================== */
.footer-vertical {
    background-color: #0056b3;
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
    border-top: 2px solid #444;
}

.footer-logo {
    max-width: 100px;
    margin-bottom: 15px;
}

.footer-vertical p {
    margin-bottom: 10px;
}

.footer-vertical a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-vertical a:hover {
    color: #fff;
}

.footer-copy {
    margin-top: 20px;
    font-size: 0.9rem;
    color: #bbb;
}

/* ======================== */
/* Responsividade          */
/* ======================== */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    .post-hero {
        height: 250px;
        padding: 15px;
    }

    .post-meta h1 {
        font-size: 1.8rem;
    }

    .post-meta p {
        font-size: 0.9rem;
    }

    .post-previews {
        flex-direction: column;
    }
}
