/* ============================================================
   VESPERZONE — COMMUNITY PAGE STYLES
   Design Industrial, Retro-Futurista e Militar/Noir
   ============================================================ */

/* ============ GERAL & UTILS ============ */
.community-hero {
  padding: 10rem clamp(1.5rem, 6vw, 5rem) 4rem;
  background: 
    linear-gradient(180deg, rgba(12,13,13,0.8), rgba(12,13,13,0.98)),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.01) 0 2px, transparent 2px 4px),
    var(--steel);
  position: relative;
  border-bottom: 5px solid var(--ink);
  text-align: center;
}

.community-hero::before {
  content: ""; position: absolute; inset: 18px;
  border: 2px solid rgba(233,229,214,0.1);
  pointer-events: none;
}

.community-hero h1 {
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  letter-spacing: 0.05em;
  margin: 1rem 0 2rem;
  color: var(--bone);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

/* ============ TABS DA COMUNIDADE ============ */
.community-tabs {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
}

.comm-tab {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--bone-dim);
  padding: 0.8rem 1.8rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.comm-tab:hover {
  color: var(--signal);
  border-color: var(--signal-dim);
  background: rgba(220,177,58,0.04);
}

.comm-tab.active {
  color: var(--ink);
  background: var(--signal);
  border-color: var(--signal);
  font-weight: 600;
  box-shadow: 0 0 15px rgba(220,177,58,0.4);
}

/* ============ SEÇÕES PRINCIPAIS ============ */
.comm-section {
  display: none;
  padding: 4rem clamp(1.5rem, 6vw, 5rem) 6rem;
  background: var(--ink);
  min-height: 50vh;
}

.comm-section.active {
  display: block;
}

/* ============ BARRA DE BUSCA E FILTROS ============ */
.search-filter-wrap {
  max-width: 1200px;
  margin: 0 auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  background: var(--steel);
  border: 1px solid var(--line);
  padding: 1.8rem;
  position: relative;
  box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.search-filter-wrap::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 4px; height: 100%;
  background: var(--signal);
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 100%;
  background: var(--ink-2);
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.95rem;
  padding: 0.9rem 1.2rem 0.9rem 2.8rem;
  outline: none;
  transition: all 0.3s;
}

.search-box input:focus {
  border-color: var(--signal-dim);
  box-shadow: 0 0 10px rgba(220,177,58,0.15);
}

.search-box::after {
  content: ">";
  position: absolute;
  left: 1.2rem;
  font-family: 'IBM Plex Mono', monospace;
  color: var(--signal);
  font-weight: bold;
  font-size: 1.1rem;
}

.categories-bar {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.cat-btn {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--bone-dim);
  padding: 0.45rem 0.9rem;
  cursor: pointer;
  transition: all 0.25s;
}

.cat-btn:hover {
  color: var(--bone);
  border-color: var(--bone-dim);
}

.cat-btn.active {
  background: rgba(220,177,58,0.12);
  border-color: var(--signal);
  color: var(--signal);
  font-weight: 600;
}

.admin-action-bar {
  display: flex;
  justify-content: flex-end;
  max-width: 1200px;
  margin: -1.5rem auto 2.5rem;
}

/* ============ GRADE DE CARDS ============ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.post-card {
  background: var(--steel);
  border: 1px solid var(--line);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  cursor: pointer;
  box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.post-card::after {
  content: "";
  position: absolute;
  top: 8px; right: 8px; width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--line);
}

.post-card:hover {
  transform: translateY(-5px);
  border-color: var(--signal-dim);
  box-shadow: 0 12px 24px rgba(0,0,0,0.5), 0 0 10px rgba(220,177,58,0.1);
}

.post-card-img {
  height: 180px;
  background-color: var(--ink-2);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

/* Fallback visual mesh */
.post-card-img.no-img {
  background: 
    radial-gradient(var(--line) 15%, transparent 16%) 0 0,
    radial-gradient(var(--line) 15%, transparent 16%) 8px 8px,
    var(--ink-2);
  background-size: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.post-card-img.no-img::before {
  content: "[ ARQUIVO CONFIDENCIAL ]";
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--bone-dim);
  letter-spacing: 0.15em;
  opacity: 0.6;
}

.post-card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.post-card-cat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--signal);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}

