/* Páginas internas (Publicações, post) — usa as variáveis e o topo de /style.css */

.topbar--static {
  position: relative;
  border-bottom: 1px dashed var(--line);
}

/* ---------- Estrutura ---------- */
.page-main { min-height: calc(100vh - 140px); }

.page-wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 64px clamp(16px, 5vw, 64px) 96px;
}

.page-title {
  margin: 20px 0 0;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 1.06;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.page-lead {
  margin: 14px 0 0;
  max-width: 680px;
  font-size: clamp(17px, 2vw, 19px);
  line-height: 1.5;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.back-link,
.btn-link {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--c-slate);
  text-decoration: none;
}

.back-link:hover,
.btn-link:hover { color: var(--c-teal); }

.btn-link { margin-top: 28px; }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 20px;
  margin-top: 48px;
}

.card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--c-sky);
  box-shadow: 0 0 0 4px rgba(162, 188, 224, 0.2), 0 14px 30px -20px rgba(11, 85, 99, 0.4);
  transform: translateY(-2px);
}

.card-date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--c-slate);
}

.card-title {
  margin: 10px 0 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

/* no card, títulos e descrições longos são cortados com "…" */
.card-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.card-title a {
  color: var(--ink);
  text-decoration: none;
}

.card-title a:hover { color: var(--c-teal); }

.card-desc {
  flex: 1;
  margin: 10px 0 0;
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.card-desc-clamp {
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.card-btn {
  align-self: flex-start;
  margin-top: 22px;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--c-teal);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 13px;
  text-decoration: none;
  transition: background 0.2s;
}

.card-btn:hover { background: var(--c-blue); }

.empty-card {
  margin-top: 48px;
  padding: 36px 28px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background-image: radial-gradient(rgba(94, 92, 108, 0.16) 1px, transparent 1.2px);
  background-size: 9px 9px;
}

.empty-card p {
  margin: 12px 0 0;
  font-size: 18px;
  color: var(--ink-soft);
}

.sec-label-inline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--c-slate);
}

.page-empty { text-align: left; }

/* ---------- Busca e tags ---------- */
.search { margin-top: 40px; }

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-box:focus-within {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 5px rgba(162, 188, 224, 0.25);
}

.search-icon {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: var(--c-slate);
  stroke-width: 2;
  stroke-linecap: round;
}

.search-box input {
  flex: 1;
  min-width: 0;
  padding: 13px 0;
  border: 0;
  outline: none;
  background: none;
  color: var(--ink);
  font: 16px var(--font-sans);
}

