/* ============================================================
   Blog TRG: Global Stylesheet
   Instituto Brasileiro de Formação de Terapeutas (IBFT)
   ============================================================ */

:root {
  --navy:       #0d3b6e;
  --navy-dark:  #071f3d;
  --navy-mid:   #1a5494;
  --blue:       #3c8cc8;
  --blue-light: #6aadde;
  --green:      #50be8c;
  --green-dark: #2d9968;
  --red:        #f0505a;
  --amber:      #f09632;
  --rose:       #a03250;

  --bg:         #f8f7f5;
  --surface:    #ffffff;
  --surface-2:  #f2f0ed;
  --text:       #111827;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border:     rgba(0,0,0,0.08);
  --border-med: rgba(0,0,0,0.12);

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -2px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.10), 0 10px 10px -5px rgba(0,0,0,0.04), 0 0 0 1px rgba(0,0,0,0.04);
  --shadow-inset: inset 0 1px 2px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(0,0,0,0.04);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: 60px;
  overflow-x: hidden;
}

/* ========== NAVBAR ========== */
.navbar {
  background: rgba(255,255,255,0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 200;
  height: 60px;
  display: flex;
  align-items: center;
  padding: 0 32px;
  justify-content: space-between;
  gap: 20px;
  transition: height 0.3s cubic-bezier(0.4,0,0.2,1), box-shadow 0.3s, background 0.3s, padding 0.3s;
}

.navbar.scrolled {
  height: 46px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08), 0 1px 0 rgba(0,0,0,0.06);
}

.navbar.scrolled .nav-logo img { height: 26px; }

.nav-logo { cursor: pointer; flex-shrink: 0; display: flex; align-items: center; }
.nav-logo img { height: 32px; width: auto; display: block; transition: height 0.3s; }

.nav-search-wrap { flex: 1; max-width: 560px; position: relative; }

.nav-search-inner {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-med);
  border-radius: 22px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  padding: 0 16px;
  height: 42px;
  gap: 10px;
  transition: border-color 0.2s, box-shadow 0.2s, height 0.3s;
}

.navbar.scrolled .nav-search-inner { height: 34px; border-radius: 17px; }

.nav-search-inner:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(60,140,200,0.18), 0 1px 4px rgba(0,0,0,0.08);
  background: var(--surface);
}

.nav-search-icon { color: var(--text-muted); flex-shrink: 0; transition: color 0.2s; width: 16px; height: 16px; }
.nav-search-inner:focus-within .nav-search-icon { color: var(--blue); }

.nav-search-inner input {
  border: none; background: none; outline: none;
  font-size: 14.5px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  color: var(--text); width: 100%; line-height: 1;
}
.nav-search-inner input::placeholder { color: var(--text-light); }

.search-clear {
  background: none; border: none; cursor: pointer;
  color: var(--text-light); padding: 0;
  display: none; align-items: center; transition: color 0.15s; flex-shrink: 0;
}
.search-clear:hover { color: var(--text); }
.search-clear.visible { display: flex; }

.mobile-search-btn {
  display: none; background: none; border: none;
  cursor: pointer; color: var(--text); padding: 6px;
  border-radius: 8px; transition: background 0.15s;
}
.mobile-search-btn:hover { background: var(--surface-2); }

