/* ==========================================================================
   Section: p-gallery-slider
   Page: single-projekt
   ========================================================================== */

.p-gallery-slider {
  container-type: inline-size;
  container-name: p-gallery-slider;
}

/* Header */
.p-gallery-slider__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.p-gallery-slider__title {
  font-family: var(--font-primary);
  font-size: var(--text-2xl);
  font-weight: 300;
  color: var(--text-title);
  margin: 0;
}

.p-gallery-slider__controls {
  display: flex;
  align-items: center;
  gap: var(--space-m);
}

.p-gallery-slider__nav {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border-primary);
  border-radius: 50%;
  color: var(--text-body);
  cursor: pointer;
  transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.p-gallery-slider__nav:hover {
  background: var(--text-title);
  border-color: var(--text-title);
  color: var(--bg-body);
}

.p-gallery-slider__nav i,
.p-gallery-slider__nav svg {
  width: 20px;
  height: 20px;
}

.p-gallery-slider__counter {
  font-family: var(--font-secondary);
  font-size: var(--text-s);
  color: var(--text-body);
  min-width: 50px;
  text-align: center;
}

/* Main Slider */
.p-gallery-slider__main {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--space-l);
}

.p-gallery-slider__track {
  display: flex;
  transition: transform 0.5s ease;
}

.p-gallery-slider__slide {
  flex: 0 0 100%;
  margin: 0;
}

.p-gallery-slider__image {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

/* Thumbnails */
.p-gallery-slider__thumbnails {
  display: flex;
  gap: var(--space-s);
  overflow-x: auto;
  padding-bottom: var(--space-xs);
  scrollbar-width: thin;
  scrollbar-color: var(--border-primary) transparent;
}

.p-gallery-slider__thumbnails::-webkit-scrollbar {
  height: 4px;
}

.p-gallery-slider__thumbnails::-webkit-scrollbar-track {
  background: transparent;
}

.p-gallery-slider__thumbnails::-webkit-scrollbar-thumb {
  background: var(--border-primary);
  border-radius: var(--radius-full);
}

.p-gallery-slider__thumb {
  flex: 0 0 auto;
  width: 100px;
  height: 68px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-s);
  background: none;
  cursor: pointer;
  overflow: hidden;
  opacity: 0.6;
  transition: opacity 0.3s ease, border-color 0.3s ease;
}

.p-gallery-slider__thumb:hover {
  opacity: 0.9;
}

.p-gallery-slider__thumb.is-active {
  border-color: var(--primary);
  opacity: 1;
}

.p-gallery-slider__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Container Queries */
@container p-gallery-slider (max-width: 968px) {
  .p-gallery-slider__title {
    font-size: var(--text-xl);
  }

  .p-gallery-slider__thumb {
    width: 90px;
    height: 60px;
  }
}

@container p-gallery-slider (max-width: 768px) {
  .p-gallery-slider__header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-m);
  }

  .p-gallery-slider__image {
    aspect-ratio: 4 / 3;
  }

  .p-gallery-slider__nav {
    width: 40px;
    height: 40px;
  }
}

@container p-gallery-slider (max-width: 640px) {
  .p-gallery-slider__thumb {
    width: 80px;
    height: 54px;
  }
}

@container p-gallery-slider (max-width: 480px) {
  .p-gallery-slider__title {
    font-size: var(--text-l);
  }

  .p-gallery-slider__thumb {
    width: 70px;
    height: 48px;
  }

  .p-gallery-slider__thumbnails {
    gap: var(--space-xs);
  }
}
