/* Фотогалерея и единый лайтбокс (profi-cpr.ru) */
.photo-nav-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 10px;
  background: #f4f9f8;
  border: 1px solid #d7ece9;
}

.photo-nav-bar__links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.photo-nav-bar__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #b9ded9;
  color: #006a65 !important;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none !important;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.photo-nav-bar__btn:hover,
.photo-nav-bar__btn:focus {
  background: #01948e;
  border-color: #01948e;
  color: #ffffff !important;
}

.photo-nav-bar__btn--accent {
  background: #01948e;
  border-color: #01948e;
  color: #ffffff !important;
}

.photo-nav-bar__btn--accent:hover,
.photo-nav-bar__btn--accent:focus {
  background: #006a65;
  border-color: #006a65;
  color: #ffffff !important;
}

.photo-nav-bar__hint {
  font-size: 13px;
  color: #4f6b68;
}

.f-gallery .course-mainpage p a {
  display: block;
  cursor: zoom-in;
}

.photo-all {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0 24px;
}

.photo-all__item {
  display: block;
  padding: 0;
  border: 0;
  background: #f3f7f6;
  overflow: hidden;
  border-radius: 10px;
  cursor: zoom-in;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.photo-all__item img {
  display: block;
  width: 100%;
  height: 175px;
  object-fit: cover;
  transition: transform 0.22s ease;
}

.photo-all__item:hover img,
.photo-all__item:focus img {
  transform: scale(1.04);
}

.photo-section-title {
  margin: 22px 0 10px;
  font-size: 20px;
  font-weight: 600;
  color: #003d38;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 58px 72px 20px;
  background: rgba(10, 14, 14, 0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  box-sizing: border-box;
}

.photo-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.photo-lightbox[hidden] {
  display: none !important;
}

.photo-lightbox__stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
}

.photo-lightbox__img {
  display: block;
  width: auto;
  height: auto;
  max-width: 86vw;
  max-height: 100%;
  object-fit: contain;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.65);
  transform: scale(0.97);
  transition: transform 0.2s ease;
}

.photo-lightbox.is-open .photo-lightbox__img {
  transform: scale(1);
}

.photo-lightbox__close {
  position: fixed;
  top: 12px;
  right: 18px;
  z-index: 5;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 20, 20, 0.65);
  color: #ffffff;
  font-size: 30px;
  line-height: 44px;
  text-align: center;
  cursor: pointer;
  transition: background 0.18s ease;
}

.photo-lightbox__close:hover,
.photo-lightbox__close:focus {
  background: rgba(255, 255, 255, 0.28);
}

.photo-lightbox__nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(15, 20, 20, 0.62);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.18s ease;
}

.photo-lightbox__nav:hover,
.photo-lightbox__nav:focus {
  background: rgba(255, 255, 255, 0.3);
}

.photo-lightbox__nav--prev {
  left: 16px;
}

.photo-lightbox__nav--next {
  right: 16px;
}

.photo-lightbox__footer {
  flex: 0 0 auto;
  width: 100%;
  max-width: 780px;
  text-align: center;
  pointer-events: none;
}

.photo-lightbox__caption {
  color: #f0f5f4;
  font-size: 14px;
  line-height: 1.38;
  margin-bottom: 4px;
}

.photo-lightbox__counter {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  letter-spacing: 0.4px;
}

@media (max-width: 640px) {
  .photo-all {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 10px;
  }

  .photo-all__item img {
    height: 125px;
  }

  .photo-lightbox {
    padding: 58px 12px 18px;
  }

  .photo-lightbox__img {
    max-width: 94vw;
  }

  .photo-lightbox__nav {
    width: 40px;
    height: 40px;
  }

  .photo-lightbox__nav--prev {
    left: 6px;
  }

  .photo-lightbox__nav--next {
    right: 6px;
  }

  .photo-lightbox__close {
    top: 8px;
    right: 8px;
  }

  .photo-lightbox__caption {
    font-size: 12px;
  }
}
