{{ $featured_image := .Param "featured_image"}}
{{ $logo_image := .Param "logo_image"}}
{{ if $featured_image }}
  {{ $featured_image := (trim $featured_image "/") | absURL }}
  {{ $logo_image := (trim $logo_image "/") }}
  <header class="cover bg-top" style="background-image: url('{{ $featured_image }}');">
    {{ if $logo_image }}
    <div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }} main-logo" style="background-image: url('{{ $logo_image }}');">
    {{ else }}
    <div class="{{ .Site.Params.cover_dimming_class | default "bg-black-60" }}">
    {{ end }}
      {{ partial "site-navigation.html" .}}
      <div class="pv6 ph3 ph4-ns"></div>
      <h1 class="tc-l f2 f-subheadline-l fw2 pl2 white-90 mb0 lh-title">
        {{ .Title | default .Site.Title }}
      </h1>
      {{ with .Params.description }}
        <h2 class="fw1 f5 f3-l white-80 measure-wide-l center mt3">
          {{ . }}
        </h2>
      {{ end }}
      <div class="pv3 ph3 ph4-ns"></div>
      </div>
    </div>
  </header>
{{ else }}
  <header>
    <div class="pb3-m pb6-l {{ .Site.Params.background_color_class | default "bg-black" }}">
      {{ partial "site-navigation.html" . }}
      <div class="pv3 ph3 ph4-ns">
        <h1 class="f2 f-subheadline-l fw2 light-silver mb0 lh-title">
          {{ .Title | default .Site.Title }}
        </h1>
        {{ with .Params.description }}
          <h2 class="fw1 f5 f3-l white-80 measure-wide-l center lh-copy mt3 mb4">
            {{ . }}
          </h2>
        {{ end }}
      </div>
    </div>
  </header>
{{ end }}
