/*
Theme Name: Bulas de Remédios
Theme URI:
Author: Blog de Bulas
Description: Tema profissional para blog de bulas de medicamentos no Brasil. Templates com Schema MedicalWebPage, FAQPage, 14 categorias terapêuticas e otimização SEO para YMYL.
Version: 1.0.0
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: bulas-remedios
*/

/* ==========================================
   VARIÁVEIS
   ========================================== */
:root {
  --primary:       #0277bd;
  --primary-dark:  #01579b;
  --primary-light: #e3f2fd;
  --accent:        #c62828;
  --accent-light:  #ffebee;
  --success:       #2e7d32;
  --warning-bg:    #fff8e1;
  --warning-border:#f9a825;
  --text:          #212121;
  --text-muted:    #6b7280;
  --bg:            #f5f7fa;
  --card-bg:       #ffffff;
  --border:        #e0e0e0;
  --radius:        8px;
  --shadow:        0 2px 8px rgba(0,0,0,.08);
  --shadow-md:     0 4px 16px rgba(0,0,0,.12);
  --font:          -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
  --container:     1140px;
}

/* ==========================================
   RESET / BASE
   ========================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; }

h1, h2, h3, h4, h5, h6 {
  line-height: 1.3;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}

h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin-top: 2rem; margin-bottom: .75rem; }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); margin-top: 1.5rem; }
h4 { font-size: 1.1rem; margin-top: 1.2rem; }

p { margin-bottom: 1rem; }

/* ==========================================
   UTILITÁRIOS
   ========================================== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-2 { margin-bottom: 2rem; }

/* ==========================================
   DISCLAIMER BAR (topo)
   ========================================== */
.disclaimer-bar {
  background: var(--accent);
  color: #fff;
  text-align: center;
  font-size: .8rem;
  padding: .45rem 1rem;
  font-weight: 500;
  letter-spacing: .01em;
}

/* ==========================================
   HEADER
   ========================================== */
.site-header {
  background: var(--primary-dark);
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-branding a {
  color: #fff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.site-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.site-tagline {
  font-size: .75rem;
  opacity: .8;
  font-weight: 400;
}

/* Header Search */
.header-search {
  display: flex;
  align-items: center;
  gap: .4rem;
  flex: 0 1 320px;
}

.header-search input {
  flex: 1;
  padding: .55rem .9rem;
  border-radius: 50px;
  border: 2px solid rgba(255,255,255,.3);
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .9rem;
  transition: border-color .2s;
}

.header-search input::placeholder { color: rgba(255,255,255,.65); }
.header-search input:focus { outline: none; border-color: rgba(255,255,255,.8); background: rgba(255,255,255,.25); }

.header-search button {
  background: rgba(255,255,255,.2);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  width: 38px;
  height: 38px;
  font-size: 1rem;
  transition: background .2s;
}

.header-search button:hover { background: rgba(255,255,255,.35); }

/* Mobile menu */
.menu-toggle {
  display: none;
  background: none;
  border: 2px solid rgba(255,255,255,.5);
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  padding: .4rem .7rem;
  font-size: 1.3rem;
}

/* Navigation */
.nav-primary { width: 100%; margin-top: .5rem; }

.nav-primary ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .2rem;
}

.nav-primary ul li a {
  color: rgba(255,255,255,.9);
  font-size: .88rem;
  font-weight: 500;
  padding: .45rem .8rem;
  border-radius: var(--radius);
  transition: background .2s;
  display: block;
  white-space: nowrap;
}

.nav-primary ul li a:hover,
.nav-primary ul li.current-menu-item a {
  background: rgba(255,255,255,.2);
  text-decoration: none;
  color: #fff;
}

/* Dropdown */
.nav-primary ul li { position: relative; }

.nav-primary ul li ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--primary-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 220px;
  z-index: 100;
  flex-direction: column;
  padding: .5rem 0;
}

.nav-primary ul li:hover > ul { display: flex; }

.nav-primary ul li ul li a {
  padding: .5rem 1rem;
  border-radius: 0;
  font-size: .85rem;
}

