import { styled } from 'styled-components';
import { deviceSize } from '../../common/deviceSizes';

export const StyledProjects = styled.section`
  h3.sub-header {
    letter-spacing: 0.1em;
    color: ${({ theme }) => theme.colors['200']};
    margin-top: 3em;
  }

  .showcase-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;
  }

  .other-projects-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2em;

    .project-card:first-child {
      grid-column: 1 / 2 span;
    }
  }

  .project-card {
    display: flex;
    flex-direction: column;
    gap: 1em;

    background-color: ${({ theme }) => theme.colors['600']};
    padding: 0.75em;
    border-radius: 1em;

    .project-thumbnail img,
    .project-badges img {
      border-radius: 1em;
    }

    h2,
    h3 {
      margin: 0;
    }
  }

  .project-content {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .project-thumbnail img {
    max-width: 100%;
  }

  hr {
    width: 100%;
    border: 1px solid #aaa;
    margin: 0.5em 0;
  }

  .project-title {
    display: flex;
    gap: 0.4em;

    h2 {
      display: inline;
    }

    img.project-title-icon {
      width: 2em;
      height: 2em;
    }
  }

  h3.project-subtitle {
    font-size: 1.1em;
    color: ${({ theme }) => theme.colors['200']};
  }

  .project-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5em;

    margin: 0.5em 0;

    img {
      max-width: 120px;
    }
  }

  .project-desc {
    color: ${({ theme }) => theme.colors['300']};
    text-align: justify;

    height: 100%;
  }

  .project-actions {
    display: flex;
    gap: 1em;
    align-self: flex-end;
    margin-top: 2em;

    a {
      padding: 0.25em;
      font-weight: bold;

      svg {
        font-size: 1.5em;
        vertical-align: bottom;
        margin-right: 0.5em;
      }
    }
  }

  @media screen and (max-width: ${deviceSize.md}) {
    .showcase-container {
      grid-template-columns: 1fr;
    }

    .other-projects-container {
      grid-template-columns: 1fr;

      .project-card:first-child {
        grid-column: 1;
      }
    }
  }
`;
