/* Gallery Grid */
.gallery-hero {
  padding-top: 8rem;
  padding-bottom: 4rem;
  text-align: center;
  background: var(--dark);
  color: var(--text-light);
}

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

.gallery-item {
  cursor: pointer;
}

.gallery-item-image {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
}

.gallery-item img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
  transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover img {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-overlay-text {
  text-align: left;
  font-size: 0.8rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.85);
}

.gallery-item-overlay-text p {
  margin-bottom: 0.75rem;
}

.gallery-item-overlay-text p:last-child {
  margin-bottom: 0;
}

.gallery-item .caption {
  padding: 0.75rem 0;
}

.gallery-item .caption h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  margin-bottom: 0.15rem;
}

.gallery-item .caption .title-kh {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.gallery-item .caption .meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}

.lightbox.open {
  display: flex;
}

.lightbox-content {
  display: flex;
  max-width: 1400px;
  width: 95%;
  max-height: 90vh;
  gap: 2rem;
  align-items: center;
}

.lightbox-image {
  flex: 1;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image img {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-info {
  width: 320px;
  flex-shrink: 0;
  color: #fff;
  padding: 2rem 0;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.lightbox-info h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.lightbox-info .title-kh {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.5);
  margin-bottom: 1rem;
}

.lightbox-info .meta {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1.5rem;
}

.lightbox-info .description {
  font-size: 0.95rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.7);
}

.lightbox-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  line-height: 1;
}
.lightbox-close:hover { opacity: 1; }

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  opacity: 0.4;
  transition: opacity 0.2s;
  padding: 1rem;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* Featured painting (full-width standalone section) */
.featured-painting {
  text-align: center;
  padding: 4rem 0;
}

.featured-painting h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.5rem, 3vw, 2rem);
  margin-bottom: 0.25rem;
}

.featured-painting .title-kh {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.featured-painting .meta {
  font-size: 0.9rem;
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 2rem;
}

.featured-painting-image {
  position: relative;
  display: inline-block;
  max-width: 100%;
  border-radius: 4px;
  overflow: hidden;
  cursor: default;
}

.featured-painting-image img {
  max-width: 100%;
  display: block;
  border-radius: 4px;
}

.featured-painting-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 3rem;
  overflow: hidden;
}

.featured-painting-image {
  cursor: pointer;
}

.featured-painting-image:hover .featured-painting-overlay {
  opacity: 1;
}

.featured-painting-overlay-text {
  max-width: 900px;
  text-align: left;
  font-size: 0.9rem;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.featured-painting-overlay-text p {
  margin-bottom: 1rem;
}

.featured-painting-overlay-text p:last-child {
  margin-bottom: 0;
}

/* Responsive */
@media (max-width: 1024px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .lightbox-content { flex-direction: column; }
  .lightbox-info { width: 100%; max-height: 30vh; overflow-y: auto; padding: 1rem 0; }
}

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; max-width: 400px; margin: 0 auto; }
}
