/* ═══════════════════════════════════════
   Gallery Page
   ═══════════════════════════════════════ */

.gallery-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.gallery-filter-btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.gallery-filter-btn:hover {
  border-color: var(--green);
  color: var(--green);
}

.gallery-filter-btn.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

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

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  padding: 0;
  border: none;
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  text-decoration: none;
  color: inherit;
}

.gallery-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

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

.gallery-card-thumb-fallback {
  background: linear-gradient(135deg, var(--green), var(--green-dark));
}

.gallery-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.gallery-card-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 52px;
  height: 52px;
  border-radius: var(--radius-full);
  background: rgba(26, 42, 31, 0.55);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-card-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 36px 16px 14px;
  background: linear-gradient(to top, rgba(26, 42, 31, 0.9), transparent);
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  line-height: 22px;
}

.gallery-empty {
  text-align: center;
  padding: 64px 20px;
}

.gallery-empty-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 8px;
}

.gallery-empty-desc {
  font-size: 16px;
  color: var(--text);
}

/* ── Lightbox ── */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(10, 16, 12, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}

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

.gallery-lightbox-content {
  max-width: 1100px;
  width: 100%;
  max-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox-content img {
  max-width: 100%;
  max-height: calc(100vh - 140px);
  border-radius: var(--radius-md);
  object-fit: contain;
}

/* Article preview card, shown in the lightbox instead of embedding the
   external page (most sites block being framed by another origin). */
.gallery-lightbox-content .gallery-article-preview {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow-y: auto;
  max-width: 640px;
  max-height: calc(100vh - 140px);
  width: 100%;
  text-align: left;
}

.gallery-lightbox-content .gallery-article-preview-image {
  width: 100%;
  height: 280px;
  max-height: none;
  border-radius: 0;
  object-fit: cover;
  display: block;
}

.gallery-article-preview-body {
  padding: 28px 32px 32px;
}

.gallery-article-preview-body .gallery-card-badge {
  position: static;
  display: inline-block;
  margin-bottom: 14px;
}

.gallery-article-preview-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--dark);
  line-height: 28px;
  margin-bottom: 12px;
}

.gallery-article-preview-desc {
  font-size: 15px;
  color: var(--text);
  line-height: 24px;
  margin-bottom: 24px;
}

.gallery-article-preview-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--green);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  padding: 12px 22px;
  border-radius: var(--radius-full);
  text-decoration: none;
  transition: var(--transition-fast);
}

.gallery-article-preview-cta:hover {
  background: var(--green-dark);
}

.gallery-lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  text-align: center;
  color: var(--white);
  font-size: 16px;
  font-weight: 700;
  padding: 0 80px;
}

.gallery-lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.gallery-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.24);
}

.gallery-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
}

.gallery-lightbox-nav:hover {
  background: rgba(255, 255, 255, 0.24);
}

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

@media (max-width: 768px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .gallery-lightbox { padding: 20px; }
  .gallery-lightbox-nav { width: 40px; height: 40px; }
  .gallery-lightbox-prev { left: 8px; }
  .gallery-lightbox-next { right: 8px; }
  .gallery-lightbox-caption { padding: 0 50px; }
}

@media (max-width: 480px) {
  .gallery-grid { grid-template-columns: 1fr; }
}
