:root {
  --green: #91b622;
  --light-green: rgb(from var(--green) r g b / 60%);
}

body {
  background-color: #fdfcfa;
  font-family: sans-serif;
  margin: 0;
}

/* Header, Main, Footer containers */
body > header,
body > main,
body > footer > div > div {
  max-width: 75rem;
  padding: 1rem 0.5rem;
  margin: 0 auto;
}

/* Header styles */
body > header {
  div {
    display: flex;
    justify-content: space-between;
    color: var(--green);

    h2 {
      font-size: 0.85rem;
      font-weight: 300;
      letter-spacing: 0.1rem;
      margin: 0;
      align-content: center;
      text-wrap: balance;
    }

    address {
      display: flex;
      align-content: center;
      gap: 1.5rem;

      svg {
        color: var(--green);
      }
    }
  }

  nav {
    display: flex;
    flex-direction: row;
    align-items: center;
    font-size: 1.2rem;
    font-weight: 400;
    text-transform: uppercase;
    margin: 24px 0 12px 0;

    ul {
      display: flex;
      flex-wrap: wrap;
      justify-content: space-evenly;
      align-items: center;
      width: 100%;
      margin: 0;
      padding: 0;
      list-style: none;

      li {
        list-style: none;
      }

      li.first-half {
        order: 1;
      }

      li.second-half {
        order: 3;
      }

      a {
        padding: 0.5rem;
        text-decoration: none;
        color: var(--green);
        white-space: nowrap;

        &:hover {
          color: #afafaf;
        }
      }
    }

    .logo {
      order: 2;
      text-align: center;

      svg {
        color: var(--green);
        width: 10rem;
        transition: transform 1s ease;

        &:hover {
          transform: scale(1.1);
        }
      }
    }

    @media screen and (max-width: 1000px) {
      flex-direction: column;

      .logo {
        order: 0;
        flex: 0 0 100%;
        padding-bottom: 20px;
      }
    }
  }
}

/* Footer styles */
body > footer {
  margin-top: 50px;
  color: #fcfcfb;

  svg {
    color: #fcfcfb;
    width: 6em;
  }

  > div:nth-child(1) {
    background-color: var(--green);

    div {
      display: flex;
      justify-content: space-between;
      align-items: center;

      ul {
        display: flex;
        flex-wrap: wrap;
        justify-content: end;
        list-style: none;
        padding: 0;
        margin: 0;
      }

      li {
        display: inline;

        a {
          padding: 0.5rem;
          margin: 0.5rem;
          color: #fcfcfb;
          text-decoration: none;

          &:hover {
            color: #748a0c;
          }
        }
      }
    }
  }

  > div:nth-child(2) {
    background-color: #748a0c;
    font-size: 0.8rem;
    font-weight: 300;
    text-wrap: balance;
  }
}

