---
export interface Props {
  title: string
}

const { title } = Astro.props
---

<section>
  <h1>{title}</h1>
  <div class="wrapper">
    <div class="line"></div>
    <slot />
    <div class="drop"></div>
  </div>
</section>

<style>
  .drop {
    display: flex;
    position: absolute;
    visibility: visible;
    left: 0;
    right: 0;
    bottom: -5rem;
    margin-left: auto;
    margin-right: auto;
    height: 1.5rem;
    width: 1.5rem;
    border-radius: 0% 50% 50% 50%;
    transform: rotate(45deg);
    background-color: var(--c-darkpurple);
  }
  .line {
    display: flex;
    position: absolute;
    visibility: visible;
    left: 0;
    right: 0;
    margin-left: auto;
    margin-right: auto;
    background-color: var(--c-darkpurple);
    height: calc(100% + 5rem);
    translate: 0% 2rem;
    width: 0.25rem;
    z-index: -1;
  }
  h1 {
    line-height: 48px;
    letter-spacing: -1px;
    color: white;
    font-size: 2.25rem;
    margin-top: 1rem;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    max-width: max-content;
    background-color: var(--c-darkgray);
    padding: 0.25rem 1.5rem;
    border-radius: 0.5rem;
    padding-bottom: 0.5rem;
    justify-self: center;
  }
  .wrapper {
    margin: 2rem 2rem 0.5rem 2rem;
    display: flex;
    flex-flow: column wrap;
    row-gap: 1em;
    column-gap: 1em;
    align-self: center;
    align-items: stretch;
    align-content: center;
    justify-content: space-around;
    padding: 1em;
    color: white;
    font-size: 1em;
    position: relative;
  }
  @media (min-width: 900px) {
    .drop {
      margin-left: 1.5rem;
    }
    .line {
      margin-left: 2.1rem;
    }
    h1 {
      margin-left: 3rem;
    }
  }
  @media (min-width: 1500px) {
    .wrapper {
      margin-left: 20rem;
      margin-right: 20rem;
    }
    h1 {
      margin-left: 20rem;
      margin-right: 20rem;
    }
  }
</style>
