/* Base layout + type — brand decoration in templates/<tpl>/blocks/gallery/css/style.css */

/* Style 1 — project grid */
.px-gallery.style-1 .px-gallery__head {
  margin-bottom: var(--px-gap-xl);
}

.px-gallery.style-1 .px-gallery__head .px-sec-desc {
  max-width: 36rem;
  margin-bottom: 0;
}

.px-gallery.style-1 .px-gallery__head.text-center .px-sec-desc {
  margin-inline: auto;
}

.px-gallery.style-1 .px-gallery__head.text-end .px-sec-desc {
  margin-inline-start: auto;
}

.px-gallery.style-1 .row.px-gallery__grid {
  --t4-gutter-x: var(--px-gap);
  --t4-gutter-y: var(--px-gap-lg);
  --bs-gutter-x: var(--px-gap);
  --bs-gutter-y: var(--px-gap-lg);
}

.px-gallery.style-1 .px-gallery__item {
  height: 100%;
  margin: 0;
}

.px-gallery.style-1 .px-gallery__frame {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--px-radius);
  background: color-mix(in srgb, var(--px-color-muted) 15%, transparent);
}

.px-gallery.style-1 .px-gallery__frame .px-editable-media {
  height: 100%;
}

.px-gallery.style-1 .px-gallery__frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s ease;
}

.px-gallery.style-1 .px-gallery__item:hover .px-gallery__frame img {
  transform: scale(1.05);
}

/* Reset template-wide figcaption chrome (e.g. `figure figcaption` badges) */
.px-gallery.style-1 .px-gallery__caption {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: var(--px-gap);
  padding: 0;
  background: none;
  font-size: inherit;
  letter-spacing: normal;
  text-align: inherit;
  text-transform: none;
  color: inherit;
}

.px-gallery.style-1 .px-gallery__meta {
  font-size: var(--px-fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--px-color-muted);
}

.px-gallery.style-1 .px-gallery__title {
  font-family: var(--heading-font-family, inherit);
  font-size: var(--px-fs-xl);
  font-weight: var(--heading-font-weight, 600);
  line-height: 1.25;
  color: var(--px-ink-strong);
  text-decoration: none;
}

.px-gallery.style-1 a.px-gallery__title .px-icon-arrow {
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

.px-gallery.style-1 a.px-gallery__title:hover .px-icon-arrow {
  transform: translateX(4px);
}

@media (prefers-reduced-motion: reduce) {
  .px-gallery.style-1 .px-gallery__frame img,
  .px-gallery.style-1 a.px-gallery__title .px-icon-arrow {
    transition: none;
  }
}

/* Style 2 — case studies (equal 3-col) */
.px-gallery.style-2 .px-gallery__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--px-gap-lg);
  margin-bottom: var(--px-gap-xl);
  text-align: start;
}

.px-gallery.style-2 .px-gallery__head-copy {
  max-width: 40rem;
}

.px-gallery.style-2 .px-gallery__all {
  display: inline-flex;
  align-items: center;
  gap: var(--px-gap-xs);
  margin-inline-start: auto;
  padding-bottom: var(--px-gap-xs);
  font-weight: 700;
  color: var(--px-ink-strong, inherit);
  text-decoration: none;
  white-space: nowrap;
}

.px-gallery.style-2 .px-gallery__all span {
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 1.5px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.45s ease;
  padding-bottom: 2px;
}

.px-gallery.style-2 .px-gallery__all i {
  font-size: 0.95em;
  transition: transform 0.45s ease;
}

.px-gallery.style-2 .px-gallery__all:hover span {
  background-size: 100% 1.5px;
}

.px-gallery.style-2 .px-gallery__all:hover i {
  transform: translateX(4px) rotate(-45deg);
}

.px-gallery.style-2 .px-gallery__cases {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--px-gap);
}

.px-gallery.style-2 .px-gallery__case {
  min-width: 0;
}

.px-gallery.style-2 .px-gallery__media {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--px-gap);
  border-radius: var(--px-radius);
  background: color-mix(in srgb, var(--px-muted, var(--px-color-muted)) 20%, var(--px-surface-raised, var(--px-color-white)));
}

.px-gallery.style-2 .px-gallery__media img {
  display: block;
  width: 100%;
  height: var(--px-case-img-h);
  object-fit: cover;
  transition: transform 0.7s ease;
}

.px-gallery.style-2 .px-gallery__placeholder {
  display: grid;
  place-items: center;
  min-height: var(--px-case-img-h);
  color: var(--px-muted, var(--px-color-muted));
}

.px-gallery.style-2 .px-gallery__result {
  position: absolute;
  left: var(--px-gap);
  top: var(--px-gap);
  z-index: 2;
  padding: 0.55rem 1.1rem;
  border-radius: var(--px-radius-pill);
  background: var(--px-color-primary);
  color: var(--px-color-dark);
  font-size: var(--px-fs-sm);
  font-weight: 700;
  line-height: 1.2;
}

.px-gallery.style-2 .px-gallery__arrow {
  position: absolute;
  right: var(--px-gap);
  bottom: var(--px-gap);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  border: 1px solid var(--px-border-on-dark-soft);
  background: color-mix(in srgb, var(--px-ink-strong) 55%, transparent);
  color: var(--px-ink-on-dark);
  backdrop-filter: blur(10px);
  opacity: 0;
  transform: translateY(0.6rem);
  transition: opacity 0.45s ease, transform 0.45s ease, background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.px-gallery.style-2 .px-gallery__arrow:hover {
  background: var(--px-color-primary);
  border-color: var(--px-color-primary);
  color: var(--px-color-dark);
}

.px-gallery.style-2 .px-gallery__case:hover .px-gallery__media img {
  transform: scale(1.06);
}

.px-gallery.style-2 .px-gallery__case:hover .px-gallery__arrow {
  opacity: 1;
  transform: translateY(0);
}

.px-gallery.style-2 .px-gallery__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
  font-size: var(--px-fs-sm);
  font-weight: 600;
  color: var(--px-muted, var(--px-color-muted));
}

.px-gallery.style-2 .px-gallery__meta-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
}

.px-gallery.style-2 .px-gallery__case-title {
  margin: 0;
  line-height: 1.25;
}

.px-gallery.style-2 .px-gallery__case-link {
  color: inherit;
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 0% 2px;
  background-repeat: no-repeat;
  background-position: left bottom;
  transition: background-size 0.45s ease;
  padding-bottom: 3px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

.px-gallery.style-2 .px-gallery__case-link:hover {
  background-size: 100% 2px;
}

@media (max-width: 991.98px) {
  .px-gallery.style-2 .px-gallery__cases {
    grid-template-columns: 1fr;
  }

  .px-gallery.style-2 .px-gallery__head {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .px-gallery.style-2 .px-gallery__media img,
  .px-gallery.style-2 .px-gallery__placeholder {
    height: auto;
    min-height: 20rem;
  }
}
