/* Портрет преподавателя — без искажений, с акцентной рамкой */

#teacher [data-animate],
#teacher [data-animate].animate-in {
  opacity: 1;
  transform: none;
}

.teacher-photo-frame {
  --teacher-photo-width: min(100%, 520px);
  position: relative;
  display: inline-block;
  width: var(--teacher-photo-width);
  aspect-ratio: 5 / 4;
  box-sizing: border-box;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  padding: 5px;
  background: linear-gradient(135deg, #f39c12 0%, #ffc857 28%, #00cec9 62%, #16213e 100%);
  box-shadow:
    0 24px 54px rgba(22, 33, 62, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.92);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  vertical-align: middle;
  background-color: #f7fafc;
  cursor: zoom-in;
  font: inherit;
  color: inherit;
  text-align: inherit;
}

.teacher-photo-frame:hover {
  transform: translateY(-6px);
  box-shadow:
    0 28px 60px rgba(0, 184, 148, 0.35),
    0 0 0 2px rgba(255, 255, 255, 0.95);
}

.teacher-photo-frame img,
.teacher-photo-frame .teacher-photo,
img.teacher-photo {
  width: 100%;
  height: 100%;
  max-width: none !important;
  object-fit: cover;
  object-position: center center;
  border-radius: 19px;
  display: block;
  border: 0;
  box-shadow: none;
  background: #edf2f7;
}

#teacher .teacher-photo-frame,
#teacher .col-lg-5.text-center {
  text-align: center;
}

#teacher .teacher-photo-frame {
  margin-inline: auto;
}

.director-block__photo .teacher-photo-frame {
  --teacher-photo-width: min(100%, 480px);
  margin-bottom: 0.75rem;
}

@media (min-width: 992px) {
  .director-block__photo {
    padding-inline: 1.5rem;
  }
}

.director-block__photo .teacher-photo-frame:hover {
  transform: translateY(-4px);
}

.teacher-photo-zoom__hint {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 33, 62, 0.72);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.teacher-photo-frame:hover .teacher-photo-zoom__hint,
.teacher-photo-frame:focus-visible .teacher-photo-zoom__hint {
  opacity: 1;
  transform: translateY(0);
}

.teacher-photo-frame:focus-visible {
  outline: 3px solid rgba(0, 206, 201, 0.85);
  outline-offset: 4px;
}

body.teacher-photo-lightbox-open {
  overflow: hidden;
}

.teacher-photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.teacher-photo-lightbox[hidden] {
  display: none !important;
}

.teacher-photo-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 16, 32, 0.86);
  backdrop-filter: blur(4px);
}

.teacher-photo-lightbox__dialog {
  position: relative;
  z-index: 1;
  width: min(96vw, 1200px);
  max-height: 92vh;
  margin: 0;
  padding: 0.75rem;
  border-radius: 24px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98));
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.75);
  animation: teacher-photo-lightbox-in 0.28s ease;
}

.teacher-photo-lightbox__image {
  display: block;
  width: 100%;
  max-height: calc(92vh - 4.5rem);
  object-fit: contain;
  border-radius: 18px;
  background: #0f172a;
}

.teacher-photo-lightbox__caption {
  margin: 0.75rem 0.35rem 0.15rem;
  color: #16213e;
  font-size: 0.98rem;
  font-weight: 600;
  text-align: center;
}

.teacher-photo-lightbox__close {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(22, 33, 62, 0.82);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.teacher-photo-lightbox__close:hover {
  transform: scale(1.05);
  background: rgba(243, 156, 18, 0.95);
}

@keyframes teacher-photo-lightbox-in {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .teacher-photo-frame,
  .teacher-photo-frame:hover {
    transition: none;
    transform: none;
  }

  .teacher-photo-zoom__hint {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .teacher-photo-lightbox__dialog {
    animation: none;
  }
}
