/**
 * IBG — Dark absoluto + shell admin unificado (v1 rebuild)
 * Carregar DEPOIS dos CSS de admin/site. Força dark; remove heranças claras.
 */

html,
html[data-theme],
html[data-theme="light"],
html[data-theme="dark"] {
  color-scheme: dark !important;
}

html,
html[data-theme="light"],
html[data-theme="dark"],
body,
body.ibg,
body.ibg-premium,
body.body-color,
body.ibg-site,
body.ibg-admin,
body.cms-hub {
  --ibg-bg: #0c0b0a;
  --ibg-bg-2: #141312;
  --ibg-paper: #1a1917;
  --ibg-cream: #141312;
  --ibg-ink: #fffcf9;
  --ibg-ink-soft: rgba(255, 252, 249, 0.78);
  --ibg-mist: rgba(255, 252, 249, 0.55);
  --bg: #0c0b0a;
  --bg-2: #141312;
  --theme: #52b788;
  --ibg-orange: #f97316;
  background-color: #0c0b0a !important;
  color: #fffcf9 !important;
}

/* Esconder toggle de tema em qualquer página */
#ibg-theme-btn,
.ibg-theme-toggle,
.ibg-theme-icon-dark,
.ibg-theme-icon-light,
[data-theme-toggle],
.cms-hub [aria-label="Alternar tema"] {
  display: none !important;
}

/* Anular prefers-color-scheme claro */
@media (prefers-color-scheme: light) {
  html,
  body {
    color-scheme: dark !important;
    background-color: #0c0b0a !important;
    color: #fffcf9 !important;
  }
}

/* Admin legacy (ibg-admin.css cream) → dark */
body.ibg-admin {
  background: #07090c !important;
  color: #eef1f6 !important;
}

body.ibg-admin .ibg-admin-field input,
body.ibg-admin input,
body.ibg-admin textarea,
body.ibg-admin select {
  background: #12141a !important;
  color: #eef1f6 !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}

body.ibg-admin .ibg-admin-field label {
  color: #8b95a5 !important;
}

body.ibg-admin .ibg-admin-error {
  background: rgba(248, 113, 113, 0.12) !important;
  color: #fecaca !important;
}

/* CMS hub — tokens IBG (verde + laranja) */
.cms-hub {
  --hub-edit: #f97316;
  --hub-edit-soft: rgba(249, 115, 22, 0.14);
  --hub-edit-glow: rgba(249, 115, 22, 0.28);
  --hub-ok: #52b788;
  --hub-radius: 16px;
  --hub-radius-sm: 12px;
}

.cms-hub-side,
.cms-hub-card,
.cms-hub .cc-panel,
.cms-hub .ibg-admin-panel {
  border-radius: var(--hub-radius) !important;
}

.cms-hub input,
.cms-hub textarea,
.cms-hub select,
.cms-hub .form-control {
  background: rgba(255, 255, 255, 0.04) !important;
  color: #eef1f6 !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 12px !important;
}

.cms-hub table,
.cms-hub .ibg-table {
  color: #eef1f6;
}

.cms-hub table th {
  color: #8b95a5;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cms-hub table td,
.cms-hub table th {
  border-color: rgba(255, 255, 255, 0.08) !important;
}

.cms-hub .btn,
.cms-hub button.primary,
.cms-hub .theme-btn:not(.border-btn) {
  background: #52b788 !important;
  color: #0a0908 !important;
  border: 0 !important;
  border-radius: 999px !important;
  font-weight: 700 !important;
}

/* Formulários / cards claros herdados */
.cms-hub [style*="background:#fff"],
.cms-hub [style*="background: #fff"],
.cms-hub [style*="background:#ffffff"],
.cms-hub [style*="background: #ffffff"],
.cms-hub [style*="background:white"] {
  background: #12141a !important;
  color: #eef1f6 !important;
}

/* Site: ministérios sempre dark (sem secção clara) */
.ibg-site #ministerios.ibg-nm,
.ibg-site #ministerios.ibg-minis.ibg-nm,
html[data-theme="dark"] .ibg-site #ministerios.ibg-nm,
html[data-theme="light"] .ibg-site #ministerios.ibg-nm {
  background: #0e1411 !important;
  color: #fff !important;
}

.ibg-site #ministerios.ibg-nm .ibg-nm-title,
.ibg-site #ministerios.ibg-nm .ibg-minis-title {
  color: #95d5b2 !important;
}

