/* style.css - layout base: menu topo (desktop) e rodapé (mobile) */
:root {
  --bg: #f7f8fb;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #111827;
  --menu-btn-bg: #0f172a;
  --menu-btn-fg: #ffffff;
  --header-bg: var(--card);
  --header-fg: var(--text);

  /* Cores configuráveis (Admin) */
  --site-bg: var(--bg);
  --posts-bg: var(--card);
  --comments-bg: #fafafa;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--site-bg, var(--bg));
  color: var(--text);
}
a { color: var(--text); text-decoration: none; }

.topo {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg, var(--card));
  color: var(--header-fg, var(--text));
  border-bottom: 1px solid var(--border);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--header-fg, var(--brand));
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Ícone do site (mesmo tamanho/ajuste do avatar) */
.site-icone {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 999px;
  border: 1px solid var(--border);
  object-fit: cover;
  display: block;
}

/* trava extra: se alguma regra global de img conflitar */
.topo .site-icone {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
  object-fit: cover !important;
}

.paginacao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.paginacao .pag-link {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #f8f8f8;
  text-decoration: none;
  color: #333;
  font-weight: 600;
}

.paginacao .pag-number {
  padding: 6px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  text-decoration: none;
  color: #333;
  min-width: 32px;
  text-align: center;
}

.paginacao .pag-number.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
  font-weight: 700;
}

.paginacao .pag-number:hover {
  background: #ececec;
}

.paginacao .pag-link:hover {
  background: #ececec;
}

.paginacao .pag-status {
  color: #555;
  font-size: 0.95rem;
}

.comentarios h4 {
  margin-top: 0;
  margin-bottom: 10px;
}

.lista-comentarios {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lista-comentarios li {
  border: 1px solid #e5e7eb;
  background: var(--comments-bg, #fafafa);
  border-radius: 8px;
  padding: 10px;
}

.lista-comentarios .cmt-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.92rem;
  color: #444;
}

.lista-comentarios .cmt-texto {
  margin-top: 6px;
  white-space: pre-wrap;
}

.form-comentario {
  display: flex;
  flex-direction: column;
}

.form-comentario label {
  display: block;
  margin-bottom: 6px;
}

.form-comentario textarea {
  display: block;
  resize: vertical;
  min-height: 80px;
}

.form-comentario button {
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.2;
  padding: 12px 16px;
  cursor: pointer;
}
.btn {
  display: inline-block;
  background: var(--menu-btn-bg);
  color: var(--menu-btn-fg);
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
}
.btn:hover { opacity: 0.92; }
.btn-admin {
  margin-left: auto;
  background: var(--menu-btn-bg);
  color: var(--menu-btn-fg);
  padding: 9px 14px;
  border-radius: 8px;
  font-weight: 700;
}
.btn-admin:hover { opacity: 0.92; }

.perfil-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  padding: 0;
  cursor: pointer;
  appearance: none;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--card);
  overflow: hidden;
}
.perfil-avatar img {
  width: 100%;
  height: 100%;
  max-width: 46px;
  max-height: 46px;
  object-fit: cover;
  display: block;
}

/* trava extra: se alguma regra global de img conflitar */
.topo .perfil-avatar {
  width: 46px !important;
  height: 46px !important;
  flex: 0 0 46px !important;
}
.topo .perfil-avatar img {
  width: 100% !important;
  height: 100% !important;
  max-width: 46px !important;
  max-height: 46px !important;
  object-fit: cover !important;
}
.perfil-avatar__fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text);
  background: #f3f4f6;
}

.avatar-dropdown {
  position: relative;
  display: inline-flex;
}

.avatar-notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.9);
  pointer-events: none;
}

.avatar-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 170px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  z-index: 50;
}

.avatar-menu[hidden] { display: none; }

.avatar-menu a {
  display: block;
  padding: 10px 10px;
  border-radius: 8px;
  font-weight: 700;
  background: transparent;
  color: var(--text);
}

.avatar-menu a:hover {
  background: rgba(0,0,0,0.04);
}

.perfil-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0 14px;
}

.perfil-tab {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
}

.perfil-tab:hover { background: rgba(0,0,0,0.03); }

.perfil-tab[aria-selected="true"] {
  background: var(--menu-btn-bg);
  color: var(--menu-btn-fg);
  border-color: var(--menu-btn-bg);
}

.menu-desktop ul { list-style: none; display: flex; gap: 12px; padding: 0; margin: 0; }
.menu-desktop li { position: relative; }
.menu-desktop li ul {
  display: none;
  position: absolute;
  top: 32px;
  left: 0;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.menu-desktop li:hover > ul { display: block; }
.menu-desktop a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--menu-btn-bg);
  color: var(--menu-btn-fg);
  font-weight: 700;
}
.menu-desktop a:hover { opacity: 0.92; }
.menu-desktop a.strong { font-weight: 700; }
.menu-desktop a.em { font-style: italic; }

