/* =====================================================================
   shared.css — Bloguru Assets Plugin  v1.0
   Header, footer e tokens compartilhados entre portal e todos os nichos.
   Carregado como dependência de bloguru.css via functions.php.
   ===================================================================== */

/* ── Color-scheme — sinaliza ao browser e ao AdSense o modo ativo ─── */
:root      { color-scheme: light; }
html.dark  { color-scheme: dark;  }

/* ── Tokens de design ───────────────────────────────────────────────── */
:root {
  --sh-bg:       #fafaf7;
  --sh-surface:  #f3f2ec;
  --sh-ink:      #14140f;
  --sh-muted:    #5c6676;
  --sh-line:     #dce3ed;
  --sh-primary:  #0d8a83;
  --sh-accent:   #0d8a83;   /* sobrescrito por nicho via wp_head */
  --sh-header-h: 64px;
}

html.dark {
  --sh-bg:       #040B16;
  --sh-surface:  #0d1825;
  --sh-ink:      #d6e3fe;
  --sh-muted:    #8fa3b8;
  --sh-line:     rgba(255, 255, 255, 0.08);
  --sh-primary:  #18C1B9;
  --sh-accent:   #18C1B9;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: var(--sh-header-h);
  padding: 0 clamp(16px, 3vw, 44px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--sh-line);
  box-shadow: 0 1px 0 var(--sh-line), 0 4px 20px rgba(0, 0, 0, 0.04);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-sizing: border-box;
}

html.dark .site-header {
  background: rgba(4, 11, 22, 0.85);
  border-bottom-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(24, 193, 185, 0.08);
}

/* ── Brand (logo + niche-tag empilhados) ────────────────────────────── */
@keyframes brand-settle {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.brand {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  text-decoration: none;
  flex-shrink: 0;
  animation: brand-settle 0.28s ease-out both;
}

.brand img {
  width: 148px;
  max-height: 38px;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Alternância dark/light do logo — seletores com maior especificidade que .brand img */
.brand .logo-light { display: block; }
.brand .logo-dark  { display: none;  }
html.dark .brand .logo-light { display: none;  }
html.dark .brand .logo-dark  { display: block; }

/* ── Niche tag ───────────────────────────────────────────────────────── */
.niche-tag {
  color: var(--sh-accent);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  padding-left: 8px;
}

@media (min-width: 621px) {
  .niche-tag { padding-left: 14px; }
}

/* ── Nav principal ──────────────────────────────────────────────────── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 0.9rem;
  font-weight: 650;
  margin-left: auto;
}

.site-nav a {
  color: var(--sh-muted);
  text-decoration: none;
  padding: 8px 0;
  white-space: nowrap;
  transition: color 0.15s;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav a.current {
  color: var(--sh-primary);
}

/* ── Ações do header (ícones: casinha, lupa, toggle) ────────────────── */
.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}

/* Quando não há .site-nav, actions vai para a direita.
   Quando há nav, o margin-left:auto da nav já empurra nav+actions para a direita —
   actions apenas segue o nav sem margem extra. */
.site-header:not(:has(.site-nav)) .header-actions {
  margin-left: auto;
}

.header-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 10px;
  color: var(--sh-muted);
  font-family: 'Material Symbols Outlined';
  font-size: 22px;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  line-height: 1;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  -webkit-user-select: none;
  user-select: none;
}

.header-icon-btn:hover {
  color: var(--sh-primary);
  background: rgba(0, 0, 0, 0.05);
}

html.dark .header-icon-btn:hover {
  background: rgba(255, 255, 255, 0.07);
}

/* ── Hamburger (mobile) ─────────────────────────────────────────────── */
/* Usa .header-icon-btn para herdar tamanho, cor e hover — mesmo padrão
   dos ícones home e tema. Resetamos a aparência nativa do <button> para
   eliminar o fundo branco que browsers aplicam por default. */
.menu-button {
  display: none;
  flex-shrink: 0;
  -webkit-appearance: none;
  appearance: none;
  background: none !important;
  border: none !important;
  padding: 0;
  outline: none;
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 28px clamp(18px, 4vw, 64px);
  color: var(--sh-muted);
  border-top: 1px solid var(--sh-line);
  background: var(--sh-surface);
  font-size: 0.875rem;
}

html.dark .site-footer {
  background: var(--sh-surface);
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--sh-muted);
}

