/* 네모의 꿈 — 같이화실 두 번째 전시 온라인 브로셔 */

:root {
  --paper: #f8f6ea;        /* 포스터 바탕 */
  --paper-deep: #f0eddc;
  --mat: #fffefa;          /* 작품 뒤 흰 네모 */
  --ink: #372f27;
  --muted: #6f6558;
  --brown: #9c6f45;        /* 포스터 제목 */
  --blue: #8fb6c7;         /* 포스터 테두리 */
  --blue-deep: #3a6f96;
  --line: rgba(55, 47, 39, 0.14);

  --serif: "Gowun Batang", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Malgun Gothic", "Segoe UI", sans-serif;

  --pad: 20px;
  --gap-x: 28px;
  --gap-y: 56px;
  color-scheme: light;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  word-break: keep-all;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--blue-deep);
  outline-offset: 3px;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 60;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--paper);
}

.skip:focus {
  left: 8px;
  top: 8px;
}

/* 포스터 테두리에서 가져온 네모 띠 */
.band {
  height: 20px;
  background-color: var(--blue);
  background-image: linear-gradient(90deg, var(--paper) 8px, transparent 8px);
  background-size: 20px 8px;
  background-position: 6px 6px;
  background-repeat: repeat-x;
}

/* ---------- 상단 고정 메뉴 ---------- */

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 var(--pad);
  background: rgba(248, 246, 234, 0.94);
  border-bottom: 1px solid var(--line);
  transform: translateY(-100%);
  visibility: hidden;
  transition: transform 0.25s ease, visibility 0s linear 0.25s;
}

.topbar.is-visible {
  transform: none;
  visibility: visible;
  transition: transform 0.25s ease, visibility 0s;
}

