:root {
  --kiosk-paper: #ffffff;
  --kiosk-ink: #000000;
  --kiosk-blue: #3e50f7;
  --kiosk-muted: rgba(0, 0, 0, 0.56);
  --page-gutter: 20px;
  --kiosk-gap: 10px;
  --kiosk-row: 4px;
  --kiosk-small-width: 120px;
  --kiosk-medium-width: 240px;
  --kiosk-large-width: 360px;
  --kiosk-grid-unit: calc(var(--kiosk-small-width) - var(--kiosk-gap));
  color-scheme: light dark;
}

html[data-theme="dark"],
[data-theme="dark"] {
  --kiosk-paper: #121212;
  --kiosk-ink: #f0f0f0;
  --kiosk-blue: #6ea8fe;
  --kiosk-muted: rgba(240, 240, 240, 0.6);
}

html[data-theme="dark"] .kiosk-popup::backdrop,
[data-theme="dark"] .kiosk-popup::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

html[data-theme="dark"] .kiosk-popup-shell,
[data-theme="dark"] .kiosk-popup-shell {
  background: #181818;
  color: #f0f0f0;
}

html[data-theme="light"],
[data-theme="light"] {
  --kiosk-paper: #ffffff;
  --kiosk-ink: #000000;
  --kiosk-blue: #3e50f7;
  --kiosk-muted: rgba(0, 0, 0, 0.56);
}

html[data-theme="light"] .kiosk-popup::backdrop,
[data-theme="light"] .kiosk-popup::backdrop {
  background: rgba(0, 0, 0, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  color-scheme: light dark;
  background: var(--kiosk-paper);
}

body {
  min-width: 100%;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  color: var(--kiosk-ink);
  background: var(--kiosk-paper);
  font-family: Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
a {
  color: inherit;
  font: inherit;
}

a {
  text-decoration: none;
}

button {
  margin: 0;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--kiosk-blue);
  outline-offset: 3px;
}

::selection {
  color: var(--kiosk-paper);
  background: var(--kiosk-blue);
}

.kiosk-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 20px;
  padding: var(--page-gutter);
  background: var(--kiosk-paper);
}

.kiosk-nav {
  display: flex;
  grid-column: 1;
  align-items: center;
  gap: 28px;
  min-width: max-content;
  font-size: 20px;
  line-height: 25px;
}

.kiosk-nav a[aria-current="page"] {
  text-decoration-line: underline;
  text-decoration-style: solid;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
}

.header-lang-switch {
  grid-column: 3;
  justify-self: end;
}

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  color: var(--kiosk-ink);
  opacity: 0.6;
  transition: opacity 200ms ease, color 200ms ease;
}

.lang-switch::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
}

.lang-switch:hover,
.lang-switch:focus-visible {
  opacity: 1;
  color: var(--kiosk-blue);
}

.theme-toggle-btn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
  width: 10px;
  height: 10px;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 50%;
  background-color: #000000;
  cursor: pointer;
  outline: none;
  opacity: 0.85;
  transition: transform 150ms ease, opacity 200ms ease, background-color 200ms ease;
}

.theme-toggle-btn:hover {
  opacity: 1;
  transform: scale(1.3);
}

.theme-toggle-btn:focus-visible {
  outline: 2px solid var(--kiosk-blue);
  outline-offset: 3px;
}

.theme-toggle-btn::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 44px;
  min-height: 44px;
  width: 100%;
  height: 100%;
}

html[data-theme="dark"] .theme-toggle-btn,
[data-theme="dark"] .theme-toggle-btn {
  background-color: #ffffff;
}

.kiosk-main {
  padding: 0 var(--page-gutter) var(--page-gutter);
}

.kiosk-header--detail {
  grid-template-columns: 1fr;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.kiosk-empty {
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.45;
}

.kiosk-popup {
  --kiosk-popup-edge: 29px;
  width: min(calc(100% - 40px), 605px);
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--kiosk-ink);
  border-radius: 0;
  color: var(--kiosk-ink);
  background: var(--kiosk-paper);
}

.kiosk-popup::backdrop {
  background: rgba(255, 255, 255, 0.88);
}

.kiosk-popup-shell {
  position: relative;
  width: 100%;
  padding: var(--kiosk-popup-edge) var(--kiosk-popup-edge) 32px;
}

.kiosk-popup-close {
  position: absolute;
  z-index: 2;
  top: var(--kiosk-popup-edge);
  right: var(--kiosk-popup-edge);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  color: var(--kiosk-ink);
  background: transparent;
  box-shadow: none;
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.kiosk-popup-close:hover,
.kiosk-popup-close:focus-visible {
  outline: 0;
  color: var(--kiosk-ink);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
  opacity: 0.55;
}

.kiosk-popup .kiosk-detail {
  width: 100%;
}

.kiosk-popup .kiosk-detail-heading {
  padding-right: 44px;
  margin: 0 0 14px;
  text-align: left;
}

.kiosk-popup .kiosk-detail-title {
  width: fit-content;
  max-width: 100%;
  margin: 0;
  padding: 4px;
  border: 0;
  border-right: 1px solid var(--kiosk-ink);
  border-bottom: 1px solid var(--kiosk-ink);
  background: var(--kiosk-paper);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.kiosk-popup .kiosk-detail-gallery {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  place-items: center;
}

.kiosk-popup .kiosk-detail-figure {
  position: relative;
  display: grid;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  place-items: center;
}

.kiosk-popup .kiosk-detail-figure img {
  position: absolute;
  inset: 0;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 100%;
  margin: auto;
  object-fit: contain;
  object-position: center;
}

.kiosk-popup-gallery-control {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 50%;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline-offset: -3px;
  color: transparent;
  background: transparent;
  box-shadow: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.kiosk-popup-gallery-control--previous {
  left: 0;
  cursor: w-resize;
}

.kiosk-popup-gallery-control--next {
  right: 0;
  cursor: e-resize;
}

.kiosk-popup-gallery-control[disabled] {
  pointer-events: none;
}

.kiosk-popup-gallery-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 12px;
  margin-top: 12px;
}

.kiosk-popup-gallery-dots[hidden] {
  display: none;
}

.kiosk-popup-gallery-dot {
  display: block;
  width: 12px;
  height: 12px;
  border: 1px solid var(--kiosk-ink);
  border-radius: 50%;
  background: var(--kiosk-paper);
}

.kiosk-popup-gallery-dot.is-active {
  background: var(--kiosk-ink);
}

.kiosk-popup .kiosk-detail-description {
  margin-top: 22px;
  padding-top: 0;
  border-top: 0;
}

#kiosk-popup-description {
  white-space: pre-wrap;
}

.kiosk-popup-information-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin-top: 10px;
  border-bottom: 0;
}

