div:has(.hex-grid) {
  container-type: inline-size;
  /* padding-bottom: 48px; */
  /* margin-bottom: -48px;   /* >= shadow reach so it isn't cropped */
}

.hex-grid {
  display: grid;
  container-type: normal;
  gap: 8px !important;

  width: 100%;
  max-width: 100% !important;
  padding: 0;
  margin-top: 0px !important;
  padding-bottom: 60px !important;
  justify-items: center;
  justify-content: center;
}

@container (min-inline-size: 901px) {
  .hex-grid {
    grid-template-columns: repeat(5, 150px);
    grid-auto-rows: 128px;
  }

  .hex-grid .wp-block-cover {
    width: 150px !important;
  }

  .hex-grid .wp-block-cover:nth-child(10n + 1) { grid-column-start: 1; }
  .hex-grid .wp-block-cover:nth-child(10n + 2) { grid-column-start: 2; }
  .hex-grid .wp-block-cover:nth-child(10n + 3) { grid-column-start: 3; }
  .hex-grid .wp-block-cover:nth-child(10n + 4) { grid-column-start: 4; }
  .hex-grid .wp-block-cover:nth-child(10n + 5) { grid-column-start: 5; }

  .hex-grid .wp-block-cover:nth-child(10n + 1) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 2) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 3) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 4) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 5) > .wp-block-cover__background {
    --hex-stop: 60%;
    background-image: linear-gradient(156deg, rgb(61, 46, 156) var(--hex-stop), rgb(232, 39, 110) 100%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(10n + 1):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 2):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 3):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 4):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 5):hover > .wp-block-cover__background {
    --hex-stop: 50%;
    opacity: 0.5;
  }

  .hex-grid .wp-block-cover:nth-child(10n + 1),
  .hex-grid .wp-block-cover:nth-child(10n + 2),
  .hex-grid .wp-block-cover:nth-child(10n + 3),
  .hex-grid .wp-block-cover:nth-child(10n + 4),
  .hex-grid .wp-block-cover:nth-child(10n + 5) { justify-self: start; transform: translateX(-40px); }

  .hex-grid .wp-block-cover:nth-child(10n + 6) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 7) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 8) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 9) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 10) > .wp-block-cover__background {
    --hex-stop: 0%;
    background-image: linear-gradient(156deg, rgb(232, 39, 110) var(--hex-stop), rgb(61, 46, 156)  40%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }

  .hex-grid .wp-block-cover:nth-child(10n + 6):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 7):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 8):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 9):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(10n + 10):hover > .wp-block-cover__background {
    --hex-stop: 20%;
    opacity: 0.5;
  }

  .hex-grid .wp-block-cover:nth-child(10n + 6),
  .hex-grid .wp-block-cover:nth-child(10n + 7),
  .hex-grid .wp-block-cover:nth-child(10n + 8),
  .hex-grid .wp-block-cover:nth-child(10n + 9),
  .hex-grid .wp-block-cover:nth-child(10n + 10) { justify-self: end; transform: translateX(40px); }
}