/* ========== HERO ========== */
.hero {
  background: linear-gradient(rgba(0,0,0,0.70), rgba(0,0,0,0.70)), url('../img/home-hero-capa.webp') center center / cover no-repeat;
  padding: 72px 40px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
  
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 0; right: 0;
  height: 40px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(40px, 4.5vw, 60px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  max-width: 900px;
  margin: 0 auto 20px;
}

.hero h1 em { font-style: italic; color: #ffd058; }

.hero-sub {
  font-size: 18px;
  color: #fff;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ========== LAYOUT ========== */
.container { max-width: 1160px; margin: 0 auto; padding: 0 32px; }

.main-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  padding: 44px 0 80px;
  align-items: start;
}

/* ========== FEED HEADER ========== */
.feed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.feed-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
}

/* ========== FILTER BAR ========== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 28px;
}

.filter-label {
  font-size: 16px; font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.8px;
  margin-right: 4px; flex-shrink: 0;
}

.filter-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 13px; border-radius: 20px;
  font-size: 16px; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border-med);
  background: var(--surface); color: var(--text-muted);
  transition: all 0.18s; box-shadow: var(--shadow-sm);
  user-select: none; white-space: nowrap;
}

.filter-chip:hover { border-color: var(--navy); color: var(--navy); box-shadow: var(--shadow-md); }

.filter-chip.active {
  background: var(--navy); color: #fff; border-color: var(--navy);
  box-shadow: 0 2px 8px rgba(13,59,110,0.30), var(--shadow-sm);
}

/* ========== FILTER DROPDOWN (mobile) ========== */
.filter-dropdown-wrap {
  display: none;
  position: relative;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.filter-dropdown-btn {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-med); background: var(--surface);
  color: var(--text); font-size: 18px; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  font-weight: 500; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.filter-dropdown-btn:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(13,59,110,0.12); }
.filter-dropdown-btn svg { transition: transform 0.22s cubic-bezier(0.4,0,0.2,1); flex-shrink: 0; color: var(--text-muted); }
.filter-dropdown-btn.open svg { transform: rotate(180deg); }

.filter-dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--surface); border: 1px solid var(--border-med);
  border-radius: var(--radius-md); box-shadow: var(--shadow-xl);
  overflow: hidden; z-index: 50;
  transform-origin: top center;
  transform: scaleY(0.92) translateY(-6px);
  opacity: 0; pointer-events: none;
  transition: transform 0.2s cubic-bezier(0.34,1.56,0.64,1), opacity 0.18s;
}

.filter-dropdown-menu.open { transform: scaleY(1) translateY(0); opacity: 1; pointer-events: auto; }

.filter-dropdown-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; font-size: 18px; font-weight: 500;
  color: var(--text-muted); cursor: pointer;
  transition: background 0.13s, color 0.13s;
  border-bottom: 1px solid var(--border);
}

.filter-dropdown-option:last-child { border-bottom: none; }
.filter-dropdown-option:hover { background: var(--surface-2); color: var(--navy); }
.filter-dropdown-option.active { color: var(--navy); font-weight: 600; }
.filter-dropdown-option.active::after {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--navy); flex-shrink: 0;
}

/* ========== POST CARD ========== */
.posts-grid { display: flex; flex-direction: column; gap: 16px; }

.post-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: row;
  align-items: stretch;
  overflow: hidden;                /* garante que a imagem respeite o border-radius do card */
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  position: relative;
  transition: transform 0.22s cubic-bezier(0.34,1.56,0.64,1), box-shadow 0.22s ease;
  padding: 0;                      /* sem padding: imagem encosta nas bordas do card */
  gap: 0;
  min-height: 210px;
}

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

/* link invisível que cobre o card inteiro */
.card-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
}

/* garante que o .read-link fique acima do card-link e seja clicável */
.read-link { position: relative; z-index: 2; }

.post-card-img {
  position: relative;
  overflow: hidden;
  width: 260px;
  flex-shrink: 0;
  border-radius: 0;                /* sem radius próprio — o card pai já recorta com overflow:hidden */
  background: var(--surface-2);
}
.post-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.4s ease; }
.post-card:hover .post-card-img img { transform: scale(1.06); }
.img-overlay { position: absolute; inset: 0; }

.post-card-body { display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; padding: 16px 20px; }

.post-tags { display: flex; flex-wrap: wrap; gap: 5px; }

.tag {
  font-size: 12px; font-weight: 600; letter-spacing: 0.6px;
  text-transform: uppercase; padding: 3px 9px;
  border-radius: 20px; border: 1px solid;
}

