.posts-page {
  max-width: 1100px;
  margin: auto;
  padding: 1rem;
}
.posts-header {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 1rem;
}
.add-post {
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.8rem;
  border: 1px solid #ddd;
  border-radius: 20px;
  color: #333;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.post-card {
  text-decoration: none;
  color: inherit;
}
.post-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 8px;
}
.post-card h3 {
  font-size: 0.95rem;
  margin: 0.4rem 0;
}
.post-date {
  font-size: 0.75rem;
  color: #777;
}
.empty-posts {
  text-align: center;
  color: #888;
  padding: 3rem 0;
}
.new-post-page {
  max-width: 600px;
  margin: auto;
  padding: 1rem;
}
.new-post-page h1 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}
.post-form {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
label {
  font-size: 0.8rem;
  color: #555;
}
input,
textarea {
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
}
textarea {
  resize: vertical;
}
.submit-btn {
  margin-top: 0.5rem;
  padding: 0.5rem;
  border: none;
  border-radius: 20px;
  background: #111;
  color: #fff;
  cursor: pointer;
  font-size: 0.9rem;
}
.post-container {
  max-width: 800px;
  margin: auto;
  padding: 1rem;
  font-family: sans-serif;
  line-height: 1.6;
  color: #333;
}
.post-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  color: #222;
}
.post-meta {
  font-size: 0.9rem;
  color: #777;
  text-align: center;
  margin-bottom: 1rem;
}
.post-cover img {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  margin: 0 auto 1rem;
}
.post-content {
  font-size: 1rem;
  padding: 0 1rem;
  background: #f9f9f9;
  border-radius: 8px;
  line-height: 1.6;
  margin-bottom: 2rem;
}
.back-link {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background: #111;
  color: #fff;
  border-radius: 20px;
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.3s;
  margin: auto;
  display: block;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
.back-link:hover {
  background: #333;
}
/* ===== Comments ===== */

.comments{
  margin-top:3rem;
  padding-top:2rem;
  border-top:1px solid #eee;
}

.comments-title{
  font-size:1.4rem;
  margin-bottom:1rem;
}

.comment-form{
  display:flex;
  flex-direction:column;
  gap:.75rem;
  margin-bottom:1.5rem;
}

.comment-form textarea{
  resize:none;
  min-height:90px;
  padding:.75rem;
  border-radius:8px;
  border:1px solid #ddd;
  font-family:inherit;
}

.comment-form button{
  align-self:flex-end;
  padding:.4rem 1.2rem;
  border-radius:20px;
  border:none;
  background:#111;
  color:#fff;
  cursor:pointer;
}

.comment-login-hint{
  font-size:.9rem;
  color:#666;
}

.comment-login-hint a{
  color:#111;
  font-weight:500;
}

.no-comments{
  font-size:.9rem;
  color:#777;
}

.comment-list{
  display:flex;
  flex-direction:column;
  gap:1.25rem;
}

.comment{
  display:flex;
  gap:.75rem;
}

.comment-avatar img{
  width:38px;
  height:38px;
  border-radius:50%;
  object-fit:cover;
}

.comment-body{
  background:#f8f8f8;
  padding:.75rem;
  border-radius:10px;
  flex:1;
}

.comment-header{
  display:flex;
  gap:.5rem;
  font-size:.85rem;
  color:#555;
  margin-bottom:.3rem;
}

.comment-body p{
  font-size:.95rem;
  margin:0;
}

.comment.reply{
  margin-top:.5rem;
  margin-right:2rem;
  opacity:.95;
}
