.gallery-heading,
.gallery-inline-head {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.gallery-heading {
  display: grid;
  max-width: 58rem;
}

.gallery-heading p,
.gallery-inline-head p {
  color: #c74a2c;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.gallery-heading h1,
.gallery-inline-head h2 {
  margin-top: 0.9rem;
  color: #ffffff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: clamp(2.7rem, 7vw, 5.5rem);
  font-weight: 800;
  line-height: 0.95;
  text-transform: uppercase;
}

.gallery-inline-head h2 {
  font-size: clamp(2.25rem, 5vw, 4.5rem);
}

.gallery-heading span,
.gallery-inline-head span {
  display: block;
  margin-top: 1rem;
  max-width: 44rem;
  color: rgba(236, 228, 222, 0.74);
  line-height: 1.8;
}

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2.25rem 0;
}

.gallery-filter,
.gallery-inline-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  color: #ece4de;
  min-height: 3rem;
  padding: 0.82rem 1rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.gallery-filter:hover,
.gallery-filter:focus-visible,
.gallery-filter.is-active,
.gallery-inline-link:hover,
.gallery-inline-link:focus-visible {
  border-color: rgba(199, 74, 44, 0.46);
  background: rgba(199, 74, 44, 0.16);
  color: #ffffff;
  outline: none;
  transform: translateY(-1px);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.1rem;
}

.gallery-grid--inline {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.gallery-card {
  display: grid;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 1.6rem;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  text-align: left;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  border-color: rgba(199, 74, 44, 0.36);
  box-shadow: 0 26px 62px rgba(0, 0, 0, 0.28);
  outline: none;
  transform: translateY(-4px);
}

.gallery-card-media {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #121816;
}

.gallery-card-media picture,
.gallery-card-media img {
  display: block;
  width: 100%;
  height: 100%;
}

.gallery-card-media img {
  object-fit: cover;
  transition: transform 0.35s ease;
}

.gallery-card:hover .gallery-card-media img,
.gallery-card:focus-visible .gallery-card-media img {
  transform: scale(1.035);
}

.gallery-card-copy {
  display: grid;
  gap: 0.45rem;
  padding: 1rem;
}

.gallery-card-category {
  color: #c74a2c;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.gallery-card-title {
  color: #ffffff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1;
  text-transform: uppercase;
}

.gallery-card-caption,
.gallery-empty {
  color: rgba(236, 228, 222, 0.72);
  font-size: 0.9rem;
  line-height: 1.65;
}

.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(4, 7, 6, 0.86);
  backdrop-filter: blur(18px);
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox-figure {
  width: min(100%, 76rem);
  max-height: calc(100vh - 2rem);
  justify-self: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 1.8rem;
  background: #0b100e;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.gallery-lightbox-figure picture,
.gallery-lightbox-figure img {
  display: block;
  width: 100%;
}

.gallery-lightbox-figure img {
  max-height: calc(100vh - 11rem);
  object-fit: contain;
  background: #050706;
}

.gallery-lightbox-figure figcaption {
  display: grid;
  gap: 0.35rem;
  padding: 1rem 1.2rem 1.15rem;
}

.gallery-lightbox-figure strong {
  color: #ffffff;
  font-family: "Barlow Condensed", sans-serif;
  font-size: 1.55rem;
  line-height: 1;
  text-transform: uppercase;
}

.gallery-lightbox-figure span {
  color: rgba(236, 228, 222, 0.72);
  line-height: 1.6;
}

.gallery-lightbox-close,
.gallery-lightbox-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.gallery-lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 3rem;
  height: 3rem;
  font-size: 1.3rem;
}

.gallery-lightbox-nav {
  width: 3.4rem;
  height: 3.4rem;
  font-size: 2.4rem;
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus-visible,
.gallery-lightbox-nav:hover,
.gallery-lightbox-nav:focus-visible {
  border-color: rgba(199, 74, 44, 0.52);
  background: rgba(199, 74, 44, 0.72);
  outline: none;
  transform: scale(1.04);
}

body.theme-light .gallery-heading h1,
body.theme-light .gallery-inline-head h2,
body.theme-light .gallery-card-title,
body[data-theme="classic"] .gallery-heading h1,
body[data-theme="classic"] .gallery-inline-head h2,
body[data-theme="classic"] .gallery-card-title {
  color: #1d1714;
}

body.theme-light .gallery-heading span,
body.theme-light .gallery-inline-head span,
body.theme-light .gallery-card-caption,
body.theme-light .gallery-empty,
body[data-theme="classic"] .gallery-heading span,
body[data-theme="classic"] .gallery-inline-head span,
body[data-theme="classic"] .gallery-card-caption,
body[data-theme="classic"] .gallery-empty {
  color: rgba(47, 38, 31, 0.72);
}

body.theme-light .gallery-filter,
body.theme-light .gallery-inline-link,
body.theme-light .gallery-card,
body[data-theme="classic"] .gallery-filter,
body[data-theme="classic"] .gallery-inline-link,
body[data-theme="classic"] .gallery-card {
  border-color: rgba(68, 44, 31, 0.12);
  background: rgba(255, 251, 246, 0.78);
  color: #2f261f;
  box-shadow: 0 18px 42px rgba(98, 79, 49, 0.12);
}

body.theme-light .gallery-filter.is-active,
body.theme-light .gallery-filter:hover,
body.theme-light .gallery-inline-link:hover,
body[data-theme="classic"] .gallery-filter.is-active,
body[data-theme="classic"] .gallery-filter:hover,
body[data-theme="classic"] .gallery-inline-link:hover {
  color: #ffffff;
  background: rgba(199, 74, 44, 0.9);
}

@media (max-width: 767px) {
  .gallery-heading,
  .gallery-inline-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .gallery-grid,
  .gallery-grid--inline {
    grid-template-columns: 1fr;
  }

  .gallery-lightbox {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }

  .gallery-lightbox-nav {
    position: fixed;
    top: 50%;
    z-index: 2;
    width: 3rem;
    height: 3rem;
    font-size: 2rem;
  }

  .gallery-lightbox-prev {
    left: 0.75rem;
  }

  .gallery-lightbox-next {
    right: 0.75rem;
  }

  .gallery-lightbox-figure {
    border-radius: 1.2rem;
  }
}
