/* Blog Detail Page — modernized */
:root {
  --blog-spacing-xs: 8px;
  --blog-spacing-sm: 12px;
  --blog-spacing-md: 20px;
  --blog-spacing-lg: 30px;
  --blog-spacing-xl: 40px;

  --blog-font-xs: 13px;
  --blog-font-sm: 14px;
  --blog-font-base: 16px;
  --blog-font-lg: 18px;
  --blog-font-xl: 24px;
  --blog-font-2xl: 32px;

  --blog-line-height-tight: 1.4;
  --blog-line-height-normal: 1.6;
  --blog-line-height-relaxed: 1.8;

  --blog-green-primary: #0ea5e9;
  --blog-green-dark: #0369a1;
  --blog-green-light: #38bdf8;
}

.post-detail-page {
  background: #ffffff;
  padding-bottom: 60px;
}

/* Hero cover */
.post-cover-hero {
  position: relative;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  height: 360px;
  overflow: hidden;
  border-radius: 0 0 24px 24px;
}

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

.post-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.1) 40%, transparent 100%);
  pointer-events: none;
}

/* Container */
.post-detail-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 20px 0;
}

/* Card */
.post-detail-container > .post-detail {
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
}

.post-detail-page .post-detail {
  background: #ffffff;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  border-top: none;
}

.pending-verification-label {
  display: inline-block;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 16px;
}

/* Title */
.post-detail-title {
  margin: 0 0 20px;
  color: #111827;
  font-size: 36px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.5px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Metadata */
.post-meta {
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding-bottom: 18px;
  border-bottom: 1px solid #f3f4f6;
  flex-wrap: wrap;
}

.post-meta-author,
.post-meta-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.post-meta-author {
  color: #111827;
  font-weight: 600;
}

.post-meta-author .user-picture {
  box-shadow: none;
}

.post-meta-author .user-profile-link {
  color: #111827;
  text-decoration: none;
  font-weight: 600;
}

.post-meta-author .user-profile-link:hover {
  color: #0284c7;
  text-decoration: none;
}

.post-meta-date {
  color: #6b7280;
  font-weight: 500;
}

.post-meta-date svg {
  color: #0ea5e9;
}

/* Rating */
.post-detail-page .post-detail-rating {
  margin: 18px 0 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.post-detail-page .post-detail-rating .star-wrap {
  font-size: 18px;
  color: #e5e7eb;
}

.post-detail-page .post-detail-rating .star-wrap::after {
  color: #fbbf24;
}

.post-detail-page .post-detail-rating .rating-value {
  font-size: 14px;
  color: #6b7280;
  font-weight: 500;
}

.post-detail-page .post-detail-rating .no-rating {
  font-size: 14px;
  color: #9ca3af;
  font-style: italic;
}

/* Article body */
.post-content {
  line-height: var(--blog-line-height-relaxed);
  font-size: 17px;
  color: #374151;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.post-content p {
  margin: 0 0 1.4em;
}

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

.post-content h2 {
  margin: 2em 0 0.6em;
  color: #111827;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-content h3 {
  margin: 1.6em 0 0.6em;
  color: #111827;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-content h4 {
  margin: 1.4em 0 0.4em;
  color: #111827;
  font-size: 1.125rem;
  font-weight: 700;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1.4em;
  padding-left: 1.4em;
}

.post-content li {
  margin-bottom: 0.4em;
}

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

.post-content a {
  color: #0284c7;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s;
}

.post-content a:hover {
  color: #0369a1;
}

.post-content blockquote {
  margin: 1.6em 0;
  padding: 16px 22px;
  border-left: 4px solid #7dd3fc;
  background: #f0f9ff;
  border-radius: 0 12px 12px 0;
  color: #4b5563;
  font-style: italic;
}

.post-content code {
  background: #f3f4f6;
  color: #b91c1c;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #111827;
  color: #f9fafb;
  padding: 18px;
  border-radius: 12px;
  overflow-x: auto;
  margin: 1.4em 0;
  font-size: 14px;
}

.post-content pre code {
  background: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 16px;
  display: block;
  margin: 1.6em auto;
}

.post-content .embed-container,
.post-content .social-embed-wrapper {
  margin: 1.6em auto;
  max-width: 100%;
  overflow: hidden;
  border-radius: 12px;
}

.post-content .embed-container iframe,
.post-content .social-embed-wrapper iframe {
  display: block;
  width: 100%;
  border: 0;
}

.post-content .instagram-media {
  max-width: 540px !important;
  width: calc(100% - 2px) !important;
  margin: 1.4em auto !important;
}

.post-content .twitter-tweet {
  margin: 1.4em auto !important;
}

/* Action bar (Share + Save) */
.post-detail-page .post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid #f3f4f6;
  border-bottom: 1px solid #f3f4f6;
  margin: 32px 0;
}

/* Shared action button style — Share + Save share the same shape */
.post-share-btn,
.post-detail-page .post-actions .btn-favorite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  min-width: 120px;
  padding: 0 18px;
  background: #ffffff;
  color: #4b5563;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s, background 0.2s, color 0.2s, transform 0.1s;
}

