/*
Theme Name: Revista Entenda
Theme URI: https://revistaentenda.com.br
Author: Revista Entenda
Description: Tema editorial responsivo para o portal Revista Entenda com importador automático de categorias, 40 artigos com imagens destacadas, 5 páginas institucionais, menu mobile com ícones e botões de compartilhamento.
Version: 4.0.0
Text Domain: revista-entenda
*/

:root {
  --bg: #f8f8f8;
  --surface: #ffffff;
  --surface-muted: #f1f1f3;
  --brand-bar: #111111;
  --brand-bar-fg: #ffffff;
  --fg: #141414;
  --muted: #5c5c66;
  --border: #e5e5e8;
  --primary: #d61f26;
  --primary-hover: #b8191f;
  --whatsapp: #25d366;
  --facebook: #1877f2;
  --font-display: 'Bricolage Grotesque', system-ui, -apple-system, sans-serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: var(--font-body); line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; line-height: 1.2; }

.re-container { max-width: 1280px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .re-container { padding: 0 24px; } }

/* Header */
.re-header { position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.re-topbar { background: var(--brand-bar); color: var(--brand-bar-fg); }
.re-topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; padding-bottom: 14px; }
.re-logo { font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; display: inline-flex; align-items: baseline; user-select: none; }
@media (min-width: 640px) { .re-logo { font-size: 36px; } }
@media (min-width: 1024px) { .re-logo { font-size: 42px; } }
.re-logo-white { color: #ffffff; }
.re-logo-red { color: var(--primary); margin-left: 4px; }
.re-tagline { display: none; font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,.7); }
@media (min-width: 1024px) { .re-tagline { display: inline; } }

.re-menu-btn { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.22); border-radius: 6px; padding: 8px 12px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; }
.re-menu-btn:hover { border-color: var(--primary); color: var(--primary); }
@media (min-width: 1024px) { .re-menu-btn { display: none; } }

/* Mobile & Tablet Menu with Icon */
.re-mobile-nav { display: none; background: var(--surface); border-top: 2px solid var(--primary); border-bottom: 1px solid var(--border); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.re-mobile-nav.is-open { display: block; }
@media (min-width: 1024px) { .re-mobile-nav, .re-mobile-nav.is-open { display: none; } }
.re-mobile-nav-list { padding: 12px 0; display: flex; flex-direction: column; gap: 4px; }
.re-mobile-nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px; font-size: 14px; font-weight: 700; color: var(--fg); }
.re-mobile-nav-link:hover, .re-mobile-nav-link.is-active { background: var(--primary); color: #fff; }
.re-mobile-nav-link svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Desktop Nav */
.re-desktop-nav { display: none; background: var(--surface); border-top: 2px solid var(--primary); border-bottom: 1px solid var(--border); }
@media (min-width: 1024px) { .re-desktop-nav { display: block; } }
.re-desktop-nav-inner { display: flex; align-items: center; gap: 8px; padding-top: 8px; padding-bottom: 8px; }
.re-desktop-nav-link { padding: 6px 12px; border-radius: 4px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg); transition: background .15s, color .15s; }
.re-desktop-nav-link:hover { background: var(--surface-muted); color: var(--primary); }
.re-desktop-nav-link.is-active { background: var(--primary); color: #fff; }

/* Main */
.re-main { padding-top: 28px; padding-bottom: 48px; min-height: 65vh; }

/* Hero */
.re-hero { display: grid; gap: 24px; border-bottom: 1px solid var(--border); padding-bottom: 36px; }
@media (min-width: 1024px) { .re-hero { grid-template-columns: 7fr 5fr; } }
.re-thumb { overflow: hidden; border-radius: 6px; background: var(--surface-muted); aspect-ratio: 16 / 9; }
.re-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.re-card:hover .re-thumb img, .re-lead:hover .re-thumb img, .re-side-item:hover .re-thumb img { transform: scale(1.03); }
.re-cat-label { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--primary); margin-top: 12px; }
.re-lead h1 { font-size: 28px; margin-top: 6px; transition: color .15s; }
@media (min-width: 640px) { .re-lead h1 { font-size: 36px; } }
.re-lead:hover h1 { color: var(--primary); }
.re-excerpt { color: var(--muted); font-size: 15px; margin: 10px 0 0; }
.re-meta { color: var(--muted); font-size: 12px; font-weight: 500; margin-top: 10px; }

.re-side-list { display: flex; flex-direction: column; }
.re-side-item { padding: 16px 0; border-bottom: 1px solid var(--border); }
.re-side-item:first-child { padding-top: 0; }
.re-side-item:last-child { border-bottom: 0; padding-bottom: 0; }
.re-side-link { display: grid; grid-template-columns: 5fr 7fr; gap: 14px; align-items: start; }
.re-side-item h2 { font-size: 17px; margin-top: 4px; transition: color .15s; }
.re-side-item:hover h2 { color: var(--primary); }

/* Category Sections */
.re-section { margin-top: 44px; }
.re-section-head { display: flex; align-items: baseline; justify-content: space-between; border-bottom: 2px solid var(--fg); padding-bottom: 8px; margin-bottom: 20px; }
.re-section-title { border-left: 4px solid var(--primary); padding-left: 12px; font-size: 24px; }
.re-section-more { font-size: 12px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--primary); }
.re-section-more:hover { text-decoration: underline; }

