/* ═══════════════════════════════════════════════
   PBRF THEME — global.css
   Tokens, reset, header, footer, layout, 404
═══════════════════════════════════════════════ */
:root {
  --purple:       #3B1F6A;
  --purple-mid:   #5A3494;
  --purple-light: #7B52B9;
  --purple-dark:  #27154A;
  --gold:         #C9A84C;
  --gold-light:   #E8C97D;
  --gold-pale:    #F5EDD4;
  --cream:        #F9F6F0;
  --gray-50:      #F4F1EC;
  --gray-100:     #EDE8E1;
  --gray-200:     #E0D9CF;
  --gray-400:     #B5A99A;
  --gray-600:     #6B6059;
  --gray-900:     #1A1210;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', sans-serif;
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px;
  --max-w: 1240px;
  --header-h: 72px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; scroll-padding-top: calc(var(--header-h) + 48px); }
body { font-family: var(--font-body); background: var(--cream); color: var(--gray-900); overflow-x: hidden; line-height: 1.6; }
img { max-width: 100%; display: block; height: auto; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; font-family: var(--font-body); }
input, textarea, select { font-family: var(--font-body); }

/* ── SCREEN READER ── */
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 9999; background: var(--gold); color: var(--purple); padding: 8px 16px; border-radius: var(--r-sm); font-weight: 700; }
.skip-link:focus { left: 8px; }
.screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ── CONTAINER ── */
.pbrf-container { max-width: var(--max-w); margin: 0 auto; padding: 0 40px; }

/* ── FIXED HEADER OFFSET (non-homepage pages) ── */
body:not(.home) { padding-top: var(--header-h); }

/* ── WP ADMIN BAR COMPENSATION ── */
/* Admin bar is 32px tall on desktop, 46px on mobile ≤782px */
.admin-bar .pbrf-header { top: 32px; }
.admin-bar body:not(.home) { padding-top: calc(var(--header-h) + 32px); }
.admin-bar .pbrf-nav.is-open { top: var(--header-h); }
@media screen and (max-width: 782px) {
  .admin-bar .pbrf-header { top: 46px; }
  .admin-bar body:not(.home) { padding-top: calc(var(--header-h) + 46px); }
  .admin-bar .pbrf-nav.is-open { top: var(--header-h); }
}

/* ── HEADER ── */
.pbrf-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 9999;
  background: rgba(59,31,106,0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(201,168,76,0.25);
  transition: box-shadow .3s;
}
.pbrf-header-inner {
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--max-w); margin: 0 auto;
  padding: 16px 40px;
}

/* Logo */
.pbrf-logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.pbrf-logo-img { height: 56px; width: auto; display: block; }
.pbrf-logo--footer .pbrf-logo-img { height: 64px; }

/* Nav */
.pbrf-nav { display: flex; align-items: center; }
.pbrf-menu { list-style: none; display: flex; align-items: center; gap: 28px; margin: 0; padding: 0; }
.pbrf-menu li { position: relative; margin: 0; }
.pbrf-menu li > a {
  color: rgba(255,255,255,0.82); font-size: 14px; font-weight: 500;
  letter-spacing: 0.04em; transition: color .2s; white-space: nowrap;
  display: block; padding: 4px 0;
}
.pbrf-menu li > a:hover,
.pbrf-menu li.current-menu-item > a,
.pbrf-menu li.current_page_item > a { color: var(--gold-light); }