.ibg-site #ministerios.ibg-nm .ibg-nm-lead,
.ibg-site #ministerios.ibg-nm .ibg-minis-lead {
  color: rgba(255, 252, 249, 0.7) !important;
}

/* Text overflow / layout safety */
.cms-hub h1,
.cms-hub h2,
.cms-hub h3,
.cms-hub p,
.ibg-site h1,
.ibg-site h2,
.ibg-site h3 {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.cms-hub-nav a,
.cms-hub-quick a {
  max-width: 100%;
}

@media (max-width: 900px) {
  .cms-hub-layout {
    grid-template-columns: 1fr !important;
    padding: 0.5rem !important;
  }
}

/* —— Kill custom green mouse cursor —— */
.mouse-cursor,
.cursor-inner,
.cursor-outer,
body .mouse-cursor {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
}
body,
body.ibg-site,
html {
  cursor: auto !important;
}

/* —— Sticky header: dark absoluto (nunca branco) —— */
.ibg-site .header-1,
.ibg-site .header-1.sticky,
.ibg-site header.sticky,
.ibg-site .sticky {
  background: rgba(12, 11, 10, 0.92) !important;
  background-color: rgba(12, 11, 10, 0.92) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.ibg-site .sticky.header-1 .header-main .main-menu ul li a,
.ibg-site .header-1 .header-main .main-menu ul li a,
.ibg-site .sticky.header-1 .header-main .sidebar__toggle,
.ibg-site .header-1 .header-main .sidebar__toggle {
  color: #fffcf9 !important;
}

.ibg-site .sticky.header-1 .header-main .main-menu ul li a:hover,
.ibg-site .header-1 .header-main .main-menu ul li a:hover {
  color: var(--theme, #52b788) !important;
}

.ibg-site:not(.ibg-ministry-page) .sticky.header-1 .header-logo {
  display: block !important;
}

.ibg-site:not(.ibg-ministry-page) .sticky.header-1 .logo-2 {
  display: none !important;
}

.ibg-site .sticky.header-1 .header-main .main-menu ul li .submenu {
  background: #141312 !important;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.ibg-site .sticky.header-1 .header-main .main-menu ul li .submenu li a {
  color: rgba(255, 252, 249, 0.85) !important;
}

/* —— Títulos de secção: contraste no dark —— */
.ibg-site .section-title h2,
.ibg-site .section-title h2 span,
.ibg-site .about-content .section-title h2,
.ibg-site #sobre .section-title h2,
.ibg-site #ofertas .section-title h2,
.ibg-site #evento .section-title h2,
.ibg-site #como-chegar .section-title h2,
.ibg-site #noticias .section-title h2 {
  color: #fffcf9 !important;
}

.ibg-site .section-title span,
.ibg-site #ibg-featured-kicker {
  color: var(--ibg-orange, #f97316) !important;
}

.ibg-site .section-title p,
.ibg-site #ibg-featured-hint,
.ibg-site #ibg-about-p1,
.ibg-site #ibg-about-p2 {
  color: rgba(255, 252, 249, 0.72) !important;
  white-space: normal;
}

.ibg-site #ibg-about-p1 .ibg-about-para,
.ibg-site #ibg-about-p2 .ibg-about-para {
  display: block;
  margin: 0 0 0.85rem;
}

.ibg-site #ibg-about-p1 .ibg-about-para:last-child,
.ibg-site #ibg-about-p2 .ibg-about-para:last-child {
  margin-bottom: 0;
}

.ibg-site #ofertas h3,
.ibg-site #ibg-ofertas-info-title {
  color: #fffcf9 !important;
}