.post-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.3rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 0.7rem;
  line-height: 1.25;
}

.post-card p {
  font-size: 0.88rem;
  color: var(--bone-dim);
  line-height: 1.5;
  margin-bottom: 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  color: var(--bone-dim);
}

.post-card-author {
  color: var(--bone);
}

.post-card-comments {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.post-card-comments svg {
  width: 12px; height: 12px;
  fill: currentColor;
}

/* Rascunho / Arquivado Badge */
.status-badge {
  position: absolute;
  top: 12px; left: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.5rem;
  text-transform: uppercase;
  z-index: 2;
  font-weight: bold;
}
.status-badge.draft { background: var(--blood); color: #fff; }
.status-badge.archived { background: var(--steel-light); color: var(--bone-dim); }

/* ============ TELA DE LEITURA (DETALHES DO POST) ============ */
.post-detail-view {
  max-width: 860px;
  margin: 0 auto;
  background: var(--steel);
  border: 1px solid var(--line);
  position: relative;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: none;
}

.post-detail-view::before {
  content: ""; position: absolute; inset: 10px;
  border: 1px dashed rgba(233,229,214,0.06);
  pointer-events: none;
}

.post-detail-view.active {
  display: block;
}

.post-detail-header-img {
  height: 350px;
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--line);
}

.post-detail-content {
  padding: 3rem 2.5rem;
  position: relative;
  z-index: 2;
}

.back-btn-wrap {
  margin-bottom: 2rem;
}

.post-detail-cat {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  color: var(--signal);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.post-detail-view h2 {
  font-family: 'Oswald', sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 600;
  text-transform: uppercase;
  color: var(--bone);
  margin: 0.8rem 0 1.2rem;
  line-height: 1.15;
}

.post-detail-meta {
  display: flex;
  gap: 1.5rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.72rem;
  color: var(--bone-dim);
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.2rem;
  margin-bottom: 2rem;
}

.post-detail-body {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--bone);
  margin-bottom: 3.5rem;
}

.post-detail-body p {
  margin-bottom: 1.4rem;
}

.post-detail-body h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.4rem;
  text-transform: uppercase;
  color: var(--signal);
  margin: 2.2rem 0 1rem;
}

/* Admin Actions em Post Aberto */
.post-admin-actions {
  display: flex;
  gap: 0.6rem;
  margin-top: -1rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 1rem;
}

/* ============ COMENTÁRIOS ESTILO REGISTRO (LOG) ============ */
.comments-section {
  border-top: 3px solid var(--ink);
  padding-top: 3rem;
  position: relative;
}

.comments-section h3 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  margin-bottom: 3rem;
}

/* Formato Registro */
.comment-log {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 1.4rem;
  position: relative;
}

.comment-log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.6rem;
  margin-bottom: 0.8rem;
}

.comment-log-user {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--signal);
  font-weight: bold;
}

.comment-log-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.65rem;
  color: var(--bone-dim);
}

.comment-log-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--bone-dim);
  white-space: pre-line;
}

/* Comentário Ocultado */
.comment-log.hidden {
  border-color: rgba(122, 48, 48, 0.4);
  background: rgba(122, 48, 48, 0.05);
}

.comment-log.hidden .comment-log-body {
  text-decoration: line-through;
  opacity: 0.5;
}

.comment-log-admin-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.8rem;
  border-top: 1px dashed rgba(233,229,214,0.06);
  padding-top: 0.6rem;
}

/* Formulário de Registro de Comentário */
.comment-form-wrap {
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 1.8rem;
}

.comment-form-wrap h4 {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.75rem;
  letter-spacing: 0.15em;
  color: var(--signal-dim);
  text-transform: uppercase;
  margin-bottom: 1.2rem;
}

.comment-form textarea {
  width: 100%;
  min-height: 110px;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--bone);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  padding: 0.8rem 1rem;
  outline: none;
  resize: vertical;
  margin-bottom: 1rem;
  transition: border-color 0.3s;
}