.footer-brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  object-fit: cover;
}

.site-footer nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 18px;
}

.site-footer nav a {
  color: var(--sh-muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s;
  line-height: 1.2;
}

.site-footer nav a:hover { color: var(--sh-primary); }

/* ── Breakpoints ─────────────────────────────────────────────────────── */

@media (max-width: 980px) {
  .menu-button { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px;
    margin-left: 0;
    background: #ffffff;
    border: 1px solid var(--sh-line);
    border-radius: 8px;
    box-shadow: 0 18px 40px rgba(7, 20, 39, 0.14);
    z-index: 49;
  }

  html.dark .site-nav {
    background: #0d1825;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.5);
  }

  .site-nav.is-open { display: flex; }

  .site-nav a {
    padding: 12px;
    border-bottom: 1px solid var(--sh-line);
    font-size: 0.95rem;
  }

  .site-nav a:last-child { border-bottom: none; }
}

@media (max-width: 620px) {
  .site-header {
    gap: 12px;
    min-height: 56px;
    padding: 0 16px;
  }

  .brand { width: 126px; }
  .brand img { width: 126px; max-height: 34px; }

  .site-footer {
    gap: 8px;
    padding: 22px 18px;
  }

  .site-footer nav { gap: 0; }

  .site-footer nav a {
    display: inline;
    padding: 0 9px;
    font-size: 0.73rem;
    font-weight: 700;
  }

  .site-footer nav a + a {
    border-left: 1px solid var(--sh-line);
  }

  html.dark .site-footer nav a + a {
    border-left-color: rgba(255, 255, 255, 0.2);
  }
}

/* ── Newsletter section — estilos sem Tailwind (nichos + páginas internas) ── */
#newsletter-section {
  padding: 40px clamp(18px, 4vw, 64px) 32px;
  background: var(--sh-surface);
  border-top: 1px solid var(--sh-line);
  border-bottom: 1px solid var(--sh-line);
  position: relative;
  overflow: hidden;
}

/* Linha de acento no topo */
#newsletter-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(to right, transparent, var(--sh-primary), transparent);
}

/* Container interno — layout coluna → duas colunas acima de 768px */
#newsletter-section > div {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 1080px;
  margin: 0 auto;
  text-align: center;
}

/* Colunas internas ocupam largura total em mobile (align-items:center encolhe sem width) */
#newsletter-section > div > div {
  width: 100%;
}

@media (min-width: 768px) {
  #newsletter-section > div {
    flex-direction: row;
    text-align: left;
  }
  #newsletter-section > div > div {
    flex: 1;
  }
}

#newsletter-section h2 {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 700;
  color: var(--sh-ink);
  margin: 0 0 10px;
  line-height: 1.2;
}

/* Apenas a coluna de texto (primeira div) — não afeta o disclaimer na coluna do form */
#newsletter-section > div > div:first-child > p {
  color: var(--sh-muted);
  margin: 0;
  font-size: 1rem;
  line-height: 1.6;
}

/* Formulário */
#newsletter-form {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: var(--sh-bg);
  border: 1px solid var(--sh-line);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  width: 100%;
}

html.dark #newsletter-form {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

#newsletter-form input[type="email"] {
  flex: 1;
  min-width: 0;
  padding: 10px 18px;
  background: transparent;
  border: none;
  color: var(--sh-ink);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
}

#newsletter-form input[type="email"]::placeholder {
  color: var(--sh-muted);
}

#newsletter-form button[type="submit"] {
  flex-shrink: 0;
  padding: 10px 20px;
  background: linear-gradient(135deg, var(--sh-primary), #2792ff);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.15s;
}

#newsletter-form button[type="submit"]:hover {
  filter: brightness(1.12);
}

#newsletter-disclaimer {
  font-size: 0.72rem;
  color: var(--sh-muted);
  text-align: center;
  margin-top: 10px;
  opacity: 0.75;
}

/* Mobile: espelha exatamente o CSS inline do portal (max-width: 767px) */
@media (max-width: 767px) {
  #newsletter-form {
    flex-direction: column;
    border-radius: 16px;
    padding: 12px;
    gap: 8px;
  }

  #newsletter-form input { padding: 10px 16px; }

  #newsletter-form button { width: 100%; justify-content: center; }

  #newsletter-disclaimer { font-size: 0.7rem; }
}
