.certificate-open {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
}

.certificate-open:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 3px;
}

.certificate-list .list .pic {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  padding: 10px;
  box-sizing: border-box;
  border: 1px solid #eee;
  border-bottom: 0;
  background: #fff;
}

.certificate-list .list .pic img {
  display: block;
  width: 240px;
  max-width: 100%;
  height: 340px;
  object-fit: contain;
}

.certificate-list .list .con {
  display: block;
  padding: 18px 12px;
  text-align: center;
}

.certificate-list .list .tit {
  font-size: 18px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.certificate-list .list:hover .pic img {
  transform: none;
}

.certificate-viewer-open {
  overflow: hidden;
}

.certificate-viewer {
  width: 1000px;
  max-width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 16px;
  box-sizing: border-box;
  border: 0;
  background: #1b1b1b;
  color: #fff;
  overflow: auto;
}

.certificate-viewer::backdrop {
  background: rgba(0, 0, 0, .85);
}

.certificate-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.certificate-viewer-header h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
}

.certificate-viewer-header p {
  margin: 4px 0 0;
  color: #ccc;
  font-size: 14px;
}

.certificate-viewer button {
  display: flex;
  flex: 0 0 44px;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  cursor: pointer;
}

.certificate-viewer button:hover {
  background: var(--brand-primary);
}

.certificate-viewer button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.certificate-viewer button:disabled {
  opacity: .35;
  cursor: default;
}

.certificate-viewer-stage {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
}

#certificate-viewer-image {
  display: block;
  justify-self: center;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100dvh - 160px);
  object-fit: contain;
}

@media (max-width: 600px) {
  .certificate-viewer {
    max-width: calc(100% - 16px);
    padding: 12px;
  }

  .certificate-viewer-header h2 {
    font-size: 18px;
  }

  .certificate-viewer-stage {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #certificate-viewer-image {
    grid-column: 1 / -1;
    grid-row: 1;
    max-height: calc(100dvh - 210px);
  }

  .certificate-viewer-previous {
    grid-row: 2;
    justify-self: end;
  }

  .certificate-viewer-next {
    grid-row: 2;
    justify-self: start;
  }
}
