/* AccordionGallery Component CSS (React Bits) */
.home-gallery-section {
  padding: 80px 0;
  background: #ffffff;
}

.hgs-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.hgs-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 36px;
}

@media (max-width: 768px) {
  .hgs-header {
    flex-direction: column;
    position: static;
    gap: 16px;
    margin-bottom: 28px;
  }
}

.hgs-title-wrap {
  text-align: center;
  max-width: 720px;
  margin: 0 auto;
}

.hgs-title {
  font-size: 32px;
  font-weight: 800;
  color: #0b1f5c;
  margin: 0 0 8px 0;
}

.hgs-title span {
  color: #2563eb;
}

.hgs-subtitle {
  font-size: 14.5px;
  color: #64748b;
  margin: 0;
}

.hgs-more-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  color: #2563eb;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 99px;
  text-decoration: none;
  transition: all 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}

@media (max-width: 768px) {
  .hgs-more-btn {
    position: static;
    transform: none;
  }
}

.hgs-more-btn:hover {
  background: #2563eb;
  color: #ffffff;
  transform: translateY(-50%) translateX(3px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

@media (max-width: 768px) {
  .hgs-more-btn:hover {
    transform: translateX(3px);
  }
}

.accordion-gallery {
  --ag-accent: #ffffff;
  --ag-overlay: #060010;
  --ag-text: #ffffff;
  --ag-gap: 10px;
  --ag-radius: 16px;
  --ag-media-size: 320px;

  display: flex;
  flex-direction: row;
  gap: var(--ag-gap);
  width: 100%;
  max-width: 100%;
  height: 460px;
  perspective: 1400px;
  perspective-origin: 50% 50%;
}

.accordion-gallery--vertical {
  flex-direction: column;
}

.ag-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 20px;
  cursor: pointer;
  display: block;
  text-decoration: none;
  outline: none;
  transform-style: preserve-3d;
  transform-origin: center center;
  background: #ffffff;
  padding: 4px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  will-change: flex-grow, transform;
  -webkit-tap-highlight-color: transparent;
}

.ag-panel:focus-visible {
  box-shadow:
    0 0 0 2px var(--ag-accent),
    0 10px 30px -18px rgba(0, 0, 0, 0.8);
}

.ag-panel__frame {
  position: absolute;
  inset: 4px;
  overflow: hidden;
  border-radius: 16px;
}

.ag-panel__media {
  --ag-gray: 0;
  --ag-dim: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--ag-media-size);
  height: 100%;
  filter: grayscale(0) brightness(1.1) contrast(1.05);
  will-change: transform, filter;
  transform: translate(-50%, -50%);
}

.accordion-gallery--vertical .ag-panel__media {
  width: 100%;
  height: var(--ag-media-size);
}

.ag-panel__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.ag-panel__overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 70%, rgba(0,0,0,0.2) 100%);
}

.ag-panel__label {
  display: none !important;
}

.ag-panel__bar {
  flex: 0 0 auto;
  width: 3px;
  height: 26px;
  border-radius: 3px;
  background: var(--ag-accent);
  opacity: 0;
  box-shadow: 0 0 12px color-mix(in srgb, var(--ag-accent) 60%, transparent);
}

.ag-panel__text {
  color: var(--ag-text);
  font-family: inherit;
  font-weight: 600;
  font-size: clamp(1rem, 1.4vw, 1.4rem);
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55);
}

@media (max-width: 768px) {
  .accordion-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    height: auto !important;
    min-height: 0 !important;
    perspective: none;
    overflow: visible;
  }

  .ag-panel {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    height: auto !important;
    min-height: 130px;
    border-radius: 18px;
    padding: 0;
    overflow: hidden;
    flex: none !important;
    transform: none !important;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
  }

  .ag-panel.ag-panel--active {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
  }

  .ag-panel:active {
    transform: scale(0.98) !important;
  }

  .ag-panel__frame {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 18px;
    overflow: hidden;
  }

  .accordion-gallery .ag-panel__media,
  .ag-panel__media {
    position: absolute !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    transform: none !important;
    width: 100% !important;
    height: 100% !important;
  }

  .ag-panel__media img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    display: block !important;
  }

  .ag-panel__overlay {
    position: absolute !important;
    inset: 0 !important;
    background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(15, 23, 42, 0.75) 100%) !important;
    pointer-events: none;
  }

  .ag-panel__label {
    display: flex !important;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    padding: 6px 10px;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 10px;
    color: #ffffff;
    align-items: center;
    gap: 6px;
    z-index: 3;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.15);
  }

  .ag-panel__bar {
    display: inline-block !important;
    width: 3px;
    height: 12px;
    background: #3b82f6;
    border-radius: 2px;
    opacity: 1 !important;
    flex-shrink: 0;
  }

  .ag-panel__text {
    display: block !important;
    opacity: 1 !important;
    color: #ffffff !important;
    font-size: 11.5px !important;
    font-weight: 600 !important;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

@media (max-width: 520px) {
  .accordion-gallery {
    gap: 10px;
  }

  .ag-panel {
    aspect-ratio: 4 / 3;
  }
  .ag-panel.ag-panel--active {
    grid-column: span 2;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ag-panel,
  .ag-panel__media {
    will-change: auto;
  }
}
