/* NEXT EVENTS */
.next-event-container {
  position: relative;
  padding: 2rem 0;
  margin-bottom: 2rem;
  margin-top: 1rem;

  &:after {
    position: absolute;
    content: "";
    background-size: 400px;
    background-repeat: repeat;
    width: 100vw;
    height: 100%;
    background-image: url(/themes/custom/pt_base/images/bg-dark-noise.png);
    z-index: -1;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
  }
  header h2 {
    color: #fff;
  }
}

@media (min-width: 1200px) {
  .next-event-container {
    position: relative;
    padding: 3rem 0;
  }
}

/* ALL EVENTS */
.upcoming-events-container {
  padding-top: 2rem;
  header h2,
  header {
    margin-bottom: 0rem;
  }

  form {
    .form-actions {
      margin-top: 0rem;
    }
  }
}

/* go to archive link — events, jobs, tenders share the same header row.
   The news grid joins it through view-layout-grid, which wraps the heading in
   .phantom-grid-header rather than a <header> (a second banner landmark). */
.phantom-tender-grid-layout header,
.phantom-job-opportunity-grid-layout header,
.upcoming-events-container header,
.phantom-news-grid-layout .phantom-grid-header {
  .section-heading-link {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: flex-start;
    align-items: flex-start;

    a {
      text-decoration: none;
      display: flex;
      flex-direction: row;
      justify-content: flex-start;
      align-items: center;
      &:hover {
        text-decoration: underline;
        svg {
          transform: scale(0.6) rotate(180deg) translateX(-14px);
        }
      }
      svg {
        position: relative;
        transform: scale(0.6) rotate(180deg) translateX(0px);
        transform-origin: center;
        top: -1px;
        left: -1px;
        transition: 0.2s ease;
      }
    }

    /* Procurements (and any link-only header): no section heading beside the
         archive link — page title already names the listing. Push the link to
         the right so it matches the top-right placement of events/jobs. */
    &.section-heading-link--link-only {
      align-items: flex-end;
      justify-content: flex-end;
    }
  }
}

@media (min-width: 768px) {
  .phantom-tender-grid-layout header,
  .phantom-job-opportunity-grid-layout header,
  .upcoming-events-container header,
  .phantom-news-grid-layout .phantom-grid-header {
    & .section-heading-link {
      flex-direction: row;
      justify-content: space-between;
      align-items: center;

      &.section-heading-link--link-only {
        justify-content: flex-end;
      }
    }
  }
}

@media (min-width: 1024px) {
  .phantom-job-opportunity-grid-layout header,
  .phantom-tender-grid-layout header,
  .upcoming-events-container header,
  /* Doubled class so this wins over view-layout-grid.css's 0.5rem, which has
     the same specificity, whatever order the two stylesheets load in. */
  .phantom-grid-layout.phantom-news-grid-layout .phantom-grid-header {
    margin-bottom: 1.5rem;
    margin-top: 2rem;
  }
}

@media (min-width: 1200px) {
  .phantom-tender-grid-layout header,
  .phantom-job-opportunity-grid-layout header,
  .upcoming-events-container header,
  .phantom-news-grid-layout .phantom-grid-header {
    & .section-heading-link a {
      font-size: 18px;
      svg {
        top: -2px;
      }
    }
  }
}
