@import './variables.css';
@import './normalize.css';
@import './fonts.css';
@import './components/header.css';
@import './components/footer.css';
@import './components/cards.css';
/* @import './mixins.css'; */

/* Breakpoints
  'medium': 600px,
  'med-lg': 800px,
  'large':  1000px,
  'full': 1180px
*/

body {
  font-family: var(--body);
  font-size: 18px;
}
main {
  /* padding-top: 60px;  */
  @media (min-width: 800px) {
    padding-top: 50px;
  }
}
article,
section.resource-cards,
section.search,
section.admin-metadata,
footer > section {
  margin: 0 auto;
  max-width: var(--max-width);
}
h1,
h2,
h3,
h4,
h4 {
  font-family: var(--header);
  font-weight: bold;
  margin: 0;
  a {
    text-decoration: none;
  }
}
h3 {
  font-size: 1.1rem;
}
p {
  line-height: 1.5;
}
a,
a:visited {
  color: var(--text);
  transition: color 0.25s ease-out;
  text-decoration: underline;
}
a:hover {
  color: var(--primary-text-link);
  transition: color 0.25s ease-out;
}
figure {
  width: 100%;
  margin: 0;
  figcaption {
    color: var(--gray-text);
    padding-top: 0.5rem;
  }
}
.show-on-focus {
  position: absolute;
  &:focus,
  &:active {
    position: static;
    display: block;
    padding: 1rem 1rem 0;
    background-color: var(--card-background);
    color: var(--primary-dark-bg);
    font-weight: bold;
  }
}

