/* noticia.css */

/* Variáveis para controle fácil */
:root {
    --largura-container: 950px;
    --largura-post-body: 900px;
    --largura-imagem: 750px;

    --titulo-font-size: 38px;
    --subtitulo-font-size: 16px; /* Corrigi "16x" para "16px" */
    --data-font-size: 14px;
    --conteudo-font-size: 16px;
}

/* Reset e base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;
    background: #fff;
    color: #222;
    text-align: center;
}

/* Container principal */
.container {
    max-width: var(--largura-container);
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
}

.bloco-anuncio-superior {
  background-color: #f5f5f5; /* cinza claro */
  max-width: 1300px;
  width: 100%;
  margin: 0 auto 20px auto;
  padding: 10px;
  text-align: center;
  min-height: 90px; /* garante altura mesmo sem anúncio */
  border-radius: 6px;
  box-shadow: 0 0 4px rgba(0,0,0,0.05);
}

/* Data da notícia */
.post-meta .post-date {
    font-size: var(--data-font-size);
    color: #777;
    margin-bottom: 10px;
}

/* Títulos - sempre centralizados, com largura controlada */
.post-title, h1 {
    font-size: var(--titulo-font-size);
    margin: 0 0 10px;
    color: #111;
    font-weight: 720;
    max-width: 950px; /* aumentei para evitar quebra precoce */
    margin-left: auto;
    margin-right: auto;
    text-align: center;

    /* Limitar a 2 linhas com reticências */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;

    white-space: normal; /* permite quebra natural */
    overflow-wrap: normal; /* evita quebras forçadas */
    word-break: normal; /* evita quebra no meio das palavras */
    hyphens: none; /* desabilita hífen */
    line-height: 1.2;
}

.post-subtitle, h2 {
    font-size: var(--subtitulo-font-size);
    color: #555;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: 500;
    max-width: var(--largura-post-body);
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

/* Aqui está a sua alteração para o subtítulo */
.post-subtitle {
    white-space: normal;
    max-width: 650px; /* ajuste esse valor para a largura que desejar */
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Imagem da notícia */
.post-image img {
    max-width: 100%;
    width: var(--largura-imagem);
    height: auto;
    display: block;
    margin: 20px auto 0;
    border-radius: 8px;
}

/* Descrição da foto */
.foto-descricao {
    font-size: 14px;
    color: #666;
    text-align: center;
    margin-top: 5px;
    font-style: italic;
}

/* Conteúdo da notícia */
.post-body {
    font-size: var(--conteudo-font-size);
    line-height: 1.7;
    color: #000;
    text-align: justify;
    margin: 0 auto;
    max-width: var(--largura-post-body);
}

.post-body p {
    margin-bottom: 1em;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin-top: 1.2em;
    margin-bottom: 0.6em;
    color: #222;
    text-align: left;
}

.post-body ul,
.post-body ol {
    margin: 1em 0;
    padding-left: 40px;
}

.post-body blockquote {
    border-left: 4px solid #ccc;
    padding-left: 15px;
    color: #666;
    margin: 20px 0;
    font-style: italic;
    background: #f9f9f9;
}

.post-body img {
    width: 100%;
    max-width: 580px;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 10px;
}

/* Categorias - fundo colorido igual ao header */
.post-category.categoria-badge {
    padding: 5px 10px;
    border-radius: 0;
    font-weight: 600;
    color: white;
    display: inline-block;
    font-size: 14px;
    text-transform: capitalize;
    margin: 10px auto;
}

.post-category.categoria-badge.politica { background-color: #b22222; }
.post-category.categoria-badge.policia { background-color: #DF2525; }
.post-category.categoria-badge.esportes { background-color: #228b22; }
.post-category.categoria-badge.tecnologia { background-color: #1e90ff; }
.post-category.categoria-badge.saude { background-color: #32cd32; }
.post-category.categoria-badge.entretenimento { background-color: #ff69b4; }
.post-category.categoria-badge.cultura { background-color: #8a2be2; }
.post-category.categoria-badge.brasil { background-color: #555555; }
.post-category.categoria-badge.regionais { background-color: #ff6600; }
.post-category.categoria-badge.mundo { background-color: #0066cc; }
.post-category.categoria-badge.geral { background-color: #444444; }

/* Social Share */
.social-share {
    margin-top: 30px;
    text-align: center;
}

.social-share h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px; /* Espaço maior para separar do ícone */
}

/* Container para alinhar ícones horizontalmente abaixo do texto */
.social-share-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.social-share a img {
    width: 32px;
    height: 32px;
    filter: grayscale(0);
    transition: filter 0.3s ease;
    cursor: pointer;
}

.social-share a:hover img {
    filter: brightness(0.8);
}

/* Responsividade */
@media (max-width: 992px) {
    :root {
        --titulo-font-size: 28px;
        --subtitulo-font-size: 18px;
        --largura-imagem: 100%;
        --largura-post-body: 95%;
    }
    .post-image img {
        width: 100% !important;
        max-width: 100% !important;
    }
    .post-title, h1 {
        max-width: 95% !important;
        font-size: 28px !important;
    }
}

@media (max-width: 767px) {
    .post-title {
        display: block !important;
        -webkit-line-clamp: unset !important;
        overflow: visible !important;
        text-overflow: clip !important;
        line-height: normal !important;
    }
}

@media (max-width: 576px) {
    :root {
        --titulo-font-size: 24px;
        --subtitulo-font-size: 16px;
        --conteudo-font-size: 16px;
    }
    .container {
        padding: 0 10px;
        margin: 20px auto;
    }
    .social-share {
        gap: 10px;
    }
}
