.home-page {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  min-height: 100vh;

  .home-footer {
    grid-area: -2/1/-1/2;
  }
}

.home-main {
  padding: 1rem;
  display: grid;
  grid-template-rows: repeat(3, 1fr);
  grid-template-columns: 1fr;
  gap: 2rem;
  container-type: inline-size;
  max-width: 1240px;
}

.home-posts {
  padding: 1rem;
  display: grid;
  grid-template-rows: repeat(auto-fit, auto);
  grid-template-columns: 1fr;
  gap: 1rem;
  container-type: inline-size;
  max-width: 900px;

  h3 {
    font-size: 2rem;
    font-weight: 400;
    border-bottom: 2px solid var(--battleship-gray);
    width: fit-content;
  }
}

@media screen and (min-width: 768px) {
  .home-main {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(2, auto);
  }

  .home-block.blue {
    grid-area: 1/1/2/2;
  }

  .home-block.red {
    grid-area: 1/2/2/3;
  }

  .home-block.gray {
    grid-area: 2/1/3/3;
  }
}

@media screen and (min-width: 1024px) {
  .home-main {
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    margin: 0 auto;
    width: 100%;
  }

  .home-posts {
    width: 100%;
    margin: 0 auto;
  }

  .home-block.blue {
    grid-area: 1/1/2/2;
  }

  .home-block.red {
    grid-area: 1/2/2/3;
  }

  .home-block.gray {
    grid-area: 1/3/2/4;
  }
}
.home-block {
  /* display: contents; */
  container-type: inline-size;

  article {
    --accent-color: var(--jonquil);

    display: grid;
    height: 100%;
    grid-template-rows: 15rem 1rem auto;
    border-radius: 1rem;
    background: var(--accent-color);
    min-height: 10rem;
    overflow: hidden;

    &.yellow {
      --accent-color: var(--jonquil);
    }
    &.blue {
      --accent-color: var(--sky-blue);
    }
    &.red {
      --accent-color: var(--tomato);
    }
    &.gray {
      --accent-color: var(--battleship-gray);
    }
  }

  header {
    grid-area: 1/1/3/2;
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto;
    overflow: hidden;
    align-content: center;
    justify-content: center;
    border-radius: 1rem 1rem 0 0;
    position: relative;

    .image {
      --offset-vertical: -2rem;
      --offset-horizontal: 2rem;

      grid-area: 1/1/2/2;
      max-width: unset;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(
        calc(-50% + var(--offset-vertical)),
        calc(-50% + var(--offset-horizontal))
      );

      .blue & {
        --offset-vertical: -2rem;
        --offset-horizontal: 2rem;
      }
      .red & {
        --offset-vertical: -2.5rem;
        --offset-horizontal: 2.5rem;
      }
      .gray & {
        --offset-vertical: -3rem;
        --offset-horizontal: 4.5rem;
      }
    }

    .logo {
      width: 16.5rem;
      position: absolute;
      max-width: unset;
      z-index: 1;
      top: 50%;
      left: 50%;
      opacity: 0.15;
      mix-blend-mode: overlay;
      transform: translate(-50%, -50%);
    }
  }

  .content {
    z-index: 1;
    grid-area: 2/1/4/2;
    background-color: var(--white);
    border-radius: inherit;
    border-bottom: 0.25rem solid;
    padding: 1rem;
    border-style: solid;
    border-width: 0 0 0.25rem 0;
    border-color: var(--accent-color);
    box-shadow: 0 -0.25rem 0.5rem -0.125rem rgba(0, 0, 0, 0.5);
  }

  .title {
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent-color);
    width: fit-content;
  }
}

@container (min-width: 480px) {
  .home-block {
    article {
      grid-template-columns: 40% 1rem auto;
      grid-template-rows: auto;
    }

    header {
      grid-area: 1/1/2/3;
      border-radius: 1rem 0 0 1rem;
    }

    .content {
      grid-area: 1/2/2/4;
      border-width: 0 0.25rem 0 0;
    }
  }
}

