.gallery-page {
  padding: 48px 0 72px;
}

.gallery-page-header {
  margin-bottom: 28px;
  text-align: center;
}

.gallery-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  color: #2a2a2a;
}

.gallery-page-header p {
  margin: 0;
  color: #6b665e;
  font-size: 1rem;
  line-height: 1.7;
}

.gallery-empty {
  background: #fcfbf8;
  border: 1px solid #e2ddd4;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
  gap: 24px;
}

.gallery-card {
  width: 100%;
  background: #fcfbf8;
  border: 1px solid #e2ddd4;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
}

.gallery-card-link {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.gallery-card-image-wrap {
  aspect-ratio: 4 / 3;
  background: #ebe6dc;
  overflow: hidden;
}

.gallery-card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-card-content {
  min-height: 122px;
  padding: 18px;
}

.gallery-card-content h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #2a2a2a;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-content p {
  margin: 0;
  color: #6b665e;
  line-height: 1.6;
  max-height: calc(1em * 1.6 * 3);
  overflow: hidden;
}

.gallery-page {
  padding: 48px 0 72px;
}

.gallery-page-header {
  margin-bottom: 28px;
  text-align: center;
}

.gallery-page-header h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
  color: #2a2a2a;
}

.gallery-page-header p {
  margin: 0;
  color: #6b665e;
  font-size: 1rem;
  line-height: 1.7;
}

.gallery-empty {
  background: #fcfbf8;
  border: 1px solid #e2ddd4;
  border-radius: 20px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.05);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 320px));
  justify-content: center;
  gap: 24px;
}

.gallery-card {
  width: 100%;
  background: #fcfbf8;
  border: 1px solid #e2ddd4;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.gallery-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.1);
}

.gallery-card-link {
  display: block;
  width: 100%;
  height: 100%;
  background: transparent;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.gallery-card-image-wrap {
  aspect-ratio: 4 / 3;
  background: #ebe6dc;
  overflow: hidden;
}

.gallery-card-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.gallery-card-content {
  min-height: 122px;
  padding: 18px;
}

.gallery-card-content h2 {
  margin: 0 0 10px;
  font-size: 1.1rem;
  color: #2a2a2a;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-card-content p {
  margin: 0;
  color: #6b665e;
  line-height: 1.6;
  max-height: calc(1em * 1.6 * 3);
  overflow: hidden;
}

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

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.82);
  cursor: pointer;
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 2;
  width: min(92vw, 980px);
  height: min(88vh, 760px);
  margin: 5vh auto;
  background: #fcfbf8;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  transform: translateY(12px) scale(0.985);
  transition: transform 0.2s ease;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 106px;
}

.gallery-lightbox.is-open .gallery-lightbox-dialog {
  transform: translateY(0) scale(1);
}

.gallery-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.82);
  color: #ffffff;
  font-size: 34px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.gallery-lightbox-close:hover {
  background: rgba(17, 17, 17, 0.96);
  transform: scale(1.05);
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 17, 17, 0.82);
  color: #ffffff;
  font-size: 42px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: translateY(-50%);
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.gallery-lightbox-nav:hover {
  background: rgba(17, 17, 17, 0.96);
}

.gallery-lightbox-nav-prev {
  left: 24px;
}

.gallery-lightbox-nav-next {
  right: 24px;
}

.gallery-lightbox-image-wrap {
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #111;
  overflow: hidden;
}

.gallery-lightbox-image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.gallery-lightbox-content {
  height: 106px;
  padding: 18px 24px 20px;
  overflow: auto;
}

.gallery-lightbox-content h3 {
  margin: 0 0 8px;
  font-size: 1.3rem;
  color: #2a2a2a;
}

.gallery-lightbox-content p {
  margin: 0;
  color: #6b665e;
  line-height: 1.6;
}

@media (max-width: 768px) {
  .gallery-page {
    padding: 32px 0 52px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gallery-card {
    max-width: 100%;
  }

  .gallery-card-content {
    min-height: auto;
    padding: 16px;
  }

  .gallery-lightbox-dialog {
    width: 94vw;
    height: 88vh;
    margin: 3vh auto;
    grid-template-rows: minmax(0, 1fr) 96px;
  }

  .gallery-lightbox-image-wrap {
    padding: 12px;
  }

  .gallery-lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 12px;
  }

  .gallery-lightbox-content {
    height: 96px;
    padding: 16px 18px;
  }

  .gallery-lightbox-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 30px;
  }

  .gallery-lightbox-nav {
    width: 46px;
    height: 46px;
    font-size: 34px;
  }

  .gallery-lightbox-nav-prev {
    left: 10px;
  }

  .gallery-lightbox-nav-next {
    right: 10px;
  }

  .gallery-lightbox-content {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .gallery-page {
    padding: 32px 0 52px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gallery-card {
    max-width: 100%;
  }

  .gallery-card-content {
    min-height: auto;
    padding: 16px;
  }

  .gallery-lightbox-dialog {
    width: 94vw;
    margin: 3vh auto;
  }

  .gallery-lightbox-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 30px;
  }

  .gallery-lightbox-nav {
    width: 46px;
    height: 46px;
    font-size: 34px;
  }

  .gallery-lightbox-nav-prev {
    left: 10px;
  }

  .gallery-lightbox-nav-next {
    right: 10px;
  }

  .gallery-lightbox-content {
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .gallery-page {
    padding: 32px 0 52px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .gallery-card {
    max-width: 100%;
  }

  .gallery-card-content {
    min-height: auto;
    padding: 16px;
  }

  .gallery-lightbox-dialog {
    width: 94vw;
    margin: 3vh auto;
  }

  .gallery-lightbox-content {
    padding: 18px;
  }
}
