import styled from 'styled-components';

const Headings = styled.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 80px 10px 40px;
  margin: auto;
  text-align: center;

  @media (min-width: ${props => props.theme.breakpoints.medium}px) {
    padding: 120px 0 80px;
  }

  h1 {
    font-size: ${props => props.theme.fontSizes.h2};
  }

  .headings-subtitle {
    margin: 0 auto 20px;
    max-width: 67ch;
    font-family: ${props => props.theme.fonts.text};
    font-size: ${props => props.theme.fontSizes.paragraph};
    font-weight: 400;
    line-height: 1.5;

    & + .headings-subtitle {
      margin-top: 30px;
    }
  }

  ${props =>
    props.textLeft &&
    `
    align-items: flex-start;
    text-align: left;

    .headings-subtitle {
      margin-left: 0;
    }
  `};
`;

export default Headings;
