@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@keyframes shadowBlink {
  0%, 100% {
    box-shadow: 0 0 20px var(--overlay-gray-shadow),
                0 0 40px var(--overlay-gray-shadow),
                0 0 60px var(--overlay-gray-shadow);
  }
  50% {
    box-shadow: 0 0 5px var(--overlay-gray-shadow-light),
                0 0 10px var(--overlay-gray-shadow-light),
                0 0 15px var(--overlay-gray-shadow-light);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body.books-page *:not(.site-header):not(.site-header *) {
  font-weight: 500;
}

body.books-page ::selection { background: transparent; }
body.books-page ::-moz-selection { background: transparent; }

body.books-page {
  line-height: 1.3;
  letter-spacing: 0;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  background-color: var(--background-color-book-library);
}

canvas {
  display: block !important;
  position: fixed !important;
  width: 100vw !important;
  height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
  pointer-events: auto;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  object-fit: contain;
  object-position: center;
  z-index: 1;
  background: transparent !important;
}

.books-page {
  box-sizing: border-box;
}

.books-page__layout {
  position: fixed;
  width: 50%;
  height: 100%;
  right: 0;
  top: 0;
  overflow-y: scroll;
  display: none;
  background-color: var(--sub-color);
  color: var(--header-text-on-light);
}

.books-page__layout-content {
  padding: var(--space-16);
}

.books-page__layout-close {
  display: flex;
  position: fixed;
  border: var(--border-white);
  background-color: var(--sub-color);
  right: 0;
  margin: var(--space-16);
  cursor: pointer;
  z-index: 20;
  align-items: center;
  justify-content: center;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.books-page__layout-close:hover {
  background-color: var(--main-color);
}

.books-page__layout-close:hover svg line {
  stroke: var(--sub-color);
}

.books-page__layout-close svg line {
  stroke: var(--header-text-on-light);
}

.books-page__list {
  position: fixed;
  overflow: visible;
  text-align: left;
  word-break: keep-all;
  height: 100%;
  right: 0;
  top: 0;
  background-color: transparent;
  color: var(--text-color);
  padding: calc(var(--space-32) + var(--space-16)) calc(var(--body-padding-sides) - var(--space-16));
  padding-bottom: var(--space-16);
  display: none;
  z-index: 10;
  text-align: center;
}

.books-page__list.visible {
  display: block;
}

.books-page__buttons {
  position: fixed;
  top: var(--body-padding-top);
  padding: 0;
  display: flex;
  justify-content: center;
  gap: var(--space-4);
  z-index: 50;
  flex-direction: column;
  align-items: flex-start;
}

.books-page__button {
  text-align: left;
  cursor: pointer;
  background-color: var(--main-color);
  min-height: 1.5rem;
  height: 1.5rem;
  padding: var(--button-outline-padding);
  display: flex;
  align-items: center;
  transition: var(--button-outline-transition);
  text-decoration: none;
  border: none !important;
  outline: none;
  color: var(--sub-color);
  font-size: inherit;
  font-weight: 500;
  line-height: 1;
}

.books-page__button:hover {
  background-color: var(--main-color-hover);
  color: var(--sub-color);
}

.books-page__button .kr { display: inline !important; }
.books-page__button .eng { display: none !important; }
body.eng .books-page__button .kr { display: none !important; }
body.eng .books-page__button .eng { display: inline !important; }

.books-page__list-items {
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
  scroll-snap-type: y mandatory;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: var(--space-8);
  align-items: flex-end;
}

.books-page__list-item {
  display: flex;
  gap: var(--space-4);
  min-height: 1.5rem;
  height: 1.5rem;
  word-break: keep-all;
  cursor: default;
  transition: all 0.3s ease;
  align-items: center;
  scroll-snap-align: start;
  justify-content: flex-end;
  padding: 0 var(--space-16);
  width: 100%;
  box-sizing: border-box;
}

.books-page__list-item > div {
  flex-shrink: 0;
  min-width: fit-content;
  min-height: 1.5rem;
  height: 1.5rem;
  color: var(--sub-color);
  background-color: var(--main-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  box-sizing: border-box;
}

.books-page__list-item > .books-page__item-title {
  flex-shrink: 1 !important;
  min-width: 0 !important;
  max-width: 100% !important;
}

.books-page__list-item:has(.books-page__item-credit:hover),
.books-page__list-item:has(.books-page__item-title:hover),
.books-page__list-item:has(.books-page__item-size:hover) {
  transform: translateX(calc(var(--space-16) * -1));
}

.books-page__list-item--selected {
  transform: scale(1.05) !important;
}

.books-page__list-item--selected .books-page__item-credit,
.books-page__list-item--selected .books-page__item-title,
.books-page__list-item--selected .books-page__item-size {
  background-color: var(--sub-color) !important;
  color: var(--main-color) !important;
}

.books-page__list-item:first-child {
  border-top: none;
  padding-top: var(--space-4);
}

.books-page__item-credit {
  min-height: 1.5rem;
  height: 1.5rem;
  text-align: center;
  padding: 0 var(--space-8);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  font-size: inherit;
}

.books-page__list-item > .books-page__item-credit,
.books-page__list-item > .books-page__item-title,
.books-page__list-item > .books-page__item-size {
  align-items: center !important;
  justify-content: center;
}

.books-page__list-item > .books-page__item-title { justify-content: flex-end; }
.books-page__list-item > .books-page__item-size { justify-content: flex-end; }

.books-page__item-title.kr {
  display: flex !important;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.books-page__item-title.eng {
  display: none !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

body.eng .books-page__item-title.kr { display: none !important; }
body.eng .books-page__item-title.eng {
  display: flex !important;
  align-items: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.books-page__item-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-8);
  transition: var(--button-outline-transition);
  padding: 0 var(--space-8);
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow: hidden;
  min-width: 0;
  line-height: 1;
  min-height: 1.5rem;
  height: 1.5rem;
  width: auto;
}

.books-page__item-title > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.books-page__item-size {
  min-height: 1.5rem;
  height: 1.5rem;
  text-align: right;
  position: relative;
  z-index: 11;
  padding: 0 var(--space-8);
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  line-height: 1;
}

.books-page__detail {
  position: absolute;
  top: 0;
  left: 0;
  display: none;
  z-index: 20;
  width: 100%;
  height: 100%;
  overflow: hidden;
  visibility: visible;
  opacity: 1;
  pointer-events: none;
}

.books-page__detail-grid {
  position: absolute;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.books-page__cover {
  width: 100%;
  height: 100%;
}

.books-page__index {
  font-weight: 700;
  font-style: normal;
  font-size: 6em;
  line-height: 0.9;
  color: var(--text-color);
  visibility: visible;
  opacity: 1;
}

.books-page__info {
  display: flex;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  padding: var(--space-16);
  z-index: 21;
  flex-direction: column;
  justify-content: center;
  flex-wrap: nowrap;
  pointer-events: none;
  visibility: visible;
}

.books-page__info > * {
  pointer-events: auto;
  visibility: visible;
  opacity: 1;
}

.books-page__info-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-8);
  visibility: visible;
  opacity: 1;
}

.books-page__info-titles,
.books-page__info-details,
.books-page__info-navigation {
  display: flex;
  gap: var(--space-8);
  flex-wrap: wrap;
  visibility: visible;
  opacity: 1;
}

.books-page__info-tag {
  position: relative;
  display: inline-block;
  text-align: center;
  background-color: var(--sub-color);
  border: var(--border-white);
  padding: var(--space-4) var(--space-8);
  margin-bottom: var(--space-8);
  margin-right: var(--space-8);
  color: var(--main-color);
  line-height: 1.3;
  white-space: nowrap;
  visibility: visible;
  opacity: 1;
}

.books-page__info-tag--title {
  font-weight: 600;
  color: var(--text-color);
}

.books-page__close-icon {
  stroke: var(--main-color);
  width: 100%;
  height: 100%;
}

.books-page__nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
  background-color: var(--sub-color);
  color: var(--main-color);
  cursor: pointer;
  transition: var(--button-outline-transition);
  line-height: 1;
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.books-page__nav-btn:hover {
  background-color: var(--button-outline-hover-bg);
  color: var(--button-outline-hover-color);
}

.books-page__nav-btn--prev,
.books-page__nav-btn--next {
  visibility: visible;
  opacity: 1;
}

.books-page__loader {
  border: 6px solid var(--main-color);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 2s linear infinite;
  border-color: var(--sub-color);
  border-top: 6px solid var(--main-color);
  z-index: 21;
}

.text a {
  text-decoration: underline;
  text-underline-offset: var(--underline-offset);
}
.text :first-child { margin-top: 0; }
.text :last-child { margin-bottom: 0; }
.text li { display: flex; }
.text li:last-child { padding-bottom: 0; }
.text ol p, .text ul p { margin-bottom: 0; }
.text ol > li { list-style: decimal; }
.text ol ol, .text ol ul, .text ul ol, .text ul ul { margin-bottom: 0; }

.picture {
  position: absolute;
  z-index: 20;
}

.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-column { display: flex; flex-direction: column; }
.cursor-pointer { cursor: pointer; }
.border-radius-circle { border-radius: 50%; }
.border-radius-md { border-radius: 8px; }
.transition-smooth { transition: all 0.3s ease; }
.transition-opacity { transition: opacity 0.2s ease; }
.position-fixed { position: fixed; }
.position-absolute { position: absolute; }
.z-index-high { z-index: 20; }
.z-index-modal { z-index: 30; }

@media only screen and (max-width: 768px) {
  .books-page__list {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .books-page__layout {
    position: static !important;
  }

  .books-page__nav-btn,
  .books-page__nav-btn--prev,
  .books-page__nav-btn--next {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  canvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    padding-bottom: var(--body-padding-sides);
  }

  .books-page__item-credit,
  .books-page__item-title,
  .books-page__item-size {
    min-width: unset;
    flex-shrink: unset;
  }

  .books-page__item-credit,
  .books-page__item-size {
    white-space: normal;
  }

  .books-page__item-title {
    width: 100%;
  }

  .books-page__list-item {
    justify-content: center;
  }
}

@media print {
  body.books-page * { display: none; }

  body.books-page {
    margin: 0;
    padding: 0;
    height: 100%;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  canvas {
    display: block;
    width: 100%;
    height: 100%;
  }
}

@page {
  size: A4;
  margin: 0mm;
}