/* ==========================================
   HERO (homepage)
   ========================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff;
  padding: 3.5rem 0;
  text-align: center;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.1rem;
  opacity: .9;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}

.hero-search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  gap: .5rem;
}

.hero-search input {
  flex: 1;
  padding: .85rem 1.2rem;
  border-radius: 50px;
  border: none;
  font-size: 1rem;
  outline: none;
}

.hero-search button {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: .85rem 1.5rem;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
  white-space: nowrap;
}

.hero-search button:hover { background: #b71c1c; }

/* ==========================================
   SEÇÃO DE CATEGORIAS
   ========================================== */
.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 3px;
  background: var(--primary-light);
  border-radius: 2px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 3rem;
}

.category-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem;
  text-align: center;
  transition: transform .2s, box-shadow .2s;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: var(--primary);
  border-color: var(--primary);
}

.category-card .cat-icon { font-size: 2rem; }
.category-card .cat-name { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.category-card .cat-count { font-size: .75rem; color: var(--text-muted); }

/* ==========================================
   CARDS DE ARTIGO
   ========================================== */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.post-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}

.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.post-card-thumb img { width: 100%; height: 180px; object-fit: cover; }

.post-card-thumb-placeholder {
  width: 100%;
  height: 180px;
  background: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.post-card-body { padding: 1.2rem; flex: 1; display: flex; flex-direction: column; }

.post-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}

.post-card-meta .cat-label {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: .15rem .5rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: .72rem;
}

.post-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .5rem;
  line-height: 1.4;
}

.post-card-title a { color: var(--text); }
.post-card-title a:hover { color: var(--primary); text-decoration: none; }

.post-card-excerpt { font-size: .875rem; color: var(--text-muted); flex: 1; }

.post-card-footer {
  padding: .75rem 1.2rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.read-more {
  color: var(--primary);
  font-size: .85rem;
  font-weight: 600;
}

/* ==========================================
   LAYOUT PRINCIPAL (single / page)
   ========================================== */
.content-wrap {
  padding: 2rem 0 3rem;
}

.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 2rem;
  align-items: start;
}

/* ==========================================
   ARTIGO SINGLE (BULA)
   ========================================== */
.article-header { margin-bottom: 1.5rem; }

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  margin-bottom: 1rem;
  font-size: .85rem;
  color: var(--text-muted);
}

.article-meta .category-badge {
  background: var(--primary);
  color: #fff;
  padding: .2rem .7rem;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
}

.article-entry {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

/* Warning box */
.warning-box {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: .9rem;
}

.warning-box strong { color: var(--accent); }

/* Info box */
.info-box {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: .9rem;
}

/* TOC */
.toc-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.toc-box h2 {
  font-size: 1rem;
  margin: 0 0 .75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 600;
}

.toc-box ol {
  margin: 0;
  padding-left: 1.5rem;
}

.toc-box ol li {
  margin-bottom: .35rem;
  font-size: .9rem;
}

.toc-box ol li a { color: var(--primary); }
.toc-box ol li a:hover { text-decoration: underline; }

/* Article headings — anchor targets */
.article-entry h2[id],
.article-entry h3[id] {
  scroll-margin-top: 80px;
}

.article-entry h2 {
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: .5rem;
}

/* Article lists */
.article-entry ul li, .article-entry ol li { margin-bottom: .35rem; }

/* FAQ */
.faq-section { margin-top: 1.5rem; }

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}

.faq-question {
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  padding: 1rem 1.25rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--card-bg);
  color: var(--text);
  transition: background .15s;
}

.faq-question:hover { background: var(--bg); }

.faq-question[aria-expanded="true"] { background: var(--primary-light); color: var(--primary-dark); }

.faq-icon { font-size: 1.2rem; transition: transform .2s; flex-shrink: 0; }
.faq-question[aria-expanded="true"] .faq-icon { transform: rotate(45deg); }

.faq-answer {
  padding: 1rem 1.25rem;
  font-size: .92rem;
  border-top: 1px solid var(--border);
  display: none;
}

.faq-answer.open { display: block; }