.comment-form textarea:focus {
  border-color: var(--signal-dim);
}

/* Box de Convite para Comentar */
.comment-gate {
  text-align: center;
  background: var(--ink-2);
  border: 1px solid var(--line);
  padding: 2rem;
  font-family: 'IBM Plex Mono', monospace;
}

.comment-gate p {
  font-size: 0.85rem;
  color: var(--bone-dim);
  margin-bottom: 1rem;
}

/* ============ ESTADO VAZIO / NENHUM POST ============ */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  border: 1px dashed var(--line);
  max-width: 600px;
  margin: 0 auto;
}

.empty-state p {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.9rem;
  color: var(--bone-dim);
}

/* ============ LABORATÓRIO LOCK SCREEN ============ */
.lab-placeholder {
  max-width: 760px;
  margin: 0 auto;
  background: var(--ink-2);
  border: 3px solid var(--ink);
  outline: 1px solid rgba(233,229,214,0.12);
  outline-offset: -3px;
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.terminal-lock {
  text-align: center;
  position: relative;
  z-index: 2;
}

.lock-icon {
  font-size: 3rem;
  color: var(--signal);
  margin-bottom: 1.5rem;
  animation: lock-glow 3s infinite ease-in-out;
}

@keyframes lock-glow {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(220,177,58,0.2)); }
  50% { filter: drop-shadow(0 0 15px rgba(220,177,58,0.6)); }
}

.terminal-lock h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 0.5rem;
}

.terminal-lock p {
  font-size: 0.85rem;
  color: var(--signal-dim);
  letter-spacing: 0.05em;
  margin-bottom: 2.5rem;
}

/* Painel de Log Industrial */
.console-logs {
  background: var(--ink);
  border: 1px solid var(--line);
  padding: 1.5rem;
  text-align: left;
  font-size: 0.78rem;
  color: #5ca09a; /* Verde terminal fosco */
  line-height: 1.6;
  max-height: 220px;
  overflow-y: auto;
  margin-bottom: 2rem;
  position: relative;
  box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

.console-logs div {
  margin-bottom: 0.4rem;
  position: relative;
}

.console-logs div::before {
  content: "> ";
  color: var(--signal);
}

/* Dots animando */
.loading-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.loading-dots span {
  width: 6px; height: 6px;
  background-color: var(--signal);
  border-radius: 50%;
  opacity: 0.2;
  animation: loading-dot 1.4s infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes loading-dot {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

/* Scanline Overlay para Terminal do Lab */
.lab-placeholder::before {
  content: "";
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
  background-size: 100% 4px, 6px 100%;
  pointer-events: none;
  z-index: 10;
}

/* ============ FORMULÁRIOS DE CRIAÇÃO/EDIÇÃO (ADMIN) ============ */
.admin-post-form-view {
  max-width: 860px;
  margin: 0 auto;
  background: var(--steel);
  border: 1px solid var(--line);
  padding: 3rem 2.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.6);
  display: none;
}

.admin-post-form-view.active {
  display: block;
}

.admin-post-form-view h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  text-transform: uppercase;
  color: var(--bone);
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 0.8rem;
}

.admin-post-form-view h2 span {
  color: var(--signal);
}

.admin-post-form-view .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media(max-width: 600px) {
  .admin-post-form-view .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

.form-actions-right {
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  margin-top: 1.5rem;
}

.mono {
  font-family: 'IBM Plex Mono', monospace;
}

/* ============ RESPONSIVE AJUSTES ============ */
@media(max-width: 768px) {
  .community-hero {
    padding-top: 8rem;
  }
  .comm-section {
    padding: 3rem 1rem 4rem;
  }
  .search-filter-wrap {
    padding: 1.2rem;
  }
  .post-detail-content {
    padding: 2rem 1.2rem;
  }
}

/* ============ AJUSTE BOTÃO VOLTAR GHOST ============ */
.btn.ghost {
  background: transparent !important;
  color: var(--bone) !important;
}
.btn.ghost:hover {
  background: rgba(233,229,214,0.05) !important;
}