/* Article styles */
main {
  h1,
  h2,
  h3,
  blockquote {
    text-wrap: balance;
    color: var(--green);
  }

  h1,
  h2 {
    text-transform: uppercase;
  }

  h1 {
    font-size: 36px;
    font-weight: 400;
    letter-spacing: -0.7px;
    margin: 0 auto 20px auto;
  }

  h2 {
    font-size: 27px;
    font-weight: 400;
    letter-spacing: -0.2px;
    line-height: 30px;
    margin: 40px 0 0 0;
  }

  h3 {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.5px;
    line-height: 38px;
  }

  p,
  li {
    color: rgb(20, 20, 20);
    font-size: 17px;
    font-weight: 300;
    letter-spacing: 0.1px;
    line-height: 29px;
    text-align: justify;
    margin: 10px 0;
  }

  a {
    color: var(--green);

    &.read-more {
      text-wrap: nowrap;
    }
  }

  blockquote {
    max-width: 75%;
    margin: 50px auto;

    p {
      color: var(--green);
      font-size: 24px;
      font-weight: 400;
      letter-spacing: -0.5px;
      line-height: 38px;
      text-align: center;
      margin: 5px;

      &:not(.attribution) {
        font-style: italic;
      }

      &.attribution {
        &::before {
          content: " ∽ ";
        }
        &::after {
          content: " ∼ ";
        }
      }
    }
  }

  img {
    width: 100%;
    height: auto;

    &.banner {
      height: 350px;
      width: 100%;
      object-fit: cover;
    }
  }

  &.event {
    section {
      float: left;
      width: 60%;

      header {
        position: relative;
        overflow: hidden;
        color: #fcfcfb;

        img {
          display: block;
          max-width: 100%;
        }

        hgroup {
          position: absolute;
          bottom: 0;
          left: 0;
          background-color: var(--green);
          margin: 0;
          padding: 1rem;
          width: 100%;
        }

        h1 {
          color: #fcfcfb;
          font-size: 2.5rem;
        }

        p {
          color: #fcfcfb;
        }
      }

      h1,
      h2,
      h3 {
        color: var(--green);
      }

      p {
        text-align: justify;
      }

      figure {
        margin: 0;

        img {
          width: 100%;
        }
      }
    }

    aside {
      float: right;
      width: 30%;
    }

    &::after {
      content: "";
      display: block;
      clear: both;
    }
  }
}

/* Utility classes */
.small-caps {
  text-transform: initial !important;
  font-variant: small-caps;
}

.center {
  p,
  h1,
  h2,
  h3 {
    text-align: center;
    text-wrap: balance;
  }
}

.emphasis p {
  color: var(--green);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 220%;
  margin-bottom: 2em;
}

.thin {
  max-width: calc(0.75 * 75rem);
  margin: auto;
}

/* Slideshow banner styles */
.slideshow-banner {
  position: relative;
  padding-bottom: 40px;

  > *:nth-child(2) {
    position: absolute;
    left: 0;
    animation: banner-fade 10s ease-in-out infinite alternate;
  }
}

@keyframes banner-fade {
  0%,
  40% {
    opacity: 0;
  }
  60%,
  100% {
    opacity: 1;
  }
}

/* Panel group styles */
.panel-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;

  .panel {
    flex: 1 1 0;
    min-width: 200px;
    padding: 15px;

    img {
      height: 150px;
      width: 100%;
      object-fit: cover;
    }

    a {
      text-decoration: none;
    }

    h2 {
      margin: 10px auto;
    }

    p {
      text-align: justify;
      margin: 5px 0 0 0;
    }
  }

  &.large {
    gap: 30px;
    text-align: left;

    .panel {
      min-width: 300px;
      padding: 0;
    }
  }

  &.shadow .panel {
    transition:
      box-shadow 0.35s,
      transform 0.35s;
    box-shadow: 0 3px 5px rgba(0, 0, 0, 0.4);

    &:hover {
      box-shadow: 0 3px 15px rgba(0, 0, 0, 0.4);
    }
  }
}

.contact-form {
  border: var(--green) 1px solid;
  border-radius: 10px;
  padding: 15px;
  max-width: 500px;
  break-inside: avoid;

  label {
    display: block;
    margin-left: 5px;
    margin-bottom: 5px;
  }

  input,
  textarea {
    width: calc(100% - 22px);
    max-width: 500px;
    border: var(--green) 1px solid;
    border-radius: 5px;
    padding: 10px;
    margin-bottom: 20px;
    outline-style: none;
    color: var(--green);
    font-weight: 500;
    font-size: 1em;
    font-family: sans-serif;
    resize: vertical;

    &:focus {
      border-color: var(--light-green);
    }
  }

  button {
    display: block;
    padding: 15px 30px;
    background-color: var(--green);
    color: white;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    margin-left: auto;

    &:hover {
      background-color: var(--light-green);
      color: rgb(20, 20, 20);
      cursor: pointer;
    }
  }
}

.twocol {
  column-count: 2;

  @media screen and (max-width: 800px) {
    column-count: 1;
  }
}
