/* Vista pública de posts, índice del blog y "Mis posts". */

.post {
  max-width: 820px;
  margin: 36px auto 90px;
  padding: 0 20px;
}

.crumbs {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.crumbs a {
  color: var(--text-dim);
}

.post h1 {
  font-size: 2.2rem;
  line-height: 1.2;
  margin: 0 0 12px;
}

.post-meta {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 24px;
}

.post-cover {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
  border: 1px solid var(--border);
  margin-bottom: 28px;
}

.draft-note {
  background: rgba(201, 154, 63, 0.15);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.86rem;
  margin-bottom: 20px;
}

/* Contenido generado por el editor */
.post-body {
  font-size: 1.08rem;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.post-body h2 { font-size: 1.6rem; margin: 2em 0 0.6em; }
.post-body h3 { font-size: 1.3rem; margin: 1.8em 0 0.5em; }
.post-body h4 { font-size: 1.1rem; margin: 1.5em 0 0.4em; }
.post-body p { margin: 0 0 1.1em; }
.post-body a { color: var(--accent-2); }
.post-body img { max-width: 100%; height: auto; border-radius: 10px; }
.post-body figure { margin: 1.4em 0; }
.post-body figcaption { color: var(--text-dim); font-size: 0.86rem; text-align: center; margin-top: 6px; }
.post-body ul, .post-body ol { padding-left: 1.5em; margin: 0 0 1.1em; }
.post-body li { margin: 0.25em 0; }
.post-body hr { border: none; border-top: 1px solid var(--border); margin: 2em 0; }

.post-body blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 4px solid var(--accent);
  color: var(--text-dim);
}

.post-body pre {
  background: #0e1409;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.55;
}

.post-body code {
  background: rgba(255, 255, 255, 0.07);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.92em;
}

.post-body pre code {
  background: none;
  padding: 0;
}

.post-body table {
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  max-width: 100%;
  margin: 1.4em 0;
}

.post-body td, .post-body th {
  border: 1px solid var(--border);
  padding: 8px 12px;
}

.post-body iframe {
  display: block;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: 0;
  border-radius: 10px;
  margin: 1.4em auto;
}

/* Índice del blog */
.blog-wrap {
  max-width: 1100px;
  margin: 36px auto 90px;
  padding: 0 20px;
}

.blog-wrap h1 { font-size: 1.8rem; margin: 0 0 6px; }
.blog-sub { color: var(--text-dim); margin: 0 0 26px; }

.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, transform 0.15s;
}

.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.post-card img, .post-card-ph { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.post-card-ph { display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); font-size: 2.4rem; }
.post-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.post-card-body h2 { font-size: 1.1rem; margin: 0; line-height: 1.3; }
.post-card-body p { margin: 0; color: var(--text-dim); font-size: 0.88rem; line-height: 1.5; flex: 1; }
.post-card-meta { color: var(--text-dim); font-size: 0.78rem; }

.pager {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 32px;
  font-size: 0.9rem;
  color: var(--text-dim);
}

/* Mis posts */
.mine-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.mine-head h1 { margin: 0; }
.mine-list { display: grid; gap: 10px; }

.mine-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.mine-title { color: var(--text); font-weight: 700; text-decoration: none; margin-right: 8px; }
.mine-title:hover { color: var(--accent); }
.mine-actions { display: flex; gap: 8px; align-items: center; }
.mine-actions form { margin: 0; }

.badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.badge.ok { color: var(--accent-2); border-color: var(--accent-2); }
.badge.draft { color: var(--accent); border-color: var(--accent); }
.btn-soft.danger:hover { border-color: var(--tier-d); color: var(--tier-d); }

.btn-soft {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
}

@media (max-width: 640px) {
  .post h1 { font-size: 1.7rem; }
  .post-body { font-size: 1rem; }
}
