:root {
  --post-surface: #ffffff;
  --post-border: rgba(15, 23, 42, 0.08);
  --post-muted: #64748b;
  --post-heading: #0f172a;
}

.blog-post-header {
  padding: 4.5rem 0 5rem;
  background: linear-gradient(180deg, rgba(26, 54, 93, 0.06), rgba(255, 255, 255, 0));
}

.blog-post {
  background: var(--post-surface);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
  padding: 2.5rem 3rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.post-header .category {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(26, 54, 93, 0.1);
  color: var(--primary-color, #1a365d);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.post-header h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.2;
  margin: 0.75rem 0 1rem;
  color: var(--post-heading);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem 1.5rem;
  color: var(--post-muted);
  font-size: 0.95rem;
}

.post-excerpt {
  background: #f8fafc;
  border-left: 4px solid var(--primary-color, #1a365d);
  padding: 1rem 1.25rem;
  border-radius: 12px;
  color: #334155;
  line-height: 1.7;
}

.excerpt-label {
  font-weight: 700;
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--post-heading);
}

.post-excerpt p {
  margin: 0;
}

.featured-image-wrap {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--post-border);
  background: #f1f5f9;
}

.featured-image {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  display: block;
}

.inline-image-wrap {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--post-border);
  background: #f1f5f9;
  margin: 2rem 0;
}

.inline-image {
  width: 100%;
  max-height: 500px;
  object-fit: contain;
  display: block;
  padding: 1rem;
}

.post-body {
  color: #334155;
  font-size: 1.05rem;
  line-height: 1.8;
}

.post-body p {
  margin: 0 0 1.5rem 0;
  text-align: justify;
  text-align-last: left;
  color: #334155;
  line-height: 1.8;
  word-wrap: break-word;
  hyphens: auto;
}

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

.post-body p br {
  content: '';
  display: block;
  margin: 0.5rem 0;
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
  margin: 1.5rem 0;
}

.post-body h2,
.post-body h3,
.post-body h4 {
  color: var(--post-heading);
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.post-body h1 {
  font-size: 2rem;
  margin: 2.5rem 0 1.5rem;
}

.post-body h2 {
  font-size: 1.75rem;
}

.post-body h3 {
  font-size: 1.4rem;
}

.post-body h4 {
  font-size: 1.2rem;
}

/* Bold and Italic Styling */
.post-body strong,
.post-body b {
  font-weight: 700;
  color: #1e293b;
}

.post-body em,
.post-body i {
  font-style: italic;
  color: #475569;
}

.post-body u {
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

.post-body s,
.post-body strike {
  text-decoration: line-through;
  color: #94a3b8;
}

/* Lists Styling */
.post-body ul,
.post-body ol {
  margin: 1.5rem 0 1.5rem 2rem;
  line-height: 1.8;
}

.post-body ul {
  list-style-type: disc;
}

.post-body ul ul {
  list-style-type: circle;
  margin: 0.5rem 0 0.5rem 2rem;
}

.post-body ul ul ul {
  list-style-type: square;
}

.post-body ol {
  list-style-type: decimal;
}

.post-body ol ol {
  list-style-type: lower-alpha;
  margin: 0.5rem 0 0.5rem 2rem;
}

.post-body li {
  margin: 0.5rem 0;
  color: #334155;
}

.post-body li p {
  margin: 0.5rem 0;
  text-align: left;
}

/* Blockquote Styling */
.post-body blockquote {
  border-left: 4px solid #0f172a;
  padding-left: 1rem;
  margin: 1.5rem 0;
  padding: 1rem;
  padding-left: 1.5rem;
  background: rgba(15, 23, 42, 0.05);
  border-radius: 4px;
  font-style: italic;
  color: #475569;
  font-size: 1.05rem;
}

/* Code Styling */
.post-body code {
  background: #f1f5f9;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: #c41e3a;
}

.post-body pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 1.5rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  color: #e2e8f0;
  padding: 0;
}

.post-footer {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--post-border);
}

.post-tags .tag {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: rgba(217, 119, 6, 0.12);
  color: var(--secondary-color, #d97706);
  font-weight: 600;
  font-size: 0.85rem;
}

.post-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.1rem;
  background: #f8fafc;
  border: 1px solid var(--post-border);
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.92rem;
}

.action-btn:hover {
  background: rgba(26, 54, 93, 0.08);
  border-color: rgba(26, 54, 93, 0.4);
  color: var(--primary-color, #1a365d);
}

.comments-section {
  margin-top: 2.5rem;
  padding-top: 2.5rem;
  border-top: 1px solid var(--post-border);
}

.comments-section h3 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.add-comment-box {
  background: #f8fafc;
  padding: 1.75rem;
  border-radius: 16px;
  border: 1px solid var(--post-border);
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-control {
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--post-border);
  border-radius: 10px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
}

.form-control:focus {
  outline: none;
  border-color: rgba(26, 54, 93, 0.5);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 120px;
}

.submit-btn {
  background: var(--primary-color, #1a365d);
  color: #fff;
  padding: 0.75rem 1.4rem;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  width: fit-content;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(26, 54, 93, 0.18);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-top: 2rem;
}

.comment-item {
  background: #fff;
  padding: 1.5rem;
  border-radius: 14px;
  border: 1px solid var(--post-border);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.comment-author {
  color: var(--post-heading);
  font-weight: 600;
}

.comment-date {
  color: var(--post-muted);
  font-size: 0.85rem;
}

.comment-content {
  color: #475569;
  line-height: 1.7;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.like-comment-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  background: #f8fafc;
  border: 1px solid var(--post-border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.like-comment-btn:hover {
  color: #e11d48;
  border-color: rgba(225, 29, 72, 0.4);
  background: rgba(225, 29, 72, 0.08);
}

.no-comments {
  text-align: center;
  color: var(--post-muted);
  padding: 2rem;
  font-style: italic;
}

.related-posts {
  margin-top: 3rem;
}

.related-posts h3 {
  margin-bottom: 1.5rem;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.related-card {
  background: #fff;
  border-radius: 16px;
  border: 1px solid var(--post-border);
  overflow: hidden;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.related-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 12px;
}

.related-card h4 {
  margin: 0;
  font-size: 1.05rem;
}

.related-card a {
  color: inherit;
  text-decoration: none;
}

.related-card .read-more {
  color: var(--primary-color, #1a365d);
  font-weight: 600;
}

@media (max-width: 992px) {
  .blog-post {
    padding: 2.2rem;
  }
}

@media (max-width: 768px) {
  .blog-post-header {
    padding: 3.5rem 0 4rem;
  }

  .blog-post {
    padding: 1.8rem;
  }

  .form-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 576px) {
  .blog-post {
    padding: 1.5rem;
  }

  .featured-image {
    max-height: 320px;
  }
}
