/* ==========================================
   ESTILOS MOBILE EXCLUSIVOS PARA A PÁGINA DE NOTÍCIAS (noticia.html)
   ========================================== */

@media (max-width: 768px) {
  /* 1. ESTRUTURA E ESPAÇAMENTO BASE */
  body {
    padding-top: 80px !important; /* Ajusta a margem do topo para o cabeçalho mobile */
  }

  main,
  .news-container,
  .noticia-container,
  #newsContent {
    padding: 1rem !important;
    margin: 1rem 0.5rem !important;
    border-radius: 8px !important;
    max-width: 100% !important;
  }

  /* 2. CABEÇALHO DA NOTÍCIA (Título, Subtítulo e Autor) */
  .news-title, 
  #newsTitle {
    font-size: 1.35rem !important;
    line-height: 1.25 !important;
    margin-bottom: 0.5rem !important;
  }

  .news-subtitle, 
  #newsSubtitle {
    font-size: 0.9rem !important;
    margin-bottom: 1rem !important;
    line-height: 1.35 !important;
  }

  .author-box {
    gap: 0.6rem !important;
    margin: 0.8rem 0 1rem 0 !important;
    padding-bottom: 0.8rem !important;
  }

  .author-avatar,
  .avatar-autor,
  .author-box img {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  .author-info {
    font-size: 0.82rem !important;
  }

  /* 3. IMAGENS E MÍDIAS DENTRO DA NOTÍCIA (EXIBIÇÃO INTEGRAL SEM CORTES) */
  .news-image {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    object-fit: contain !important;
    margin: 1rem auto !important;
    border-radius: 6px !important;
  }

  /* Imagens no corpo do texto (Garante altura proporcional sem cortar pôsteres verticais) */
  .news-body img,
  #viewBody img,
  .noticia-conteudo img,
  #newsContent img,
  .news-body p img,
  #viewBody p img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;         /* Permite que a altura cresça proporcionalmente */
    max-height: none !important;     /* Remove o limite de 300px que cortava a imagem */
    object-fit: contain !important;  /* Exibe a imagem inteira sem recortar topo ou fundo */
    display: block !important;
    margin: 0.8rem auto !important;
    border-radius: 6px !important;
  }

  .news-body p:has(img),
  #newsContent p:has(img) {
    margin: 0.4rem 0 !important;
  }

  /* Vídeos do YouTube adaptados para telas pequenas */
  .news-body iframe[src*="youtube.com"],
  .news-body iframe[src*="youtu.be"],
  #newsContent iframe[src*="youtube.com"],
  #newsContent iframe[src*="youtu.be"] {
    width: 100% !important;
    min-height: 200px !important;
    margin: 1rem auto !important;
    border-radius: 8px !important;
  }

  /* Twitter e embeds externos */
  .twitter-tweet, 
  .twitter-tweet-rendered,
  iframe[src*="twitter.com"], 
  iframe[src*="x.com"] {
    margin: 1rem auto !important;
    width: 100% !important;
  }

  /* 4. BLOCO DE PRODUTOS AFILIADOS (EM COLUNA) */
  .bloco-produto-afiliado {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
    padding: 12px !important;
  }

  .img-afiliado-mini {
    width: 65px !important;
    height: 65px !important;
    min-width: 65px !important;
    min-height: 65px !important;
    align-self: center !important;
  }

  .produto-info {
    text-align: center !important;
  }

  .produto-titulo {
    font-size: 0.85rem !important;
    text-align: center !important;
    margin-bottom: 6px !important;
  }

  .produto-precos {
    justify-content: center !important;
  }

  .botao-oferta-afiliado {
    width: 100% !important;
    text-align: center !important;
    padding: 0.7rem !important;
    font-size: 0.85rem !important;
  }

  /* 5. CITAÇÕES (BLOCKQUOTE) */
  blockquote.destaque-citacao {
    margin: 1.2rem 0 !important;
    padding: 0.8rem 1rem !important;
  }

  blockquote.destaque-citacao p {
    font-size: 0.95rem !important;
  }
}
/* GALERIA NO CELULAR: no máximo duas fotos por linha. */
@media (max-width: 768px) {
  #viewBody .rg-gallery,
  .news-body .rg-gallery,
  #editor-container-edicao .ql-editor .rg-gallery,
  #viewBody .rg-gallery[data-columns="3"],
  #editor-container-edicao .ql-editor .rg-gallery[data-columns="3"] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: .8rem 0 !important;
  }
  #viewBody .rg-gallery img,
  .news-body .rg-gallery img,
  #editor-container-edicao .ql-editor .rg-gallery img {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    object-fit: contain !important;
    border-radius: 0 !important;
  }
}

@media (max-width: 768px) {
  #viewBody .reddit-embed-bq,
  #viewBody iframe[src*="reddit"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 12px auto !important;
  }
}
