/*
 * BLOG STYLESHEET
 * Extends index.css. Minimal overrides for blog listing, post content, and comments.
 */

/* ---- Blog Listing ---- */

.blog-list {
  list-style: none;
  padding: 0;
}

.blog-post-link {
  font-size: 1.2rem;
  font-weight: bold;
}

.blog-post-date {
  font-size: 0.85rem;
  color: var(--link-visited);
}

.blog-post-summary {
  text-indent: 16px;
  font-style: italic;
}

/* ---- Blog Post ---- */

.blog-post-meta {
  font-size: 0.9rem;
  color: var(--link-visited);
  border-bottom: 1px solid rgba(241, 245, 249, 0.15);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.blog-post pre {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(241, 245, 249, 0.1);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
}

.blog-post p code {
  background: rgba(0, 0, 0, 0.3);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.blog-post blockquote {
  border-left: 3px solid var(--link-color);
  padding: 0.5rem 1rem;
  background: rgba(56, 189, 248, 0.05);
}

/* ---- Figures & Images ---- */

/* Block-level break in text flow; centered; reasonable max width on wide screens */
.blog-post figure {
  display: block;
  margin: 2rem auto;
  max-width: min(
    100%,
    640px
  ); /* never wider than the column, capped at 640px */
  text-align: center;
}

/* Image fills the figure container; aspect ratio is always preserved */
.blog-post figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
}

.blog-post figcaption {
  margin-top: 0.5rem;
  color: var(--link-visited);
  font-style: italic;
}

/* ---- Comments ---- */

.comments-title {
  border-top: 1px solid rgba(241, 245, 249, 0.15);
  padding-top: 2rem;
  margin-top: 3rem;
}

.comment-input {
  display: block;
  width: 100%;
  padding: 0.6rem 0.8rem;
  margin-bottom: 0.5rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(241, 245, 249, 0.2);
  border-radius: 4px;
  color: var(--text-color);
  font-family: inherit;
  font-size: inherit;
  box-sizing: border-box;
}

.comment-input:focus {
  outline: none;
  border-color: var(--link-color);
}

.comment-textarea {
  resize: vertical;
  min-height: 80px;
}

.comment-name {
  max-width: 300px;
}

/* Honeypot — invisible to users */
.comment-hp {
  position: absolute;
  left: -9999px;
  opacity: 0;
  height: 0;
  pointer-events: none;
}

.comment-submit {
  background: var(--link-color);
  color: var(--bg-color);
  border: none;
  padding: 0.5rem 1.2rem;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
}

.comment-submit:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.comment {
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(241, 245, 249, 0.08);
}

.comment-author {
  font-weight: bold;
  color: var(--link-color);
}

.comment-time {
  font-size: 0.8rem;
  color: var(--link-visited);
}

.comment-body {
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-reply-btn {
  background: none;
  border: none;
  color: var(--link-visited);
  cursor: pointer;
  font-size: 0.8rem;
  padding: 0;
}

.reply-form-container .comment-form {
  padding-left: 0.5rem;
  border-left: 2px solid rgba(56, 189, 248, 0.3);
}

.no-comments,
.comments-error {
  font-style: italic;
}

.comments-error {
  color: #f87171;
}