/* Afiliado CTA */
.affiliate-box {
  background: linear-gradient(135deg, #e8f5e9, #c8e6c9);
  border: 1px solid #81c784;
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}

.affiliate-box h3 { color: var(--success); margin-bottom: .5rem; }
.affiliate-box p { font-size: .9rem; margin-bottom: 1rem; }

.btn-affiliate {
  display: inline-block;
  background: var(--success);
  color: #fff;
  padding: .75rem 2rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: .95rem;
  transition: background .2s;
}

.btn-affiliate:hover { background: #1b5e20; text-decoration: none; color: #fff; }

/* Compartilhamento */
.share-box {
  display: flex;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  padding: 1.25rem;
  background: var(--bg);
  border-radius: var(--radius);
  margin-top: 2rem;
  border: 1px solid var(--border);
}

.share-box span { font-weight: 600; font-size: .9rem; }

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .45rem .9rem;
  border-radius: 50px;
  font-size: .82rem;
  font-weight: 600;
  color: #fff;
  transition: opacity .2s;
}

.share-btn:hover { opacity: .85; text-decoration: none; color: #fff; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.telegram { background: #0088cc; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.copy { background: var(--text-muted); }

/* Posts relacionados */
.related-posts { margin-top: 2.5rem; }
.related-posts h2 { font-size: 1.3rem; margin-bottom: 1rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }

/* ==========================================
   SIDEBAR
   ========================================== */
.sidebar { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 1.25rem; }

.widget {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--primary);
  color: var(--primary-dark);
}

/* Sidebar search */
.widget-search { display: flex; gap: .5rem; }

.widget-search input {
  flex: 1;
  padding: .55rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
}

.widget-search input:focus { border-color: var(--primary); }

.widget-search button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .55rem .9rem;
  cursor: pointer;
  font-size: .95rem;
}

/* Category list widget */
.cat-list { list-style: none; padding: 0; margin: 0; }

.cat-list li {
  border-bottom: 1px solid var(--border);
  padding: .4rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .9rem;
}

.cat-list li:last-child { border-bottom: none; }

.cat-list li a { color: var(--text); font-weight: 500; }
.cat-list li a:hover { color: var(--primary); text-decoration: none; }

.cat-list .count {
  background: var(--bg);
  border-radius: 50px;
  padding: .1rem .5rem;
  font-size: .75rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Newsletter widget */
.newsletter-form { display: flex; flex-direction: column; gap: .65rem; }

.newsletter-form input {
  padding: .65rem .9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .9rem;
  outline: none;
}

.newsletter-form input:focus { border-color: var(--primary); }

.newsletter-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .7rem;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s;
}

.newsletter-form button:hover { background: var(--primary-dark); }

.newsletter-disclaimer { font-size: .72rem; color: var(--text-muted); text-align: center; }

/* Legal sidebar widget */
.legal-widget { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }
.legal-widget strong { color: var(--accent); }

/* ==========================================
   BREADCRUMBS
   ========================================== */
.breadcrumbs {
  font-size: .82rem;
  color: var(--text-muted);
  padding: .75rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: .3rem;
  align-items: center;
}

.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs a:hover { color: var(--primary); text-decoration: none; }
.breadcrumbs .sep { opacity: .4; }

/* ==========================================
   PÁGINA DE CATEGORIA
   ========================================== */
.category-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.category-header h1 { margin-bottom: .35rem; }
.category-header .cat-desc { color: var(--text-muted); margin: 0; }
.category-header .cat-priority {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: .2rem .7rem;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  margin-top: .5rem;
}

/* ==========================================
   PAGINAÇÃO
   ========================================== */
.pagination {
  display: flex;
  justify-content: center;
  gap: .4rem;
  flex-wrap: wrap;
  margin: 2rem 0;
}

.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: .9rem;
  font-weight: 600;
  color: var(--text);
  transition: all .2s;
}

.pagination a:hover, .pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  text-decoration: none;
}

/* ==========================================
   PÁGINA ESTÁTICA (sobre, contato, etc.)
   ========================================== */
.page-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.page-title { font-size: 2rem; margin-bottom: .5rem; }
.page-content h2 { color: var(--primary-dark); }
.page-content h3 { color: var(--primary); }