.post-share-btn:hover,
.post-detail-page .post-actions .btn-favorite:hover {
  border-color: #d1d5db;
  background: #f9fafb;
  color: #111827;
  box-shadow: none;
  transform: none;
}

.post-detail-page .post-actions .btn-favorite,
.post-detail-page .post-actions .btn-favorite.active,
.post-detail-page .post-actions .btn-favorite.active:hover {
  box-shadow: none;
  transform: none;
}

.post-share-btn:active {
  transform: scale(0.98);
}

.post-share-btn.is-copied {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0369a1;
}

.post-detail-page .post-actions .btn-favorite-wrapper {
  display: contents;
}

.post-detail-page .post-actions .btn-favorite .favorite-icon {
  display: inline-flex;
  align-items: center;
  color: #6b7280;
  transition: color 0.2s;
}

.post-detail-page .post-actions .btn-favorite .favorite-icon svg {
  width: 16px;
  height: 16px;
}

.post-detail-page .post-actions .btn-favorite:hover .favorite-icon,
.post-detail-page .post-actions .btn-favorite.active .favorite-icon {
  color: #e53935;
}

/* Owner edit/delete row */
.post-owner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 32px;
}

.post-owner-actions .edit-button,
.post-owner-actions .delete-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0 16px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 600;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.post-owner-actions .edit-button {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.post-owner-actions .edit-button:hover {
  background: #e0f2fe;
}

.post-owner-actions .delete-button {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.post-owner-actions .delete-button:hover {
  background: #fee2e2;
  color: #991b1b;
}

.post-owner-actions form {
  margin: 0;
  display: contents;
}

/* Comment hint */

/* Hide FAB on mobile for blog detail */
@media (max-width: 768px) {
  body.blog-detail-body .fab-main {
    display: none;
  }

  .post-cover-hero {
    height: 240px;
    border-radius: 0 0 18px 18px;
  }

  .post-detail-container {
    padding: 18px 14px 0;
  }

  .post-detail-container > .post-detail {
    padding: 24px 20px;
    border-radius: 14px;
  }

  .post-detail-page .post-detail {
    padding: 0;
    border-radius: 0;
  }

  .post-detail-title {
    font-size: 28px;
  }

  .post-content {
    font-size: 16px;
  }

  .post-content h2 {
    font-size: 1.35rem;
  }

  .post-content h3 {
    font-size: 1.15rem;
  }

  .post-meta {
    gap: 14px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .post-detail-container > .post-detail {
    padding: 20px 16px;
    border-radius: 12px;
  }

  .post-detail-page .post-detail {
    padding: 0;
    border-radius: 0;
  }

  .post-cover-hero {
    height: 200px;
    border-radius: 0 0 14px 14px;
  }

  .post-detail-title {
    font-size: 24px;
  }
}
