:root {
  --popup-bg: #ffffff;
  --popup-border: #dbdbdb;
  --popup-text: #262626;
  --popup-muted: #8e8e8e;
}

.custom-mfp-popup .popup-content {
  display: flex;
  width: min(96vw, 1520px);
  height: min(90vh, 960px);
  background: var(--popup-bg);
  border: 0px solid var(--popup-border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.custom-mfp-popup .popup-main {
  flex: 1 1 auto;
  min-width: 0;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.custom-mfp-popup .popup-main img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.custom-mfp-popup .popup-main.is-panorama img {
  object-fit: contain;
  object-position: center center;
  width: 100%;
  height: 100%;
}

.custom-mfp-popup .popup-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: rgba(0, 0, 0, 0.45);
  border: none;
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
  outline: none;
}

.custom-mfp-popup .popup-nav::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 18px 18px;
  filter: invert(1);
}

.custom-mfp-popup .popup-nav:hover {
  background: rgba(0, 0, 0, 0.75);
}

.custom-mfp-popup .popup-prev {
  left: 14px;
}

.custom-mfp-popup .popup-prev::before {
  background-image: url("../../images/left.svg");
}

.custom-mfp-popup .popup-next {
  right: 14px;
}

.custom-mfp-popup .popup-next::before {
  background-image: url("../../images/right.svg");
}

.custom-mfp-popup .popup-sidebar {
  width: 360px;
  max-width: 40vw;
  min-width: 300px;
  background: var(--popup-bg);
  position: relative;
  color: var(--popup-text);
  display: flex;
  flex-direction: column;
}

.custom-mfp-popup .popup-sidebar::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("../../images/logo_dark.png");
  background-repeat: no-repeat;
  background-position: center center;
  top: 25rem;
  background-size: 150% auto;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.custom-mfp-popup .popup-sidebar > * {
  position: relative;
  z-index: 1;
}

.custom-mfp-popup .sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--popup-border);
}

.custom-mfp-popup .sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 20%;
  /* background: linear-gradient(135deg, #ff8a00, #e52e71); */
  background-image: url("../../images/de.svg");
  background-position: center;
  background-size: cover;
  /* color: #fff; */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.custom-mfp-popup .sidebar-account {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.custom-mfp-popup .sidebar-username {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}

.custom-mfp-popup .sidebar-location {
  font-size: 11px;
  color: #e41919;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.custom-mfp-popup .sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.custom-mfp-popup .sidebar-caption {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--popup-text);
  word-break: break-word;
}

.custom-mfp-popup .sidebar-caption-user {
  margin-right: 8px;
}

.custom-mfp-popup .sidebar-footer {
  border-top: 1px solid var(--popup-border);
}

.custom-mfp-popup .sidebar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  font-size: 21px;
}

.custom-mfp-popup .sidebar-actions i {
  cursor: default;
}

.custom-mfp-popup .sidebar-comment {
  border-top: 1px solid var(--popup-border);
  padding: 10px 16px;
}

.custom-mfp-popup .sidebar-comment input {
  width: 100%;
  border: 0;
  outline: 0;
  font-size: 14px;
  color: var(--popup-text);
  background: transparent;
}

.custom-mfp-popup .sidebar-comment input::placeholder {
  color: var(--popup-muted);
}

.mfp-bg {
  background: rgba(0, 0, 0, 0.88);
}

.mfp-content {
  max-width: none;
}

.custom-mfp-wrapper #image-popup-template,
.custom-mfp-wrapper .custom-mfp-popup {
  width: auto !important;
  margin: 0 auto !important;
  display: flex;
  justify-content: center;
}

.custom-mfp-wrapper .mfp-container {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 24px !important;
  text-align: center;
}

.custom-mfp-wrapper .mfp-content {
  display: inline-block !important;
  width: auto !important;
  max-width: calc(100vw - 48px) !important;
  margin: 0 auto !important;
}

.custom-mfp-wrapper.mfp-inline-holder .mfp-content,
.custom-mfp-wrapper.mfp-ajax-holder .mfp-content {
  width: auto !important;
}

.custom-mfp-wrapper .mfp-container:before {
  display: none;
}

@media (max-width: 991px) {
  .custom-mfp-wrapper .mfp-container {
    padding: 14px;
  }

  .custom-mfp-popup .popup-content {
    height: 88vh;
  }

  .custom-mfp-popup .popup-sidebar {
    width: 320px;
    min-width: 280px;
  }
}

@media (max-width: 767px) {
  .custom-mfp-popup .popup-content {
    flex-direction: column;
    width: 95vw;
    height: 92vh;
  }

  .custom-mfp-popup .popup-main {
    height: 52vh;
    flex: 0 0 auto;
  }

  .custom-mfp-popup .popup-sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    flex: 1;
  }
}