/* Dropdown — padding-top acts as invisible hover bridge */
.pbrf-menu li ul {
  display: none;
  position: absolute; left: 0; top: 100%;
  padding-top: 12px;
  min-width: 220px; list-style: none;
  margin: 0; z-index: 1000;
}
/* Visual box via ::before — no yellow top bar */
.pbrf-menu li ul::before {
  content: '';
  position: absolute; top: 12px; left: 0; right: 0; bottom: 0;
  background: #2d175a;
  border: 1px solid rgba(201,168,76,0.25);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  z-index: -1;
}
/* Arrow indicator */
.pbrf-menu li ul::after {
  content: '';
  position: absolute; top: 4px; left: 22px;
  width: 0; height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 8px solid rgba(201,168,76,0.25);
  z-index: 1;
}
.pbrf-menu li:hover > ul,
.pbrf-menu li:focus-within > ul { display: flex; flex-direction: column; }
.pbrf-menu li ul li { margin: 0; position: static; padding: 0; }
.pbrf-menu li ul li:first-child { padding-top: 6px; }
.pbrf-menu li ul li:last-child  { padding-bottom: 6px; }
.pbrf-menu li ul li a {
  display: block;
  padding: 9px 12px;
  margin: 2px 6px;
  font-size: 13px; color: rgba(255,255,255,0.75);
  white-space: nowrap;
  border-radius: 7px;
  transition: background .15s, color .15s, padding-left .15s;
  position: relative; z-index: 1;
}
.pbrf-menu li ul li a:hover {
  background: rgba(255,255,255,0.10);
  color: var(--gold-light);
  padding-left: 16px;
}

/* Header actions wrapper (CTA + mobile toggle) */
.pbrf-header-actions {
  display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}

/* CTA */
.pbrf-header-cta {
  background: var(--gold); color: var(--purple);
  font-weight: 700; font-size: 14px; padding: 10px 22px;
  border-radius: 6px; white-space: nowrap;
  transition: background .2s, transform .15s; display: inline-block;
}
.pbrf-header-cta:hover { background: var(--gold-light); transform: translateY(-1px); color: var(--purple); }

/* Mobile toggle */
.pbrf-menu-toggle {
  display: none; background: none; border: 1.5px solid rgba(255,255,255,0.3);
  border-radius: 6px; padding: 7px 10px; cursor: pointer; color: #fff;
  font-size: 18px; line-height: 1; flex-shrink: 0;
}

/* Mobile nav open state */
.pbrf-nav.is-open {
  display: flex; position: fixed; top: var(--header-h); left: 0; right: 0;
  background: var(--purple); padding: 20px 24px;
  flex-direction: column; align-items: flex-start;
  border-bottom: 1px solid rgba(201,168,76,0.2); z-index: 9998;
}

/* Lock body scroll when mobile menu is open */
body.pbrf-menu-open { overflow: hidden; }
.pbrf-nav.is-open .pbrf-menu { flex-direction: column; gap: 0; width: 100%; }
.pbrf-nav.is-open .pbrf-menu > li > a { padding: 12px; border-bottom: 1px solid rgba(255,255,255,0.08); }

/* Mobile submenu — same visual as desktop dropdown, triggered by hover/touch */
.pbrf-nav.is-open .pbrf-menu li ul { display: none; }
.pbrf-nav.is-open .pbrf-menu li.is-open > ul { display: flex !important; flex-direction: column; }

