/*
Theme Name: RBGG Viva
Theme URI: https://rbgg.com.br/
Author: RBGG
Author URI: https://rbgg.com.br/
Description: Tema editorial leve, acessível e otimizado para SEO para o portal RBGG, com foco em saúde, longevidade, direitos e qualidade de vida na terceira idade.
Version: 1.1.0
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.0
Text Domain: rbgg-viva
Tags: news, blog, two-columns, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready
*/

:root {
  --ink: #17352f;
  --ink-soft: #45615b;
  --paper: #fffdf8;
  --surface: #f4f1e8;
  --surface-2: #e8f2ed;
  --brand: #0f6b57;
  --brand-dark: #08493b;
  --accent: #e8972f;
  --accent-soft: #fff0d6;
  --line: #d9e0dc;
  --white: #ffffff;
  --danger: #a33a2c;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 12px 34px rgba(23, 53, 47, 0.10);
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--brand-dark); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { color: var(--brand); }
button, input, textarea, select { font: inherit; }
button, input[type="submit"] { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.container { width: min(calc(100% - 40px), var(--container)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.screen-reader-text:focus, .skip-link:focus {
  clip: auto !important; width: auto; height: auto; padding: 12px 18px; margin: 0;
  top: 10px; left: 10px; z-index: 99999; background: var(--white); color: var(--ink);
}

/* Header */
.site-header {
  position: relative; z-index: 20; border-top: 5px solid var(--accent);
  background:
    radial-gradient(circle at 10% -40%, rgba(255,255,255,.12), transparent 38%),
    linear-gradient(115deg, #0b5948 0%, #123d34 72%, #102e28 100%);
  box-shadow: 0 8px 28px rgba(9, 42, 34, .18);
}
.header-inner { min-height: 94px; display: flex; align-items: center; gap: clamp(24px, 4vw, 52px); }
.brand-logo { display: inline-flex; flex: 0 0 auto; align-items: center; text-decoration: none; }
.brand-logo img { width: 194px; height: auto; }
.search-form { display: flex; align-items: stretch; }
.search-field {
  width: 100%; min-height: 50px; padding: 10px 16px; border: 1px solid #b9c8c2;
  border-right: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); background: var(--white); color: var(--ink);
}
.search-submit {
  min-height: 50px; padding: 10px 18px; border: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--brand); color: var(--white); font-weight: 750;
}
.search-submit:hover { background: var(--brand-dark); }
.primary-navigation { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.menu-toggle { display: none; min-height: 44px; padding: 8px 14px; border: 1px solid rgba(255,255,255,.55); border-radius: 8px; background: rgba(255,255,255,.08); color: var(--white); font-weight: 750; }
.primary-menu, .primary-menu ul { list-style: none; margin: 0; padding: 0; }
.primary-menu { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.primary-menu a { display: block; padding: 13px 11px; border-radius: 8px; color: rgba(255,255,255,.94); font-size: 15px; font-weight: 750; text-decoration: none; }
.primary-menu a:hover, .primary-menu .current-menu-item > a, .primary-menu .current-cat > a { color: var(--white); background: rgba(255,255,255,.12); }
.nav-search { flex: 0 1 270px; min-width: 210px; }
.nav-search .search-field { min-height: 44px; border-color: rgba(255,255,255,.28); background: rgba(255,255,255,.96); }
.nav-search .search-submit { min-height: 44px; padding-inline: 14px; background: var(--accent); color: #2d2113; }
.nav-search .search-submit:hover { background: #f1ae58; }

/* Shared editorial components */
.site-main { min-height: 55vh; }
.section { padding: 52px 0; }
.section-muted { background: var(--surface); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; border-bottom: 2px solid var(--line); }
.section-title { margin: 0 0 -2px; padding-bottom: 11px; border-bottom: 4px solid var(--accent); font-family: Georgia, "Times New Roman", serif; font-size: clamp(27px, 3vw, 38px); line-height: 1.15; }
.section-link { margin-bottom: 12px; font-weight: 750; text-decoration: none; }
.eyebrow, .post-category {
  display: inline-flex; align-items: center; width: fit-content; margin-bottom: 10px; color: var(--brand);
  font-size: 13px; font-weight: 850; line-height: 1.2; letter-spacing: .07em; text-decoration: none; text-transform: uppercase;
}
.post-title { margin: 0; font-family: Georgia, "Times New Roman", serif; line-height: 1.16; text-wrap: balance; }
.post-title a { color: var(--ink); text-decoration: none; }
.post-title a:hover { color: var(--brand); }
.post-meta { display: flex; flex-wrap: wrap; gap: 7px 14px; margin-top: 12px; color: var(--ink-soft); font-size: 14px; }
.post-excerpt { margin: 13px 0 0; color: var(--ink-soft); }
.thumb-wrap { display: block; overflow: hidden; border-radius: var(--radius); background: var(--surface-2); aspect-ratio: 16 / 9; }
.thumb-wrap img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s ease; }
a.thumb-wrap:hover img { transform: scale(1.025); }
.image-placeholder {
  width: 100%; height: 100%; display: grid; place-items: center; padding: 20px;
  background: linear-gradient(145deg, var(--surface-2), #d2e7dc); color: var(--brand); font-family: Georgia, serif;
  font-size: 24px; font-weight: 700; text-align: center;
}

/* Magazine hero */
.home-hero { padding: 34px 0 52px; background: linear-gradient(180deg, var(--white), var(--paper)); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(340px, .8fr); gap: 28px; }
.hero-lead { position: relative; min-height: 530px; overflow: hidden; border-radius: var(--radius-lg); background: var(--ink); box-shadow: var(--shadow); }
.hero-lead .thumb-wrap { position: absolute; inset: 0; border-radius: 0; aspect-ratio: auto; opacity: .76; }
.hero-lead .thumb-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 22%, rgba(8,31,26,.2) 48%, rgba(8,31,26,.95) 100%); }
.hero-lead .image-placeholder { color: var(--white); background: linear-gradient(145deg, #326f62, #102f28); }
.hero-content { position: absolute; z-index: 2; left: clamp(24px, 4vw, 48px); right: clamp(24px, 4vw, 48px); bottom: clamp(26px, 4vw, 46px); color: var(--white); }
.hero-content .post-category { color: #ffd08c; }
.hero-content .post-title { font-size: clamp(34px, 4.5vw, 58px); }
.hero-content .post-title a, .hero-content .post-meta { color: var(--white); }
.hero-side { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.hero-mini { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.hero-mini .thumb-wrap { margin-bottom: 13px; border-radius: var(--radius-sm); }
.hero-mini .post-title { font-size: 20px; }

/* Grids and cards */
.content-with-sidebar { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 44px; align-items: start; }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.post-card { min-width: 0; }
.post-card .thumb-wrap { margin-bottom: 16px; }
.post-card .post-title { font-size: 25px; }
.category-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr); gap: 32px; }
.category-lead .thumb-wrap { margin-bottom: 18px; }
.category-lead .post-title { font-size: 32px; }
.compact-list { display: grid; gap: 18px; }
.compact-card { display: grid; grid-template-columns: 128px 1fr; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.compact-card:last-child { border-bottom: 0; }
.compact-card .thumb-wrap { border-radius: 9px; aspect-ratio: 1 / .78; }
.compact-card .post-title { font-size: 19px; }
.compact-card .post-meta { margin-top: 7px; }

/* Sidebar */
.sidebar { display: grid; gap: 26px; }
.widget { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white); box-shadow: 0 8px 26px rgba(23,53,47,.05); }
.widget-title { margin: 0 0 17px; padding-bottom: 10px; border-bottom: 3px solid var(--accent); font-family: Georgia, serif; font-size: 24px; line-height: 1.2; }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.widget li:last-child { border-bottom: 0; }
.widget a { font-weight: 700; text-decoration: none; }
.care-box { background: var(--brand-dark); color: var(--white); }
.care-box .widget-title { color: var(--white); border-color: var(--accent); }
.care-box p { color: rgba(255,255,255,.87); }
.care-box a { color: #ffd08c; }

/* Archive */
.archive-header { padding: 42px 0; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.archive-title { margin: 0; font-family: Georgia, serif; font-size: clamp(34px, 5vw, 54px); line-height: 1.1; }
.archive-description { max-width: 760px; margin: 13px 0 0; color: var(--ink-soft); }
.archive-list { display: grid; gap: 26px; }
.list-card { display: grid; grid-template-columns: minmax(220px, 36%) 1fr; gap: 26px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.list-card .post-title { font-size: clamp(25px, 3vw, 32px); }
.pagination { margin-top: 38px; }
.nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.page-numbers { min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); font-weight: 750; text-decoration: none; }
.page-numbers.current, .page-numbers:hover { background: var(--brand); color: var(--white); border-color: var(--brand); }

/* Single */
.breadcrumbs { padding: 18px 0; color: var(--ink-soft); font-size: 14px; }
.breadcrumbs a { text-decoration: none; }
.single-header { padding: 20px 0 34px; }
.single-title { max-width: 970px; margin: 0; font-family: Georgia, serif; font-size: clamp(38px, 6vw, 66px); line-height: 1.08; letter-spacing: -.02em; text-wrap: balance; }
.single-deck { max-width: 850px; margin: 18px 0 0; color: var(--ink-soft); font-size: clamp(20px, 2.4vw, 25px); line-height: 1.5; }
.single-header .post-meta { margin-top: 20px; font-size: 15px; }
.single-layout { display: grid; grid-template-columns: minmax(0, 790px) 320px; justify-content: center; gap: 52px; align-items: start; }
.entry-content { font-family: Georgia, "Times New Roman", serif; font-size: 20px; line-height: 1.82; }
.entry-content > * { max-width: 100%; }
.entry-content p { margin: 0 0 1.35em; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--ink); line-height: 1.24; margin: 1.7em 0 .65em; }
.entry-content h2 { font-size: 34px; }
.entry-content h3 { font-size: 28px; }
.entry-content ul, .entry-content ol { padding-left: 1.35em; }
.entry-content li { margin-bottom: .55em; }
.entry-content blockquote { margin: 1.6em 0; padding: 22px 28px; border-left: 5px solid var(--accent); background: var(--accent-soft); font-size: 23px; }
.entry-content a { color: var(--brand); }
.entry-content table { width: 100%; border-collapse: collapse; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 17px; }
.entry-content th, .entry-content td { padding: 12px; border: 1px solid var(--line); text-align: left; }
.entry-content th { background: var(--surface-2); }
.entry-content img { border-radius: var(--radius-sm); }
.article-note { margin: 34px 0; padding: 20px 24px; border: 1px solid #e9c37f; border-radius: var(--radius-sm); background: var(--accent-soft); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; font-size: 16px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0; }
.post-tags a { padding: 7px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; font-weight: 700; text-decoration: none; }
.author-box { display: grid; grid-template-columns: 74px 1fr; gap: 18px; margin-top: 35px; padding: 24px; border-radius: var(--radius); background: var(--surface); }
.author-box img { border-radius: 50%; }
.author-box h2 { margin: 0 0 6px; font-size: 22px; }
.author-box p { margin: 0; color: var(--ink-soft); font-size: 16px; }
.post-navigation { margin-top: 42px; padding-top: 28px; border-top: 1px solid var(--line); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.post-navigation a { display: block; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; }
.post-navigation .nav-next { text-align: right; }

/* Comments and forms */
.comments-area { margin-top: 48px; padding-top: 35px; border-top: 1px solid var(--line); }
.comments-title, .comment-reply-title { font-family: Georgia, serif; }
.comment-list { padding-left: 24px; }
.comment-list li { margin-bottom: 24px; }
.comment-body { padding: 20px; border-radius: var(--radius-sm); background: var(--surface); }
label { display: block; margin-bottom: 5px; font-weight: 700; }
input[type="text"], input[type="email"], input[type="url"], textarea {
  width: 100%; padding: 12px 14px; border: 1px solid #aebdb7; border-radius: 8px; background: var(--white); color: var(--ink);
}
textarea { min-height: 150px; }
input[type="submit"], .button {
  display: inline-flex; min-height: 48px; align-items: center; justify-content: center; padding: 10px 20px;
  border: 0; border-radius: 8px; background: var(--brand); color: var(--white); font-weight: 800; text-decoration: none;
}
input[type="submit"]:hover, .button:hover { background: var(--brand-dark); color: var(--white); }

/* Footer */
.site-footer { margin-top: 54px; background: #102e28; color: rgba(255,255,255,.82); }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 46px; padding: 54px 0 40px; }
.footer-title { margin: 0 0 15px; color: var(--white); font-family: Georgia, serif; font-size: 24px; }
.site-footer a { color: var(--white); }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.footer-bottom { padding: 20px 0; border-top: 1px solid rgba(255,255,255,.16); font-size: 14px; }
.footer-bottom-inner { display: flex; justify-content: space-between; gap: 20px; }
.footer-bottom p { margin: 0; }

/* Empty and 404 */
.empty-state { padding: 70px 0; text-align: center; }
.empty-state h1 { margin: 0 0 12px; font-family: Georgia, serif; font-size: clamp(38px, 6vw, 64px); }
.empty-state p { max-width: 650px; margin: 0 auto 25px; color: var(--ink-soft); }

@media (max-width: 1020px) {
  .hero-grid, .content-with-sidebar, .single-layout { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .single-layout { max-width: 790px; margin-inline: auto; }
  .header-inner { gap: 20px; }
  .brand-logo img { width: 166px; }
  .primary-menu a { padding-inline: 8px; font-size: 14px; }
  .nav-search { flex-basis: 220px; min-width: 185px; }
}

@media (max-width: 760px) {
  body { font-size: 17px; }
  .container, .narrow { width: min(calc(100% - 28px), var(--container)); }
  .header-inner { min-height: 78px; justify-content: space-between; flex-wrap: wrap; padding: 11px 0; }
  .brand-logo img { width: 155px; }
  .menu-toggle { display: inline-flex; align-items: center; gap: 8px; }
  .primary-navigation { display: none; flex: 0 0 100%; padding: 8px 0 10px; }
  .primary-navigation.is-open { display: grid; }
  .primary-menu { display: block; }
  .primary-menu a { padding: 12px 8px; border-top: 1px solid rgba(255,255,255,.15); border-radius: 0; font-size: 16px; }
  .nav-search { min-width: 0; width: 100%; margin-top: 8px; }
  .section { padding: 38px 0; }
  .home-hero { padding: 22px 0 38px; }
  .hero-lead { min-height: 460px; }
  .hero-side, .post-grid, .category-layout, .sidebar, .footer-grid { grid-template-columns: 1fr; }
  .hero-mini { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
  .hero-mini .thumb-wrap { margin: 0; aspect-ratio: 1 / .86; }
  .list-card { grid-template-columns: 130px 1fr; gap: 16px; }
  .list-card .post-excerpt { display: none; }
  .compact-card { grid-template-columns: 110px 1fr; }
  .single-title { font-size: 40px; }
  .entry-content { font-size: 19px; line-height: 1.75; }
  .entry-content h2 { font-size: 29px; }
  .post-navigation .nav-links, .footer-bottom-inner { grid-template-columns: 1fr; display: grid; }
  .post-navigation .nav-next { text-align: left; }
}

@media (max-width: 460px) {
  .hero-lead { min-height: 420px; }
  .hero-content .post-title { font-size: 32px; }
  .hero-mini { grid-template-columns: 96px 1fr; }
  .hero-mini .post-title, .compact-card .post-title { font-size: 17px; }
  .list-card { grid-template-columns: 1fr; }
  .list-card .thumb-wrap { aspect-ratio: 16 / 8; }
  .author-box { grid-template-columns: 1fr; }
}

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