/* ACH Sine Gallery Styles */
.ach-sine-gallery-wrapper {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 2em auto;
  text-align: center;
  max-height: 600px;
  overflow: hidden;
  position: relative;
  border-radius: 12px;
}
.ach-sine-gallery-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 32px auto;
  max-width: 700px;
  text-align: center;
  gap: 8px;
  position: absolute !important;
  background: var(--color-neutral-object);
  bottom: 10%;
  left: 0;
  right: 0;
  border-radius: 12px;
  padding: 32px;
}
.ach-sine-gallery-meta .badge-shortcode {
  align-self: center !important;
}
.ach-sine-gallery-title {
  font-size: 40px;
  font-weight: 600;
  text-align: center;
  margin: 0;
  color: var(--color-neutral-heading);
}
.ach-sine-gallery-subtitle {
  font-size: 18px;
  color: var(--color-body);
  text-align: center;
}
.ach-sine-gallery-scroll {
  width: 100%;
  overflow-x: hidden;
  overflow-y: hidden;
  scrollbar-width: none; /* Firefox */
}
.ach-sine-gallery-scroll::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}
/* Desktop: show all 8 columns */
.ach-sine-gallery-grid {
  display: flex;
  flex-direction: row;
  gap: 18px;
  min-height: 480px;
  position: relative;
  padding: 0.5em 0;
  margin: 0 auto;
  justify-content: center;
}
.ach-sine-gallery-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  flex: 0 0 220px;
  align-items: center;
  position: relative;
}
.ach-sine-gallery-img-wrap {
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--color-object-accent-silent);
  border-radius: 12px;
  margin-bottom: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.07);
  transition: box-shadow 0.2s;
}
.ach-sine-gallery-img-wrap:active {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.13);
}
.ach-sine-gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  aspect-ratio: 2/3;
}
/* Overlay for muted columns (1,2,7,8) */
.ach-sine-gallery-col.overlay .ach-sine-gallery-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.65);
  pointer-events: none;
  border-radius: 12px;
  z-index: 2;
  transition: background 0.2s;
}
/* Remove overlay on hover */
.ach-sine-gallery-col.overlay:hover .ach-sine-gallery-img-wrap::after {
  background: rgba(255, 255, 255, 0);
}

/* Lightbox styles */
.ach-sine-gallery-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  flex-direction: column;
  transition: opacity 0.2s;
}
.ach-sine-gallery-lightbox-img {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  margin: 0 0 1em 0;
}
.ach-sine-gallery-lightbox-close,
.ach-sine-gallery-lightbox-prev,
.ach-sine-gallery-lightbox-next {
  position: absolute;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 2.2rem;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  top: 32px;
  cursor: pointer;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.ach-sine-gallery-lightbox-close {
  right: 32px;
}
.ach-sine-gallery-lightbox-prev {
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
}
.ach-sine-gallery-lightbox-next {
  right: 32px;
  top: 50%;
  transform: translateY(-50%);
}
/* Responsive: always show 4 center columns visible and focused */
@media (max-width: 900px) {
  .ach-sine-gallery-title {
    font-size: 32px;
  }
}
@media (max-width: 600px) {
  .ach-sine-gallery-title {
    font-size: 24px;
  }
  .ach-sine-gallery-meta {
    padding: 16px;
  }
  .ach-sine-gallery-meta .badge-shortcode {
    margin-bottom: 0.5em;
  }
}

/* Tablet & Mobile: always show 4 columns, reduce width to fit viewport */
@media (max-width: 1024px) {
  .ach-sine-gallery-grid {
    width: 100%;
    gap: 2vw;
    min-height: 320px;
    justify-content: center;
  }
  .ach-sine-gallery-col {
    flex: 0 0 calc((100% - 3 * 2vw) / 4);
    width: calc((100% - 3 * 2vw) / 4);
    box-sizing: border-box;
  }
}
@media (max-width: 600px) {
  .ach-sine-gallery-grid {
    width: 100%;
    gap: 2vw;
    min-height: 220px;
    justify-content: center;
  }
  .ach-sine-gallery-col {
    flex: 0 0 calc((100% - 3 * 2vw) / 4);
    width: calc((100% - 3 * 2vw) / 4);
    box-sizing: border-box;
  }
}
