/* =========================================================
   핑크젤리 — photobook pages (screen + print)
   A book is a stack of A5 sheets: cover, one sheet per day, closing sheet.
   Shared by the real photobook page and the public demo.
   ========================================================= */
.book { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.book-page { position: relative; width: min(520px, 100%); aspect-ratio: 148 / 210; background: #FFFDFB; color: var(--tuxedo); overflow: hidden;
  border-radius: 4px; box-shadow: 0 1px 0 var(--line), 0 18px 40px rgba(120, 70, 60, .16); display: flex; flex-direction: column; font-family: var(--font); }
.book-page .photo { background: #F3E7E3; }
.book-page .photo::before { display: none; }
.book-page .folio { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-family: var(--font-serif); font-size: 13px;
  color: var(--text-3); font-variant-numeric: tabular-nums; letter-spacing: .12em; }

/* cover: full-bleed photo, a serif masthead over it */
.bk-cover { color: #fff; justify-content: space-between; }
.bk-cover .cover-photo { position: absolute; inset: 0; }
.bk-cover .cover-photo > img, .bk-cover .cover-photo > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bk-cover .cover-photo::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(45, 28, 28, .52) 0%, rgba(45, 28, 28, 0) 34%, rgba(45, 28, 28, 0) 56%, rgba(45, 28, 28, .62) 100%); }
.bk-cover .cover-mast { position: relative; z-index: 2; padding: 30px 30px 0; }
.bk-cover .issue { display: inline-block; white-space: nowrap; font-size: 14px; letter-spacing: .14em; padding-bottom: 8px; border-bottom: 1px solid rgba(255,255,255,.7); }
.bk-cover h1, .bk-cover h2.bk-title { font-family: var(--font-serif); font-size: 50px; line-height: 1.12; letter-spacing: -1.5px; font-weight: 700; color: #fff; margin-top: 14px;
  text-shadow: 0 2px 22px rgba(40, 20, 20, .28); word-break: keep-all; }
.bk-cover .cover-foot { position: relative; z-index: 2; padding: 0 30px 32px; }
.bk-cover .cover-line { font-family: var(--font-serif); font-size: 22px; line-height: 1.4; }
.bk-cover .period { font-size: 14px; letter-spacing: .06em; margin-top: 6px; color: rgba(255,255,255,.88); }
.bk-cover .stamp-mark { position: absolute; z-index: 2; right: 28px; bottom: 34px; width: 46px; height: 46px; background: #fff; opacity: .92; transform: rotate(-12deg);
  -webkit-mask: var(--paw) center / contain no-repeat; mask: var(--paw) center / contain no-repeat; }
.bk-cover.no-photo { color: var(--tuxedo); background: linear-gradient(160deg, var(--sky), var(--bg-2)); }
.bk-cover.no-photo .cover-photo::after { display: none; }
.bk-cover.no-photo h1, .bk-cover.no-photo h2.bk-title, .bk-cover.no-photo .period { color: var(--tuxedo); text-shadow: none; }
.bk-cover.no-photo .issue { border-color: var(--tuxedo); }
.bk-cover.no-photo .stamp-mark { background: var(--cheese); }

/* a day — shared type: a big serif numeral, a pull-quote with an oversized quotation mark */
.bk-day .day-head { display: flex; align-items: flex-end; gap: 12px; }
.bk-day .num { font-family: var(--font-serif); font-size: 74px; line-height: .78; font-weight: 700; letter-spacing: -3px; color: var(--cheese-deep); }
.bk-day .day-head span { display: flex; flex-direction: column; font-size: 14px; color: var(--text-2); line-height: 1.35; }
.bk-day .day-head i { font-style: normal; font-weight: 700; color: var(--text); letter-spacing: .08em; }
.bk-day .quote { position: relative; font-family: var(--font-serif); font-size: 23px; line-height: 1.5; letter-spacing: -.3px; color: var(--tuxedo); padding-top: 22px; word-break: keep-all; }
.bk-day .quote::before { content: '\201C'; position: absolute; left: -4px; top: -14px; font-family: Georgia, var(--font-serif); font-size: 70px; line-height: 1; color: var(--blush); }
.bk-day .memo { font-size: 15px; color: var(--text-2); line-height: 1.75; margin-top: 10px; }
.bk-day .tags-line { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 12px; }
.bk-day .tags-line span { font-size: 13px; color: var(--text-3); letter-spacing: .06em; }
.bk-day .tags-line span::before { content: '#'; color: var(--cheese-deep); margin-right: 1px; }
.bk-day .shots { min-height: 0; display: grid; gap: 5px; }
.bk-day .shots .photo { min-height: 0; border-radius: 0; }
.bk-day .shots .photo > video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.bk-day .vid-flag { position: absolute; z-index: 2; left: 10px; bottom: 10px; font-size: 13px; font-weight: 700; color: #fff; background: rgba(45, 28, 28, .55);
  padding: 2px 9px; border-radius: 999px; }

/* feature: one photo bleeds off the top, the words sit on a two-column grid under it */
.bk-day.feature .shots { flex: 0 0 64%; }
.bk-day.feature .shots .photo { height: 100%; }
.bk-day.feature .day-text { flex: 1; min-height: 0; display: grid; grid-template-columns: auto 1fr; gap: 0 22px; padding: 26px 30px 44px; align-content: start; }
.bk-day.feature .day-head { flex-direction: column; align-items: flex-start; gap: 10px; }
.bk-day.feature .quote { padding-top: 14px; }
.bk-day.feature .quote::before { top: -22px; }
.bk-day.feature.r .day-text { grid-template-columns: 1fr auto; }
.bk-day.feature.r .day-head { order: 2; align-items: flex-end; text-align: right; }

/* gallery: masthead line on top, an asymmetric photo grid, the words underneath */
.bk-day.gallery { padding: 30px 28px 46px; gap: 16px; }
.bk-day.gallery .day-head { padding-bottom: 14px; border-bottom: 1px solid var(--tuxedo); }
.bk-day.gallery.r .day-head { flex-direction: row-reverse; text-align: right; }
.bk-day.gallery .shots { flex: 1; }
.bk-day .shots.n2 { grid-template: 1fr / 1.35fr 1fr; }
.bk-day .shots.n2 .photo:last-child { margin-top: 18%; }
.bk-day .shots.n3 { grid-template: 1fr 1fr / 1.45fr 1fr; }
.bk-day .shots.n3 .photo:first-child { grid-row: 1 / -1; }
.bk-day .shots.n4 { grid-template: 1.3fr 1fr / 1fr 1fr; }
.bk-day.gallery.r .shots.n2 { grid-template-columns: 1fr 1.35fr; }
.bk-day.gallery.r .shots.n2 .photo:last-child { margin-top: 0; }
.bk-day.gallery.r .shots.n2 .photo:first-child { margin-top: 18%; }
.bk-day.gallery.r .shots.n3 .photo:first-child { grid-column: 2; grid-row: 1 / -1; }
.bk-day.gallery .words { max-height: 36%; overflow: hidden; padding-top: 16px; }
.bk-day.gallery .quote { font-size: 21px; padding-top: 18px; }
.bk-day.gallery .quote::before { top: -18px; }

/* text-only moments: a contents page */
.bk-moments { padding: 40px 32px 46px; gap: 20px; }
.bk-moments h2 { font-family: var(--font-serif); font-size: 32px; font-weight: 700; letter-spacing: -1px; padding-bottom: 14px; border-bottom: 1px solid var(--tuxedo); }
.bk-moments ul { display: flex; flex-direction: column; gap: 18px; }
.bk-moments li { list-style: none; display: grid; grid-template-columns: 78px 1fr; gap: 14px; align-items: baseline; }
.bk-moments li span { font-size: 14px; color: var(--cheese-deep); font-weight: 700; letter-spacing: .04em; }
.bk-moments li p { font-family: var(--font-serif); font-size: 21px; line-height: 1.5; }

/* closing */
.bk-end { padding: 44px 34px; justify-content: center; align-items: flex-start; gap: 22px; background: linear-gradient(170deg, var(--sky), var(--bg-2)); }
.bk-end .big { font-family: var(--font-serif); font-size: 32px; font-weight: 700; letter-spacing: -1px; line-height: 1.35; }
.bk-end dl { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; font-size: 17px; }
.bk-end dt { color: var(--text-2); }
.bk-end dd { font-family: var(--font-serif); font-weight: 700; }
.bk-end .sign { font-family: var(--font-hand); font-size: 26px; color: var(--text-2); }
.bk-end .stamp-mark { width: 42px; height: 42px; background: var(--cheese); transform: rotate(10deg);
  -webkit-mask: var(--paw) center / contain no-repeat; mask: var(--paw) center / contain no-repeat; }

@media (max-width: 560px) {
  .bk-cover h1, .bk-cover h2.bk-title { font-size: 36px; }
  .bk-cover .cover-mast { padding: 22px 22px 0; }
  .bk-cover .cover-foot { padding: 0 22px 24px; }
  .bk-cover .cover-line { font-size: 18px; }
  .bk-day .num { font-size: 54px; }
  .bk-day .quote { font-size: 18px; }
  .bk-day.feature .day-text { padding: 18px 18px 36px; gap: 0 14px; }
  .bk-day.gallery { padding: 20px 18px 36px; }
  .bk-moments li p { font-size: 18px; }
}

.book-page .print-only { display: none; }
/* while turning pages into pictures (insta.js): video still frames, like print */
.book.exporting .book-page .print-only { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.book.exporting .book-page .print-only ~ .vid-flag { display: none; }

/* print / save as PDF: one A5 sheet per page, app chrome hidden */
@media print {
  .book-page .print-only { display: block; position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
  .book-page .print-only ~ .vid-flag, .book-page .photo:has(.print-only) .screen-only { display: none; }
  @page { size: A5; margin: 0; }
  html, body { background: #fff !important; }
  .sidebar, .m-top, .m-tab, .no-print, #toast { display: none !important; }
  .d-app { display: block !important; }
  .book { gap: 0; }
  .book-page { width: 148mm; height: 210mm; aspect-ratio: auto; border-radius: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .book-page:last-child { break-after: auto; page-break-after: auto; }
}
