/* =========================
   Post Detail (詳細)
========================= */

.post-detail {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 22px;
  align-items: start;
}

/* Left: images */
.post-images {
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 14px;
  background: #fff;
}

.sub-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

/* 画像はすべて正方形 */
.sub-image img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 12px;
  background: #f2f2f2;
}

/* 画像カード */
.sub-image {
  position: relative;
}

.sub-image .js-like-btn {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  padding: 6px 10px;
}

/* Right: info */
.post-info {
  position: sticky;
  top: 16px;
  border: 1px solid #eee;
  border-radius: 16px;
  padding: 16px;
  background: #fff;
}

.post-title {
  margin: 0 0 10px;
  font-size: 20px;
  line-height: 1.4;
}

.post-like {
  margin-bottom: 10px;
}

.post-description {
  margin: 0;
  color: #444;
  font-size: 14px;
  line-height: 1.7;
}

/* Comments */
.post-info h3 {
  margin: 18px 0 10px;
  font-size: 16px;
}

.comment {
  border-top: 1px solid #f0f0f0;
  padding-top: 10px;
  margin-top: 10px;
}

.comment strong {
  font-size: 13px;
  color: #222;
}

.comment p {
  margin: 6px 0 0;
  font-size: 14px;
  color: #444;
  line-height: 1.6;
}

.empty {
  color: #777;
  font-size: 14px;
}

/* Comment form */
.comment-form {
  margin-top: 14px;
}

.comment-form textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  outline: none;
  resize: vertical;
}

.comment-form textarea:focus {
  border-color: #bbb;
}

.comment-form button {
  margin-top: 8px;
  border: none;
  background: #111;
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
}

.comment-form button:hover {
  opacity: 0.92;
}

/* Responsive */
@media (max-width: 900px) {
  .post-detail {
    grid-template-columns: 1fr;
  }
  .post-info {
    position: static;
  }
  .sub-images {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 480px) {
  .sub-images {
    grid-template-columns: 1fr;
  }
}



/* ===== 投稿者 ===== */
.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #eee;
}

/* 画像未設定時 */
.author-avatar.placeholder {
  background: #eee;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 18px;
}

.author-name {
  font-weight: 600;
  font-size: 15px;
  color: #222;
}

.author-name:hover {
  text-decoration: underline;
}


.message-btn {
  margin-top: 4px;
  display: inline-block;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #ddd;
  color: #333;
  background: #fafafa;
}

.message-btn:hover {
  background: #f0f0f0;
}


/* 投稿者全体 */
.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 名前 + ボタンのコンテナ */
.author-meta {
  display: flex;
  align-items: center;
  width: 100%;           /* ← 横幅をフルに */
}

/* ユーザー名は左 */
.author-name {
  font-weight: 600;
  font-size: 15px;
}

/* メッセージボタンを右寄せ */
.message-btn {
  margin-left: auto;    /* ← これが核心 */
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fafafa;
  color: #333;
}

.message-btn:hover {
  background: #f0f0f0;
}



/* 投稿者アクション */
.author-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.edit-btn {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
}

.edit-btn:hover {
  background: #f2f2f2;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.author-meta {
  flex: 1; /* ← 左を占有 */
}

.author-actions {
  display: flex;
  gap: 8px;
}

/* 編集ボタン */
.edit-btn {
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 999px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
}

.edit-btn:hover {
  background: #f2f2f2;
}