/* Contact form */
.contact-form { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.5rem; }

.form-group label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .35rem; }

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  font-family: var(--font);
  outline: none;
  transition: border-color .2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus { border-color: var(--primary); }

.form-group textarea { resize: vertical; min-height: 130px; }

.btn-primary {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  padding: .8rem 2rem;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: background .2s;
  align-self: flex-start;
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; text-decoration: none; }

/* ==========================================
   BUSCA
   ========================================== */
.search-header {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border);
}

.search-header h1 { font-size: 1.4rem; }
.search-header span { color: var(--accent); }

.search-form-main { display: flex; gap: .75rem; margin-top: 1rem; }

.search-form-main input {
  flex: 1;
  padding: .7rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  outline: none;
}

.search-form-main input:focus { border-color: var(--primary); }

.search-form-main button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: .7rem 1.5rem;
  font-weight: 700;
  cursor: pointer;
}

/* ==========================================
   404
   ========================================== */
.error-404 {
  text-align: center;
  padding: 5rem 1rem;
}

.error-404 .error-code {
  font-size: 8rem;
  font-weight: 900;
  color: var(--border);
  line-height: 1;
}

.error-404 h1 { font-size: 1.8rem; margin-bottom: 1rem; }
.error-404 p { color: var(--text-muted); margin-bottom: 2rem; }

/* ==========================================
   FOOTER
   ========================================== */