/* ── FOOTER ── */
.pbrf-footer { background: var(--gray-900); padding: 72px 40px 40px; }
.pbrf-footer-grid { max-width: var(--max-w); margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 60px; padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.pbrf-footer-brand .pbrf-logo { margin-bottom: 16px; }
.pbrf-footer-brand p { font-size: 13px; color: rgba(255,255,255,0.4); line-height: 1.7; max-width: 280px; margin-bottom: 6px; }
.pbrf-footer-address { font-size: 12px !important; color: rgba(255,255,255,0.3) !important; }
.pbrf-logo--footer .pbrf-logo-name { color: #fff; }
.pbrf-logo--footer .pbrf-logo-sub  { color: var(--gold-light); }
.pbrf-footer-col h4 { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 16px; }
.pbrf-footer-col ul { display: flex; flex-direction: column; gap: 9px; }
.pbrf-footer-col ul li a { color: rgba(255,255,255,0.45); font-size: 13px; transition: color .2s; }
.pbrf-footer-col ul li a:hover { color: rgba(255,255,255,0.8); }
.pbrf-footer-bottom { max-width: var(--max-w); margin: 32px auto 0; display: flex; align-items: center; justify-content: space-between; }
.pbrf-footer-copy { font-size: 12px; color: rgba(255,255,255,0.25); }
.pbrf-footer-copy a { color: rgba(255,255,255,0.35); }
.pbrf-footer-social { display: flex; gap: 8px; }
.pbrf-social-btn { width: 34px; height: 34px; border-radius: 7px; border: 1px solid rgba(255,255,255,0.12); display: grid; place-items: center; font-size: 11px; font-weight: 700; color: rgba(255,255,255,0.45); transition: all .2s; }
.pbrf-social-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ── PAGE HERO (all interior pages) ── */
.pg-hero { background: var(--purple); padding: 64px 40px 0; position: relative; overflow: hidden; }
.pg-hero--has-image { background-size: cover; background-position: center center; min-height: 520px; display: flex; flex-direction: column; justify-content: flex-end; }
.pg-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 50% 100% at 95% 50%, rgba(90,52,148,0.55) 0%, transparent 65%),
    radial-gradient(ellipse 30% 60% at 0% 100%, rgba(201,168,76,0.07) 0%, transparent 55%);
}
.pg-hero--has-image::before {
  background: rgba(27,14,50,0.88);
}
.pg-hero-grid { position: absolute; inset: 0; opacity: 0.03; pointer-events: none; background-image: linear-gradient(rgba(255,255,255,1) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,1) 1px, transparent 1px); background-size: 60px 60px; }
.pg-hero-content { position: relative; padding-bottom: 52px; }
.pg-hero h1 { font-family: var(--font-display); font-size: clamp(36px, 4.5vw, 56px); font-weight: 900; color: #fff; line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 16px; }
.pg-hero h1 em { font-style: italic; color: var(--gold); }
.pg-hero-lead { font-size: 17px; color: rgba(255,255,255,0.6); font-weight: 300; line-height: 1.75; max-width: 560px; }
.pg-eyebrow { display: inline-flex; align-items: center; gap: 8px; background: rgba(201,168,76,0.12); border: 1px solid rgba(201,168,76,0.3); color: var(--gold-light); font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 13px; border-radius: 100px; margin-bottom: 18px; }
.pg-eyebrow-dot { width: 4px; height: 4px; background: var(--gold); border-radius: 50%; }
.pg-breadcrumb { font-size: 12px; color: rgba(255,255,255,0.4); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pg-breadcrumb a { color: rgba(255,255,255,0.4); transition: color .2s; }
.pg-breadcrumb a:hover { color: var(--gold-light); }
.pg-breadcrumb-sep { opacity: 0.4; }
.pg-breadcrumb-current { color: var(--gold-light); }
.pg-wave { width: 100%; height: 48px; display: block; background: var(--cream); clip-path: ellipse(55% 100% at 50% 100%); margin-top: -1px; }

/* ── PAGE LAYOUT ── */
.pg-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 60px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 60px 40px 32px;
}
/* Wrapper dos comentários — espaço reduzido acima, respiro antes do footer */
.pg-comments-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 40px;
  margin-bottom: 80px;
}
.pg-layout:has(.pg-sidebar:empty) { grid-template-columns: 1fr; }
.pg-content {}
.pg-sidebar {}

/* ── PROSE (conteúdo de páginas) ── */
.pg-prose h2 { font-family: var(--font-display); font-size: 30px; font-weight: 900; color: var(--purple); margin: 48px 0 16px; line-height: 1.15; letter-spacing: -0.02em; }
.pg-prose h3 { font-family: var(--font-display); font-size: 22px; font-weight: 700; color: var(--purple); margin: 36px 0 12px; }
.pg-prose h4 { font-size: 16px; font-weight: 700; color: var(--gray-900); margin: 24px 0 8px; }
.pg-prose p  { font-size: 16px; color: var(--gray-600); line-height: 1.8; margin-bottom: 18px; font-weight: 300; }
.pg-prose p strong { color: var(--gray-900); font-weight: 600; }
.pg-prose a:not([class]) { color: var(--purple-mid); border-bottom: 1px solid rgba(90,52,148,0.3); transition: border-color .2s; }
.pg-prose a:not([class]):hover { border-color: var(--purple-mid); }
.pg-prose ul, .pg-prose ol { margin: 0 0 18px 20px; display: flex; flex-direction: column; gap: 8px; }
.pg-prose li { font-size: 16px; color: var(--gray-600); line-height: 1.7; font-weight: 300; }
.pg-prose li::marker { color: var(--gold); }
.pg-prose blockquote { margin: 32px 0; padding: 24px 32px; background: var(--purple); border-radius: var(--r-md); position: relative; }
.pg-prose blockquote p { font-family: var(--font-display); font-size: 20px; font-style: italic; color: #fff; line-height: 1.5; margin: 0; }
.pg-prose img { border-radius: var(--r-md); margin: 32px 0; }
.pg-post-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; color: rgba(255,255,255,0.55); font-size: 13px; margin-top: 8px; }
.pg-post-tags { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--gray-200); font-size: 13px; color: var(--gray-400); }
.pg-featured-img { margin-bottom: 36px; border-radius: var(--r-md); overflow: hidden; }

