<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Blog Review Template</title>
    <style>
      body {
        min-height: 100vh;
        background: #f3f4f6;
        padding: 2rem 0;
        font-family: "Segoe UI", Arial, sans-serif;
      }
      .container {
        max-width: 800px;
        margin: 0 auto;
        padding: 1.5rem;
        background: #fff;
        border-radius: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        border: 1px solid #e5e7eb;
      }
      .header {
        text-align: center;
        margin-bottom: 1.5rem;
      }
      .header h1 {
        font-size: 2rem;
        font-weight: bold;
        color: #111827;
        margin-bottom: 0.25rem;
      }
      .header p {
        color: #6b7280;
        font-size: 1rem;
      }
      .badge {
        display: inline-block;
        padding: 0.5rem 1.5rem;
        border-radius: 9999px;
        font-weight: 600;
        font-size: 1.125rem;
        border: 1px solid;
        margin: 0 auto 1.5rem auto;
      }
      .badge.approved {
        background: #d1fae5;
        color: #065f46;
        border-color: #6ee7b7;
      }
      .badge.rejected {
        background: #fee2e2;
        color: #991b1b;
        border-color: #fca5a5;
      }
      .section {
        margin-bottom: 1.5rem;
        background: #fff;
        border-radius: 0.75rem;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
        border: 1px solid #e5e7eb;
      }
      .section-header {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid #e5e7eb;
        font-size: 1.125rem;
        font-weight: bold;
        color: #1f2937;
      }
      .section-content {
        padding: 1.5rem;
      }
      .grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
      }
      .grid-item h3 {
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.25rem;
        font-size: 1rem;
      }
      .grid-item p {
        color: #111827;
        font-size: 1rem;
      }
      .image-block {
        margin-top: 1rem;
      }
      .image-block h3 {
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.5rem;
      }
      .image-block img {
        width: 100%;
        height: 16rem;
        object-fit: cover;
        border-radius: 0.5rem;
        border: 1px solid #e5e7eb;
      }
      .content-preview {
        margin-top: 1rem;
      }
      .content-preview h3 {
        font-weight: 600;
        color: #374151;
        margin-bottom: 0.5rem;
      }
      .content-preview-box {
        background: #f9fafb;
        padding: 1rem;
        border-radius: 0.5rem;
        border: 1px solid #e5e7eb;
        color: #1f2937;
        font-size: 1rem;
      }
      .status-approved {
        border: 1px solid #bbf7d0;
        background: #f0fdf4;
        border-radius: 0.75rem;
        padding: 1rem 1.5rem;
        color: #065f46;
        font-weight: 500;
        margin-bottom: 1.5rem;
      }
      .rejection-section {
        border: 1px solid #fecaca;
        background: #fff;
        border-radius: 0.75rem;
        margin-bottom: 1.5rem;
      }
      .rejection-section .section-header {
        color: #b91c1c;
      }
      .rejection-list {
        list-style: none;
        padding-left: 0;
        margin: 0;
      }
      .rejection-list li {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        color: #b91c1c;
        margin-bottom: 0.5rem;
      }
      .rejection-list li span:first-child {
        color: #ef4444;
        font-size: 1.25rem;
        line-height: 1;
      }
      .improvement-section {
        border: 1px solid #fed7aa;
        background: #fff;
        border-radius: 0.75rem;
        margin-bottom: 1.5rem;
      }
      .improvement-section .section-header {
        color: #c2410c;
      }
      .improvement-list {
        list-style: none;
        padding-left: 0;
        margin: 0;
      }
      .improvement-list li {
        display: flex;
        align-items: flex-start;
        gap: 0.5rem;
        color: #c2410c;
        margin-bottom: 0.5rem;
      }
      .improvement-list li span:first-child {
        color: #fb923c;
        font-size: 1.25rem;
        line-height: 1;
      }
      .review-summary {
        background: #f9fafb;
        border-radius: 0.75rem;
        border: 1px solid #e5e7eb;
        text-align: center;
        padding: 1.5rem;
        color: #6b7280;
        font-size: 0.95rem;
      }
      .review-summary .status {
        font-weight: 600;
      }
      .review-summary .status.approved {
        color: #059669;
      }
      .review-summary .status.rejected {
        color: #dc2626;
      }
      @media (max-width: 700px) {
        .container {
          padding: 0.5rem;
        }
        .section-content {
          padding: 1rem;
        }
        .section-header {
          padding: 0.75rem 1rem;
        }
        .grid {
          grid-template-columns: 1fr;
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <!-- Header -->
      <div class="header">
        <h1>Shalom Fiscal Blog & Article Posting</h1>
        <p>For Development & Project Managers</p>
      </div>

      <!-- Status Badge -->
      <div style="text-align: center">
        <% if (status === 'Approved') { %>
        <span class="badge approved">✅ Approved</span>
        <% } else { %>
        <span class="badge rejected">❌ Rejected</span>
        <% } %>
      </div>

      <!-- Blog Information -->
      <div class="section">
        <div class="section-header">Blog Details</div>
        <div class="section-content">
          <div class="grid">
            <div class="grid-item">
              <h3>Title</h3>
              <p><%= blog.title %></p>
            </div>
            <div class="grid-item">
              <h3>Author</h3>
              <p><%= blog.author %></p>
            </div>
            <div class="grid-item">
              <h3>Submitted Date</h3>
              <p><%= blog.submittedDate %></p>
            </div>
            <div class="grid-item">
              <h3>Reviewed By</h3>
              <p><%= reviewedBy %></p>
            </div>
          </div>

          <!-- Blog Image -->
          <% if (blog.image) { %>
          <div class="image-block">
            <h3>Featured Image</h3>
            <img src="<%= blog.image %>" alt="Blog featured image" />
          </div>
          <% } %>

          <!-- Blog Content Preview -->
          <div class="content-preview">
            <h3>Content Preview</h3>
            <div class="content-preview-box">
              <%= blog.content.length > 300 ? blog.content.substring(0, 300) +
              '...' : blog.content %>
            </div>
          </div>
        </div>
      </div>

      <!-- Review Status Section -->
      <% if (status === 'Approved') { %>
      <div class="status-approved">
        ✅ Blog has been approved and is ready for publication!
      </div>
      <% } else { %>
      <!-- Rejection Reasons -->
      <% if (rejectionReasons && rejectionReasons.length > 0) { %>
      <div class="rejection-section">
        <div class="section-header">❌ Reasons for Rejection</div>
        <div class="section-content">
          <ul class="rejection-list">
            <% rejectionReasons.forEach(function(reason) { %>
            <li>
              <span>•</span>
              <span><%= reason %></span>
            </li>
            <% }); %>
          </ul>
        </div>
      </div>
      <% } %>

      <!-- Suggested Improvements -->
      <% if (improvements && improvements.length > 0) { %>
      <div class="improvement-section">
        <div class="section-header">Suggested Improvements</div>
        <div class="section-content">
          <ul class="improvement-list">
            <% improvements.forEach(function(improvement) { %>
            <li>
              <span>•</span>
              <span><%= improvement %></span>
            </li>
            <% }); %>
          </ul>
        </div>
      </div>
      <% } %> <% } %>

      <!-- Review Summary -->
      <div class="review-summary">
        <div>Review completed on <%= reviewDate %></div>
        <div>
          Status:
          <span
            class="status <%= status === 'Approved' ? 'approved' : 'rejected' %>"
          >
            <%= status %>
          </span>
        </div>
      </div>
    </div>
  </body>
</html>