.tag-blue  { background: rgba(60,140,200,0.10);  color: #1d6fa0; border-color: rgba(60,140,200,0.2); }
.tag-green { background: rgba(80,190,140,0.10);  color: #1a7a52; border-color: rgba(80,190,140,0.2); }
.tag-red   { background: rgba(240,80,90,0.10);   color: #b8303a; border-color: rgba(240,80,90,0.2); }
.tag-amber { background: rgba(240,150,50,0.10);  color: #b36e10; border-color: rgba(240,150,50,0.2); }
.tag-rose  { background: rgba(160,50,80,0.10);   color: #7a1e35; border-color: rgba(160,50,80,0.2); }

.post-card-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px; font-weight: 700;
  color: var(--navy-dark); line-height: 1.35;
}

.post-card-excerpt {
  font-size: 15px; color: var(--text-muted); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden;
}

.post-card-footer {
  margin-top: auto; padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between; gap: 12px;
}

.post-date { font-size: 15px; color: var(--text-light); }

.read-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 700; color: #fff;
  border: none; cursor: pointer; padding: 8px 16px;
  border-radius: 20px; background: var(--navy);
  box-shadow: 0 2px 8px rgba(13,59,110,0.30), 0 1px 2px rgba(0,0,0,0.10);
  transition: background 0.18s, box-shadow 0.18s, transform 0.15s;
  white-space: nowrap; flex-shrink: 0; letter-spacing: 0.2px;
  text-decoration: none;
}

.read-link:hover {
  background: var(--navy-mid);
  box-shadow: 0 4px 14px rgba(13,59,110,0.40), 0 1px 3px rgba(0,0,0,0.12);
  transform: translateX(2px);
}

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

.widget {
  background: var(--surface); border-radius: var(--radius-lg);
  padding: 22px; border: 1px solid var(--border); box-shadow: var(--shadow-md);
}

.widget-title {
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--text-light); margin-bottom: 14px;
}

.cat-list { display: flex; flex-direction: column; gap: 2px; }

.cat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 13px; color: var(--text-muted);
  transition: background 0.15s, color 0.15s; gap: 8px; text-decoration: none;
}

.cat-item:hover, .cat-item.active { background: rgba(13,59,110,0.06); color: var(--navy); }
.cat-item .cat-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.cat-item .cat-name { flex: 1; font-weight: 500; }
.cat-count { font-size: 15px; background: var(--surface-2); color: var(--text-light); padding: 2px 7px; border-radius: 10px; font-weight: 500; }

.recent-list { display: flex; flex-direction: column; }

.recent-item {
  display: flex; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer; transition: opacity 0.15s; text-decoration: none; color: inherit;
}

.recent-item:last-child { border-bottom: none; padding-bottom: 0; }
.recent-item:first-child { padding-top: 0; }
.recent-item:hover { opacity: 0.7; }

.recent-thumb { width: 52px; height: 52px; border-radius: 8px; overflow: hidden; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.recent-thumb img { width: 100%; height: 100%; object-fit: cover; }

.recent-info { flex: 1; min-width: 0; }
.recent-title { font-size: 16px; font-weight: 600; color: var(--navy-dark); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 3px; }
.recent-date { font-size: 15px; color: var(--text-light); }

.widget-dark {
  background: linear-gradient(135deg, var(--navy-dark), var(--navy));
  border: none; color: #fff;
}

.widget-dark .widget-title { color: rgba(255,255,255,0.45); }
.widget-dark p { font-size: 17px; color: rgba(255,255,255,0.72); line-height: 1.65; }
.widget-dark small { font-size: 16px; color: rgba(255,255,255,0.4); display: block; margin-top: 10px; }

/* ========== NO RESULTS ========== */
.no-results { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.no-results h3 { font-size: 24px; font-weight: 600; margin-bottom: 8px; color: var(--navy); }
.no-results a { color: var(--blue); }

/* ========== BACK TO TOP ========== */
.back-to-top {
  position: fixed; bottom: 32px; right: 32px; z-index: 300;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--navy); color: #fff; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(13,59,110,0.35), 0 1px 4px rgba(0,0,0,0.12);
  opacity: 0; transform: translateY(12px) scale(0.88);
  transition: opacity 0.25s, transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background 0.2s, box-shadow 0.2s;
  pointer-events: none;
}

.back-to-top.visible { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
.back-to-top:hover { background: var(--navy-mid); box-shadow: 0 6px 20px rgba(13,59,110,0.45); transform: translateY(-2px) scale(1.06); }
.back-to-top:active { transform: scale(0.94); }

/* ========== FOOTER ========== */
footer {
  background: var(--navy-dark); color: rgba(255,255,255,0.5);
  text-align: center; padding: 28px 32px; font-size: 12px; line-height: 1.7;
}

footer a { color: var(--green); text-decoration: none; }

/* ========== ANIMATIONS ========== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-card { animation: fadeUp 0.35s ease both; }
.post-card:nth-child(1) { animation-delay: 0.04s; }
.post-card:nth-child(2) { animation-delay: 0.08s; }
.post-card:nth-child(3) { animation-delay: 0.12s; }
.post-card:nth-child(4) { animation-delay: 0.16s; }

/* ========== RESPONSIVE ========== */
@media (max-width: 880px) {
  .main-grid        { grid-template-columns: 1fr; }
  .sidebar          { display: flex; position: static; max-height: none; overflow-y: visible; }
  .sidebar > .widget:first-child { display: none; }
  .sidebar > .widget-dark        { display: none; }
  .post-card        { flex-direction: column; min-height: unset; }
  .post-card-img    { width: 100%; height: 200px; border-radius: 0; }
  .post-card-body   { flex: 1; padding: 14px 16px; }
  .navbar           { padding: 0 16px; justify-content: flex-start; }
  .mobile-search-btn { margin-left: auto; }
  .nav-search-wrap  { display: none; }
  .nav-search-wrap.mobile-open {
    display: block; position: fixed; top: 60px; left: 0; right: 0;
    z-index: 199; background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px); padding: 12px 16px;
    border-bottom: 1px solid var(--border); max-width: 100%;
  }
  .mobile-search-btn { display: flex; }
  .hero, .article-hero { padding: 48px 20px 60px; }
  .container        { padding: 0 20px; }
  .filter-bar       { display: none; }
  .filter-dropdown-wrap { display: block; }

  /* Typography — mobile */
  .hero h1           { font-size: clamp(34px, 3.8vw, 51px); }
  .hero-sub          { font-size: 18px; }
  .feed-title        { font-size: 20px; }
  .post-card-title   { font-size: 18px; }
  .post-card-excerpt { font-size: 14px; }
  .post-date         { font-size: 13px; }
}

/* Typography — large desktop */
@media (min-width: 1280px) {
  .hero-sub          { font-size: 22px; }
  .feed-title        { font-size: 24px; }
  .post-card-title   { font-size: 22px; }
  .post-card-excerpt { font-size: 15px; }
}

@media (min-width: 881px) {
  .nav-search-wrap    { display: block; }
  .mobile-search-btn  { display: none; }
}

/* ── Pagination ─────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 40px 0 16px;
  flex-wrap: wrap;
}
.pagination .page-btn {
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pagination .page-btn:hover:not(:disabled) {
  background: var(--primary-light, #eef4fb);
  color: var(--navy);
  border-color: var(--navy);
}
.pagination .page-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 700;
  pointer-events: none;
}
.pagination .page-btn:disabled {
  opacity: .35;
  cursor: default;
}
.pagination .page-ellipsis {
  color: var(--text-muted);
  font-size: 14px;
  padding: 0 4px;
  user-select: none;
}
@media (max-width: 880px) {
  .pagination { gap: 4px; }
  .pagination .page-btn { min-width: 32px; height: 32px; font-size: 13px; }
}

/* ── Seletor de idioma ─────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 16px;
}

.lang-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-light);
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.lang-btn {
  background: none;
  border: 2px solid transparent;
  border-radius: 4px;
  padding: 2px;
  cursor: pointer;
  opacity: 0.45;
  transition: opacity 0.2s, border-color 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
}

.lang-btn:hover {
  opacity: 0.85;
  transform: scale(1.1);
}

.lang-btn.active {
  opacity: 1;
  border-color: var(--primary);
}

.lang-btn img {
  display: block;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
}

/* Esconde barra padrão do Google Translate */
.goog-te-banner-frame { display: none !important; }
body { top: 0 !important; }

.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip-bubble {
  display: none !important;
  visibility: hidden !important;
}

body {
  top: 0 !important;
  position: static !important;
}

iframe.goog-te-banner-frame {
  display: none !important;
}

/* Espaço para o banner do Google Translate quando ativo */
html.translated-ltr .navbar,
html.translated-rtl .navbar {
  top: 40px;
}

html.translated-ltr body,
html.translated-rtl body {
  padding-top: 100px;
}