/* ── SIDEBAR ── */
.pg-related { margin-top: 32px; }
.pg-related h4 { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 14px; }
.pg-related-link { display: flex; align-items: flex-start; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--gray-200); font-size: 13px; color: var(--gray-600); line-height: 1.4; transition: color .2s; }
.pg-related-link:hover { color: var(--purple); }
.pg-related-icon { flex-shrink: 0; font-size: 14px; margin-top: 1px; }
.widget-title { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gold); font-weight: 700; margin-bottom: 14px; }

/* ── BLOG GRID ── */
.blog-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; padding: 48px 0; }
.blog-card { background: #fff; border-radius: var(--r-md); border: 1px solid var(--gray-200); overflow: hidden; display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.blog-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(59,31,106,0.1); }
.blog-card-img { display: block; height: 200px; overflow: hidden; background: var(--gray-100); }
.blog-card-img img { width: 100%; height: 100%; object-fit: cover; }
.blog-card-img--placeholder { display: flex; align-items: center; justify-content: center; font-size: 40px; }
.blog-card-body { padding: 24px; flex: 1; display: flex; flex-direction: column; }
.blog-card-meta { font-size: 11px; color: var(--gray-400); font-weight: 500; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.blog-card-title { font-family: var(--font-display); font-size: 18px; font-weight: 700; color: var(--purple); line-height: 1.25; margin-bottom: 10px; }
.blog-card-title a { color: inherit; }
.blog-card-excerpt { font-size: 14px; color: var(--gray-600); line-height: 1.65; flex: 1; margin-bottom: 16px; font-weight: 300; }
.blog-card-cta { font-size: 13px; font-weight: 700; color: var(--purple); display: inline-flex; align-items: center; gap: 4px; margin-top: auto; transition: gap .2s; }
.blog-card:hover .blog-card-cta { gap: 8px; }

/* ── PAGINATION ── */
.pbrf-pagination { padding: 0 0 60px; display: flex; justify-content: center; }
.pbrf-pagination .nav-links { display: flex; gap: 8px; }
.pbrf-pagination .page-numbers { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 1.5px solid var(--gray-200); font-size: 14px; color: var(--gray-600); transition: all .2s; }
.pbrf-pagination .page-numbers.current, .pbrf-pagination .page-numbers:hover { background: var(--purple); color: #fff; border-color: var(--purple); }
.pbrf-no-results { font-size: 16px; color: var(--gray-400); padding: 80px 0; text-align: center; }

/* ── 404 ── */
.pbrf-404 { flex: 1; display: flex; align-items: center; justify-content: center; padding: 80px 40px; min-height: 560px; position: relative; overflow: hidden; }
.pbrf-404::before { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(59,31,106,0.03) 1px, transparent 1px), linear-gradient(90deg, rgba(59,31,106,0.03) 1px, transparent 1px); background-size: 48px 48px; pointer-events: none; }
.pbrf-404-bg-num { position: absolute; font-family: var(--font-display); font-size: clamp(200px,30vw,360px); font-weight: 900; color: rgba(59,31,106,0.05); line-height: 1; letter-spacing: -0.05em; user-select: none; pointer-events: none; top: 50%; left: 50%; transform: translate(-50%,-50%); white-space: nowrap; }
.pbrf-404-inner { position: relative; text-align: center; max-width: 560px; }
.pbrf-404-accent { display: flex; align-items: center; justify-content: center; gap: 12px; margin-bottom: 28px; }
.pbrf-404-accent-line { width: 40px; height: 2px; background: var(--gold); border-radius: 2px; }
.pbrf-404-accent-label { font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--gold); }
.pbrf-404-code { font-family: var(--font-display); font-size: clamp(72px,12vw,120px); font-weight: 900; color: var(--purple); line-height: 1; letter-spacing: -0.04em; margin-bottom: 16px; }
.pbrf-404-code em { font-style: italic; color: var(--gold); }
.pbrf-404-title { font-family: var(--font-display); font-size: clamp(22px,3vw,30px); font-weight: 700; color: var(--purple); margin-bottom: 16px; line-height: 1.2; }
.pbrf-404-desc { font-size: 16px; color: var(--gray-600); line-height: 1.75; font-weight: 300; margin-bottom: 40px; }
.pbrf-404-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 52px; }
.pbrf-btn-primary { display: inline-flex; align-items: center; gap: 8px; background: var(--purple); color: #fff; font-weight: 700; font-size: 14px; padding: 13px 28px; border-radius: var(--r-sm); transition: all .2s; }
.pbrf-btn-primary:hover { background: var(--purple-mid); transform: translateY(-1px); }
.pbrf-btn-gold { display: inline-flex; align-items: center; gap: 8px; background: var(--gold); color: var(--purple); font-weight: 700; font-size: 14px; padding: 13px 28px; border-radius: var(--r-sm); transition: all .2s; }
.pbrf-btn-gold:hover { background: var(--gold-light); transform: translateY(-1px); }
.pbrf-btn-ghost { display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--purple); font-weight: 500; font-size: 14px; padding: 12px 24px; border-radius: var(--r-sm); border: 1.5px solid var(--gray-200); transition: all .2s; }
.pbrf-btn-ghost:hover { border-color: var(--purple); }
.pbrf-404-links-label { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--gray-400); margin-bottom: 16px; }
.pbrf-404-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.pbrf-404-link { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--gray-200); border-radius: 100px; padding: 7px 16px; font-size: 13px; color: var(--gray-600); transition: all .2s; }
.pbrf-404-link:hover { border-color: var(--purple); color: var(--purple); }
.pbrf-404-link-icon { font-size: 14px; }