.site-footer {
  background: #1a1a2e;
  color: rgba(255,255,255,.75);
  padding: 3rem 0 1.5rem;
  margin-top: 3rem;
  font-size: .9rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-col h3 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.footer-col p { font-size: .85rem; line-height: 1.6; }

.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul li a { color: rgba(255,255,255,.65); font-size: .85rem; }
.footer-col ul li a:hover { color: #fff; text-decoration: none; }

.footer-disclaimer {
  background: rgba(255,255,255,.05);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  font-size: .8rem;
  color: rgba(255,255,255,.5);
  margin-bottom: 1.5rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  font-size: .8rem;
  color: rgba(255,255,255,.4);
}

.footer-bottom a { color: rgba(255,255,255,.5); }
.footer-bottom a:hover { color: #fff; text-decoration: none; }

/* ==========================================
   HOMEPAGE — Seções
   ========================================== */
.home-section { padding: 2.5rem 0; }
.home-section.alt-bg { background: var(--card-bg); }

.view-all-link {
  text-align: center;
  margin-top: 1.5rem;
}

.view-all-link a {
  display: inline-block;
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: .6rem 1.5rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: .9rem;
  transition: all .2s;
}

.view-all-link a:hover { background: var(--primary); color: #fff; text-decoration: none; }

/* Trusted bar */
.trusted-bar {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
}

.trusted-bar .items {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  font-size: .85rem;
  color: var(--text-muted);
}

.trusted-bar .items span { display: flex; align-items: center; gap: .35rem; font-weight: 500; }

/* ==========================================
   RESPONSIVO
   ========================================== */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .posts-grid { grid-template-columns: 1fr; }
  .categories-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .menu-toggle { display: block; }
  .nav-primary { display: none; }
  .nav-primary.open { display: block; }
  .nav-primary ul { flex-direction: column; }
  .nav-primary ul li ul { position: static; box-shadow: none; padding-left: 1rem; }
  .nav-primary ul li:hover > ul { display: none; }
  .nav-primary ul li.open > ul { display: flex; }
  .hero-search { flex-direction: column; }
  .article-entry { padding: 1.25rem; }
  .header-inner { flex-wrap: wrap; }
  .header-search { flex: 1 1 100%; order: 3; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .related-grid { grid-template-columns: 1fr; }
}

/* ==========================================
   TABELAS DE DADOS FARMACOLÓGICOS
   ========================================== */
.pharma-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25rem 0;
  font-size: .9rem;
  overflow-x: auto;
  display: block;
}

.pharma-table th {
  background: var(--primary-dark);
  color: #fff;
  padding: .65rem 1rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.pharma-table td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.5;
}

.pharma-table tr:nth-child(even) td { background: #f8fafc; }
.pharma-table tr:hover td { background: var(--primary-light); }

.pharma-table .severity-high   { color: #c62828; font-weight: 700; }
.pharma-table .severity-medium { color: #e65100; font-weight: 600; }
.pharma-table .severity-low    { color: #2e7d32; font-weight: 500; }

.pharma-table .freq-tag {
  display: inline-block;
  padding: .1rem .5rem;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: 700;
  white-space: nowrap;
}

.freq-muito-comum  { background: #ffcdd2; color: #c62828; }
.freq-comum        { background: #ffe0b2; color: #e65100; }
.freq-incomum      { background: #fff9c4; color: #f57f17; }
.freq-raro         { background: #dcedc8; color: #33691e; }
.freq-muito-raro   { background: #e8f5e9; color: #2e7d32; }

/* Caixa de mecanismo de ação */
.moa-box {
  background: linear-gradient(135deg, #e8eaf6, #f3e5f5);
  border-left: 4px solid #5c6bc0;
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.moa-box h3 { color: #3949ab; margin-top: 0; font-size: 1rem; }
.moa-box p  { margin-bottom: 0; font-size: .92rem; }

/* Ficha farmacológica (ADME) */
.pharma-card {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.pharma-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
}

.pharma-item .p-label {
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: .3rem;
}

.pharma-item .p-value {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}

.pharma-item .p-detail {
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .2rem;
}

/* Caixa de identificação do medicamento */
.drug-id-box {
  background: var(--card-bg);
  border: 2px solid var(--primary-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem 1.5rem;
}

.drug-id-box .id-field { font-size: .875rem; }
.drug-id-box .id-label { font-size: .72rem; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.drug-id-box .id-value { font-weight: 600; color: var(--text); }

/* Populações especiais */
.special-pop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}

.special-pop-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  font-size: .875rem;
}

.special-pop-card .pop-title {
  font-weight: 700;
  font-size: .85rem;
  margin-bottom: .5rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}

.pop-safe      { border-top: 3px solid #2e7d32; }
.pop-caution   { border-top: 3px solid #f9a825; }
.pop-avoid     { border-top: 3px solid #c62828; }
.pop-safe .pop-title   { color: #2e7d32; }
.pop-caution .pop-title{ color: #e65100; }
.pop-avoid .pop-title  { color: #c62828; }

/* Superdosagem */
.overdose-box {
  background: #fce4ec;
  border: 2px solid #e91e63;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
}

.overdose-box h3 { color: #ad1457; margin-top: 0; }

/* Genéricos */
.generics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin: 1rem 0;
}

.generic-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
}

.generic-card .g-name   { font-weight: 700; color: var(--text); }
.generic-card .g-lab    { color: var(--text-muted); font-size: .8rem; }
.generic-card .g-price  { color: var(--success); font-weight: 600; font-size: .85rem; margin-top: .25rem; }

/* Registro ANVISA */
.anvisa-box {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.25rem 0;
  font-size: .875rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem 2rem;
  align-items: center;
}

.anvisa-box .anvisa-logo { font-size: 1.5rem; }
.anvisa-box strong { color: #1b5e20; }

/* Barra de score de evidência */
.evidence-bar-wrap { margin: 1rem 0; }
.evidence-label { font-size: .82rem; font-weight: 600; color: var(--text-muted); margin-bottom: .3rem; }
.evidence-bar { height: 10px; background: var(--border); border-radius: 50px; overflow: hidden; }
.evidence-fill { height: 100%; border-radius: 50px; background: linear-gradient(90deg, var(--primary), #26c6da); }

/* Comparativo */
.compare-table-wrap { overflow-x: auto; margin: 1.25rem 0; }

/* ==========================================
   PRINT
   ========================================== */
@media print {
  .site-header, .sidebar, .site-footer, .share-box, .affiliate-box,
  .disclaimer-bar, .related-posts, .menu-toggle { display: none !important; }
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .article-entry { box-shadow: none; border: none; padding: 0; }
  body { font-size: 12pt; }
}
