* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

@font-face {
  font-family: "Pretendard";
  src: url("../Pretendard-Regular.woff2") format("woff2");
  font-weight: normal;
  font-style: normal;
}

/* 전체 화면 높이 고정 */

html,
body {
  width: 100%;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;

  padding: 10px;
  overflow: hidden;

  font-family: "Pretendard";
  word-break: keep-all;

  background-color: #fcfeff;
}

.guide {
    position: absolute;
    right: 60px;
    top: 23px;

    width: 28px;
    height: 28px;

    padding: 0;

    border: 1px dotted dimgray;
    border-radius: 50%;

    background: transparent;

    color: dimgray;
    font-size: 15px;
    line-height: 10pt;

    display: flex;
    align-items: center;
    justify-content: center;

    cursor: pointer;

    z-index: 3000;
}

.guide:hover {
    background: dimgray;
    color: white;
}


/* 이용안내 모달 */

.guide-modal {
    position: fixed;
    inset: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(247, 247, 247, 0.95);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition: opacity 0.25s ease;

    z-index: 10000;
}

.guide-modal.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.guide-modal-inner {
    position: relative;

    width: min(500px, calc(100vw - 40px));

    padding: 35px;

    background: #f7f7f7;
    border-radius: 12px;

    font-size: 12pt;
    line-height: 1.7;

    word-break: keep-all;
}

.guide-modal-inner h2 {
    margin-bottom: 25px;

    font-size: 18px;
    font-weight: 600;
}

.guide-modal-inner p {
    margin-bottom: 20px;
}

.guide-modal-inner p:last-child {
    margin-bottom: 0;
}

.guide-close {
    position: absolute;
    top: 15px;
    right: 18px;

    border: 0;
    background: none;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;
}

.lang {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 17pt;
/*    color: dimgray;*/
}

.lang > a {
    color: dimgray;
}

/* 제목 */

h1 {
  flex: 0 0 auto;

  padding: 10px;
  margin-bottom: 10px;

  font-size: 23pt;
  font-weight: normal;
}

a {
  color: black;
  text-decoration: none;
}

u {
  padding-bottom: 0.5px;

  border-bottom: 1px solid black;
  text-decoration: none;
}

p {
  line-height: 20pt;
}

/* 상단 단계 이미지 */

.stages {
  flex: 0 0 auto;

  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: 10px;

  width: 100%;

  padding: 0 10px 20px;
  margin-bottom: 10px;

  border-bottom: 1px solid dimgray;
}

.stage {
  position: relative;
  min-width: 0;
}

.stage img {
  position: relative;
  z-index: 1;

  display: block;

  width: 100%;
  height: auto;

  transform-origin: center center;
  transition: transform 0.2s ease;
}

.stage img:hover {
  transform: scale(1.1);

  border: 1px dotted darkgray;
  border-radius: 12px;

  cursor: pointer;
}

/* 본문 */

section {
  flex: 1 1 0;
  min-height: 0;

  display: flex;
  align-items: stretch;

  width: 100%;

  padding: 10px;
  overflow: hidden;
}

/* Sketchfab */

.sketchfab-embed-wrapper {
  flex: 1 1 0;

  min-width: 0;
  min-height: 0;
  height: 100%;

  overflow: hidden;
}

.sketchfab-embed-wrapper iframe {
  display: block;

  width: 100%;
  height: 100%;

  border: 1px dotted black;
}

.viewer {
  position: relative;

  width: 100%;
  height: 100%;
  min-height: 0;

  overflow: hidden;
}

.viewer iframe {
  display: block;

  width: 100%;
  height: 100%;

  border: 1px dotted black;
}

.loading {
  position: absolute;
  inset: 0;
  z-index: 100;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px dotted black;
  background: #f7f7f7;
  color: slategray;

  font-size: 14px;
}

.loading.loaded {
  opacity: 0;
  pointer-events: none;

  transition-property: opacity;
  transition-duration: 0s;
  transition-delay: 20s;
}

.dots::after {
  content: "";
  animation: loadingDots 3s infinite steps(4);
}

@keyframes loadingDots {
  0% {
    content: "";
  }

  25% {
    content: ".";
  }

  50% {
    content: "..";
  }

  75% {
    content: "...";
  }

  100% {
    content: "";
  }
}

/* 오른쪽 사이드바 */

.sidebar {
  flex: 0 0 30%;

  display: flex;
  flex-direction: column;

  width: 30%;
  height: 100%;
  min-height: 0;

  margin-left: 20px;
  overflow: hidden;
}

/* 고정 헤더 */

.sidebar > header {
  position: relative;
  z-index: 10;

  flex: 0 0 auto;

  padding-bottom: 5px;
  margin-bottom: 10px;

  background-color: #fcfeff;
  border-bottom: 1px solid dimgray;
}

.sidebar > header h2 {
  margin-bottom: 5px;

  font-size: 18px;
  font-weight: normal;
  line-height: 25pt;
}

.sidebar > header h3 {
  margin-bottom: 5px;

  font-size: 15px;
  font-weight: normal;
}

.keywords {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;

  padding: 0;
  margin-bottom: 5px;

  list-style: none;
}

.keywords li {
  padding: 3px 8px;

  border: 1px dotted black;
  border-radius: 12px;
  background-color: #f7f7f7;

  font-size: 13.5px;
}

.sidebar > header p {
  margin-top: 10px;
  font-size: 15px;
  line-height: 15pt;
}

/* 기록물 영역만 스크롤 */

