:root {
  color-scheme: light;
  --paper: #f7f0e3;
  --ink: #3c332a;
  --green: #455943;
  --rose: #963e36;
  --line: #dfd1bb;
  --display: "Nanum Myeongjo", "Songti SC", "Batang", serif;
  --body: "Hiragino Sans", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(ellipse at 50% 12%, #fff9ee 0, transparent 55%), var(--paper);
  color: var(--ink);
  font: 16px/1.65 var(--body);
}
.masthead {
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  letter-spacing: .19em;
  font: 700 14px/1.4 var(--display);
  letter-spacing: .16em;
}
.masthead span { color: var(--green); margin-right: 5px; font-size: 21px; vertical-align: middle; }
main { width: min(1080px, calc(100% - 92px)); margin: auto; }
.cover { display: grid; align-items: center; grid-template-columns: 0.85fr 1.15fr; gap: 6%; padding: 72px 0 80px; }
.coverText { padding-left: 5%; }
.edition { font-size: .75rem; color: var(--rose); font-weight: 700; letter-spacing: .18em; margin: 0 0 18px; }
h1, h2 { font-family: var(--display); margin: 0; }
h1 { color: var(--green); font-weight: 700; font-size: clamp(3rem, 6.7vw, 6rem); line-height: 1.12; letter-spacing: -.075em; }
.dedication { margin: 21px 0 27px; color: #645748; font-family: var(--display); font-size: clamp(1rem, 2vw, 1.18rem); }
.jump { display: inline-flex; align-items: center; gap: 16px; border: 1px solid #b7b4a0; border-radius: 100px; padding: 8px 16px; color: var(--green); text-decoration: none; font-size: .82rem; }
.jump:hover { background: #e9eadc; }
.coverPhoto { position: relative; padding: 9px 12px; }
.paper { padding: 12px 12px 24px; background: #fffcf5; transform: rotate(2deg); box-shadow: 0 9px 24px #59402d2b; position: relative; }
.paper::before { content: ""; width: 103px; height: 29px; background: #dac59da8; position: absolute; top: -13px; left: calc(50% - 51px); transform: rotate(-6deg); z-index: 1; }
img { display: block; }
.paper img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery { padding: 21px 0 50px; border-top: 1px solid var(--line); scroll-margin-top: 16px; }
.galleryTitle { display: flex; align-items: baseline; gap: 12px; justify-content: space-between; margin-bottom: 24px; }
h2 { color: var(--green); font-size: clamp(1.33rem, 3.7vw, 2rem); letter-spacing: -.06em; }
.galleryTitle span { color: #67574a; white-space: nowrap; font-size: .8rem; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; }
figure { margin: 0; background: #fffcf5; padding: 8px; box-shadow: 0 3px 12px #59402d17; content-visibility: auto; contain-intrinsic-block-size: auto 230px; }
.print { display: block; overflow: hidden; }
.print img { width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .22s ease; }
.print:hover img { transform: scale(1.035); }
figcaption { text-align: center; font-family: var(--display); font-size: .88rem; padding: 8px 0 4px; }
footer { text-align: center; color: #67574a; font-family: var(--display); font-size: .84rem; border-top: 1px solid var(--line); padding: 22px 0 45px; }
.message { text-align: center; padding: 16vh 0; }
.message h1 { font-size: clamp(1.9rem, 6vw, 3.5rem); }
dialog { position: fixed; padding: 12px; border: none; border-radius: 10px; background: var(--paper); color: var(--ink); width: min(92vw, 850px); overflow: auto; }
dialog::backdrop { background: #231c18cf; }
.close { display: block; margin: 0 0 8px auto; }
.zoom img { width: 100%; height: min(66dvh, 670px); object-fit: contain; background: #302823; }
.controls { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.controls p { margin: 0; }
dialog button { background: #fffcf5; color: var(--ink); border: 1px solid var(--line); border-radius: 50%; width: 44px; height: 44px; font-size: 1.25rem; cursor: pointer; }
dialog button:disabled { opacity: .45; cursor: default; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
@media (max-width: 650px) {
  main { width: calc(100% - 36px); }
  .masthead { padding: 11px 18px; }
  .cover { grid-template-columns: 1fr; gap: 28px; padding: 32px 0 30px; }
  .coverText { text-align: center; padding: 0; }
  .cover h1 { font-size: clamp(2.55rem, 10vw, 3.45rem); }
  .edition { margin-bottom: 10px; }
  .dedication { margin: 10px 0 14px; }
  .coverPhoto { width: min(360px, 100%); margin: auto; }
  .grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
  figure { padding: 5px; contain-intrinsic-block-size: auto 150px; }
  figcaption { font-size: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .print img { transition: none; }
}
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; text-align: center; gap: 10px; margin-top: 28px; }
.pagination div:first-child { justify-self: start; }
.pagination div:last-child { justify-self: end; }
