/* ==========================================================================
   DIGITAL CRAZY HUB — ACHIEVEMENTS PAGE STYLES
   File: css/pages/achievements.css
   Architecture: HTML5, CSS3, root.css design tokens, BEM-inspired modular classes
   MANDATORY GOVERNANCE: ZERO media queries in this file.
   All responsive media queries are maintained exclusively in css/responsive.css.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page Banner Overrides for Achievements Page
   -------------------------------------------------------------------------- */
.achievements-page .page-banner-badges {
  display: none !important;
}

.achievements-page .page-banner-aside {
  display: none;
}

.achievements-page .page-banner-grid {
  grid-template-columns: 1fr;
}

.achievements-page .page-banner-content {
  max-width: 100%;
}

/* --------------------------------------------------------------------------
   Section 1: Achievements Main Gallery Container
   -------------------------------------------------------------------------- */
.achievements-section {
  padding-top: 4.5rem;
  padding-bottom: 6rem;
  background-color: var(--color-bg, #FFFFFF);
  position: relative;
}

/* Individual Gallery Group Block */
.gallery-group {
  margin-bottom: 4.5rem;
}

.gallery-group:last-child {
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Section 2: Gallery Section Header & Auto Count Badge
   -------------------------------------------------------------------------- */
.gallery-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--color-border-light, #F0F2F7);
  position: relative;
}

/* Elegant brand-blue category indicator accent */
.gallery-section-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 52px;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary, #0755C9), var(--color-primary-gradient-end, #00A3FF));
  border-radius: var(--radius-pill, 999px);
}

.gallery-section-title {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--color-navy, #0B1730);
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 14px;
  letter-spacing: -0.015em;
}

/* Dynamic Image Total Badge */
.gallery-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--radius-pill, 999px);
  background-color: var(--color-primary-soft, #F3F6FF);
  border: 1px solid rgba(7, 85, 201, 0.16);
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--color-primary, #0755C9);
  line-height: 1;
}

/* --------------------------------------------------------------------------
   Section 3: Gallery Grid (4-Column Desktop Default)
   -------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

/* Gallery Item & Card */
.gallery-item {
  position: relative;
}

.gallery-card {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  border-radius: var(--radius-md, 12px);
  text-align: left;
  outline: none;
  transition: transform var(--transition-fast, 0.25s cubic-bezier(0.16, 1, 0.3, 1)),
    box-shadow var(--transition-fast, 0.25s cubic-bezier(0.16, 1, 0.3, 1));
}

.gallery-card:hover {
  transform: translateY(-5px);
}

.gallery-card:focus-visible {
  outline: 3px solid var(--color-primary, #0755C9);
  outline-offset: 3px;
  border-radius: var(--radius-md, 12px);
}

/* Card Inner Frame — display: block ensures span container behaves as block */
.gallery-card-inner {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-md, 12px);
  background-color: var(--color-bg-alt, #F5F6FA);
  border: 1px solid var(--color-border, #E5E8F0);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(11, 23, 48, 0.06));
  transition: border-color var(--transition-fast, 0.2s ease),
    box-shadow var(--transition-fast, 0.2s ease);
}

/* Portrait aspect ratio specifically tailored for awards trophies */
#group-awards .gallery-card-inner {
  aspect-ratio: 3 / 4;
}

.gallery-card:hover .gallery-card-inner {
  border-color: rgba(7, 85, 201, 0.35);
  box-shadow: var(--shadow-md, 0 10px 28px rgba(11, 23, 48, 0.12));
}

/* Thumbnail Image */
.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.3s ease;
}

.gallery-card:hover .gallery-thumb {
  transform: scale(1.06);
}

/* Subtle Hover Zoom Overlay */
.gallery-hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(7, 85, 201, 0.45) 0%, rgba(101, 71, 245, 0.45) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-fast, 0.2s ease);
  pointer-events: none;
}

.gallery-card:hover .gallery-hover-overlay,
.gallery-card:focus-visible .gallery-hover-overlay {
  opacity: 1;
}

.gallery-zoom-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--color-primary, #0755C9);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transform: scale(0.85);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-zoom-icon svg {
  display: block;
  width: 22px;
  height: 22px;
}

.gallery-card:hover .gallery-zoom-icon,
.gallery-card:focus-visible .gallery-zoom-icon {
  transform: scale(1);
}

/* --------------------------------------------------------------------------
   Section 4: Interactive Lightbox Dialog Component
   -------------------------------------------------------------------------- */
.lightbox-dialog {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1),
    visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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

/* Translucent Dark Backdrop */
.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(5, 7, 13, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  cursor: pointer;
}

/* Main Lightbox Container */
.lightbox-container {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 24px;
  box-sizing: border-box;
  max-width: 1400px;
  margin: 0 auto;
  pointer-events: none;
}

/* Toolbar Header (Counter & Close Button) */
.lightbox-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: 14px;
  pointer-events: auto;
}

.lightbox-counter {
  font-family: var(--font-heading, 'Outfit', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 18px;
  border-radius: var(--radius-pill, 999px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.lightbox-close-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast, 0.2s ease);
}

.lightbox-close-btn:hover {
  background-color: var(--color-error, #E5484D);
  border-color: var(--color-error, #E5484D);
  transform: scale(1.08);
}

.lightbox-close-btn:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Main Lightbox Stage (Navigation + Preview Image) */
.lightbox-stage {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  overflow: hidden;
  pointer-events: auto;
  gap: 20px;
}

/* Navigation Arrow Buttons */
.lightbox-nav-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 20;
  flex-shrink: 0;
  transition: all var(--transition-fast, 0.2s ease);
}

.lightbox-nav-btn:hover {
  background-color: var(--color-primary, #0755C9);
  border-color: var(--color-primary, #0755C9);
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(7, 85, 201, 0.4);
}

.lightbox-nav-btn:focus-visible {
  outline: 2px solid #FFFFFF;
  outline-offset: 2px;
}

/* Preview Image Frame */
.lightbox-figure-wrap {
  position: relative;
  flex: 1;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: calc(100vh - 140px);
  user-select: none;
  cursor: default;
}

.lightbox-preview-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm, 6px);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
  transition: opacity 0.25s ease,
    transform 0.25s ease;
}