@container (max-inline-size: 900px) and (min-inline-size: 701px) {
  .hex-grid {
    grid-template-columns: repeat(4, 150px);
    grid-auto-rows: 128px;
  }

  .hex-grid .wp-block-cover {
    width: 150px !important;
  }

  .hex-grid .wp-block-cover:nth-child(8n + 1) { grid-column-start: 1; }
  .hex-grid .wp-block-cover:nth-child(8n + 2) { grid-column-start: 2; }
  .hex-grid .wp-block-cover:nth-child(8n + 3) { grid-column-start: 3; }
  .hex-grid .wp-block-cover:nth-child(8n + 4) { grid-column-start: 4; }

  .hex-grid .wp-block-cover:nth-child(8n + 1),
  .hex-grid .wp-block-cover:nth-child(8n + 2),
  .hex-grid .wp-block-cover:nth-child(8n + 3),
  .hex-grid .wp-block-cover:nth-child(8n + 4) { justify-self: start; transform: translateX(-40px); }

  .hex-grid .wp-block-cover:nth-child(8n + 1) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 2) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 3) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 4) > .wp-block-cover__background {
    --hex-stop: 60%;
    background-image: linear-gradient(156deg, rgb(61, 46, 156) var(--hex-stop), rgb(232, 39, 110) 100%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(8n + 1):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 2):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 3):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 4):hover > .wp-block-cover__background {
    --hex-stop: 50%;
    opacity: 0.5;
  }

  .hex-grid .wp-block-cover:nth-child(8n + 5),
  .hex-grid .wp-block-cover:nth-child(8n + 6),
  .hex-grid .wp-block-cover:nth-child(8n + 7),
  .hex-grid .wp-block-cover:nth-child(8n + 8) { justify-self: end; transform: translateX(40px); }

  .hex-grid .wp-block-cover:nth-child(8n + 5) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 6) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 7) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 8) > .wp-block-cover__background {
    --hex-stop: 0%;
    background-image: linear-gradient(156deg, rgb(232, 39, 110) var(--hex-stop), rgb(61, 46, 156)  40%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(8n + 5):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 6):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 7):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(8n + 8):hover > .wp-block-cover__background {
    --hex-stop: 20%;
    opacity: 0.5;
  }
}

@container (max-inline-size: 700px) and (min-inline-size: 501px) {
  .hex-grid {
    grid-template-columns: repeat(3, 150px);
    grid-auto-rows: 128px;
  }

  .hex-grid .wp-block-cover {
    width: 150px !important;
  }

  .hex-grid .wp-block-cover:nth-child(6n + 1) { grid-column-start: 1; }
  .hex-grid .wp-block-cover:nth-child(6n + 2) { grid-column-start: 2; }
  .hex-grid .wp-block-cover:nth-child(6n + 3) { grid-column-start: 3; }

  .hex-grid .wp-block-cover:nth-child(6n + 1),
  .hex-grid .wp-block-cover:nth-child(6n + 2),
  .hex-grid .wp-block-cover:nth-child(6n + 3) {
    justify-self: start;
    transform: translateX(-40px);
  }

  .hex-grid .wp-block-cover:nth-child(6n + 1) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 2) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 3) > .wp-block-cover__background {
    --hex-stop: 60%;
    background-image: linear-gradient(156deg, rgb(61, 46, 156) var(--hex-stop), rgb(232, 39, 110) 100%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(6n + 1):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 2):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 3):hover > .wp-block-cover__background {
    --hex-stop: 50%;
    opacity: 0.5;
  }

  .hex-grid .wp-block-cover:nth-child(6n + 4),
  .hex-grid .wp-block-cover:nth-child(6n + 5),
  .hex-grid .wp-block-cover:nth-child(6n + 6) {
    justify-self: end;
    transform: translateX(40px);
  }

  .hex-grid .wp-block-cover:nth-child(6n + 4) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 5) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 6) > .wp-block-cover__background {
    --hex-stop: 0%;
    background-image: linear-gradient(156deg, rgb(232, 39, 110) var(--hex-stop), rgb(61, 46, 156)  40%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(6n + 4):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 5):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(6n + 6):hover > .wp-block-cover__background {
    --hex-stop: 20%;
    opacity: 0.5;
  }
}