/* ── SEARCH FORM ── */
.search-form { display: flex; gap: 0; max-width: 480px; margin-top: 32px; }
.search-field { flex: 1; padding: 12px 16px; border: 1.5px solid var(--gray-200); border-right: none; border-radius: var(--r-sm) 0 0 var(--r-sm); font-size: 15px; background: #fff; }
.search-submit { background: var(--purple); color: #fff; font-weight: 700; font-size: 14px; padding: 12px 24px; border: none; border-radius: 0 var(--r-sm) var(--r-sm) 0; }

/* ══ RESPONSIVE ══ */
@media (max-width: 1024px) {
  .pbrf-footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .blog-grid { grid-template-columns: repeat(2,1fr); }
  .pg-layout { grid-template-columns: 1fr; padding: 40px 20px 52px; }
  .pg-comments-wrapper { padding: 0 20px; margin-bottom: 52px; }
}
@media (max-width: 768px) {
  .pbrf-container { padding: 0 20px; }
  .pbrf-header-inner { padding: 14px 20px; }
  .pbrf-nav { display: none; }
  .pbrf-menu-toggle { display: block; }
  .pbrf-header-cta { font-size: 13px; padding: 9px 16px; }
  .pbrf-footer { padding: 48px 20px 32px; }
  .pbrf-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .pbrf-footer-bottom { flex-direction: column; align-items: flex-start; gap: 16px; }
  .blog-grid { grid-template-columns: 1fr; }
  .pg-hero { padding: 48px 20px 0; }
  .pg-hero h1 { font-size: 36px; }
  .pg-layout { padding: 40px 20px 60px; gap: 40px; }
  .pbrf-404 { padding: 52px 24px; }
  .pbrf-404-actions { flex-direction: column; align-items: center; }
  .pbrf-btn-primary, .pbrf-btn-gold, .pbrf-btn-ghost { width: 100%; justify-content: center; }
}

/* ── SCROLL ANIMATIONS ── */
.pbrf-animate { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .5s ease; }
.pbrf-animate.pbrf-visible { opacity: 1; transform: translateY(0); }