.conteudo { max-width: 1100px; margin: 20px auto 80px; padding: 0 18px; }
.hero { background: var(--card); border:1px solid var(--border); border-radius: 12px; padding: 20px; margin-bottom: 20px; }
.eyebrow { text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.hero h1 { margin: 0 0 8px; }
.lead { color: var(--muted); margin: 0; }

.posts h2 { margin: 0 0 12px; }
.posts .card { background: var(--posts-bg, var(--card)); }
.card.comentarios { background: var(--comments-bg, var(--card)); }
.cards {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.cards .card { width: 100%; }
.card { background: var(--card); border:1px solid var(--border); border-radius: 12px; padding: 14px; }
.card-full { grid-column: 1 / -1; }
.card h3 { margin: 0 0 6px; }
.card small { color: var(--muted); }
.card p { margin: 8px 0 0; color: #374151; }
.post-body {
  margin-top: 10px;
  color: #1f2937;
  line-height: 1.6;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.post-body img { max-width: 100%; height: auto; }
.post-body .yt-embed { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; }
.post-body .yt-embed__frame { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; }
.breadcrumb { margin-bottom: 8px; font-size: 13px; }
.cta { margin-top: 8px; font-weight: 700; }
.vazio { background: #fff8e6; border:1px solid #f6d48f; color:#6b4a00; padding:12px; border-radius:10px; }

.galeria h2 { margin: 0 0 12px; }
.album { background: var(--card); border:1px solid var(--border); border-radius: 12px; padding: 14px; margin-bottom: 16px; }
.album-head { display:flex; justify-content: space-between; align-items:flex-start; gap: 10px; margin-bottom: 10px; }
.lead-sm { color: var(--muted); margin: 4px 0 0; }
.grid-midias { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.midia-card { border:1px solid var(--border); border-radius:10px; overflow:hidden; background:#fff; display:flex; flex-direction:column; }
.midia-card img { width:100%; height:160px; object-fit:cover; display:block; }
.video-wrap { padding:10px; display:flex; align-items:center; justify-content:center; min-height:160px; }
.midia-meta { padding:10px; display:flex; flex-direction:column; gap:4px; }
.midia-titulo { font-weight:700; }
.midia-desc { color:#4b5563; font-size:13px; }

.lightbox { position: fixed; inset: 0; display: none; align-items: center; justify-content: center; z-index: 999; }
.lightbox[aria-hidden="false"] { display: flex; }
.lightbox__backdrop { position:absolute; inset:0; background: rgba(0,0,0,0.65); }
.lightbox__content { position: relative; background: #0b0b0b; padding: 14px; border-radius: 10px; max-width: 90vw; max-height: 90vh; display:flex; flex-direction:column; gap:10px; box-shadow: 0 10px 35px rgba(0,0,0,0.35); }
.lightbox__body { display:flex; align-items:center; justify-content:center; background:#000; padding:10px; max-height: 80vh; }
.lightbox__body img, .lightbox__body video { max-width: 85vw; max-height: 80vh; }
.lightbox__caption { color: #f1f5f9; font-size: 14px; line-height: 1.5; }
.lightbox__count { color:#cbd5e1; font-size:13px; margin-bottom:4px; }
.lightbox__title { font-weight: 700; margin-bottom: 4px; }
.lightbox__desc { color: #cbd5e1; }
.lightbox__close { position:absolute; top:8px; right:10px; background: transparent; border:0; color:#fff; font-size:22px; cursor:pointer; }
.lightbox__nav { position:absolute; top:50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color:#fff; border:0; width:36px; height:48px; border-radius:8px; font-size:22px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.lightbox__prev { left:8px; }
.lightbox__next { right:8px; }
.lightbox__controls { margin-top:6px; }
.lightbox__play { background: rgba(255,255,255,0.1); color:#fff; border:1px solid rgba(255,255,255,0.25); border-radius:8px; padding:6px 10px; cursor:pointer; }

.menu-mobile {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  background: var(--header-bg, var(--card));
  color: var(--header-fg, var(--text));
  border-top: 1px solid var(--border);
  padding: 10px 12px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.menu-mobile ul { list-style: none; display: flex; gap: 10px; padding: 0; margin: 0; justify-content: center; flex-wrap: wrap; }
.menu-mobile li ul { display: none; }
.menu-mobile a {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--menu-btn-bg);
  color: var(--menu-btn-fg);
}
.menu-mobile a.submenu {
  font-size: 13px;
  padding: 7px 9px;
}
.menu-mobile a:hover { opacity: 0.92; }

@media (max-width: 768px) {
  body { padding-bottom: calc(55px + env(safe-area-inset-bottom)); }
  .menu-desktop { display: none; }
  .btn-admin { font-size: 13px; padding: 8px 10px; }
  .menu-mobile { display: block; }
  .conteudo { margin-bottom: 0; }
}
