/* =========================
   SINGLE POST / PROJECT
========================= */

/* All images in posts/projects (thumbnail + in-content) */
main img {
  border-radius: 14px;
}

main > img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  margin-bottom: 1.75rem;
}

/* =========================
   SINGLE PAGE TAGS (FIX)
========================= */

/* Target ONLY the tag list directly under the title */
main > ul {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.2rem;
  padding: .5rem 3rem;
  margin: 1.25rem 0 2rem;
  background-color: var(--color-bg-secondary);
  border-radius: 15px;
  border: 1px var(--color-bg-tertiary);
  border: 1px solid var(--color-bg-tertiary);
}

main > ul > li {
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  font-size: 1rem;
  text-align: left;
  white-space: nowrap;
}

/* Mobile */
@media (max-width: 640px) {
  main > ul {
    grid-template-columns: repeat(2, 1fr);
  }
}


/* =========================
   PROSE: CODE, TABLES, ETC.
========================= */

pre {
  background: var(--color-bg-secondary);
  border: 1px solid var(--color-bg-tertiary);
  border-radius: 8px;
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.5rem 0;
  line-height: 1.5;
}

pre code {
  color: var(--text-primary);
  font-family: "Courier New", monospace;
  font-size: 0.9rem;
  background: transparent;
  padding: 0;
}

code {
  background: var(--color-bg-secondary);
  color: var(--text-highlighted);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: "Courier New", monospace;
  font-size: 0.9em;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  border: 1px solid var(--color-bg-tertiary);
  border-radius: 8px;
  overflow: hidden;
}

thead {
  background: var(--color-bg-secondary);
  border-bottom: 2px solid var(--color-bg-tertiary);
}

th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--text-highlighted);
}

td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--color-bg-tertiary);
  color: var(--text-primary);
}

tbody tr:hover {
  background: var(--color-bg-secondary);
}

tbody tr:last-child td {
  border-bottom: none;
}

blockquote {
  border-left: 4px solid var(--text-highlighted);
  margin: 1.5rem 0;
  padding: 1rem 1.5rem;
  background: var(--color-bg-secondary);
  border-radius: 4px;
  color: var(--text-secondary);
  font-style: italic;
}

blockquote p {
  margin: 0.5rem 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-bg-tertiary);
  margin: 2rem 0;
}

/* =========================
   RELATED POSTS
========================= */

.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-bg-tertiary);
}

.related-posts h2 {
  margin-bottom: 1.5rem;
}

.posts-grid {
  display: grid;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (min-width: 768px) {
  .posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

/* =========================
   BACK LINK
========================= */

.back-link {
  margin-top: 2rem;
  padding-top: 1rem;
}

.back-link a {
  display: inline-block;
  color: var(--text-highlighted);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-link a:hover {
  transform: translateX(-4px);
  color: var(--gradient-start);
}