.topbar__title {
  font-weight: 700;
  font-size: 16px;
  color: var(--brown);
  text-decoration: none;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.topbar__nav {
  display: flex;
  gap: 2px;
}

.topbar__nav a {
  padding: 12px 8px;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.topbar__nav a:hover {
  color: var(--blue-deep);
}

/* ---------- 표지 ---------- */

.cover {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
}

.cover__inner {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  padding: 36px var(--pad) 48px;
  text-align: center;
}

.cover__poster {
  margin: 0;
  line-height: 0;
}

.cover__poster img {
  width: auto;
  height: auto;
  max-width: min(76vw, 360px);
  max-height: 60vh;
  border-radius: 2px;
  box-shadow: 0 1px 2px rgba(55, 47, 39, 0.14), 0 22px 44px -22px rgba(55, 47, 39, 0.45);
}

.cover__eyebrow {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--blue-deep);
}

.cover__title {
  margin: 6px 0 0;
  font-size: 44px;
  font-size: clamp(40px, 11vw, 66px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.06em;
  color: var(--brown);
}

.facts {
  margin: 22px 0 0;
  font-size: 15.5px;
  line-height: 1.6;
}

.facts div {
  display: flex;
  justify-content: center;
  padding: 3px 0;
}

.facts dt {
  flex: 0 0 auto;
  margin-right: 14px;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.95;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.facts dd {
  margin: 0;
  text-align: left;
}

.cover__actions {
  margin: 26px 0 0;
}

.btn {
  display: inline-block;
  padding: 12px 26px;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
  background: transparent;
  color: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 공통 구획 ---------- */

.section {
  padding: 68px 0 72px;
  scroll-margin-top: 40px;
}

.section--tint {
  background: var(--paper-deep);
}

.head {
  margin: 0 0 40px;
  text-align: center;
}

.head::before {
  content: "";
  display: block;
  width: 10px;
  height: 10px;
  margin: 0 auto 18px;
  background: var(--blue);
}

.head__en {
  margin: 0;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--blue-deep);
}

.head__ko {
  margin: 6px 0 0;
  font-size: 27px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.04em;
  color: var(--brown);
}

.head__note {
  margin: 10px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* ---------- 인사말 ---------- */

.greeting__text {
  max-width: 30em;
  margin: 0 auto;
  text-align: center;
  font-size: 16.5px;
  font-size: clamp(16px, 4.3vw, 18.5px);
  line-height: 2.05;
}

.greeting__text p {
  margin: 0 0 1.5em;
}

.greeting__sign {
  margin: 2.4em 0 0;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--brown);
}

/* ---------- 참여 작가 ---------- */

.names {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px 6px;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.names li {
  width: 78px;
}

.names a {
  display: block;
  padding: 10px 2px;
  text-align: center;
  font-size: 17px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: color 0.15s ease;
}

.names a:hover {
  color: var(--blue-deep);
}

/* ---------- 작품 ---------- */

.works__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap-y) var(--gap-x);
  margin: 0;
  padding: 0;
  list-style: none;
}

.work {
  width: 100%;
  scroll-margin-top: 76px;
}

.work figure {
  margin: 0;
}

.work__open {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}

.work__mat {
  display: block;
  position: relative;
}

.work__mat picture {
  display: block;
}

.work__mat img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  -webkit-filter: drop-shadow(0 1px 1px rgba(55, 47, 39, 0.2)) drop-shadow(0 10px 16px rgba(55, 47, 39, 0.16));
  filter: drop-shadow(0 1px 1px rgba(55, 47, 39, 0.2)) drop-shadow(0 10px 16px rgba(55, 47, 39, 0.16));
}

.work figcaption {
  padding-top: 16px;
}

.work__artist {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.06em;
}

.work__title {
  margin: 4px 0 0;
  font-size: 16px;
  line-height: 1.55;
}

.work__title-en {
  display: block;
  font-size: 15px;
  font-style: italic;
  color: var(--muted);
}

.work__meta {
  margin: 6px 0 0;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

/* 세 점이 한 작품인 경우 */
.work__set {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.work--set .work__mat::before {
  content: "";
  display: block;
  padding-top: 100%;
}

.work--set .work__mat img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  max-height: none;
}

/* 작가 이름을 눌러 이동했을 때 잠깐 표시 */
.work:target .work__open {
  animation: mark 2.6s ease-out 1;
}

@keyframes mark {
  0%,
  60% {
    outline: 2px solid var(--blue);
    outline-offset: 8px;
  }
  100% {
    outline: 2px solid transparent;
    outline-offset: 8px;
  }
}

/* ---------- 오시는 길 ---------- */

.visit__card {
  max-width: 560px;
  margin: 0 auto;
  padding: 30px 26px 32px;
  background: var(--mat);
  border: 1px solid var(--line);
}

.info {
  margin: 0;
}

.info div {
  display: flex;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.info div:first-child {
  padding-top: 0;
}

.info dt {
  flex: 0 0 3.2em;
  margin-right: 18px;
  font-family: var(--sans);
  font-size: 13px;
  line-height: 2.1;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.info dd {
  margin: 0;
  font-size: 16.5px;
}

.visit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0 0;
}

.visit__actions .btn {
  flex: 1 1 180px;
  padding: 12px 14px;
  text-align: center;
}

/* ---------- 맺음 ---------- */

.foot {
  background: var(--paper-deep);
}

.foot__inner {
  padding: 46px var(--pad) 54px;
  text-align: center;
}

.foot__name {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--brown);
}

.foot__link {
  margin: 8px 0 0;
  font-family: var(--sans);
  font-size: 14.5px;
}

.foot__link a {
  color: var(--blue-deep);
  text-underline-offset: 3px;
}

.foot__note {
  margin: 26px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 크게 보기 ---------- */

html.is-locked body {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

.viewer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: none;
  flex-direction: column;
  background: #15120f;
  color: #f3eee2;
}

.viewer.is-open {
  display: flex;
}

.viewer__stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
}

.viewer__img {
  position: absolute;
  top: 60px;
  left: 10px;
  width: calc(100% - 20px);
  height: calc(100% - 66px);
  max-width: none;
  object-fit: contain;
}

.viewer__bar {
  flex: 0 0 auto;
  padding: 10px 56px 18px;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center;
}

.viewer__artist {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.viewer__title {
  margin: 2px 0 0;
  font-size: 15.5px;
  line-height: 1.5;
}

.viewer__meta {
  margin: 4px 0 0;
  font-family: var(--sans);
  font-size: 12.5px;
  color: rgba(243, 238, 226, 0.66);
}

.viewer__count {
  position: absolute;
  top: 18px;
  top: calc(18px + env(safe-area-inset-top));
  left: 20px;
  margin: 0;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: rgba(243, 238, 226, 0.66);
}

.viewer button {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: rgba(21, 18, 15, 0.45);
  color: #f3eee2;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.viewer button:hover {
  background: rgba(243, 238, 226, 0.16);
}

.viewer button:focus-visible {
  outline-color: #f3eee2;
}

.viewer button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.viewer__close {
  position: absolute;
  top: 6px;
  top: calc(6px + env(safe-area-inset-top));
  right: 8px;
  width: 46px;
  height: 46px;
}

.viewer__nav {
  position: absolute;
  top: calc(50% + 27px);
  width: 44px;
  height: 68px;
  transform: translateY(-50%);
}

.viewer__nav--prev {
  left: 4px;
}

.viewer__nav--next {
  right: 4px;
}

/* ---------- 태블릿 이상: 흰 네모 안에 작품 ---------- */

@media (min-width: 700px) {
  :root {
    --pad: 32px;
    --gap-x: 36px;
    --gap-y: 60px;
  }

  .section {
    padding: 92px 0 100px;
  }

  .head {
    margin-bottom: 52px;
  }

  .head__ko {
    font-size: 31px;
  }

  .topbar__nav a {
    padding: 12px 12px;
    font-size: 15px;
  }

  .work {
    width: calc((100% - var(--gap-x)) / 2 - 0.5px);
  }

  .work--set {
    width: 100%;
  }

  .work__mat {
    background: var(--mat);
  }

  .work__mat::before {
    content: "";
    display: block;
    padding-top: 100%;
  }

  .work__mat img,
  .work--set .work__mat img {
    position: absolute;
    top: 9%;
    left: 9%;
    width: 82%;
    height: 82%;
    max-height: none;
  }

  .work__set {
    gap: var(--gap-x);
  }

  .work--set figcaption {
    text-align: center;
  }

  .viewer__img {
    left: 76px;
    width: calc(100% - 152px);
  }

  .viewer__nav {
    width: 52px;
    height: 84px;
  }

  .viewer__nav--prev {
    left: 12px;
  }

  .viewer__nav--next {
    right: 12px;
  }

  .viewer button svg {
    width: 28px;
    height: 28px;
  }
}

/* ---------- PC ---------- */

@media (min-width: 900px) {
  .cover__inner {
    flex-direction: row;
    gap: 76px;
    padding: 56px var(--pad);
    text-align: left;
  }

  .cover__poster img {
    max-width: 420px;
    max-height: 78vh;
  }

  .facts div {
    justify-content: flex-start;
  }

  .facts {
    font-size: 16.5px;
  }
}

@media (min-width: 1040px) {
  :root {
    --gap-x: 44px;
    --gap-y: 72px;
  }

  .work {
    width: calc((100% - 2 * var(--gap-x)) / 3 - 0.5px);
  }

  .work--set {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .topbar,
  .topbar.is-visible,
  .btn {
    transition: none;
  }

  .work:target .work__open {
    animation: none;
  }
}

@media print {
  .topbar,
  .viewer,
  .skip,
  .cover__actions,
  .visit__actions {
    display: none !important;
  }

  .cover {
    min-height: 0;
  }

  .work {
    break-inside: avoid;
  }
}
