/* public/css/posts-show.css */

/* === Заголовок поста === */
.post-header {
  margin-bottom: 1.5rem;
}

.post-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.post-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.post-badge.blog {
  background: #f3e8ff;
  color: #7c3aed;
}

.post-badge.forum {
  background: #dbeafe;
  color: #2563eb;
}

.post-badge.category {
  background: #f1f5f9;
  color: #64748b;
}

.post-badge.pinned {
  background: #fef3c7;
  color: #92400e;
}

.post-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #2d3748;
  margin: 0.5rem 0;
  line-height: 1.3;
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  font-size: 0.9rem;
  color: #64748b;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.post-author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a7c59, #3a6347);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* === Контент поста === */
.post-content {
  background: #ffffff;
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  line-height: 1.8;
  color: #374151;
  font-size: 1.05rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content p:last-child {
  margin-bottom: 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
}

.post-content a {
  color: #4a7c59;
  text-decoration: none;
  border-bottom: 1px dashed #4a7c59;
  transition: all 0.2s ease;
}

.post-content a:hover {
  color: #3a6347;
  border-bottom-style: solid;
}

/* === Действия с постом === */
.post-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-wrap: wrap;
  gap: 1rem;
}

.post-stats {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.post-stat {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: #64748b;
  font-size: 0.9rem;
}

.post-stat button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  color: inherit;
  font-size: inherit;
  transition: color 0.2s ease;
}

.post-stat button:hover {
  color: #4a7c59;
}

.post-stat svg {
  width: 18px;
  height: 18px;
  color: currentColor;
}

.post-editor-links {
  display: flex;
  gap: 1rem;
}

.post-editor-links a {
  color: #4a7c59;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.post-editor-links a:hover {
  color: #3a6347;
  text-decoration: underline;
}

.post-editor-links a.delete {
  color: #dc2626;
}

.post-editor-links a.delete:hover {
  color: #b91c1c;
}

/* === Комментарии === */
.comments-section {
  margin-top: 2rem;
}

.comments-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}

.comment-form {
  background: #ffffff;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.comment-form textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 0.75rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.comment-form textarea:focus {
  outline: none;
  border-color: #4a7c59;
  box-shadow: 0 0 0 3px rgba(74, 124, 89, 0.1);
}

.comment-form .btn-submit {
  background: linear-gradient(135deg, #4a7c59, #3a6347);
  color: #ffffff;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 50px;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.comment-form .btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74, 124, 89, 0.3);
}

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.comment-item {
  background: #ffffff;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  border-left: 3px solid #4a7c59;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  transition: box-shadow 0.2s ease;
}

.comment-item:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.comment-author {
  font-weight: 500;
  color: #2d3748;
}

.comment-date {
  color: #94a3b8;
}

.comment-text {
  color: #64748b;
  line-height: 1.6;
  font-size: 0.95rem;
  margin: 0;
}

.empty-comments {
  text-align: center;
  padding: 2rem;
  color: #64748b;
  background: #f8f5f0;
  border-radius: 12px;
  font-size: 0.95rem;
}

/* === Изображения поста === */
.post-featured-image {
  margin: 1rem 0 1.5rem;
  border-radius: 12px;
  overflow: hidden;
}

.post-featured-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  display: block;
}

.post-images-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.post-image-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  transition: transform 0.2s ease;
}

.post-image-item:hover {
  transform: scale(1.02);
}

.post-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-image-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  color: white;
  padding: 2rem 0.75rem 0.5rem;
  font-size: 0.8rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.post-image-item:hover .post-image-caption {
  opacity: 1;
}

/* === Lightbox === */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
}

.lightbox.hidden {
  display: none;
}

.lightbox img {
  max-width: 90%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
  left: 1rem;
}

.lightbox-next {
  right: 1rem;
}

.lightbox-caption {
  color: white;
  text-align: center;
  margin-top: 1rem;
  padding: 0 2rem;
  max-width: 80%;
  font-size: 0.95rem;
}

/* === Адаптивность для поста === */
@media (max-width: 640px) {
  .post-title {
    font-size: 1.5rem;
  }

  .post-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .post-stats {
    width: 100%;
    justify-content: space-between;
  }

  .post-editor-links {
    width: 100%;
    justify-content: flex-end;
  }

  .post-content {
    padding: 1.5rem;
    font-size: 1rem;
  }
}
