<% var detailAllowed = typeof successStoryDetailAllowed !== 'undefined' ? successStoryDetailAllowed : true; %>
<article class="success-story-card<%= detailAllowed ? '' : ' success-story-card--locked' %>">
  <% if (detailAllowed) { %>
  <a class="success-story-link" href="/ai-cases/<%= story.slug %>">
    <div class="success-thumb" aria-hidden="true">
      <span class="success-thumb-icon">✦</span>
      <span class="success-thumb-kicker"><%= story.department || "사내 사례" %></span>
    </div>
    <div class="success-badge"><%= story.department || "사내" %> · <%= story.author || "" %></div>
    <h3><%= story.title %></h3>
    <p class="success-excerpt"><%= story.excerpt || "" %></p>
    <div class="tag-row">
      <% (story.tags || []).forEach((oneTag) => { %>
      <span class="tag-chip">#<%= oneTag %></span>
      <% }) %>
    </div>
    <small class="success-meta">
      <% if (story.publishedAt) { %><%= story.publishedAt %><% } %>
    </small>
  </a>
  <% } else { %>
  <div
    class="success-story-link"
    title="로그인 후 이용 가능합니다."
  >
    <div class="success-thumb" aria-hidden="true">
      <span class="success-thumb-icon">✦</span>
      <span class="success-thumb-kicker"><%= story.department || "사내 사례" %></span>
    </div>
    <div class="success-badge"><%= story.department || "사내" %> · <%= story.author || "" %></div>
    <h3><%= story.title %></h3>
    <p class="success-excerpt"><%= story.excerpt || "" %></p>
    <div class="tag-row">
      <% (story.tags || []).forEach((oneTag) => { %>
      <span class="tag-chip">#<%= oneTag %></span>
      <% }) %>
    </div>
    <small class="success-meta">
      <% if (story.publishedAt) { %><%= story.publishedAt %><% } %>
    </small>
  </div>
  <% } %>
</article>
