/**
 * assets/css/hub-modes.css - Modo claro/escuro do GlobalFire Hub (KAN-187)
 *
 * - Tokens do modo claro aplicados em <html data-theme="light"> (o atributo é definido pelo
 *   script de tema do layout no site e no painel admin; o IGNIS nunca o recebe).
 *   Ajustes próprios do admin ficam em admin-modes.css.
 * - Cabeçalho, conta do usuário e botões de ícone no padrão Premium.
 * - Ajustes de componentes que ainda tinham cores fixas.
 * A identidade laranja (#F36A27) é a mesma nos dois modos.
 */

/* ==========================================================================
   1. TOKENS DO MODO CLARO
   ========================================================================== */
html[data-theme="light"] {
  color-scheme: light;
  --hub-bg: #f5f5f7;
  --hub-bg-rgb: 245, 245, 247;
  --hub-surface-0: #ffffff;
  --hub-surface-1: #fafafb;
  --hub-surface-2: #f2f2f5;
  --hub-surface-3: #e9e9ee;
  --hub-text: #111114;
  --hub-text-soft: #2a2a30;
  --hub-text-muted: #55555e;
  --hub-text-dim: #74747e;
  --hub-fg-rgb: 17, 17, 20;
  --hub-field-bg: #ffffff;
  --hub-field-text: #111114;
  --hub-header-bg: rgba(255, 255, 255, 0.92);
  --hub-shadow-soft: 0 12px 32px rgba(17, 17, 20, 0.10);

  /* tokens legados usados por componentes antigos */
  --hub-black: #f5f5f7;
  --hub-white: #111114;
  --hub-bg-elevated: #ffffff;
  --hub-bg-surface: #fafafb;
  --hub-bg-card: #ffffff;
  --hub-bg-card-hover: #f2f2f5;
  --hub-border-subtle: rgba(17, 17, 20, 0.10);
  --hub-border-medium: rgba(17, 17, 20, 0.20);
  --hub-gray-light: #2a2a30;
  --hub-gray-muted: #55555e;
  --hub-gray-dark: #74747e;
  --hub-gray-border: #d4d4da;
  --hub-shadow-card: 0 10px 30px rgba(17, 17, 20, 0.10);
  --hub-orange-muted: rgba(243, 106, 39, 0.12);
}

/* Blocos sobre fotografia/vídeo mantêm o tema escuro (texto branco sobre imagem escurecida) */
html[data-theme="light"] :is(
  .hub-card,
  .hub-event-hero-card,
  .next-culto-hero-banner,
  .waiting-hero-card
) {
  --hub-bg: #000000;
  --hub-bg-rgb: 0, 0, 0;
  --hub-surface-0: #0c0c0e;
  --hub-surface-1: #121214;
  --hub-surface-2: #16161a;
  --hub-surface-3: #1c1c20;
  --hub-text: #ffffff;
  --hub-text-soft: #e4e4e7;
  --hub-text-muted: #b4b4bb;
  --hub-text-dim: #8a8a92;
  --hub-fg-rgb: 255, 255, 255;
  --hub-black: #000000;
  --hub-white: #ffffff;
  --hub-gray-light: #eeeeee;
  --hub-gray-muted: #aaaaaa;
  --hub-gray-dark: #666666;
  --hub-border-subtle: rgba(255, 255, 255, 0.12);
  --hub-border-medium: rgba(255, 255, 255, 0.22);
  color-scheme: dark;
}

/* Transição suave ao alternar (sem afetar animações próprias) */
html.hub-theme-switching,
html.hub-theme-switching * {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease !important;
}

/* ==========================================================================
   2. CABEÇALHO
   ========================================================================== */
body.gf-public-shell .site-header {
  background: var(--hub-header-bg, rgba(0, 0, 0, 0.92)) !important;
  border-bottom: 1px solid rgba(var(--hub-fg-rgb), 0.08) !important;
}
html[data-theme="light"] body.gf-public-shell .site-header {
  box-shadow: 0 1px 0 rgba(17, 17, 20, 0.04), 0 8px 24px rgba(17, 17, 20, 0.04);
}

html[data-theme="light"] body.gf-public-shell .site-header .logo img {
  filter: none;
}

/* Botões de ícone do header (tema e carrinho) com o mesmo desenho */
body.gf-public-shell .hub-icon-btn,
body.gf-admin-shell .site-header .hub-icon-btn,
body.gf-public-shell .site-header .hub-cart-btn {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: none;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  background: rgba(var(--hub-fg-rgb), 0.06) !important;
  color: var(--hub-text) !important;
  border: 1px solid rgba(var(--hub-fg-rgb), 0.12) !important;
  box-shadow: none !important;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease !important;
}
body.gf-public-shell .hub-icon-btn:hover,
body.gf-public-shell .hub-icon-btn:focus-visible,
body.gf-admin-shell .site-header .hub-icon-btn:hover,
body.gf-admin-shell .site-header .hub-icon-btn:focus-visible,
body.gf-public-shell .site-header .hub-cart-btn:hover {
  border-color: var(--hub-orange) !important;
  color: var(--hub-orange) !important;
  background: rgba(243, 106, 39, 0.08) !important;
  transform: none !important;
}
.hub-theme-toggle .hub-theme-ico-moon,
.hub-theme-toggle .hub-theme-ico-sun {
  display: inline-flex;
  line-height: 0;
}
.hub-theme-toggle .hub-theme-ico-sun { display: none; }
html[data-theme="light"] .hub-theme-toggle .hub-theme-ico-sun { display: inline-flex; }
html[data-theme="light"] .hub-theme-toggle .hub-theme-ico-moon { display: none; }