/* Home page styles */
.index {
  background-color: var(--dark-background);
  color: var(--light-text);
  padding-bottom: 6rem;
  section {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  @media (min-width: 600px) {
    padding-bottom: 10rem;
  }
  .headline {
    padding-top: 2rem;
    h1 {
      font-size: 2rem;
      text-align: center;
      padding: 1rem 0 3rem;
      @media (min-width: 600px) {
        padding: 2rem 0;
        font-size: 2.75rem;
        font-weight: 600;
      }
    }
    .display {
      display: none;
      margin: 0 auto;
      width: 45rem;
      font-size: 1.25rem;
      text-align: center;
      padding-bottom: 3rem;
      @media (min-width: 800px) {
        display: block;
      }
    }
  }
  .resource-cards {
    header {
      display: flex;
      flex-direction: row;
      align-items: flex-end;
      justify-content: space-between;
      padding-bottom: 0.5rem;
    }
    h2 {
      margin-top: 6rem;
      font-size: 1.5rem;
      font-weight: 600;
      @media (min-width: 600px) {
        margin-top: 8rem;
        display: inline-block;
      }
      @media (min-width: 600px) {
        /* width: 70%; */
      }
    }
    .header-link {
      display: none;
    }
    /* .full-card {
      display: none;
    } */
    @media (min-width: 600px) {
      /* .compact-card {
        display: none;
      }
      .full-card {
        display: block;
      } */
      .header-link {
        display: block;
        /* width: 30%;
        text-align: right; */
      }
    }
    /* .list-link {
      display: block;
      text-align: right;
    } */
  }
  a {
    color: var(--light-text);
  }
}
.resource-cards {
  padding: 1rem 1rem 3rem;
}
.admin-metadata {
  font-size: 90%;
  margin-bottom: 0;
  @media (min-width: 1180px) {
    padding: 1rem 0 2rem;
  }
  h2 {
    font-size: 1.5rem;
    border-top: 1px solid var(--light-gray-text);
    padding-top: 0.5rem;
    @media (min-width: 600px) {
      width: 50%;
    }
    @media (min-width: 1000px) {
      width: 33%;
    }
  }
  p {
    padding-top: 1rem;
    font-style: italic;
  }
  li.source-citation {
    @media (min-width: 800px) {
      margin-bottom: 0;
    }
  }
  svg {
    position: relative;
    top: 2px;
    padding-left: 0.25rem;
  }
}

/* Search styles */
section.search {
  padding-top: 3rem;
  margin-bottom: 2rem;

  @media (min-width: 600px) {
    /* padding-top: 100px;
    margin-top: -100px; */
  }
  form {
    @media (min-width: 600px) {
      width: 60%;
      margin: 0 auto;
      display: grid;
      grid-template-columns: 1fr 1fr 1fr 1fr;
      grid-column-gap: 2rem;
    }
  }
  input {
    border: none;
    border-bottom: 2px solid var(--primary);
    background-color: var(--dark-background);
    color: var(--light-text);
    background-image: url('/icons/search.svg');
    background-size: contain;
    background-repeat: no-repeat;
    font-size: 1.5rem;
    width: 100%;
    padding: 0 0 2px 40px;
    box-sizing: border-box;
    border-radius: 0;
    margin: 0;
    &::placeholder {
      color: var(--light-gray-text);
      transition: opacity 0.3s;
    }
    &:focus {
      outline: none;
      &::placeholder {
        opacity: 0;
        transition: opacity 0.3s;
      }
    }
    &::-webkit-search-cancel-button {
      -webkit-appearance: none;
      height: 1em;
      width: 1em;
      border-radius: 50em;
      background: url('/icons/close.svg') no-repeat 50% 50%;
      background-size: contain;
      opacity: 0;
      pointer-events: none;
    }
    &[type='search']:focus::-webkit-search-cancel-button {
      opacity: 0.5;
      pointer-events: all;
    }
    @media (min-width: 600px) {
      /* row start / column start / row end / column end */
      grid-area: 1 / 1 / 1 / 5;
    }
  }
  label {
    display: inline-block;
    color: var(--light-gray-text);
    padding: 8px 0 24px;
    font-size: 90%;
    @media (min-width: 600px) {
      grid-area: 2 / 1 / 2 / 5;
    }
  }
  /* button {
    background-color: var(--primary-dark-bg);
    color: var(--light-text);
    padding: 1rem;
    border: none;
    font-family: var(--header);
    font-weight: 600;
    font-size: 1.5rem;
    cursor: pointer;
    &[type=submit] {
      width: 100%;
      border-radius: 5px;
    }
    &[type=reset] {
      display: block;
      margin: 2rem auto;
      border-radius: 30px;
      line-height: 0;
    }
  } */
  #results-count {
    padding: 1.5rem 0 1rem;
    font-size: 1rem;
    font-weight: 400;
  }
  #search-result-list {
    display: none;
    padding-inline-start: 0;
    width: 90%;
    margin: 1rem auto;
    /* padding: .5rem 5%; */
    padding: 0;
    background-color: var(--card-background);
    @media (min-width: 600px) {
      padding: 0.5rem 2rem;
      width: 80%;
    }
    h3 {
      a {
        text-decoration: underline;
      }
      span {
        font-weight: 400;
        color: var(--light-gray-text);
        padding-left: 0.5rem;
        &::before {
          content: ' — ';
          padding-right: 0.5rem;
        }
      }
    }
    ul {
      padding: 0;
    }
    li {
      list-style: none;
      padding-bottom: 1.5rem;
      span {
        font-size: 1rem;
      }
      &.no-results {
        padding: 1.5rem 0;
      }
    }
    .close-icon {
      display: flex;
      justify-content: center;
      padding: 2rem 0 3rem;
      a {
        display: inline-block;
        line-height: 0;
        background: var(--primary-dark-bg);
        padding: 1.5rem;
        border-radius: 100px;
      }
    }
  }
  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
}

/* Article styles */
.article {
  padding: 1rem;
  @media (min-width: 800px) {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 2rem;
  }
  .hero {
    margin: -1rem -1rem 1rem;
    @media (min-width: 800px) {
      margin: 1rem 0 0;
      order: 3;
      width: 30%;
    }
    img {
      width: 100%;
      object-fit: cover;
      @media (min-width: 800px) {
        border-radius: 5px;
      }
    }
    p,
    a {
      color: var(--gray-text);
    }
    p {
      text-align: right;
      font-size: 75%;
      margin: -0.25rem 1rem 0.25rem;
      @media (min-width: 800px) {
        margin-right: 0;
      }
    }
  }
  .header {
    @media (min-width: 800px) {
      order: 1;
      width: 100%;
      padding-top: 1.3rem;
    }
    h1 {
      font-size: 40px;
      line-height: 48px;
      display: flex;
      flex-direction: column-reverse;
    }
  }
  .body {
    @media (min-width: 800px) {
      order: 2;
      width: 70%;
      /* ensure that all portable text blocks have right padding in multi-column view. */
      h2,
      p,
      ol,
      ul {
        padding-right: 4rem;
      }
    }
    ul,
    ol {
      padding-left: 1.5rem;
      line-height: initial;
      li {
        padding-bottom: 1rem;
      }
    }
  }
}

