.modal-img { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 3000; align-items: center; justify-content: center; padding: 32px; cursor: zoom-out; }
.modal-img.active { display: flex; }
.modal-img img { max-width: 95vw; max-height: 95vh; object-fit: contain; cursor: default; animation: zoomIn .3s ease; }
.modal-img .close-btn { position: absolute; top: 20px; right: 20px; width: 50px; height: 50px; background: rgba(255,255,255,.1); border: 2px solid rgba(255,255,255,.3); border-radius: 50%; color: #fff; font-size: 2rem; display: grid; place-items: center; cursor: pointer; transition: .3s; }
.modal-img .close-btn:hover { background: rgba(255,255,255,.2); transform: rotate(90deg); }
@keyframes zoomIn { from { transform: scale(.8); opacity: 0; } to { transform: scale(1); opacity: 1; } }
/* === ПОЛНОЭКРАННАЯ ГАЛЕРЕЯ ДОКУМЕНТОВ === */
.doc-gallery {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(25, 27, 24, 0.97);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(6px);
}

.doc-gallery.active {
  display: flex;
  opacity: 1;
}

.doc-gallery-stage {
  position: relative;
  width: 90vw;
  height: 85vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.doc-gallery-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 15px 60px rgba(0,0,0,0.6);
  opacity: 1;
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.doc-gallery-stage img.loading {
  opacity: 0;
}

.doc-gallery-loader {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(243, 239, 229, 0.2);
  border-top-color: #A8823C;
  border-radius: 50%;
  animation: doc-spin 0.8s linear infinite;
  display: none;
}

.doc-gallery-loader.active { display: block; }

@keyframes doc-spin {
  to { transform: rotate(360deg); }
}

.doc-gallery-close {
  position: absolute;
  top: 20px;
  right: 30px;
  background: rgba(243, 239, 229, 0.08);
  border: 1px solid rgba(243, 239, 229, 0.2);
  color: #F3EFE5;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10002;
}

.doc-gallery-close:hover {
  background: rgba(168, 130, 60, 0.3);
  border-color: #A8823C;
  transform: rotate(90deg);
}

.doc-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(243, 239, 229, 0.08);
  color: #F3EFE5;
  border: 1px solid rgba(243, 239, 229, 0.2);
  font-size: 2.8rem;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10001;
  font-family: Georgia, serif;
}

.doc-gallery-nav:hover {
  background: rgba(168, 130, 60, 0.3);
  border-color: #A8823C;
}

.doc-gallery-nav.prev { left: 30px; }
.doc-gallery-nav.next { right: 30px; }

.doc-gallery-counter {
  position: absolute;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: #A8823C;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 2px;
  background: rgba(25, 27, 24, 0.6);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid rgba(243, 239, 229, 0.15);
}

.doc-gallery-caption {
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  color: #A8823C;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 1px;
  text-align: center;
  max-width: 80vw;
}

.doc-gallery-hint {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(243, 239, 229, 0.45);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Эффект при наведении на миниатюру */
.cert-item .img-wrap { position: relative; overflow: hidden; }
.cert-item .zoom-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 2rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 3;
}

.cert-item .img-wrap:hover .zoom-hint { opacity: 1; }
.cert-item .img-wrap:hover img { 
  filter: brightness(0.75); 
  transform: scale(1.02);
  transition: filter 0.25s, transform 0.35s;
}

/* Адаптив для телефонов */
@media (max-width: 768px) {
  .doc-gallery-nav {
    width: 44px;
    height: 44px;
    font-size: 2rem;
  }
  .doc-gallery-nav.prev { left: 10px; }
  .doc-gallery-nav.next { right: 10px; }
  .doc-gallery-close { top: 12px; right: 12px; width: 40px; height: 40px; font-size: 1.6rem; }
  .doc-gallery-stage { width: 96vw; height: 75vh; }
  .doc-gallery-caption { font-size: 0.95rem; bottom: 50px; }
  .doc-gallery-hint { font-size: 0.7rem; }
}
/* Подсказку про колесико опускаем в самый низ, чтобы не мешала */
#docGallery .doc-gallery-hint {
  bottom: 6px !important;
  font-size: .68rem !important;
}
/* ======================================================
   ЦВЕТ ПОДПИСИ «ДЕЛО № …» В ГАЛЕРЕЕ
   Меняйте только значение в строке  color: ...
   ====================================================== */
#docGallery .doc-gallery-caption {
  color: #A8823C !important;              /* ← ВОТ ЗДЕСЬ меняйте цвет */
  bottom: 26px !important;
  top: auto !important;
  text-shadow: 0 2px 12px rgba(0,0,0,0.9);
  font-weight: 600;
}