{% extends "base.html" %}

{% block title %}{{ article.title }} — {{ collection_title }}{% endblock %}

{% block seo %}
  <meta name="description" content="{{ seo.description }}">
  <link rel="canonical" href="{{ seo.canonical_url }}">
  <meta property="og:type" content="article">
  <meta property="og:title" content="{{ seo.og_title }}">
  <meta property="og:description" content="{{ seo.description }}">
  <meta property="og:url" content="{{ seo.canonical_url }}">
  <meta property="og:site_name" content="{{ collection_title }}">
  {% if seo.og_image %}<meta property="og:image" content="{{ seo.og_image }}">{% endif %}
  <meta property="article:published_time" content="{{ article.published_at }}">
  <link rel="alternate" type="application/atom+xml" title="{{ collection_title }} — RSS" href="{{ base_url }}/feed.xml">
  <script type="application/ld+json">{{ seo.json_ld | safe }}</script>
{% endblock %}

{% block extra_css %}
.journal-article {
  max-width: var(--layout-max-width);
  margin: 3rem auto;
  padding: 0 1rem;
}
.journal-article__title {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  line-height: 1.3;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
  text-align: center;
}
.journal-article__meta {
  color: var(--color-muted);
  font-size: 0.85rem;
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--color-muted);
}
.journal-article__content {
  font-size: 1rem;
  line-height: 1.8;
  text-align: justify;
  hyphens: auto;
}
.journal-article__content p { margin-bottom: 1em; text-indent: 1.5em; }
.journal-article__content p:first-child { text-indent: 0; }
.journal-article__back {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.85rem;
}
{% endblock %}

{% block content %}
<article class="journal-article">
  {% if article.og_image %}<div style="text-align:center;margin-bottom:1.5rem;"><img src="/cas/{{ article.og_image }}" alt="{{ article.title }}" style="max-width:100%;max-height:400px;object-fit:cover;"></div>{% endif %}
  <h1 class="journal-article__title">{{ article.title }}</h1>
  {% if article.subtitle %}<p style="font-size:1.1rem;color:var(--color-muted);text-align:center;margin-bottom:0.5rem;font-family:var(--font-heading);">{{ article.subtitle }}</p>{% endif %}
  <div class="journal-article__meta">Publisert {{ article.published_at_short }}</div>
  <div class="journal-article__content">
    {{ article.content | safe }}
  </div>
  <a class="journal-article__back" href="{{ base_url }}">&larr; Tilbake til innholdsfortegnelse</a>
</article>
{% endblock %}