/* Link "Entrar" */
body.gf-public-shell .hub-header-link {
  color: var(--hub-text);
  border: 1px solid rgba(var(--hub-fg-rgb), 0.16);
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}
body.gf-public-shell .hub-header-link:hover {
  color: #fff;
  background: var(--hub-orange);
  border-color: var(--hub-orange);
}

/* 3. CONTA DO USUÁRIO (dropdown): movido para hub-chrome.css, pois também aparece no admin. */

/* ==========================================================================
   4. HOME
   ========================================================================== */
html[data-theme="light"] body.gf-public-shell .hub-home-bg {
  filter: grayscale(100%) contrast(105%) brightness(120%);
  opacity: 0.16;
}
html[data-theme="light"] body.gf-public-shell .hub-home-logo-wrap img {
  filter: none;
}

/* ==========================================================================
   5. TÍTULOS EM GRADIENTE (eram branco → cinza claro, invisíveis no claro)
   ========================================================================== */
html[data-theme="light"] body.gf-public-shell :is(.hub-conheca-title, .hub-events-title) {
  background: linear-gradient(180deg, #111114 0%, #3a3a42 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

/* ==========================================================================
   6. BOTÕES DE ENVIO SEM ESTILO PRÓPRIO
   A camada global do IGNIS (style.css) não se aplica mais à casca do Hub; botões de
   envio sem classe própria recebem o botão primário do Hub. :where() = especificidade
   zero, então qualquer estilo da página prevalece.
   ========================================================================== */
:where(body.gf-public-shell) :where(button[type="submit"], input[type="submit"]) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 12px 24px;
  border: 0;
  border-radius: 999px;
  background: var(--hub-orange);
  color: #fff;
  font-family: var(--hub-font-sans);
  font-weight: 700;
  cursor: pointer;
}
:where(body.gf-public-shell) :where(button[type="submit"], input[type="submit"]):hover {
  background: #d9581c;
}

/* ==========================================================================
   7. VITRINE DO MENU, GAVETA MOBILE E CARRINHO NO MODO CLARO
   (os cards da vitrine são fotos e continuam escuros)
   ========================================================================== */
html[data-theme="light"] .hub-showcase-overlay {
  background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, 0.97) 0%, rgba(242, 242, 245, 0.99) 100%);
}
html[data-theme="light"] .hub-showcase-footer {
  background: rgba(255, 255, 255, 0.92);
}
html[data-theme="light"] .hub-mobile-drawer {
  background: rgba(250, 250, 251, 0.99);
}
html[data-theme="light"] .hub-mobile-logout-btn {
  color: #dc2626;
}

/* Header um pouco mais alto (padrão premium); no mobile, proporcional */
@media (max-width: 768px) {
  html body.gf-public-shell .site-header .container {
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  html body.gf-public-shell .site-header .logo img {
    height: 34px !important;
  }
}

/* ==========================================================================
   8. ETIQUETAS (EYEBROWS) SEM ASPECTO DE BOTÃO
   Rótulos informativos não clicáveis: sem fundo, sem contorno e com tipografia
   fina e espaçada (mesmo estilo do "Bem-vindo ao Ministério"). Selos posicionados
   sobre fotos (produtos, transmissões) mantêm o fundo para legibilidade.
   Os <style> das páginas vêm depois no documento, por isso o !important.
   ========================================================================== */
html body.gf-public-shell :is(
  .hub-conheca-pill-tag,
  .hub-events-pill-tag,
  .hub-badge-pill,
  .hub-prayer-badge,
  .gf-lesson-pill,
  .gf-status-pill,
  .gf-lead-status,
  .hub-role-badge,
  .transmissao-badge-row .neo-badge,
  .transmissao-badge-row .channel-tag,
  .hub-contrib-tag,
  .gf-fh-tag
) {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
  font-family: var(--hub-font-sans) !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.26em !important;
  text-transform: uppercase !important;
  line-height: 1.4 !important;
}

/* Cores das etiquetas de status, legíveis nos dois temas (sem o fundo colorido) */
html body.gf-public-shell .gf-status-pill { color: var(--hub-text-muted) !important; }
html body.gf-public-shell .gf-status-pill.status-approved { color: #16a34a !important; }
html body.gf-public-shell .gf-status-pill.status-pending { color: #d97706 !important; }
html body.gf-public-shell :is(.gf-status-pill.status-rejected, .gf-status-pill.status-suspended) { color: #dc2626 !important; }
html body.gf-public-shell .hub-role-badge { color: var(--hub-orange) !important; }
html body.gf-public-shell .gf-lead-status { color: var(--hub-orange) !important; }
