:root {
  --grid-square: repeat(2,minmax(0,1fr));
  --grid-vertical: repeat(3,minmax(0,1fr));
}

.now-header {
  margin: var(--sizing-3xl) 0 var(--sizing-lg);
}

.default-wrapper > .now-header:first-of-type {
  margin-top: 0;
}

.now-header-buttons {
  margin: 0 0 var(--sizing-lg);

  & > button {
    margin-bottom: var(--sizing-sm);

    &:last-of-type {
      margin-right: 0;
    }
  }
}

.now-header-wrapper {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.media-grid {
  display: grid;
  gap: var(--sizing-sm);

  &.square {
    grid-template-columns: var(--grid-square);

    & img {
      width: 100%;
      height: 100%;
    }
  }

  &.vertical {
    grid-template-columns: var(--grid-vertical);

    & img {
      width: 100%;
      height: auto;
    }
  }

  & .item-wrapper {
    position: relative;

    &.shadow picture::after {
      position: absolute;
      z-index: 1;
      content: '';
      top: 0;
      left: 1px;
      border-radius: calc(var(--sizing-xs) * .85);
      box-shadow: inset 0 -70px 50px -40px #000;
      width: calc(100% - 2px);
      height: calc(100% - 1px);
    }

    & picture {
      width: 100%;
      height: 100%;
      position: relative;
      display: flex;
    }
  }

  & a:hover img,
  & a:focus img,
  & a:active img {
    border-color: var(--accent-color-hover)
  }

  & .meta-text {
    position: absolute;
    z-index: 2;
    padding: 0 var(--sizing-sm);
    bottom: var(--sizing-sm);
    width: 100%;
    box-sizing: border-box;

    & .header,
    & .subheader {
      color: var(--color-lightest);
      font-size: var(--font-size-xs);
      line-height: var(--line-height-xs);
      text-shadow: rgba(0, 0, 0, 0.7) 0px 0px 10px;
    }

    & .header {
      font-weight: var(--font-weight-bold);
    }
  }

  & img {
    border: 1px solid var(--accent-color);
    border-radius: var(--rounded);
    transition-property: border-color;
    transition-timing-function: var(--transition-ease-in-out);
    transition-duration: 300ms;
  }
}

@media screen and (min-width: 768px) {
  :root {
    --grid-square: repeat(4,minmax(0,1fr));
    --grid-vertical: repeat(6,minmax(0,1fr));
  }

  .now-header-wrapper {
    flex-direction: row;
  }

  .now-header-buttons {
    margin: var(--sizing-3xl) 0 var(--sizing-lg);

    & > button {
      margin-bottom: 0;
    }
  }
}