.kiosk-popup-category {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
}

.kiosk-popup .kiosk-detail-actions {
  justify-content: flex-end;
  padding: 7px 0;
  border: 0;
  white-space: nowrap;
}

.kiosk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--kiosk-grid-unit), 1fr));
  grid-auto-rows: var(--kiosk-row);
  grid-auto-flow: dense;
  align-items: start;
  gap: var(--kiosk-gap);
}

.kiosk-card {
  min-width: 0;
  align-self: start;
  grid-column: span 2;
}

.kiosk-link {
  display: block;
  min-width: 0;
}

.kiosk-media {
  display: block;
  width: 100%;
  overflow: hidden;
  background: transparent;
}

.kiosk-media img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  transition: opacity 160ms ease;
}

.kiosk-link:hover .kiosk-media img {
  opacity: 0.78;
}

.kiosk-meta {
  padding-top: 6px;
  color: var(--kiosk-ink);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.kiosk-category,
.kiosk-title,
.kiosk-detail-category,
.kiosk-detail-title,
.kiosk-detail-figure {
  margin: 0;
}

.kiosk-category {
  margin-bottom: 1px;
  color: var(--kiosk-blue);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.kiosk-title {
  font-size: 13.5px;
  font-weight: 400;
  line-height: 1.45;
}

.kiosk-link:hover .kiosk-title,
.kiosk-link:focus-visible .kiosk-title {
  color: var(--kiosk-blue);
}

.kiosk-empty {
  color: var(--kiosk-muted);
}

.kiosk-detail-main {
  padding: 0 var(--page-gutter) var(--page-gutter);
}

.kiosk-detail {
  width: min(100%, 920px);
}

.kiosk-detail-heading {
  margin-bottom: 14px;
}

.kiosk-detail-category {
  margin-bottom: 3px;
  color: var(--kiosk-blue);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.kiosk-detail-title {
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 400;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.kiosk-detail-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 72vh;
  object-fit: contain;
  object-position: left top;
  background: transparent;
}

.kiosk-detail-actions {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.kiosk-detail-actions a:hover,
.kiosk-detail-actions a:focus-visible,
.kiosk-empty a:hover,
.kiosk-empty a:focus-visible {
  color: var(--kiosk-blue);
}

@media (max-width: 767px) {
  :root {
    --page-gutter: 15px;
    --kiosk-gap: 8px;
  }

  .theme-toggle-btn {
    right: 24px;
    bottom: 24px;
  }

  .kiosk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .kiosk-nav {
    grid-column: unset;
    gap: 20px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    font-size: 16px;
    line-height: 22px;
  }

  .kiosk-nav::-webkit-scrollbar {
    display: none;
  }

  .header-lang-switch {
    grid-column: unset;
    margin-left: auto;
  }

  .kiosk-empty {
    margin-bottom: 13px;
    font-size: 12px;
  }

  .kiosk-popup {
    --kiosk-popup-edge: 12px;
    width: calc(100% - 30px);
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
  }

  .kiosk-popup-shell {
    padding: var(--kiosk-popup-edge) var(--kiosk-popup-edge) 22px;
  }

  .kiosk-popup-close {
    font-size: 23px;
  }

  .kiosk-popup-information-row {
    gap: 12px;
  }

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

  .kiosk-card {
    grid-column: span 1;
  }

  .kiosk-meta {
    padding-top: 5px;
    font-size: 12px;
  }

  .kiosk-title {
    font-size: 12.5px;
  }

  .kiosk-detail-heading {
    margin-bottom: 10px;
  }

  .kiosk-detail-category {
    font-size: 11px;
  }

  .kiosk-detail-title {
    font-size: 26px;
  }

  .kiosk-detail-actions {
    font-size: 12px;
  }
}

@media (max-width: 380px) {
  .kiosk-nav {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    --kiosk-paper: #121212;
    --kiosk-ink: #f0f0f0;
    --kiosk-blue: #6ea8fe;
    --kiosk-muted: rgba(240, 240, 240, 0.6);
  }

  .kiosk-popup::backdrop {
    background: rgba(0, 0, 0, 0.7);
  }

  .kiosk-popup-shell {
    background: #181818;
    color: #f0f0f0;
  }

  :root:not([data-theme="light"]) .theme-toggle-btn {
    background-color: #ffffff;
  }
}