.ibg-site #ofertas p,
.ibg-site #ofertas li {
  color: rgba(255, 252, 249, 0.75) !important;
}

/* Ministérios — cards foto (ref visual + ID IBG) */
.ibg-site #ministerios.ibg-nm {
  --nm-accent: #52b788;
  --nm-orange: #f97316;
}

.ibg-site .ibg-nm-foot__title {
  color: rgba(255, 252, 249, 0.92);
}

/* Legado template — cursor custom desactivado */
.ibg-site .mouse-cursor,
body .mouse-cursor,
.cursor-outer,
.cursor-inner {
  display: none !important;
  pointer-events: none !important;
}

.preloader.loaded {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.ibg-site .ibg-nm-foot__sub {
  color: rgba(149, 213, 178, 0.75);
}

/* Offcanvas / menu mobile dark */
.ibg-site .fix-area .offcanvas__info,
.ibg-site .offcanvas__info,
.ibg-site .offcanvas__wrapper {
  background: #0c0b0a !important;
  color: #fffcf9 !important;
}

.ibg-site .offcanvas__info a,
.ibg-site .offcanvas__contact-text a,
.ibg-site .mean-container .mean-nav ul li a {
  color: #fffcf9 !important;
}

.ibg-site .offcanvas__close button {
  color: #fffcf9 !important;
}


/* ——— Botões: uma só cor de marca (editável no admin via --theme / --ibg-green) ——— */
.ibg-site .theme-btn,
.ibg-site a.theme-btn,
body.ibg-ministry-page .theme-btn,
body.ibg-ministry-page a.theme-btn,
#ibg-hero-btn1,
#ibg-hero-btn2,
.ibg-hero__actions .theme-btn,
.ibg-hero__actions .theme-btn.border-btn {
  background: var(--theme, var(--ibg-green, #52b788)) !important;
  color: #0a0908 !important;
  border: 1.5px solid var(--theme, var(--ibg-green, #52b788)) !important;
  font-family: var(--ibg-font, "IBG", system-ui, sans-serif) !important;
  font-weight: 700 !important;
  text-transform: none !important;
  box-shadow: 0 10px 28px rgba(var(--ibg-green-rgb, 82, 183, 136), 0.28) !important;
}

.ibg-site .theme-btn::before,
.ibg-site .theme-btn::after,
.ibg-site a.theme-btn::before,
.ibg-site a.theme-btn::after,
body.ibg-ministry-page .theme-btn::before,
body.ibg-ministry-page .theme-btn::after,
#ibg-hero-btn1::before,
#ibg-hero-btn1::after,
#ibg-hero-btn2::before,
#ibg-hero-btn2::after {
  content: none !important;
  display: none !important;
  opacity: 0 !important;
  width: 0 !important;
  background: transparent !important;
  pointer-events: none !important;
}

.ibg-site .theme-btn:hover,
.ibg-site .theme-btn:focus-visible,
.ibg-site a.theme-btn:hover,
body.ibg-ministry-page .theme-btn:hover,
#ibg-hero-btn1:hover,
#ibg-hero-btn2:hover,
.ibg-site .theme-btn.border-btn:hover {
  background: var(--theme-hover, var(--ibg-green-hover, #1b4332)) !important;
  border-color: var(--theme-hover, var(--ibg-green-hover, #1b4332)) !important;
  color: #ffffff !important;
  box-shadow: 0 0 22px rgba(var(--ibg-green-rgb, 82, 183, 136), 0.42),
    0 10px 28px rgba(var(--ibg-green-rgb, 82, 183, 136), 0.28) !important;
}

.ibg-site #ministerios.ibg-nm .ibg-nm-title,
.ibg-site #ministerios.ibg-nm .ibg-nm-title span {
  color: #b7e4c7 !important;
  font-family: var(--ibg-font-display, "IBG", system-ui, sans-serif) !important;
  font-weight: 800 !important;
}

.ibg-site #ministerios.ibg-nm .ibg-nm-title span {
  color: var(--ibg-orange, #f97316) !important;
}