/* Gallery Page Dedicated Styles */

/* Only gallery-specific additions to avoid overriding main site styles */
/* Keep variables in case gallery needs standalone rendering */
:root {
  --accent: #2563eb;
  --border: #e2e8f0;
  --shadow: 0 10px 25px rgba(0,0,0,0.08);
  --radius: 14px;
}

/* Hero */
.gallery-hero { background: linear-gradient(135deg, #eef2ff 0%, #f8fafc 100%); padding: 60px 0; border-bottom: 1px solid var(--border); }
.gallery-hero h1 { font-size: 2.2rem; margin: 0 0 10px; }
.gallery-hero p { margin: 0; color: var(--text-secondary); }

/* Sections */
.gallery-section { padding: 50px 0; }
.gallery-page { padding-top: 100px; }
.gallery-header { margin-bottom: 20px; }
.gallery-title { font-size: 1.6rem; margin: 0 0 6px; }
.gallery-subtitle { color: var(--text-secondary); margin: 0; }

/* Grid */
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.gallery-item { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: box-shadow .2s ease; }
.gallery-item:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0,0,0,0.12); }
.gallery-item img { display: block; width: 100%; height: 220px; object-fit: cover; backface-visibility: hidden; transform: translateZ(0); }
.gallery-item img { image-rendering: auto; }
/* Ensure Best Performers banner shows fully (no crop) */
#best-performers-2025 .gallery-item img,
#best-performers-2025-2 .gallery-item img { height: auto; object-fit: contain; object-position: center; }

/* Simple two-slide carousel for Best Performers */
#best-performers-2025 .bp-carousel,
#best-performers-2025-2 .bp-carousel { position: relative; }
#best-performers-2025 .bp-slide,
#best-performers-2025-2 .bp-slide { display: none; width: 100%; height: auto; }
#best-performers-2025 .bp-slide.active,
#best-performers-2025-2 .bp-slide.active { display: block; }
#best-performers-2025 .gallery-grid,
#best-performers-2025-2 .gallery-grid { grid-template-columns: 1fr; justify-items: center; }
#best-performers-2025 .bp-nav,
#best-performers-2025-2 .bp-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 0;
  background: rgba(15, 23, 42, 0.85); /* dark slate */
  color: #fff;
  box-shadow: 0 6px 16px rgba(0,0,0,0.25);
  cursor: pointer;
}
#best-performers-2025 .bp-prev,
#best-performers-2025-2 .bp-prev { left: 8px; }
#best-performers-2025 .bp-next,
#best-performers-2025-2 .bp-next { right: 8px; }
#best-performers-2025 .bp-nav:hover,
#best-performers-2025-2 .bp-nav:hover { filter: brightness(1.1); }

#best-performers-2025 .bp-dots,
#best-performers-2025-2 .bp-dots {
  position: static;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
  grid-column: 1 / -1; /* ensure it sits under the image in the grid */
}
#best-performers-2025 .bp-dot,
#best-performers-2025-2 .bp-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: #94a3b8; /* slate-400 visible on light bg */
  border: 0;
  opacity: 0.8;
}
#best-performers-2025 .bp-dot.active,
#best-performers-2025-2 .bp-dot.active {
  background: var(--primary-color, #2563eb);
  opacity: 1;
  box-shadow: 0 0 0 2px rgba(37,99,235,0.25);
}

/* Dark mode tweaks */
body.dark-mode #best-performers-2025 .bp-dot,
body.dark-mode #best-performers-2025-2 .bp-dot {
  background: rgba(255,255,255,0.5);
}
body.dark-mode #best-performers-2025 .bp-dot.active,
body.dark-mode #best-performers-2025-2 .bp-dot.active {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.25);
}
.gallery-item.offset-down img { object-position: 50% 35%; }
.gallery-item figcaption { padding: 10px 12px; font-weight: 600; color: var(--text-primary); }

/* Video grid */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }
.video-item { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); background: #000; }
.video-wrapper { position: relative; width: 100%; padding-top: 56.25%; }
.video-wrapper iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Actions */
.gallery-actions { margin-top: 24px; }
.btn { display: inline-flex; gap: 8px; align-items: center; padding: 12px 16px; border-radius: 10px; text-decoration: none; font-weight: 600; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }

/* Floating Buttons */
.floating-buttons { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.floating-buttons a { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; color: #fff; text-decoration: none; box-shadow: var(--shadow); }
.whatsapp-btn { background: #25D366; }
.call-btn { background: #10b981; }

/* Footer uses main site styles from styles.css */

@media (max-width: 768px) {
  .gallery-page { padding-top: 90px; }
  .gallery-title { font-size: 1.4rem; }
  .gallery-grid { grid-template-columns: 1fr; gap: 16px; }
  .gallery-item img { height: 180px; }
  /* Hide carousel chevrons on mobile for both sections */
  #best-performers-2025 .bp-nav,
  #best-performers-2025-2 .bp-nav { display: none !important; }
  /* Certificate Distribution: show full image on mobile */
  #certificate-distribution .gallery-item img { height: auto; object-fit: contain; object-position: center; }
  .video-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .gallery-page { padding-top: 80px; }
  .gallery-item img { height: 160px; }
  #certificate-distribution .gallery-item img { height: auto; object-fit: contain; object-position: center; }
}

/* Tablet: also show full image for Certificate Distribution */
@media (min-width: 769px) and (max-width: 1024px) {
  #certificate-distribution .gallery-item img { height: auto; object-fit: contain; object-position: center; }
  .video-grid { grid-template-columns: 1fr 1fr; }
}
