/*
Theme Name: Vale pra Casa
Theme URI: https://valepracasa.com.br
Author: Vale pra Casa
Description: Tema editorial nativo para o Vale pra Casa, otimizado para Gutenberg, conteúdo dinâmico e publicação sem page builder.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 8.0
Text Domain: vale-pra-casa
*/

:root {
  --paper: #f7f5f0;
  --surface: #fff;
  --ink: #2d2c28;
  --olive: #66735b;
  --olive-dark: #536049;
  --terracotta: #c86c4c;
  --mustard: #d2a84a;
  --beige: #e8e0d3;
  --muted: #77736d;
  --line: #ddd8cf;
  --radius: 10px;
  --content: min(1180px, 86vw);
}

* { box-sizing: border-box; }
html { max-width: 100%; scroll-behavior: smooth; scroll-padding-top: 105px; overflow-x: hidden; }
body { margin: 0; max-width: 100%; overflow-x: hidden; background: var(--paper); color: var(--ink); font: 16px/1.55 "Source Sans 3", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
button { cursor: pointer; }
img { display: block; max-width: 100%; height: auto; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, h3, h4 { font-family: "Archivo", Arial, sans-serif; letter-spacing: -.025em; }
a, button { transition: color .18s, background-color .18s, border-color .18s, transform .18s; }
:focus-visible { outline: 3px solid var(--terracotta); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; z-index: 1000; top: 12px; left: 12px; width: auto; height: auto; clip: auto; padding: 10px 14px; margin: 0; border-radius: 6px; background: var(--ink); color: #fff; }
.eyebrow { display: block; margin-bottom: 12px; color: var(--olive); font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.text-link, .guide-link { color: var(--olive); font-weight: 700; }
.text-link:hover, .guide-link:hover { color: var(--terracotta); }
.outline-button, .primary-button { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 0 16px; border: 1px solid var(--olive); border-radius: 7px; color: var(--olive); font-weight: 700; }
.outline-button:hover { background: var(--olive); color: #fff; }
.primary-button { border-color: var(--olive); background: var(--olive); color: #fff; }
.primary-button:hover { background: var(--olive-dark); }

/* Cabeçalho */
.affiliate-bar { min-height: 30px; padding: 6px 4vw; display: flex; align-items: center; justify-content: center; gap: 8px; border-bottom: 1px solid var(--line); background: #f0ece4; color: var(--muted); font-size: 12px; }
.affiliate-bar span { color: var(--olive); font-size: 11px; font-weight: 700; }
.affiliate-bar a { font-size: 11px; text-decoration: underline; text-underline-offset: 3px; }
.site-header { min-height: 72px; padding: 0 max(24px, 5vw); display: grid; grid-template-columns: 190px 1fr 150px; align-items: center; position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, .96); box-shadow: 0 2px 14px rgb(45 44 40 / 4%); backdrop-filter: blur(10px); }
.custom-logo-link { display: inline-flex; align-items: center; }
.custom-logo { width: auto; max-width: 180px; max-height: 54px; object-fit: contain; }
.wordmark { display: inline-flex; width: max-content; flex-direction: column; font-family: "Archivo", sans-serif; font-size: 9px; font-weight: 700; line-height: 1; letter-spacing: .1em; }
.wordmark strong { position: relative; font-size: 25px; font-weight: 700; letter-spacing: -.045em; }
.wordmark strong::after { content: ""; position: absolute; left: 0; bottom: -6px; width: 30px; height: 2px; background: var(--olive); }
.main-nav { display: flex; align-items: center; justify-content: center; }
.main-nav ul, .mobile-nav ul { list-style: none; padding: 0; margin: 0; }
.main-nav > ul { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 2.6vw, 38px); }
.main-nav a { font-size: 14px; font-weight: 600; }
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--olive); }
.mobile-nav { display: none; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
.search-button { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.search-button svg { width: 19px; height: 19px; }
.menu-button { display: none; padding: 8px; border: 0; background: transparent; color: var(--ink); }
.menu-button svg { width: 25px; height: 25px; }
.menu-close-icon { display: none; }
.menu-button[aria-expanded="true"] .menu-open-icon { display: none; }
.menu-button[aria-expanded="true"] .menu-close-icon { display: block; }

/* Home */
.calm-hero { padding: 74px max(24px, 8vw) 54px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfaf7 0%, var(--paper) 100%); }
.hero-statement { max-width: 940px; }
.hero-statement h1 { max-width: 900px; margin: 0; font-size: clamp(52px, 5vw, 64px); font-weight: 700; line-height: 1.08; letter-spacing: -.045em; }
.hero-statement p { max-width: 650px; margin: 22px 0 0; color: var(--muted); font-size: 19px; line-height: 1.5; }
.hero-search { display: grid; grid-template-columns: 30px 1fr auto; align-items: center; gap: 18px; max-width: 980px; min-height: 82px; margin-top: 40px; padding: 13px 15px 13px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 12px 35px rgb(45 44 40 / 7%); }
.hero-search svg { width: 25px; height: 25px; }
.hero-search > div { display: flex; flex-direction: column; }
.hero-search label { color: var(--muted); font-size: 12px; }
.hero-search input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 18px; }
.hero-search button { min-height: 48px; padding: 0 28px; border: 0; border-radius: 7px; background: var(--olive); color: #fff; font-weight: 700; }
.hero-search button:hover { background: var(--olive-dark); }
.quick-categories { display: flex; flex-wrap: wrap; gap: 8px 22px; max-width: 980px; margin-top: 18px; }
.quick-categories a { color: var(--muted); font-size: 14px; }
.quick-categories a:hover { color: var(--olive); text-decoration: underline; text-underline-offset: 4px; }
.editorial-section { padding-left: max(24px, 7vw); padding-right: max(24px, 7vw); }
.simple-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; margin-bottom: 32px; }
.simple-section-heading h2 { max-width: 760px; margin: 0; font-size: clamp(30px, 3.4vw, 40px); font-weight: 700; line-height: 1.15; }
.simple-section-heading p { max-width: 620px; margin: 9px 0 0; color: var(--muted); font-size: 17px; }
.category-section { padding-top: 76px; padding-bottom: 88px; }
.category-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.category-cards > a { min-height: 210px; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.category-cards > a:hover { border-color: #b9c2b2; transform: translateY(-2px); }
.category-cards svg { width: 30px; height: 30px; margin-bottom: 24px; color: var(--olive); stroke-width: 1.5; }
.category-cards h3 { margin: 0 0 8px; font-size: 21px; }
.category-cards p { margin: 0 0 18px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.category-cards span { color: var(--olive); font-size: 13px; font-weight: 700; }
.category-empty { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--muted); }
.featured-editorial { padding-top: 82px; padding-bottom: 92px; background: var(--surface); }
.editorial-lead { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, .65fr); gap: 5vw; }
.lead-story > .lead-image { display: flex; aspect-ratio: 16/9; overflow: hidden; border-radius: var(--radius); background: var(--beige); }
.lead-story > .lead-image img { width: 100%; height: 100%; object-fit: cover; }
.lead-story > div { padding-top: 20px; }
.lead-story small, .secondary-stories small, .article-card small, .article-hero small { color: var(--olive); font-size: 12px; font-weight: 700; }
.lead-story h3 { max-width: 760px; margin: 8px 0 10px; font-size: clamp(28px, 3vw, 38px); line-height: 1.12; }
.lead-story p { max-width: 700px; margin: 0 0 14px; color: var(--muted); }
.secondary-stories { border-top: 1px solid var(--line); }
.secondary-stories article { padding: 24px 0; border-bottom: 1px solid var(--line); }
.secondary-stories h3 { margin: 7px 0; font-size: 22px; line-height: 1.15; }
.secondary-stories p { margin: 0 0 10px; color: var(--muted); font-size: 14px; }
.secondary-stories a { color: var(--olive); font-size: 13px; font-weight: 700; }
.recent-section { padding-top: 80px; padding-bottom: 94px; background: var(--surface); }
.recent-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; }
.home-empty { padding-top: 25px; padding-bottom: 70px; }
.editorial-manifesto { display: grid; grid-template-columns: 1fr 1fr; gap: 7vw; padding: 76px max(24px, 7vw); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--beige); }
.manifesto-intro h2 { max-width: 620px; margin: 12px 0 18px; font-size: clamp(32px, 3.7vw, 44px); line-height: 1.13; }
.manifesto-intro h2 strong { color: var(--olive); }
.manifesto-intro p { font-size: 17px; }
.manifesto-points { border-top: 1px solid #cbc1b3; }
.manifesto-points > div { padding: 20px 0; border-bottom: 1px solid #cbc1b3; }
.manifesto-points h3 { margin: 0; font-size: 21px; }
.manifesto-points p { margin: 4px 0 0; color: var(--muted); }

/* Cards e estados vazios */
.article-card { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; min-width: 0; padding: 22px 0; border-bottom: 1px solid var(--line); }
.article-thumb { display: block; aspect-ratio: 4/3; overflow: hidden; border-radius: 9px; background: var(--beige); }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s; }
.article-card:hover img { transform: scale(1.02); }
.article-card .card-content { min-width: 0; padding: 0; }
.article-card h2 { margin: 7px 0; font-size: 24px; line-height: 1.18; overflow-wrap: anywhere; }
.article-card p { max-width: 680px; margin: 0 0 10px; color: var(--muted); }
.article-card.compact { grid-template-columns: 96px minmax(0, 1fr); gap: 15px; padding: 0; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); overflow: hidden; }
.article-card.compact .article-thumb { height: 100%; min-height: 110px; border-radius: 0; }
.article-card.compact .card-content { padding: 14px 14px 14px 0; }
.article-card.compact h2 { font-size: 17px; }
.article-card.compact .guide-link { font-size: 12px; }
.article-card.feature { display: block; padding: 0; border: 0; }
.article-card.feature .article-thumb { margin-bottom: 15px; }
.article-card.feature h2 { font-size: 21px; }
.article-card.feature p { font-size: 14px; }
.image-empty { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; color: #a49e94; background: linear-gradient(135deg, #eee9df, #e4ded2); }
.image-empty svg { width: 64px; height: 64px; opacity: .58; }
.empty-state { padding: 60px 0; border-bottom: 1px solid var(--line); }
.empty-state h2 { margin: 0 0 8px; font-size: 32px; }
.empty-state p { margin: 0; color: var(--muted); }

/* Rodapé */
.site-footer { padding: 60px max(24px, 7vw) 24px; background: #2d302a; color: #fff; }
.footer-top { padding-bottom: 34px; border-bottom: 1px solid #4a4e46; }
.wordmark-footer strong { font-size: 32px; }
.footer-top p { margin: 18px 0 0; color: #c8c3ba; }
.footer-main { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6vw; padding: 38px 0; }
.footer-main > div { display: flex; flex-direction: column; gap: 9px; }
.footer-main h2 { margin: 0 0 8px; color: #d8c7b5; font: 700 13px "Source Sans 3", sans-serif; letter-spacing: 0; }
.footer-main a { width: max-content; color: #cbc4b9; font-size: 14px; }
.footer-main a:hover { color: #fff; text-decoration: underline; }
.footer-empty { color: #9d978f; font-size: 13px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 25px; padding-top: 20px; border-top: 1px solid #4a4e46; color: #9d978f; font-size: 11px; }
.footer-bottom ul { display: flex; list-style: none; gap: 16px; margin: 0; padding: 0; }

/* Páginas internas */
.inner-page { min-height: 72vh; padding: 34px max(24px, 7vw) 95px; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 34px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.breadcrumb a:hover { color: var(--olive); }
.listing-hero { display: grid; grid-template-columns: 150px 1fr; gap: 30px; align-items: start; padding: 28px 0 48px; border-bottom: 1px solid var(--line); }
.listing-hero > span, .prose-page article > span { color: var(--olive); font-size: 13px; font-weight: 700; }
.listing-hero h1, .prose-page h1, .not-found-page h1 { max-width: 900px; margin: 0; font-size: clamp(42px, 4.5vw, 54px); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.listing-hero p, .archive-description { max-width: 650px; color: var(--muted); font-size: 17px; }
.listing-group { padding-top: 48px; }
.article-grid { border-top: 1px solid var(--line); }
.category-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.category-list > a { display: grid; grid-template-columns: 1fr auto; gap: 18px; min-height: 150px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.category-list > a:hover { border-color: #b9c2b2; transform: translateY(-2px); }
.category-list h2 { margin: 0 0 8px; font-size: 25px; }
.category-list p { margin: 0; color: var(--muted); }
.category-list b { color: var(--olive); font-size: 13px; white-space: nowrap; }
.search-group { margin-top: 55px; }
.search-group .hero-search, .listing-hero .hero-search { margin-top: 25px; }
.navigation.pagination { margin-top: 36px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.nav-links .page-numbers { min-width: 42px; min-height: 42px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.nav-links .current { border-color: var(--olive); background: var(--olive); color: #fff; }
.prose-page article { max-width: 820px; margin: 40px auto; }
.prose-page h1 { margin: 20px 0 32px; }
.page-featured-image { margin-bottom: 32px; overflow: hidden; border-radius: var(--radius); }
.not-found-page { max-width: 760px; min-height: 65vh; margin: auto; padding: 100px 24px; text-align: center; }
.not-found-page p { color: var(--muted); font-size: 18px; }
.not-found-page > div { display: flex; justify-content: center; gap: 12px; }

/* Artigo e Gutenberg */
.article-page { max-width: 1400px; margin: auto; }
.article-hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 6vw; align-items: end; padding: 32px 0 38px; border-top: 1px solid var(--line); }
.article-hero h1 { margin: 12px 0 0; font-size: clamp(42px, 4.5vw, 54px); line-height: 1.1; letter-spacing: -.04em; overflow-wrap: anywhere; }
.article-deck > p { font-size: 18px; }
.article-deck dl { margin: 25px 0 0; border-top: 1px solid var(--line); }
.article-deck dl > div { display: flex; justify-content: space-between; gap: 20px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.article-deck dd { margin: 0; text-align: right; }
.article-cover { width: 100%; margin: 0; aspect-ratio: 16/7; overflow: hidden; border-radius: var(--radius); background: #f1eee7; }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.article-layout { display: grid; grid-template-columns: minmax(0, 740px) 250px; gap: 6vw; justify-content: center; padding-top: 62px; }
.article-body, .entry-content { min-width: 0; font-size: 17px; line-height: 1.75; }
.entry-content > * { max-width: 100%; }
.entry-content p { margin: 0 0 24px; }
.entry-content h2 { margin: 52px 0 17px; padding-top: 5px; font-size: 32px; line-height: 1.2; }
.entry-content h3 { margin-top: 36px; line-height: 1.25; }
.entry-content h4 { margin-top: 28px; }
.entry-content a { color: var(--terracotta); text-decoration: underline; text-underline-offset: 3px; }
.entry-content ul, .entry-content ol { margin: 0 0 26px; padding-left: 24px; }
.entry-content li + li { margin-top: 7px; }
.entry-content blockquote, .wp-block-quote { margin: 32px 0; padding: 18px 22px; border-left: 4px solid var(--olive); background: var(--surface); }
.entry-content blockquote p:last-child { margin-bottom: 0; }
.entry-content figure { margin: 32px 0; }
.entry-content figcaption { margin-top: 8px; color: var(--muted); font-size: 13px; text-align: center; }
.entry-content table, .wp-block-table table { width: 100%; border-collapse: collapse; }
.entry-content th, .entry-content td { padding: 12px; border: 1px solid var(--line); text-align: left; vertical-align: top; }
.entry-content th { background: var(--ink); color: #fff; }
.wp-block-table { max-width: 100%; overflow-x: auto; }
.wp-block-button__link { border-radius: 7px; background: var(--olive); color: #fff !important; text-decoration: none !important; }
.wp-block-button__link:hover { background: var(--olive-dark); }
.wp-block-separator { border-color: var(--line); }
.wp-block-columns { gap: 24px; }
.article-side { min-width: 0; }
.affiliate-disclosure { position: sticky; top: 105px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 12px; }
.affiliate-disclosure p { margin: 6px 0 0; }
.related-section { margin-top: 65px; padding-top: 35px; border-top: 1px solid var(--line); }
.related-section > header { margin-bottom: 22px; }
.related-section h2 { margin: 0; font-size: 30px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.alignwide { width: min(1120px, 90vw); max-width: none !important; margin-left: 50%; transform: translateX(-50%); }
.alignfull { width: 100vw; max-width: none !important; margin-left: 50%; transform: translateX(-50%); }

@media (max-width: 1100px) {
  .category-cards { grid-template-columns: repeat(3, 1fr); }
  .recent-grid { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 720px); }
  .article-side { display: block; }
  .affiliate-disclosure { position: static; }
}

@media (max-width: 760px) {
  .affiliate-bar { display: block; padding: 7px 18px; text-align: center; font-size: 10px; line-height: 1.35; }
  .affiliate-bar span { display: none; }
  .site-header { min-height: 64px; padding: 0 18px; grid-template-columns: 1fr auto; }
  .wordmark strong { font-size: 21px; }
  .custom-logo { max-height: 46px; }
  .desktop-nav { display: none; }
  .mobile-nav { position: absolute; left: 0; right: 0; top: 63px; padding: 15px 18px 22px; align-items: stretch; flex-direction: column; background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); box-shadow: 0 12px 20px rgb(45 44 40 / 8%); }
  .mobile-nav.open { display: flex; }
  .mobile-nav li + li { border-top: 1px solid var(--line); }
  .mobile-nav a { display: block; padding: 10px 0; font-size: 15px; font-weight: 600; }
  .menu-button { display: block; }
  .search-button span { display: none; }
  .calm-hero { padding: 46px 18px 36px; }
  .hero-statement h1 { font-size: clamp(36px, 10vw, 42px); line-height: 1.1; letter-spacing: -.035em; }
  .hero-statement p { margin-top: 16px; font-size: 17px; }
  .hero-search { grid-template-columns: 23px 1fr; margin-top: 28px; padding: 12px; }
  .hero-search button { grid-column: 1 / -1; }
  .quick-categories { gap: 8px 15px; }
  .editorial-section { padding-left: 18px; padding-right: 18px; }
  .simple-section-heading { display: block; margin-bottom: 25px; }
  .simple-section-heading h2 { font-size: 29px; }
  .simple-section-heading .text-link { display: inline-block; margin-top: 16px; }
  .category-section, .featured-editorial, .recent-section { padding-top: 58px; padding-bottom: 64px; }
  .category-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
  .category-cards > a { min-height: 0; padding: 17px; }
  .category-cards svg { margin-bottom: 16px; }
  .category-cards h3 { font-size: 19px; }
  .category-cards p { display: none; }
  .editorial-lead { grid-template-columns: 1fr; }
  .lead-story h3 { font-size: 29px; }
  .secondary-stories { margin-top: 30px; }
  .recent-grid { grid-template-columns: 1fr; gap: 34px; }
  .editorial-manifesto { grid-template-columns: 1fr; padding: 58px 18px; gap: 28px; }
  .manifesto-intro h2 { font-size: 31px; }
  .footer-main { grid-template-columns: 1fr 1fr; }
  .footer-bottom { flex-direction: column; }
  .inner-page { padding: 22px 18px 75px; }
  .breadcrumb { margin-bottom: 28px; font-size: 11px; }
  .listing-hero { grid-template-columns: 1fr; gap: 8px; padding: 22px 0 34px; }
  .listing-hero h1, .prose-page h1, .not-found-page h1 { font-size: clamp(32px, 9vw, 38px); line-height: 1.12; }
  .article-card { grid-template-columns: 112px minmax(0, 1fr); gap: 15px; }
  .article-card h2 { font-size: 21px; }
  .article-card p { font-size: 14px; }
  .related-grid { grid-template-columns: 1fr; }
  .category-list { grid-template-columns: 1fr; }
  .article-hero { grid-template-columns: 1fr; padding: 24px 0 30px; }
  .article-hero h1 { font-size: clamp(32px, 9vw, 38px); line-height: 1.12; }
  .article-cover { aspect-ratio: 4/3; }
  .article-layout { padding-top: 42px; }
  .entry-content h2 { font-size: 27px; }
  .not-found-page { padding-top: 70px; }
  .wp-block-columns { flex-direction: column; }
}

@media (max-width: 390px) {
  .category-cards { grid-template-columns: 1fr; }
  .category-cards p { display: block; }
  .footer-main { grid-template-columns: 1fr; }
  .article-card { grid-template-columns: 1fr; }
  .article-card .article-thumb { aspect-ratio: 16/9; }
  .article-card.compact { grid-template-columns: 82px 1fr; }
  .article-card.compact .article-thumb { aspect-ratio: auto; }
  .not-found-page > div { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
