.arete-posts {
  display: grid;
  grid-template-columns: repeat(var(--arete-columns, 3), minmax(0, 1fr));
  gap: clamp(14px, 2vw, 28px);
}

.arete-gallery-shell {
  position: relative;
  padding-inline: 52px;
}

.arete-gallery {
  --arete-gap: clamp(14px, 2vw, 28px);
  display: flex;
  gap: var(--arete-gap);
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.arete-gallery::-webkit-scrollbar { display: none; }

.arete-gallery__item {
  position: relative;
  flex: 0 0 100%;
  overflow: hidden;
  margin: 0;
  border-radius: 12px;
  background: #111;
  scroll-snap-align: start;
}

.arete-gallery--columns-2 .arete-gallery__item { flex-basis: 50%; }
.arete-gallery--columns-3 .arete-gallery__item { flex-basis: 33.3333%; }
.arete-gallery--columns-4 .arete-gallery__item { flex-basis: 25%; }
.arete-gallery--columns-5 .arete-gallery__item { flex-basis: 20%; }
.arete-gallery--columns-6 .arete-gallery__item { flex-basis: 16.6667%; }

.arete-gallery-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  display: grid;
  place-items: center;
  width: 42px;
  height: 68px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, .68);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: opacity .2s ease, background .2s ease, transform .2s ease;
}
.arete-gallery-nav:hover { background: rgba(0, 0, 0, .9); transform: translateY(-50%) scale(1.05); }
.arete-gallery-nav:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.arete-gallery-nav:disabled { opacity: .28; cursor: default; transform: translateY(-50%); }
.arete-gallery-nav--prev { left: 0; }
.arete-gallery-nav--next { right: 0; }

.arete-gallery__item img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform .25s ease;
}

.arete-gallery__item a:hover img { transform: scale(1.035); }
.arete-gallery__item a:focus-visible { outline: 3px solid currentColor; outline-offset: -3px; }

.arete-gallery__item figcaption {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 20px 12px 10px;
  color: #fff;
  font-size: .875rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .78));
}

.arete-post-card {
  overflow: hidden;
  border: 1px solid rgba(127, 127, 127, .25);
  border-radius: 14px;
  background: var(--wp--preset--color--base, #fff);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .07);
}

.arete-post-card__image { display: block; }
.arete-post-card__image img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.arete-post-card__body { padding: clamp(16px, 2vw, 24px); }
.arete-post-card h3 { margin: 0 0 8px; font-size: clamp(1.15rem, 2vw, 1.45rem); }
.arete-post-card h3 a { color: inherit; text-decoration: none; }
.arete-post-card time { opacity: .68; font-size: .85rem; }
.arete-post-card p { margin: 14px 0; }
.arete-post-card__button { display: inline-block; font-weight: 700; }
.arete-gallery-posts__posts { margin-top: clamp(32px, 6vw, 72px); }

.arete-lightbox {
  position: fixed;
  z-index: 999999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, .9);
}
.arete-lightbox[hidden] { display: none; }
.arete-lightbox img { max-width: min(1200px, 94vw); max-height: 88vh; object-fit: contain; }
.arete-lightbox button { z-index: 2; border: 0; color: #fff; cursor: pointer; }
.arete-lightbox button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.arete-lightbox__close { position: fixed; top: 16px; right: 20px; padding: 4px 12px; background: rgba(0,0,0,.45); font-size: 42px; line-height: 1; }
.arete-lightbox__arrow { position: fixed; top: 50%; display: grid; place-items: center; width: 58px; height: 82px; border-radius: 8px; background: rgba(0,0,0,.52); font-size: 48px; line-height: 1; transform: translateY(-50%); transition: background .2s ease, transform .2s ease; }
.arete-lightbox__arrow:hover { background: rgba(0,0,0,.82); transform: translateY(-50%) scale(1.06); }
.arete-lightbox__prev { left: clamp(10px, 3vw, 42px); }
.arete-lightbox__next { right: clamp(10px, 3vw, 42px); }
.arete-lightbox p { position: fixed; bottom: 8px; color: #fff; }

@media (max-width: 900px) {
  .arete-posts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .arete-gallery__item { flex-basis: 50%; }
}
@media (max-width: 560px) {
  .arete-posts { grid-template-columns: 1fr; }
  .arete-gallery-shell { padding-inline: 40px; }
  .arete-gallery__item { flex-basis: 100%; }
  .arete-gallery-nav { width: 34px; height: 58px; font-size: 27px; }
  .arete-lightbox { padding: 12px; }
  .arete-lightbox__arrow { width: 44px; height: 64px; font-size: 36px; }
}