.home-post {
  container-type: inline-size;
  color: var(--black);
  text-decoration: none;

  article {
    --accent-color: var(--jonquil);

    display: grid;
    height: 100%;
    grid-template-rows: 5rem 1rem auto;
    border-radius: 1rem;
    background: var(--accent-color);
    min-height: 10rem;
    overflow: hidden;

    &.yellow {
      --accent-color: var(--jonquil);
    }
    &.blue {
      --accent-color: var(--sky-blue);
    }
    &.green {
      --accent-color: var(--olive);
    }
    &.red {
      --accent-color: var(--tomato);
    }
    &.gray {
      --accent-color: var(--battleship-gray);
    }
  }

  header {
    grid-area: 1/1/3/2;
    display: grid;
    grid-template-columns: auto;
    grid-template-rows: auto;
    overflow: hidden;
    align-content: center;
    justify-content: center;
    border-radius: 1rem 1rem 0 0;
    position: relative;

    .image {
      --offset-vertical: -2rem;
      --offset-horizontal: 2rem;

      grid-area: 1/1/2/2;
      max-width: unset;
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(
        calc(-50% + var(--offset-vertical)),
        calc(-50% + var(--offset-horizontal))
      );

      .blue & {
        --offset-vertical: -2rem;
        --offset-horizontal: 2rem;
      }
      .red & {
        --offset-vertical: -2.5rem;
        --offset-horizontal: 2.5rem;
      }
      .gray & {
        --offset-vertical: -3rem;
        --offset-horizontal: 4.5rem;
      }
    }

    .logo {
      width: 16.5rem;
      position: absolute;
      max-width: unset;
      z-index: 1;
      top: 50%;
      left: 50%;
      opacity: 0.15;
      mix-blend-mode: overlay;
      transform: translate(-50%, -50%);
    }
  }

  .content {
    z-index: 1;
    grid-area: 2/1/4/2;
    background-color: var(--white);
    border-radius: inherit;
    border-bottom: 0.25rem solid;
    padding: 1rem;
    border-style: solid;
    border-width: 0 0 0.25rem 0;
    border-color: var(--accent-color);
    box-shadow: 0 -0.25rem 0.5rem -0.125rem rgba(0, 0, 0, 0.5);
  }

  .title {
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent-color);
    width: fit-content;
  }
}

@container (min-width: 480px) {
  .home-post {
    article {
      grid-template-columns: 20% 1rem auto;
      grid-template-rows: auto;
    }

    header {
      grid-area: 1/1/2/3;
      border-radius: 1rem 0 0 1rem;
    }

    .content {
      grid-area: 1/2/2/4;
      border-width: 0 0.25rem 0 0;
    }
  }
}

.home-header {
  --accent-color: var(--jonquil);

  display: grid;
  grid-template-columns: 1rem 1fr 1rem;
  grid-template-rows: 11rem auto auto;
  margin-bottom: 1rem;

  .background {
    overflow: hidden;
    grid-area: 1/1/3/4;
    background-color: var(--jonquil);
    text-align: center;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 0.25rem 0.5rem -0.25rem rgba(0, 0, 0, 0.5);
  }

  .image {
    overflow: hidden;
    max-height: 23.5rem;
    grid-area: 1/1/4/4;
    text-align: center;
    position: relative;
    border-radius: 0 0 1rem 0;

    .logo {
      --logo-width: 12rem;

      width: var(--logo-width);
      z-index: 2;
      position: absolute;
      top: 4rem;
      left: calc(50% - var(--logo-width) / 2);
      filter: drop-shadow(0 0 1rem var(--black-60));

      transition: all 0.3s ease;
    }

    .device {
      position: relative;
      top: -6rem;
      left: -1rem;
      width: 30rem;
      max-width: unset;
      object-fit: cover;
      transition: all 0.3s ease;
    }
  }

  .content {
    grid-area: 2/2/4/3;
    z-index: 1;
    background-color: var(--white);
    border-radius: 1rem;
    border-bottom: 0.25rem solid var(--jonquil);
    padding: 1rem;
    max-width: 25rem;
    box-shadow: 0 0.25rem 0.3rem -0.25rem rgba(0, 0, 0, 0.5) inset;
  }

  .title {
    font-weight: 400;
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    border-bottom: 2px solid var(--accent-color);
    width: fit-content;
  }

  a {
    display: block;
  }
}
@media screen and (min-width: 768px) {
  .home-header {
    grid-template-columns: 1fr minmax(740px, 1124px) 1fr;

    .content {
      margin-left: 1rem;
    }

    .image {
      grid-area: 1/1/3/4;
      overflow: hidden;
      position: relative;

      .device {
        width: 78rem;
        position: absolute;
        left: calc(50% - 9rem);
        top: calc(50% - 31rem);
      }

      .logo {
        --logo-width: 24rem;
        top: 2rem;
      }
    }
  }
}
.home-footer {
  background-color: var(--jonquil);
  min-height: 12rem;
  padding: 2rem 1rem;
  position: relative;

  &::after {
    content: "";
    background-color: var(--background);
    display: block;
    width: 100%;
    top: 0;
    left: 0;
    height: 1rem;
    position: absolute;
    border-radius: 0 0 1rem 1rem;
    box-shadow: 0 0.25rem 0.5rem -0.25rem rgba(0, 0, 0, 0.5);
  }

  .content {
    display: grid;
    grid-template-columns: auto 1fr auto;
    max-width: 1124px;
    margin: 0 auto;
    align-items: center;
  }

  .link-list {
    grid-area: 1/1/2/2;
    list-style: none;
    padding: 0;
    columns: 2;

    li {
      margin: 0 0 0.5rem;
    }

    a {
      display: flex;
      align-items: center;
      text-decoration: none;
      color: var(--black);
      font-weight: 400;
    }

    img {
      height: 2.25rem;
      width: 2.25rem;
      margin-right: 0.5rem;
    }
  }

  .coffee {
    grid-area: 1/3/2/4;
  }

  .coffee-link {
    display: block;
    height: 7.25rem;
    width: 7.25rem;
  }
}
