/* Aplicado somente quando existe tema ativo; nenhuma alteração de layout. */
:root:has(#postline-active-theme) {}
html:has(#postline-active-theme) body {background:var(--postline-background);}
html:has(#postline-active-theme) .sbfcp-global-search {background:var(--postline-background);border-color:var(--postline-secondary);}
html:has(#postline-active-theme) .sbfcp-global-search h2,
html:has(#postline-active-theme) .section-heading h2 {color:var(--postline-primary);}
html:has(#postline-active-theme) .sbfcp-global-search button,
html:has(#postline-active-theme) #bibliotecas .library-info .arrow,
html:has(#postline-active-theme) #noticias .postline-sync-go,
html:has(#postline-active-theme) #noticias .postline-sync-category {background:var(--postline-accent)!important;color:var(--postline-primary)!important;}
html:has(#postline-active-theme) #bibliotecas .library-info,
html:has(#postline-active-theme) #bibliotecas .library-card {background:var(--postline-surface)!important;}
html:has(#postline-active-theme) #bibliotecas .library-info strong,
html:has(#postline-active-theme) #noticias .postline-sync-item-title {color:var(--postline-text)!important;}
html:has(#postline-active-theme) #noticias .postline-sync-aside,
html:has(#postline-active-theme) #noticias .postline-sync-feature-link {background:var(--postline-primary)!important;}
html:has(#postline-active-theme) #noticias .postline-sync-item {background:var(--postline-secondary)!important;}
html:has(#postline-active-theme) #noticias .postline-sync-item-title {color:#fff!important;}
html:has(#postline-active-theme) #noticias .postline-sync-controls button,
html:has(#postline-active-theme) #noticias .postline-sync-bottom {border-color:var(--postline-accent)!important;color:var(--postline-accent)!important;}

/* Cabeçalho institucional: faixa superior, navegação e acentos.
   Os seletores ficam restritos aos componentes globais. */
html:has(#postline-active-theme) .topbar,
html:has(#postline-active-theme) .top-bar,
html:has(#postline-active-theme) .top-strip,
html:has(#postline-active-theme) .header-top,
html:has(#postline-active-theme) .site-topbar,
html:has(#postline-active-theme) .sbfcp-topbar,
html:has(#postline-active-theme) .gov-bar,
html:has(#postline-active-theme) .government-bar {
  background:var(--postline-primary)!important;
  border-color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) .site-header,
html:has(#postline-active-theme) .main-header,
html:has(#postline-active-theme) .header-main,
html:has(#postline-active-theme) .sbfcp-header,
html:has(#postline-active-theme) body > header {
  border-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .site-header a:hover,
html:has(#postline-active-theme) .main-header a:hover,
html:has(#postline-active-theme) .sbfcp-header a:hover,
html:has(#postline-active-theme) body > header nav a:hover {
  color:var(--postline-secondary)!important;
}
/* Rodapé: fundo, títulos, linhas e elementos de destaque. */
html:has(#postline-active-theme) .site-footer,
html:has(#postline-active-theme) .sbfcp-footer,
html:has(#postline-active-theme) .footer-main,
html:has(#postline-active-theme) .footer-content,
html:has(#postline-active-theme) body > footer {
  background:var(--postline-primary)!important;
  border-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .site-footer h2,
html:has(#postline-active-theme) .site-footer h3,
html:has(#postline-active-theme) .sbfcp-footer h2,
html:has(#postline-active-theme) .sbfcp-footer h3,
html:has(#postline-active-theme) body > footer h2,
html:has(#postline-active-theme) body > footer h3 {
  color:#fff!important;
}
html:has(#postline-active-theme) .site-footer a:hover,
html:has(#postline-active-theme) .sbfcp-footer a:hover,
html:has(#postline-active-theme) body > footer a:hover {
  color:var(--postline-accent)!important;
}
html:has(#postline-active-theme) .site-footer .footer-bottom,
html:has(#postline-active-theme) .sbfcp-footer .footer-bottom,
html:has(#postline-active-theme) body > footer .footer-bottom,
html:has(#postline-active-theme) .copyright {
  background:var(--postline-primary)!important;
  border-color:var(--postline-secondary)!important;
}

/* V2 — seletores verificados nos arquivos includes/header.php,
   includes/footer.php e assets/css/etapa7-footer.css fornecidos. */
/* Ativação condicional: sem skin ativa, a identidade original não é alterada. */
html:has(#postline-active-theme) .postline-site-header .institution-strip {
  background:var(--postline-primary)!important;
}
html:has(#postline-active-theme) .postline-site-header .main-header {
  border-top-color:var(--postline-primary)!important;
  border-bottom-color:var(--postline-primary)!important;
  background:var(--postline-surface)!important;
}
html:has(#postline-active-theme) .postline-site-header .header-nav a,
html:has(#postline-active-theme) .postline-site-header .postline-mobile-toggle {
  color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) .postline-site-header .header-nav a:hover,
html:has(#postline-active-theme) .postline-site-header .header-nav a:focus-visible {
  color:var(--postline-secondary)!important;
  border-bottom-color:var(--postline-accent)!important;
}
html:has(#postline-active-theme) .postline-site-header .postline-mobile-toggle {
  border-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-footer,
html:has(#postline-active-theme) .sbfcp-footer .sbfcp-footer-main {
  background:var(--postline-primary)!important;
}
html:has(#postline-active-theme) .sbfcp-footer .sbfcp-footer-bottom {
  background:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-footer nav h2::after,
html:has(#postline-active-theme) .sbfcp-footer-contact h2::after {
  background:var(--postline-accent)!important;
}
html:has(#postline-active-theme) .sbfcp-footer h2.sbfcp-footer-eyebrow,
html:has(#postline-active-theme) .sbfcp-footer nav li::before,
html:has(#postline-active-theme) .sbfcp-footer .sbfcp-contact-icon,
html:has(#postline-active-theme) .sbfcp-footer a:hover,
html:has(#postline-active-theme) .sbfcp-footer a:focus-visible {
  color:var(--postline-accent)!important;
}
html:has(#postline-active-theme) .sbfcp-footer .sbfcp-back-top {
  background:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-footer .sbfcp-back-top:hover {
  background:var(--postline-primary)!important;
  outline-color:var(--postline-accent)!important;
}


/* V3 — banner e Agenda Cultural: regras verificadas no index.php e agenda-cultural.css.
   Nenhuma regra muda posicionamento, tamanhos, conteúdo ou comportamento. */
html:has(#postline-active-theme) #inicio.sbfcp-hero .hero-overlay {
  background:linear-gradient(90deg, color-mix(in srgb,var(--postline-primary) 93%,transparent) 0%,color-mix(in srgb,var(--postline-primary) 83%,transparent) 27%,color-mix(in srgb,var(--postline-primary) 15%,transparent) 68%,color-mix(in srgb,var(--postline-primary) 58%,transparent) 100%)!important;
}
html:has(#postline-active-theme) #inicio .quicklinks-wrap {background:var(--postline-primary)!important}
html:has(#postline-active-theme) #inicio .quicklinks a:hover,
html:has(#postline-active-theme) #inicio .quicklinks a:focus-visible {background:var(--postline-secondary)!important}
html:has(#postline-active-theme) #inicio .quicklinks a i,
html:has(#postline-active-theme) #inicio .quicklinks a span,
html:has(#postline-active-theme) #inicio .sbfcp-kicker,
html:has(#postline-active-theme) #inicio .hero-copy h2 {color:var(--postline-accent)!important}
html:has(#postline-active-theme) #inicio .sbfcp-hero-cta {background:var(--postline-accent)!important;color:var(--postline-primary)!important}
html:has(#postline-active-theme) #inicio .quote-rule {background:var(--postline-accent)!important;border-color:var(--postline-accent)!important}

html:has(#postline-active-theme) #sbfcp-cultural {border-color:var(--postline-secondary)!important;background:var(--postline-surface)!important;color:var(--postline-text)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-head {border-top-color:var(--postline-secondary)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-head strong,
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-nav,
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-events>strong {color:var(--postline-primary)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-nav button {color:var(--postline-secondary)!important;border-color:var(--postline-secondary)!important;background:var(--postline-background)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-days button.has-event,
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-date,
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-event>button {background:var(--postline-secondary)!important;border-color:var(--postline-secondary)!important;color:#fff!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-days button.selected {outline-color:var(--postline-accent)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-days button.has-event small {color:var(--postline-secondary)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-event-info strong {color:var(--postline-text)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-events,
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-foot {background:var(--postline-background)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-event {background:var(--postline-surface)!important}
html:has(#postline-active-theme) #sbfcp-cultural .sbfcp-cultural-days button:not(.has-event) {background:var(--postline-surface)!important;color:var(--postline-text)!important}


/* V4 — Nossa localização. Apenas cores, sem afetar mapa ou filtros. */
html:has(#postline-active-theme) #localizacao.location {
  background:var(--postline-background)!important;
}
html:has(#postline-active-theme) #localizacao .location-controls h2 {
  color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) #localizacao .location-controls h2 i {
  border-top-color:var(--postline-accent)!important;
}
html:has(#postline-active-theme) #localizacao .location-controls p {
  color:var(--postline-text)!important;
}
html:has(#postline-active-theme) #localizacao .location-filters select {
  background:var(--postline-surface)!important;
  border-color:var(--postline-secondary)!important;
  color:var(--postline-text)!important;
}
html:has(#postline-active-theme) #localizacao #pesquisar-local {
  background:var(--postline-secondary)!important;
  border-color:var(--postline-secondary)!important;
  color:#fff!important;
}
html:has(#postline-active-theme) #localizacao #limpar-local {
  background:var(--postline-surface)!important;
  border-color:var(--postline-secondary)!important;
  color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) #localizacao #pesquisar-local:hover,
html:has(#postline-active-theme) #localizacao #pesquisar-local:focus-visible {
  background:var(--postline-primary)!important;
}
html:has(#postline-active-theme) #localizacao .map-feedback {
  color:var(--postline-text)!important;
}
html:has(#postline-active-theme) #localizacao #mapa-externo {
  color:var(--postline-secondary)!important;
}

/* V5 — Nossas bibliotecas: somente cores; carrossel, filtros e fotos intactos. */
html:has(#postline-active-theme) #bibliotecas.sbfcp-library-vitrine {
 background:var(--postline-background)!important;
}
html:has(#postline-active-theme) #bibliotecas .section-heading h2,
html:has(#postline-active-theme) #bibliotecas .section-heading h2 i {
 color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) #bibliotecas .section-heading h2 i {
 background:var(--postline-accent)!important;
 border-color:var(--postline-accent)!important;
}
html:has(#postline-active-theme) #bibliotecas .section-heading p,
html:has(#postline-active-theme) #bibliotecas #sbfcp-library-count {
 color:var(--postline-text)!important;
}
html:has(#postline-active-theme) #bibliotecas .section-more {
 color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-library-search,
html:has(#postline-active-theme) #bibliotecas .sbfcp-library-search input {
 background:var(--postline-surface)!important;
 color:var(--postline-text)!important;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-library-search {
 border-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-library-search i {
 color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-city-list button,
html:has(#postline-active-theme) #bibliotecas .sbfcp-city-nav,
html:has(#postline-active-theme) #bibliotecas .sbfcp-rail-arrow {
 background:var(--postline-surface)!important;
 border-color:var(--postline-secondary)!important;
 color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-city-list button[aria-pressed="true"] {
 background:var(--postline-secondary)!important;
 border-color:var(--postline-secondary)!important;
 color:#fff!important;
}
html:has(#postline-active-theme) #bibliotecas.sbfcp-library-vitrine #sbfcp-library-track>.library-card {
 border-color:var(--postline-secondary)!important;
 background:var(--postline-surface)!important;
}
html:has(#postline-active-theme) #bibliotecas.sbfcp-library-vitrine #sbfcp-library-track>.library-card .sbfcp-photo-city {
 color:var(--postline-secondary)!important;
 background:var(--postline-surface)!important;
}
html:has(#postline-active-theme) #bibliotecas.sbfcp-library-vitrine #sbfcp-library-track>.library-card .library-info strong {
 color:var(--postline-text)!important;
}
html:has(#postline-active-theme) #bibliotecas.sbfcp-library-vitrine #sbfcp-library-track>.library-card .library-info small {
 color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) #bibliotecas.sbfcp-library-vitrine #sbfcp-library-track>.library-card .library-info .arrow {
 background:var(--postline-accent)!important;
 color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-library-dots button {
 background:var(--postline-secondary)!important;
 opacity:.35;
}
html:has(#postline-active-theme) #bibliotecas .sbfcp-library-dots button[aria-current="true"] {
 background:var(--postline-secondary)!important;
 opacity:1;
}


/* V6: Newsletter compartilhada; cores somente quando skin está ativa. */
html:has(#postline-active-theme) .sbfcp-newsletter {
  background:var(--postline-background)!important;
  border-top-color:var(--postline-secondary)!important;
  border-bottom-color:var(--postline-secondary)!important;
  color:var(--postline-text)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter::before {
  background:linear-gradient(90deg,transparent,var(--postline-background) 96%),
    repeating-linear-gradient(0deg,transparent 0 18px,var(--postline-secondary) 19px 24px,transparent 25px 39px)!important;
  opacity:.10!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter-copy {
  border-right-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter-eyebrow,
html:has(#postline-active-theme) .sbfcp-newsletter-verification i {
  color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter h2 {
  color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter-copy>p:last-child,
html:has(#postline-active-theme) .sbfcp-newsletter-consent,
html:has(#postline-active-theme) .sbfcp-newsletter-pending {
  color:var(--postline-text)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter-panel {
  background:var(--postline-surface)!important;
  border-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter input[type=text],
html:has(#postline-active-theme) .sbfcp-newsletter input[type=email],
html:has(#postline-active-theme) .sbfcp-newsletter-verification {
  background:var(--postline-surface)!important;
  color:var(--postline-text)!important;
  border-color:var(--postline-secondary)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter-action {
  background:var(--postline-accent)!important;
  color:var(--postline-primary)!important;
}
html:has(#postline-active-theme) .sbfcp-newsletter-action:hover,
html:has(#postline-active-theme) .sbfcp-newsletter-action:focus-visible {
  filter:brightness(.92);
}
html:has(#postline-active-theme) .postline-location-newsletter-space {
  background:var(--postline-background)!important;
}
