:root {
  --cortica: #d9c4a0;
  --cortica-escura: #b89b6e;
  --quadro: #1f3a2e;
  --quadro-claro: #2c4f3d;
  --giz: #f4f1e8;
  --nota-texto: #f2c94c;
  --nota-imagem: #56a3d9;
  --nota-video: #e8735c;
  --nota-link: #9b8ac4;
  --tinta: #26241d;
  --tinta-suave: #6b6558;
  --sombra: 0 4px 10px rgba(38, 36, 29, 0.18);
  --raio: 10px;
  font-size: 16px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 1px 1px, rgba(38,36,29,0.06) 1px, transparent 0) 0 0/16px 16px,
    var(--cortica);
  color: var(--tinta);
  min-height: 100vh;
}

h1, h2, h3 {
  font-family: "Kalam", "Segoe Print", cursive;
  font-weight: 700;
  margin: 0;
}

a { color: inherit; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: var(--raio);
  padding: 0.7rem 1.2rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}
button:active { transform: translateY(1px) scale(0.98); }

.btn-principal {
  background: var(--quadro);
  color: var(--giz);
}
.btn-principal:hover { background: var(--quadro-claro); }

.btn-secundario {
  background: transparent;
  color: var(--quadro);
  border: 2px solid var(--quadro);
}

.btn-perigo {
  background: var(--nota-video);
  color: var(--giz);
}

input, textarea, select {
  font-family: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  border: 2px solid rgba(38,36,29,0.15);
  border-radius: 8px;
  background: #fffdf8;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--quadro);
}

.topo {
  background: var(--quadro);
  color: var(--giz);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--sombra);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topo h1 { font-size: 1.4rem; }
.topo .marca { display: flex; align-items: center; gap: 0.5rem; }
.topo .marca span.pin { color: var(--nota-video); font-size: 1.1rem; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.2rem;
}

.cartao {
  background: #fffdf8;
  border-radius: var(--raio);
  padding: 1.1rem;
  box-shadow: var(--sombra);
  margin-bottom: 1rem;
}

.grade-murais {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.mural-card {
  background: #fffdf8;
  border-radius: var(--raio);
  padding: 1rem;
  box-shadow: var(--sombra);
  border-top: 6px solid var(--quadro);
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mural-card:hover { transform: translateY(-3px); box-shadow: 0 8px 18px rgba(38,36,29,0.22); }
.mural-card .capa-card {
  width: calc(100% + 2rem);
  margin: -1rem -1rem 0.7rem -1rem;
  height: 90px;
  object-fit: cover;
  display: block;
}
.mural-card .status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  margin-top: 0.4rem;
}
.status.aberto { background: #dff2e4; color: #1f7a3d; }
.status.fechado { background: #f2dfdf; color: #a13d3d; }

.mural-grid-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.post-nota {
  border-radius: 6px;
  padding: 1rem;
  box-shadow: var(--sombra);
  position: relative;
  transform: rotate(var(--giro, -1deg));
}
.post-nota.texto { background: var(--nota-texto); }
.post-nota.imagem { background: var(--nota-imagem); color: var(--giz); }
.post-nota.video { background: var(--nota-video); color: var(--giz); }
.post-nota.link { background: var(--nota-link); color: var(--giz); }
.post-nota img, .post-nota iframe {
  width: 100%;
  border-radius: 4px;
  margin-top: 0.5rem;
  display: block;
}
.post-nota .autor {
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0.85;
  margin-top: 0.6rem;
}
.btn-curtir {
  margin-top: 0.5rem;
  background: rgba(255,255,255,0.55);
  color: var(--tinta);
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-curtir.curtido { background: rgba(255,255,255,0.85); }

.pendente-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.7rem;
  border-radius: 8px;
  background: #fbf6e9;
  margin-bottom: 0.5rem;
}
.pendente-item .acoes { display: flex; gap: 0.5rem; }
.pendente-item .acoes button { padding: 0.4rem 0.7rem; font-size: 0.85rem; }

.link-copiar {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  background: var(--giz);
  border-radius: 8px;
  padding: 0.5rem;
}
.link-copiar input { border: none; background: transparent; }

.aviso {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--tinta-suave);
}

.oculto { display: none !important; }

/* ---------- Paleta de cores do mural ---------- */
.paleta-cores {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
}
.cor-opcao {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(38,36,29,0.3);
  transition: transform 0.1s ease;
}
.cor-opcao:hover { transform: scale(1.1); }
.cor-opcao.selecionada { border-color: var(--tinta); transform: scale(1.08); }

.capa-detalhe {
  width: calc(100% + 2.2rem);
  margin: -1.1rem -1.1rem 1rem -1.1rem;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.banner-mural-publico {
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  display: block;
}

.form-post label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  margin: 0.7rem 0 0.3rem;
}

.tipo-seletor {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.tipo-seletor button {
  flex: 1;
  background: rgba(38,36,29,0.06);
  color: var(--tinta);
  font-size: 0.85rem;
}
.tipo-seletor button.ativo.texto { background: var(--nota-texto); }
.tipo-seletor button.ativo.imagem { background: var(--nota-imagem); color: var(--giz); }
.tipo-seletor button.ativo.video { background: var(--nota-video); color: var(--giz); }
.tipo-seletor button.ativo.link { background: var(--nota-link); color: var(--giz); }

.rodape-mensagem {
  text-align: center;
  font-size: 0.85rem;
  color: var(--tinta-suave);
  margin-top: 1rem;
}

@media (max-width: 480px) {
  .topo h1 { font-size: 1.1rem; }
}

/* ---------- Exportação / impressão ---------- */
#areaImpressao { display: none; }
@media print {
  body * { visibility: hidden; }
  #areaImpressao, #areaImpressao * { visibility: visible; }
  #areaImpressao {
    display: block;
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    color: #000;
    background: #fff;
  }
  #areaImpressao .item-impresso {
    break-inside: avoid;
    border-bottom: 1px solid #ccc;
    padding: 0.6rem 0;
  }
  #areaImpressao .autor-impresso { font-size: 0.8rem; color: #555; }
  #areaImpressao img { max-height: 300px; }
}