@container (max-inline-size: 500px) and (min-inline-size: 301px) {
  .hex-grid {
    grid-template-columns: repeat(2, 150px);
    grid-auto-rows: 128px;
  }

  .hex-grid .wp-block-cover {
    width: 150px !important;
  }

  .hex-grid .wp-block-cover:nth-child(4n + 1) { grid-column-start: 1; }
  .hex-grid .wp-block-cover:nth-child(4n + 2) { grid-column-start: 2; }

  .hex-grid .wp-block-cover:nth-child(4n + 1),
  .hex-grid .wp-block-cover:nth-child(4n + 2) {
    justify-self: start;
    transform: translateX(-40px);
  }

  .hex-grid .wp-block-cover:nth-child(4n + 1) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(4n + 2) > .wp-block-cover__background {
    --hex-stop: 60%;
    background-image: linear-gradient(156deg, rgb(61, 46, 156) var(--hex-stop), rgb(232, 39, 110) 100%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(4n + 1):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(4n + 2):hover > .wp-block-cover__background {
    --hex-stop: 50%;
    opacity: 0.5;
  }

  .hex-grid .wp-block-cover:nth-child(4n + 3),
  .hex-grid .wp-block-cover:nth-child(4n + 4) {
    justify-self: end;
    transform: translateX(40px);
  }

  .hex-grid .wp-block-cover:nth-child(4n + 3) > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(4n + 4) > .wp-block-cover__background {
    --hex-stop: 0%;
    background-image: linear-gradient(156deg, rgb(232, 39, 110) var(--hex-stop), rgb(61, 46, 156)  40%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(4n + 3):hover > .wp-block-cover__background,
  .hex-grid .wp-block-cover:nth-child(4n + 4):hover > .wp-block-cover__background {
    --hex-stop: 20%;
    opacity: 0.5;
  }
}

@container (max-inline-size: 300px) {
  .hex-grid {
    grid-template-columns: repeat(1, 150px);
    grid-auto-rows: 128px;
  }

  .hex-grid .wp-block-cover {
    width: 150px !important;
  }


  .hex-grid .wp-block-cover:nth-child(2n + 1) { grid-column-start: 1; }

  .hex-grid .wp-block-cover:nth-child(2n + 1) { justify-self: start; transform: translateX(-40px); }

  .hex-grid .wp-block-cover:nth-child(2n + 1) > .wp-block-cover__background {
    --hex-stop: 60%;
    background-image: linear-gradient(156deg, rgb(61, 46, 156) var(--hex-stop), rgb(232, 39, 110) 100%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }
  .hex-grid .wp-block-cover:nth-child(2n + 1):hover > .wp-block-cover__background {
    --hex-stop: 50%;
    opacity: 0.5;
  }

  .hex-grid .wp-block-cover:nth-child(2n + 2) { justify-self: end; transform: translateX(40px); }

  .hex-grid .wp-block-cover:nth-child(2n + 2) > .wp-block-cover__background {
    --hex-stop: 0%;
    background-image: linear-gradient(156deg, rgb(232, 39, 110) var(--hex-stop), rgb(61, 46, 156)  40%);
    transition: --hex-stop .5s ease, opacity .5s ease;
    opacity: 0.75;
  }

  .hex-grid .wp-block-cover:nth-child(2n + 2):hover > .wp-block-cover__background {
    --hex-stop: 20%;
    opacity: 0.5;
  }
}

.hex-grid .wp-block-cover {
  margin: 0;
  padding: 0;
  position: relative;
  background: transparent;

  /* Pointy-top regular hexagon: height / width = 2 / √3 ≈ 1.1547 */
  aspect-ratio: 1 / 1.1547 !important;
}

/* Shadow effect on hover */
@media (hover: hover) and (pointer: fine) {
  .hex-grid .wp-block-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 115.47" preserveAspectRatio="none"><polygon points="50,0 100,28.87 100,86.6 50,115.47 0,86.6 0,28.87" fill="black"/></svg>') center / 100% 100% no-repeat;
    filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
  }
  .hex-grid .wp-block-cover:hover::before { opacity: 1; }
  .hex-grid .wp-block-cover { overflow: visible !important; will-change: transform; }
}

/* clip every visual layer to the hexagon */
.hex-grid .wp-block-cover > :not(p, .wp-block-cover__inner-container) {
  clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

/* Image & link fill the hex mask. */
.hex-grid .wp-block-cover > a {
  display: block;
  width: 100%;
  height: 100%;
}

.hex-grid .wp-block-cover > figcaption {
  height: 100%;
  align-content: center;
  color: #fff;
  opacity: 0.8;
  font-size: 2.5vmin !important;
  text-overflow: ellipsis;
  font-weight: 600;
  text-align: center;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  padding: 10px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 5px;
  z-index: 2;
}

.hex-grid .wp-block-cover img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  border-radius: 0;
}

@property --hex-stop {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 62%;
}