/* Method & Discipline shared styles */
.citation {
  font-size: 70%;
  vertical-align: top;
  padding-left: 0.25rem;
}

/* 404 page styles */
.not-found {
  padding-bottom: 8rem;
  a:hover {
    color: var(--primary-dark-bg);
  }
  .links {
    font-weight: 300;
  }
  .headline .display {
    display: block;
    width: 100%;
  }
}

/* Method detail styles */
article.method,
article.discipline {
  padding: 1rem;
  section {
    margin-bottom: 2rem;
    @media (min-width: 800px) {
      margin-bottom: 4rem;
    }
    &.overview {
      @media (min-width: 800px) {
        display: flex;
        flex-wrap: wrap;
      }
      .hero {
        margin: -1rem -1rem 1rem;
        @media (min-width: 800px) {
          margin: 1rem 0 0;
          order: 3;
          width: 30%;
        }
        img {
          height: 225px;
          width: 100%;
          background-color: var(--light-text);
          object-fit: cover;
          @media (min-width: 800px) {
            border-radius: 5px;
          }
        }
        p,
        a {
          color: var(--gray-text);
        }
        p {
          text-align: right;
          font-size: 75%;
          margin: -0.25rem 1rem 0.25rem;
          @media (min-width: 800px) {
            margin-right: 0;
          }
        }
      }
      .header {
        @media (min-width: 800px) {
          order: 1;
          width: 100%;
        }
        h1 {
          font-size: 40px;
          line-height: 48px;
          display: flex;
          flex-direction: column-reverse;
          span:nth-child(2) {
            font-family: var(--header);
            color: var(--card-background);
            text-transform: uppercase;
            font-weight: bold;
            font-size: 13px;
            line-height: 1;
            padding-bottom: 0.5rem;
          }
          &.no-eyebrow {
            padding-top: 1.3rem;
          }
        }
      }
      .description {
        @media (min-width: 800px) {
          order: 2;
          width: 70%;
          p,
          ol,
          ul {
            padding-right: 2rem;
          }
        }
      }
      /* discipline template specific styles for the overview section */
      &.discipline {
        @media (min-width: 800px) {
          align-items: stretch;
        }
        .hero {
          img {
            background-color: var(--light-text);
          }
          @media (min-width: 800px) {
            order: 1;
            width: 50%;
            margin-top: 0;
            height: auto;
            img {
              height: 100%;
            }
          }
          @media (min-width: 1000px) {
            height: 100%;
            img {
              height: auto;
            }
          }
        }
        .discipline-summary {
          @media (min-width: 800px) {
            order: 2;
            width: 45%;
            padding-left: 5%;
            div {
              width: 100%;
              p {
                padding-right: 0;
              }
            }
          }
        }
      }
    }
    &.details {
      .outcomes {
        ul {
          list-style: none;
          padding-inline-start: 1.3rem;
          p {
            margin-top: 0;
          }
        }
      }
      @media (min-width: 800px) {
        display: flex;
        .steps {
          width: 70%;
          ol {
            padding-right: 6rem;
          }
          p {
            padding-right: 3rem;
          }
        }
        .outcomes {
          width: 30%;
          ul {
            list-style: none;
            padding-inline-start: 0;
            p {
              margin-top: 0;
            }
          }
        }
      }
    }
    ol {
      padding-left: 1.5rem;
    }
    li {
      margin-bottom: 0.75rem;
      line-height: 1.5;
    }
  }
}
.resource-cards {
  padding: 1rem;
  padding-bottom: 4rem;
}
section.sources {
  padding-top: 80px;
}

/* Card grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min), 3fr));
  grid-gap: 2rem;
  padding: 0;
  a {
    color: var(--text);
    text-decoration: none;
  }
}
.dark {
  @media (min-width: 600px) {
    grid-row-gap: 3rem;
    grid-column-gap: 3.5rem;
  }
}

