.kiu-events-wrap {
  article details:last-child {
    margin-bottom: 0 !important;
  }
}

.kiu-events-wrap article {
  padding-block-end: var(--wp--preset--spacing--medium);
  border-block-end: 1px solid var(--wp--preset--color--main-accent);
}

.kiu-grid-wrap {
  --column-width: 100%;

  display: grid;
  gap: var(--wp--preset--spacing--small);
  grid-template-columns: repeat(auto-fill, minmax(calc(var(--column-width) - var(--wp--preset--spacing--small)), 1fr));

  figure {
    &, figcaption {margin: 0 !important;}

    a {
      display: block;
      text-decoration: none;
      color: var(--wp--preset--color--base);
    }

    &:where(:hover, :focus, :active, :focus-within) {
      a {text-decoration: underline;}
    }

    figcaption {
      text-align: center;
      font-size: var(--wp--preset--font-size--x-small) !important;
      font-weight: var(--wp--custom--font-weight--semi-bold);
      text-transform: uppercase;
      color: currentColor;
      background-color: var(--wp--preset--color--main) !important;
      word-break: break-word;
      hyphens: auto;
    }

    picture {
      display: block;

      img {
        display: block;
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        object-fit: cover;
        object-position: center;
      }
    }
  }
}

@media (min-width: 480px) {
  .kiu-grid-wrap {
    --column-width: 50%;
  }
}

@media (min-width: 768px) {
  .kiu-grid-wrap {
    --column-width: 33.33333%;
  }
  .kiu-events-wrap.alignwide .kiu-grid-wrap {
    --column-width: 25%;
  }
}

.editor-styles-wrapper .kiu-events-wrap {
  &:is(.is-vertical) {
    flex-direction: column;
  }
  &:is(.is-content-justification-stretch) {
    align-items: stretch;
  }
  &:is(.is-nowrap) {
    flex-wrap: nowrap;
  }
}
