/*
 * ValeSJC - Mobile global
 * Escopo: home, páginas internas, posts, categorias, arquivos e rodapé.
 * Objetivo: eliminar estouro horizontal, ajustar respiro, títulos, grids, imagens e blocos editoriais.
 */

@media (max-width: 980px) {
  html,
  body {
    max-width: 100%;
    overflow-x: hidden;
  }

  *,
  *::before,
  *::after {
    box-sizing: border-box;
  }

  img,
  picture,
  video,
  iframe,
  embed,
  object,
  svg {
    max-width: 100%;
  }

  img,
  picture,
  video {
    height: auto;
  }

  iframe {
    width: 100%;
  }

  .site,
  .site-header,
  .site-main,
  .site-footer,
  .content-area,
  main,
  header,
  footer,
  section,
  article,
  aside,
  nav {
    max-width: 100%;
  }

  .container,
  .wrap,
  .site-container,
  .content-wrap,
  .page-wrap,
  .entry-wrap,
  .archive-wrap,
  .single-wrap,
  .home-wrap,
  .inner,
  .grid,
  .row,
  .columns,
  .wp-block-group,
  .wp-block-columns {
    max-width: 100%;
  }

  .grid,
  .row,
  .columns,
  .wp-block-columns,
  .home-grid,
  .post-grid,
  .archive-grid,
  .category-grid,
  .featured-grid,
  .cards-grid,
  .news-grid,
  .editorial-grid {
    gap: 1.25rem;
  }

  .entry-content,
  .page-content,
  .post-content,
  .archive-content,
  .home-content {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  h1,
  .site-title,
  .entry-title,
  .page-title,
  .archive-title,
  .home-title,
  .hero-title {
    overflow-wrap: anywhere;
    word-break: normal;
  }

  table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  pre,
  code {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
  }

  figure,
  .wp-caption {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .alignwide,
  .alignfull {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
}

/* Home */

@media (max-width: 860px) {
  body.home .site-main,
  body.front-page .site-main,
  body.home main,
  body.front-page main {
    width: 100%;
  }

  body.home .hero,
  body.home .home-hero,
  body.home .front-hero,
  body.home .featured,
  body.home .featured-area,
  body.home .lead-story,
  body.home .main-story,
  body.home .headline-area,
  body.home .top-stories,
  body.home .news-section,
  body.home .editorial-section,
  body.home .home-section {
    max-width: 100%;
  }

  body.home .hero,
  body.home .home-hero,
  body.home .front-hero,
  body.home .featured-area,
  body.home .lead-story,
  body.home .headline-area {
    padding-left: 18px;
    padding-right: 18px;
  }

  body.home .home-grid,
  body.home .featured-grid,
  body.home .post-grid,
  body.home .archive-grid,
  body.home .category-grid,
  body.home .cards-grid,
  body.home .news-grid,
  body.home .editorial-grid,
  body.home .top-stories,
  body.home .section-grid {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  body.home .card,
  body.home .post-card,
  body.home .news-card,
  body.home .story-card,
  body.home .featured-card,
  body.home article {
    width: 100%;
    max-width: 100%;
  }

  body.home h1,
  body.home .hero-title,
  body.home .home-title,
  body.home .entry-title,
  body.home .post-title {
    font-size: clamp(2rem, 9.5vw, 3rem);
    line-height: 1.06;
    letter-spacing: -0.035em;
  }

  body.home h2,
  body.home .section-title,
  body.home .card-title {
    font-size: clamp(1.35rem, 6.2vw, 2rem);
    line-height: 1.12;
  }

  body.home h3 {
    font-size: clamp(1.1rem, 5.2vw, 1.45rem);
    line-height: 1.18;
  }

  body.home p,
  body.home li {
    font-size: 1rem;
    line-height: 1.65;
  }

  body.home .post-thumbnail,
  body.home .thumb,
  body.home .card-image,
  body.home .featured-image {
    width: 100%;
    max-width: 100%;
  }

  body.home .post-thumbnail img,
  body.home .thumb img,
  body.home .card-image img,
  body.home .featured-image img {
    width: 100%;
    height: auto;
    object-fit: cover;
  }
}

/* Páginas internas, posts e arquivos */

@media (max-width: 860px) {
  body:not(.home) .site-main,
  body:not(.home) main,
  body:not(.home) .content-area,
  body:not(.home) .entry-content,
  body:not(.home) .post-content,
  body:not(.home) .page-content,
  body:not(.home) .archive-content {
    width: 100%;
    max-width: 100%;
  }

  body:not(.home) h1,
  body:not(.home) .entry-title,
  body:not(.home) .page-title,
  body:not(.home) .archive-title {
    font-size: clamp(2rem, 9vw, 3rem);
    line-height: 1.08;
    letter-spacing: -0.03em;
  }

  body:not(.home) h2 {
    font-size: clamp(1.45rem, 6vw, 2.1rem);
    line-height: 1.16;
  }

  body:not(.home) h3 {
    font-size: clamp(1.2rem, 5vw, 1.55rem);
    line-height: 1.2;
  }

  body:not(.home) p,
  body:not(.home) li {
    font-size: 1rem;
    line-height: 1.72;
  }

  body:not(.home) .post-navigation,
  body:not(.home) .nav-links {
    display: grid;
    gap: 1rem;
  }

  body.archive .site-main,
  body.category .site-main,
  body.tag .site-main,
  body.search .site-main {
    width: 100%;
  }

  body.archive .post-grid,
  body.category .post-grid,
  body.tag .post-grid,
  body.search .post-grid,
  body.archive .archive-grid,
  body.category .archive-grid,
  body.tag .archive-grid,
  body.search .archive-grid {
    display: grid;
    grid-template-columns: 1fr;
  }
}

/* Header, menu e identidade */

@media (max-width: 720px) {
  .site-header,
  .header,
  .main-header,
  .masthead,
  .header-inner,
  .site-branding,
  .main-navigation,
  .primary-navigation {
    max-width: 100%;
  }

  .header-inner,
  .site-branding,
  .main-navigation,
  .primary-navigation {
    padding-left: 16px;
    padding-right: 16px;
  }

  .site-branding,
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
  }

  .custom-logo,
  .site-logo img,
  .site-branding img {
    max-width: min(100%, 280px);
    height: auto;
  }

  .site-title,
  .site-title a {
    max-width: 100%;
    font-size: clamp(2rem, 12vw, 3.25rem);
    line-height: 0.95;
    text-align: center;
  }

  .site-description,
  .tagline {
    max-width: 100%;
    font-size: 0.9rem;
    line-height: 1.35;
    text-align: center;
  }

  .main-navigation ul,
  .primary-navigation ul,
  .menu,
  .nav-menu {
    max-width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem 0.7rem;
  }

  .main-navigation a,
  .primary-navigation a,
  .menu a,
  .nav-menu a {
    white-space: normal;
    line-height: 1.25;
  }
}

/* Respiro lateral geral */

@media (max-width: 720px) {
  main,
  .site-main,
  .content-area,
  .container,
  .wrap,
  .site-container,
  .content-wrap,
  .page-wrap,
  .entry-wrap,
  .archive-wrap,
  .single-wrap,
  .home-wrap,
  .inner {
    padding-left: 18px;
    padding-right: 18px;
  }

  .entry-content,
  .page-content,
  .post-content,
  .archive-content,
  .home-content {
    padding-left: 0;
    padding-right: 0;
  }

  .wp-block-columns,
  .columns,
  .row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .wp-block-column {
    width: 100%;
    max-width: 100%;
  }
}

/* Rodapé */

@media (max-width: 720px) {
  .site-footer,
  footer,
  .footer,
  .footer-inner,
  .footer-widgets,
  .footer-columns,
  .footer-grid {
    max-width: 100%;
  }

  .footer-inner,
  .footer-widgets,
  .footer-columns,
  .footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding-left: 18px;
    padding-right: 18px;
    text-align: center;
  }

  .site-footer p,
  .site-footer li,
  footer p,
  footer li {
    font-size: 0.92rem;
    line-height: 1.55;
  }

  .site-footer a,
  footer a {
    overflow-wrap: anywhere;
  }
}

/* Mobile estreito */

@media (max-width: 520px) {
  main,
  .site-main,
  .content-area,
  .container,
  .wrap,
  .site-container,
  .content-wrap,
  .page-wrap,
  .entry-wrap,
  .archive-wrap,
  .single-wrap,
  .home-wrap,
  .inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  body.home .hero,
  body.home .home-hero,
  body.home .front-hero,
  body.home .featured-area,
  body.home .lead-story,
  body.home .headline-area {
    padding-left: 16px;
    padding-right: 16px;
  }

  h1,
  .entry-title,
  .page-title,
  .archive-title,
  .home-title,
  .hero-title {
    font-size: clamp(1.8rem, 10vw, 2.45rem);
  }

  p,
  li {
    font-size: 0.98rem;
  }

  .entry-meta,
  .post-meta,
  .byline,
  .posted-on {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  .button,
  .btn,
  .wp-block-button__link,
  input[type="submit"],
  button {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }
}

/* Ajuste fino: manchete principal da home no mobile */
@media (max-width: 860px) {
  body.home .hero h1,
  body.home .home-hero h1,
  body.home .front-hero h1,
  body.home .lead-story h1,
  body.home .main-story h1,
  body.home .headline-area h1,
  body.home .hero-title,
  body.home .home-title {
    font-size: clamp(1.82rem, 8.2vw, 2.55rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
  }

  body.home .hero p,
  body.home .home-hero p,
  body.home .front-hero p,
  body.home .lead-story p,
  body.home .main-story p,
  body.home .headline-area p {
    line-height: 1.58;
  }
}

@media (max-width: 520px) {
  body.home .hero h1,
  body.home .home-hero h1,
  body.home .front-hero h1,
  body.home .lead-story h1,
  body.home .main-story h1,
  body.home .headline-area h1,
  body.home .hero-title,
  body.home .home-title {
    font-size: clamp(1.68rem, 8.8vw, 2.18rem);
    line-height: 1.12;
  }
}

/* Correção crítica: manchete principal da home no mobile
   Impede quebra artificial de palavras e amplia a largura útil do texto. */
@media (max-width: 860px) {
  body.home .hero,
  body.home .home-hero,
  body.home .front-hero,
  body.home .featured,
  body.home .featured-area,
  body.home .lead-story,
  body.home .main-story,
  body.home .headline-area,
  body.home .top-stories,
  body.home .home-section,
  body.home article:first-of-type {
    width: 100%;
    max-width: 100%;
  }

  body.home .hero *,
  body.home .home-hero *,
  body.home .front-hero *,
  body.home .featured-area *,
  body.home .lead-story *,
  body.home .main-story *,
  body.home .headline-area *,
  body.home article:first-of-type * {
    max-width: 100%;
  }

  body.home .hero h1,
  body.home .home-hero h1,
  body.home .front-hero h1,
  body.home .lead-story h1,
  body.home .main-story h1,
  body.home .headline-area h1,
  body.home article:first-of-type h1,
  body.home .hero-title,
  body.home .home-title,
  body.home .entry-title,
  body.home .post-title {
    width: 100%;
    max-width: 100%;
    font-size: clamp(1.72rem, 7.4vw, 2.22rem);
    line-height: 1.12;
    letter-spacing: -0.018em;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }

  body.home .hero p,
  body.home .home-hero p,
  body.home .front-hero p,
  body.home .lead-story p,
  body.home .main-story p,
  body.home .headline-area p,
  body.home article:first-of-type p {
    width: 100%;
    max-width: 100%;
    font-size: 0.98rem;
    line-height: 1.58;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
  }
}

@media (max-width: 520px) {
  body.home .hero h1,
  body.home .home-hero h1,
  body.home .front-hero h1,
  body.home .lead-story h1,
  body.home .main-story h1,
  body.home .headline-area h1,
  body.home article:first-of-type h1,
  body.home .hero-title,
  body.home .home-title,
  body.home .entry-title,
  body.home .post-title {
    font-size: clamp(1.58rem, 7vw, 2rem);
    line-height: 1.14;
  }
}