.re-grid-4 { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .re-grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .re-grid-4 { grid-template-columns: repeat(4, 1fr); } }

.re-grid-3 { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .re-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .re-grid-3 { grid-template-columns: repeat(3, 1fr); } }

.re-card { display: flex; flex-direction: column; }
.re-card-boxed { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 16px; transition: border-color .15s; }
.re-card-boxed:hover { border-color: var(--primary); }
.re-card h2, .re-card h3 { font-size: 18px; margin-top: 10px; transition: color .15s; }
.re-card:hover h2, .re-card:hover h3 { color: var(--primary); }
.re-card-excerpt { color: var(--muted); font-size: 14px; margin: 8px 0 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Single Article & Page */
.re-article-wrap { max-width: 780px; margin: 0 auto; }
.re-breadcrumb { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.re-breadcrumb a:hover { color: var(--primary); }
.re-article-title { font-size: 30px; margin-top: 8px; }
@media (min-width: 640px) { .re-article-title { font-size: 44px; } }
.re-article-meta { display: flex; flex-wrap: wrap; gap: 10px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 12px 0; margin: 18px 0 24px; font-size: 13px; color: var(--muted); }
.re-article-cover { margin-bottom: 26px; }
.re-prose { font-size: 17px; line-height: 1.75; color: var(--fg); }
.re-prose p { margin: 0 0 18px; }
.re-prose h2 { font-size: 24px; margin: 28px 0 12px; }
.re-prose ul, .re-prose ol { margin: 0 0 18px; padding-left: 22px; }
.re-prose li { margin-bottom: 8px; }

/* Share Box */
.re-share-box { margin-top: 36px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 18px 20px; }
.re-share-label { font-size: 11px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.re-share-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.re-share-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 6px; font-size: 14px; font-weight: 700; color: #fff; border: 0; cursor: pointer; font-family: inherit; transition: opacity .15s; }
.re-share-btn:hover { opacity: .9; }
.re-share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.re-share-wa { background: var(--whatsapp); }
.re-share-fb { background: var(--facebook); }
.re-share-ig { background: linear-gradient(135deg, #f58529 0%, #dd2a7b 55%, #8134af 100%); }
.re-share-hint { margin: 12px 0 0; font-size: 12px; color: var(--muted); }

/* Footer */
.re-footer { margin-top: 56px; background: var(--brand-bar); color: var(--brand-bar-fg); border-top: 4px solid var(--primary); }
.re-footer-inner { padding-top: 40px; padding-bottom: 36px; }
.re-footer-top { display: flex; flex-direction: column; gap: 24px; border-bottom: 1px solid rgba(255,255,255,.15); padding-bottom: 28px; }
@media (min-width: 768px) { .re-footer-top { flex-direction: row; align-items: center; justify-content: space-between; } }
.re-footer-desc { max-width: 440px; margin: 12px 0 0; font-size: 14px; color: rgba(255,255,255,.72); }
.re-footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; font-size: 14px; font-weight: 500; }
.re-footer-links a { color: rgba(255,255,255,.85); }
.re-footer-links a:hover { color: var(--primary); }
.re-footer-copy { margin-top: 20px; font-size: 12px; color: rgba(255,255,255,.6); }

/* Article search */
.re-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.re-search summary { list-style: none; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; cursor: pointer; color: var(--brand-bar-fg); border-radius: 6px; }
.re-search summary::-webkit-details-marker { display: none; }
.re-search summary:hover { color: var(--primary); }
.re-search summary:focus-visible, .re-search-submit:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
.re-search-panel { position: absolute; top: 100%; left: 0; width: 100%; background: var(--brand-bar); padding: 16px; border-bottom: 2px solid var(--primary); }
.re-search-form { display: flex; gap: 8px; max-width: 1232px; margin: 0 auto; }
.re-search-input { flex: 1; min-width: 0; width: 100%; height: 42px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--fg); padding: 0 12px; font: inherit; font-size: 16px; }
.re-search-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.re-search-submit { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 42px; height: 42px; border: 0; border-radius: 6px; background: var(--primary); color: var(--brand-bar-fg); cursor: pointer; }
.re-search-submit:hover { background: var(--primary-hover); }
.re-search-heading { padding-bottom: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.re-search-heading h1 { border-left: 4px solid var(--primary); padding-left: 12px; font-size: 30px; }
.re-search-empty { padding: 36px 0; text-align: center; }
.re-search-empty .re-search-form { margin-top: 24px; max-width: 600px; }
.re-search-pagination { margin-top: 36px; }
.re-search-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 12px; }
.re-search-pagination .page-numbers { padding: 6px 12px; border: 1px solid var(--border); border-radius: 4px; }
.re-search-pagination .current { background: var(--primary); color: var(--brand-bar-fg); }
.re-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; }
body.search .re-main { padding-top: 96px; }
@media (max-width: 360px) { .re-topbar-inner { gap: 8px; } .re-menu-btn { padding: 8px; } .re-logo { font-size: 28px; } }
@media (prefers-reduced-motion: reduce) { .re-thumb img { transition: none; } }