.search-box input::placeholder { color: #9a9dab; }

.tag-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  font-size: 12.5px;
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.chip:hover { border-color: var(--c-blue); color: var(--c-teal); }

.chip.is-active {
  border-color: var(--c-teal);
  background: var(--c-teal);
  color: #fff;
}

.chip-count { opacity: 0.6; font-size: 11px; }

.chip--sm { padding: 3px 9px; font-size: 11.5px; }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.tag-list--post { margin-top: 18px; }

.results-info {
  margin: 22px 0 0;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.results-info a { color: var(--c-teal); }

#results[aria-busy="true"] { opacity: 0.55; transition: opacity 0.15s; }

#results .cards,
#results .empty-card { margin-top: 28px; }

/* ---------- Post ---------- */
.post { max-width: 800px; }

.post .back-link { margin-bottom: 28px; }

.post-header {
  padding-bottom: 32px;
  margin-bottom: 40px;
  border-bottom: 1px dashed var(--line);
}

.post-header .page-title { margin-top: 10px; }

.draft-banner {
  margin-bottom: 24px;
  padding: 12px 16px;
  border: 1px solid var(--c-lilac);
  border-radius: 10px;
  background: rgba(190, 184, 235, 0.18);
  font-size: 14px;
  color: var(--ink-soft);
}

/* Conteúdo do post — as mesmas regras valem dentro do editor (.ql-editor.post-content) */
.post-content {
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.post-content > * + * { margin-top: 0.9em; }
.post-content p { margin: 0; }
.post-content > p + p { margin-top: 0.9em; }

.post-content h2,
.post-content h3 {
  margin: 1.6em 0 0.4em;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.post-content h2 { font-size: 1.65em; }
.post-content h3 { font-size: 1.3em; }

.post-content a { color: var(--c-teal); text-underline-offset: 3px; }
.post-content a:hover { color: var(--c-blue); }

.post-content blockquote {
  margin: 1.2em 0;
  padding: 4px 0 4px 18px;
  border-left: 3px solid var(--c-blue);
  color: var(--ink-soft);
}

.post-content pre,
.post-content .ql-code-block-container {
  margin: 1.2em 0;
  padding: 16px 18px;
  border-radius: 10px;
  background: #1d2230;
  color: #e9edf6;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre;
}

.post-content code {
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.post-content :not(pre) > code {
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
}

.post-content:not(.ql-editor) ul,
.post-content:not(.ql-editor) ol { padding-left: 1.4em; }
.post-content:not(.ql-editor) li + li { margin-top: 0.3em; }

/* tamanhos e alinhamentos do editor */
.post-content .ql-size-small { font-size: 0.75em; }
.post-content .ql-size-large { font-size: 1.5em; }
.post-content .ql-size-huge  { font-size: 2.5em; line-height: 1.2; }
.post-content .ql-align-center  { text-align: center; }
.post-content .ql-align-right   { text-align: right; }
.post-content .ql-align-justify { text-align: justify; }
.post-content .ql-indent-1 { padding-left: 2em; }
.post-content .ql-indent-2 { padding-left: 4em; }
.post-content .ql-indent-3 { padding-left: 6em; }

/* imagens: borda e tamanho escolhidos no editor */
.post-content img {
  display: inline-block;
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

.post-content img.img-rounded { border-radius: 16px; }
.post-content img.img-sm   { width: 33%; }
.post-content img.img-md   { width: 50%; }
.post-content img.img-lg   { width: 75%; }
.post-content img.img-full { width: 100%; }

/* vídeos */
.post-content video.post-video,
.post-content iframe.ql-video {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 12px;
  background: #000;
}

.post-content iframe.ql-video { aspect-ratio: 16 / 9; height: auto; }

.post-content hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 2em 0;
}

@media (max-width: 560px) {
  .post-content { font-size: 17px; }
  .post-content img.img-sm { width: 50%; }
  .post-content img.img-md,
  .post-content img.img-lg { width: 100%; }
}

/* ---------- Comentários ---------- */
.post { padding-bottom: 56px; }

.comments {
  max-width: 800px;
  padding-top: 40px;
  border-top: 1px dashed var(--line);
}

.page-wrap.comments { padding-top: 40px; }

.comments-title {
  margin: 16px 0 0;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: -0.015em;
}

.comments-empty {
  margin: 10px 0 0;
  color: var(--ink-soft);
  font-size: 15.5px;
}

.comment-list,
.comment-replies {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list { margin-top: 24px; }

.comment-list > .comment + .comment {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.comment-main {
  display: flex;
  gap: 12px;
  min-width: 0;
}

.comment-box { flex: 1; min-width: 0; }

.comment-replies {
  margin: 12px 0 0 22px;
  padding-left: 22px;
  border-left: 2px solid var(--bg-soft);
}

.comment--reply + .comment--reply { margin-top: 12px; }

.avatar {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  color: #fff;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.avatar--admin {
  background: conic-gradient(from var(--brand-angle) at 50% 50%,
    #5299D3, #0B5563, #A2BCE0, #BEB8EB, #5E5C6C, #5299D3);
  animation: brand-spin 6s linear infinite;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.avatar--gone {
  background: var(--bg-soft);
  border: 1px dashed var(--line);
}

.comment--reply .avatar { width: 30px; height: 30px; font-size: 13px; }

.comment-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
}

.comment-nick {
  font-size: 15px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.comment-badge {
  padding: 1px 7px;
  border-radius: 999px;
  background: rgba(11, 85, 99, 0.12);
  color: var(--c-teal);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.comment-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-slate);
  text-decoration: none;
}

.comment-date:hover { color: var(--c-teal); }

.comment-body {
  margin: 6px 0 0;
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.comment-body > * { margin: 0; }
.comment-body > * + * { margin-top: 0.6em; }

.comment-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 0.88em;
}

.comment-body pre {
  padding: 12px 14px;
  border-radius: 10px;
  background: #1d2230;
  color: #e8ebf3;
  overflow-x: auto;
  font-size: 14px;
  line-height: 1.55;
}

.comment-body pre code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  white-space: pre;
}

.comment-body blockquote {
  padding-left: 12px;
  border-left: 3px solid var(--c-sky);
  color: var(--ink-soft);
}

.comment-body del { color: var(--c-slate); }

.comment-gone {
  margin: 8px 0 0;
  color: var(--c-slate);
  font-style: italic;
  font-size: 14.5px;
}

.comment-actions {
  display: flex;
  gap: 14px;
  margin-top: 6px;
}

.comment-act {
  padding: 0;
  border: 0;
  background: none;
  color: var(--c-slate);
  font-family: var(--font-mono);
  font-size: 12.5px;
  cursor: pointer;
}

.comment-act:hover { color: var(--c-teal); }
.comment-act--del:hover { color: #c0392b; }
.comment-act[hidden] { display: none; }

.comment.is-new > .comment-main .comment-box {
  animation: comment-new 2.4s ease-out;
  border-radius: 8px;
}

@keyframes comment-new {
  from { background: rgba(162, 188, 224, 0.35); box-shadow: 0 0 0 8px rgba(162, 188, 224, 0.35); }
  to   { background: transparent; box-shadow: 0 0 0 8px transparent; }
}

/* formulário */
.comment-form {
  margin-top: 36px;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.comment .comment-form { margin: 16px 0 0 48px; }

.cf-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.cf-who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.cf-who-text { overflow-wrap: anywhere; }
.cf-who-text strong { color: var(--ink); }

.cf-field { display: block; margin-top: 14px; }

.cf-field[hidden] { display: none; }

.cf-label {
  display: block;
  margin-bottom: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-slate);
}

.cf-field input,
.cf-field textarea,
.cf-key {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--font-sans);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cf-field textarea { min-height: 110px; resize: vertical; }

.cf-field input:focus,
.cf-field textarea:focus,
.cf-key:focus {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 4px rgba(82, 153, 211, 0.15);
  background: #fff;
}

.cf-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--c-slate);
}

.cf-hint code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  font-family: var(--font-mono);
  font-size: 11.5px;
  white-space: nowrap;
}

.cf-replying {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--ink-soft);
}

.cf-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 12px;
}

.cf-foot .card-btn { margin: 0 0 0 auto; border: 0; cursor: pointer; }
.cf-foot .card-btn:disabled { opacity: 0.6; cursor: default; }

.cf-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--c-slate);
}

.cf-error {
  margin: 0;
  font-size: 14px;
  color: #b03a2e;
}

.cf-error:empty { display: none; }

.cf-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.cf-noscript {
  margin-top: 28px;
  color: var(--ink-soft);
}

/* painel "Minha identidade" */
.cf-ident {
  margin-top: 14px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: var(--bg);
}

.cf-ident-text,
.cf-ident-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-soft);
}

.cf-ident-note { margin: 8px 0 12px; font-size: 13px; color: var(--c-slate); }
.cf-ident-sub { margin-top: 16px; }

.cf-key-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.cf-key {
  flex: 1;
  min-width: 0;
  padding: 8px 11px;
  font: 13px var(--font-mono);
  background: #fff;
}

.cf-small-btn {
  flex: none;
  margin: 0;
  border: 0;
  cursor: pointer;
}

.cf-small-btn:disabled { opacity: 0.6; }

.cf-ident .cf-error { margin-top: 8px; }

@media (max-width: 560px) {
  .comment-replies { margin-left: 8px; padding-left: 14px; }
  .comment .comment-form { margin-left: 0; }
  .comment-form { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .avatar--admin, .comment.is-new > .comment-main .comment-box { animation: none; }
}