.archives {
  flex: 1 1 0;
  min-height: 0;

  padding-right: 4px;

  overflow-y: auto;
  overflow-x: hidden;
}

/* 관련 기록물 */

.archives h3 {
  margin-bottom: 10px;

  font-size: 12pt;
  font-weight: normal;
}

.archive {
  padding: 12px;
  margin-bottom: 10px;

  border: 1px dotted black;
  background: #f7f7f7;

  overflow-y: scroll;
}

.archive:hover {
  cursor: pointer;
}

.archive p {
  width: auto;
  margin-top: 10px;
}

li {
  list-style: none;
}

/* 각주 */

.footnote {
  position: relative;
  display: inline-block;

  font-weight: bold;
  text-decoration: underline;
  text-decoration-style: dotted;

  cursor: help;
}

.bold {
  font-weight: bold;
  text-decoration: underline;
  text-decoration-style: dotted;

  cursor: help;
}

.footnote-text {
  position: fixed;
  z-index: 9999;

  width: 240px;
  max-width: calc(30vw - 40px);

  padding: 8px 10px;

  border: 1px dotted black;
  background: #f7f7f7;

  font-size: 12px;
  line-height: 1.4;
  font-weight: normal;
  white-space: normal;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.footnote:hover .footnote-text {
  opacity: 1;
  visibility: visible;
}

.img-code {
  color: darkgray;

  font-family: monospace;
  font-size: 10.5pt;
}

/* details */

summary {
  list-style: none;
  cursor: pointer;
}

summary::-webkit-details-marker {
  display: none;
}

summary::before {
  content: "+ ";
}

details[open] > summary::before {
  content: "- ";
}

.details-content {
  max-height: 0;
  overflow: hidden;

  opacity: 0;

  transition:
    max-height 0.6s cubic-bezier(.4, 0, .2, 1),
    opacity 0.35s ease;
}

details[open] .details-content {
  opacity: 1;
}

details:not([open]) .details-content {
  max-height: 0;
}

/* 처음 일부만 열린 상태 */

details.partial .details-content {
  position: relative;

  max-height: 180px;
  overflow: hidden;
}

details.partial .details-content::after {
  content: "";

  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;

  height: 80px;

  background: linear-gradient(
    rgba(247, 247, 247, 0),
    rgba(247, 247, 247, 1)
  );

  pointer-events: none;
}

details.full .details-content::after {
  display: none;
}

/* 기록물 이미지 */

.record-content {
  flex: 1;

  min-width: 0;
  max-width: 300px;

  margin: 0 auto;
}

.archive img {
  display: block;

  width: 100%;
  height: auto;

  margin: 10px auto;
}

figcaption {
  width: 100%;

  font-size: 10pt;
  line-height: 13pt;
}

.caption-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;

  margin-bottom: 4px;
}

.caption-title span {
  flex-shrink: 0;

  color: darkgray;
  white-space: nowrap;
}

/* 이전·다음 버튼 */

.record-viewer {
  display: flex;
  align-items: center;
  gap: 10px;

  width: 100%;
}

.record-prev,
.record-next {
  flex-shrink: 0;

  width: 14px;
  height: 14px;

  padding: 0;

  border: none;
  background: none;
  color: black;

  font-size: 12px;
  line-height: 14px;

  cursor: pointer;
}

.record-prev:hover,
.record-next:hover {
  opacity: 0.5;
}

/* 모달 */

.modal {
  position: fixed;
  inset: 0;
  z-index: 999;

  display: none;
  align-items: center;
  justify-content: center;

  background: rgba(0, 0, 0, 0.25);
}

.modal.open {
  display: flex;
}

.modal-content {
  display: flex;
  align-items: center;
  gap: 20px;

  max-width: calc(100vw - 80px);
  max-height: calc(100vh - 40px);

  padding: 30px;
  overflow: auto;

  border: 1px dotted black;
  background: #f7f7f7;
}

.modal-record {
  min-width: 0;
  text-align: center;
}

.modal-record img {
  display: block;

  width: auto;
  height: auto;

  max-width: calc(100vw - 220px);
  max-height: calc(100vh - 180px);

  margin: 0 auto 12px;
}

.modal-record figcaption {
  color: black;

  font-size: 10pt;
  line-height: 1.5;
  text-align: left;
}

.modal-prev,
.modal-next {
  flex-shrink: 0;

  width: 7px;
  height: 7px;

  border: none;
  border-radius: 50%;

  background: black;
  color: transparent;

  cursor: pointer;
}

.modal-prev:hover,
.modal-next:hover {
  opacity: 0.5;
}

.model-report-trigger {
  cursor: pointer;
}

.modal.single-record .modal-prev,
.modal.single-record .modal-next {
  display: none;
}

/* 반응형 */

@media screen and (max-width: 900px) {
  body {
    overflow-y: auto;
  }

  section {
    flex-direction: column;
    overflow: visible;
  }

  .sketchfab-embed-wrapper {
    flex: 0 0 auto;
    width: 100%;
    height: 45vh;
    min-height: 300px;
  }

  .sidebar {
    flex: 0 0 auto;

    width: 100%;
    height: auto;
    min-height: 0;

    margin-top: 20px;
    margin-left: 0;

    overflow: visible;
  }

  .archives {
    flex: none;
    overflow: visible;
  }

  .record-content {
    max-width: 100%;
  }

  .modal-content {
    max-width: calc(100vw - 20px);
    padding: 20px;
  }

  .modal-record img {
    max-width: calc(100vw - 100px);
  }
}