---
import SmallTitle from '../components/titles/smallTitle.astro'
import Layout from './Layout.astro'
const { frontmatter } = Astro.props

const title = `${frontmatter.title} - Firq FGO Site`
const description = frontmatter.description
const options_date: Intl.DateTimeFormatOptions = {
  year: 'numeric',
  month: 'long',
  day: '2-digit',
}
const date = new Date(frontmatter.pubDate).toLocaleDateString(
  'en-GB',
  options_date
)
const subtext = `Written by ${frontmatter.author} • Published on ${date}`
---

<Layout title={title} currentpage="blog" descriptionOverride={description}>
  <SmallTitle maintext={frontmatter.title} subtext={subtext} fadeout={true} returnbutton={true} baseurl='blog'/>
  <article>
    <slot />
  </article>
</Layout>

<style>
  article {
    color: var(--c-primary-text);
    margin: 0.5rem 3rem 0.5rem 3rem;
    font-size: 1.1em;
    text-align: justify;
    padding-bottom: 5rem;
  }

  article :global(h2) {
    font-size: 32px;
    word-wrap: normal;
    color: var(--c-primary-text);
    max-width: max-content;
    padding-bottom: 0.5rem;
    text-align: left;
    line-height: 32px;
    &:after {
      content:' ';
      display: block;
      width: 75%;
      margin-top: 2px;
      border: 1px solid var(--c-accent-1);
      box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05);
    }
  }

  article :global(h3) {
    font-size: 24px;
    word-wrap: normal;
    color: var(--c-primary-text);
    max-width: max-content;
    padding-bottom: 0.5rem;
    text-align: left;
    line-height: 32px;
    &:after {
      content:' ';
      display: block;
      width: 75%;
      margin-top: 2px;
      border: 1px solid var(--c-accent-1);
      box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05);
    }
  }

  article :global(h4) {
    font-size: 18px;
    word-wrap: normal;
    color: var(--c-primary-text);
    max-width: max-content;
    margin-bottom: 0px;
    text-align: left;
    line-height: 32px;
    &:after {
      content:' ';
      display: block;
      width: 75%;
      margin-top: 1px;
      border: 1px solid var(--c-accent-1);
      box-shadow:inset 0 1px 1px rgba(0, 0, 0, .05);
    }
  }

  article :global(a) {
    color: #dcb7ff;
    text-decoration: none;
    font-style: italic;
  }

  article :global(.astro-code) {
    width: auto;
    padding: 1rem 1rem 1rem 2rem;
  }

  article :global(code) {
    font-weight: bold;
    color: orange;
  }

  @media (min-width: 1000px) {
    article {
      margin-left: 22.5%;
      margin-right: 22.5%;
    }
    h1 {
      margin-left: 20%;
      margin-right: 20%;
    }
    p {
      margin-left: 20%;
      margin-right: 20%;
    }
  }
</style>