/* ===== The Garage Sale Book: viewer + page designs ===== */
.book-body { background: var(--stage); color: #fff; height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column;
  background-image: radial-gradient(ellipse at 50% 40%, var(--stage-2) 0%, var(--stage) 70%); }

/* ---- toolbar ---- */
.book-bar { flex: none; height: 56px; display: flex; align-items: center; gap: 10px; padding: 0 12px; padding-top: env(safe-area-inset-top); background: rgba(0, 0, 0, .25); border-bottom: 1px solid rgba(255, 255, 255, .08); position: relative; z-index: 20; }
.bb-back { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 700; font-size: 14px; padding: 6px 10px 6px 6px; border-radius: 10px; }
.bb-back:hover { background: rgba(255, 255, 255, .08); }
.bb-back img { width: 30px; height: 30px; }
.bb-title { flex: 1; display: flex; justify-content: center; min-width: 0; }
.bb-title select { background: rgba(255, 255, 255, .08); color: #fff; border: 1px solid rgba(255, 255, 255, .15); border-radius: 10px; padding: 7px 30px 7px 12px; font-weight: 700; font-size: 14px; max-width: 100%;
  appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 9px center; background-size: 13px; }
.bb-title select option { color: #000; }
.bb-acts { display: flex; gap: 4px; }
.bb-btn { display: flex; align-items: center; gap: 6px; background: none; border: 0; color: #fff; font-weight: 700; font-size: 13px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.bb-btn:hover { background: rgba(255, 255, 255, .1); }
.bb-btn svg { width: 19px; height: 19px; }
@media (max-width: 700px) { .bb-btn span, .bb-back span { display: none; } .hide-sm { display: none; } }

/* ---- stage ---- */
.stage { flex: 1; position: relative; display: flex; align-items: center; justify-content: center; min-height: 0; overflow: hidden; touch-action: pan-y; }
.book-scale { position: relative; transform-origin: center center; flex: none; }
.loading-book { position: absolute; font: 700 28px var(--hand); color: var(--yellow); }
.turn { position: absolute; top: 50%; margin-top: -28px; width: 56px; height: 56px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; z-index: 10; display: grid; place-items: center; transition: background .15s, opacity .2s; }
.turn:hover { background: rgba(255, 255, 255, .22); }
.turn svg { width: 26px; height: 26px; }
.turn.prev { left: 14px; } .turn.next { right: 14px; }
.turn[disabled] { opacity: 0; pointer-events: none; }
@media (max-width: 760px) {
  .turn { top: auto; bottom: 10px; margin: 0; width: 46px; height: 46px; background: rgba(0, 0, 0, .45); }
}

.book-foot { flex: none; display: flex; align-items: center; gap: 14px; padding: 8px 18px calc(10px + env(safe-area-inset-bottom)); font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .75); }
.book-foot input { flex: 1; accent-color: var(--yellow); max-width: 600px; margin: 0 auto; }
.book-foot span { min-width: 110px; text-align: right; }

/* ---- the book engine ---- */
.book { position: relative; width: 100%; height: 100%; perspective: 2600px; -webkit-perspective: 2600px; }
.leaf { position: absolute; top: 0; height: 100%; transform-origin: left center; -webkit-transform-style: preserve-3d; transform-style: preserve-3d; will-change: transform; }
.mode-spread .leaf { left: 50%; width: 50%; }
.mode-single .leaf { left: 0; width: 100%; }
.face { position: absolute; inset: 0; overflow: hidden; -webkit-backface-visibility: hidden; backface-visibility: hidden; background: var(--page); box-shadow: 0 14px 34px rgba(0, 0, 0, .38); }
.face.back { transform: rotateY(180deg); -webkit-transform: rotateY(180deg); }
.mode-spread .face.front { border-radius: 0 6px 6px 0; }
.mode-spread .face.back { border-radius: 6px 0 0 6px; }
.mode-single .face { border-radius: 6px; }
.shade { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(to left, rgba(0, 0, 0, .28), rgba(0, 0, 0, 0) 55%); }
.turning .shade { animation: shade .7s ease-in-out; }
@keyframes shade { 50% { opacity: 1; } }

/* ---- page base ---- */
.page { position: absolute; inset: 0; width: 540px; height: 760px; background: var(--page); color: var(--ink); padding: 34px 36px 52px; overflow: hidden; font-family: var(--body); }
.page::after { content: ''; position: absolute; top: 0; bottom: 0; width: 46px; pointer-events: none; }
.page.right::after { left: 0; background: linear-gradient(to right, rgba(60, 40, 10, .16), rgba(60, 40, 10, 0)); }
.page.left::after { right: 0; background: linear-gradient(to left, rgba(60, 40, 10, .16), rgba(60, 40, 10, 0)); }
.pg-foot { position: absolute; left: 36px; right: 36px; bottom: 18px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 700; color: #a99f8f; letter-spacing: .06em; text-transform: uppercase; }
.page.left .pg-foot { flex-direction: row-reverse; }
.page a { color: inherit; }
.pg-kicker { font: 700 13px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 6px; }
.pg-h { font: 800 34px/1.02 var(--head); letter-spacing: -.03em; margin: 0 0 14px; }

/* ---- front cover ---- */
.page.cover { background: var(--red); color: #fff; padding: 40px 38px; background-image: radial-gradient(rgba(255, 255, 255, .09) 1.5px, transparent 1.6px); background-size: 14px 14px; }
.page.cover::after { display: none; }
.cv-top { display: flex; justify-content: space-between; align-items: flex-start; }
.cv-free { background: var(--yellow); color: var(--ink); font: 800 14px/1 var(--head); padding: 8px 12px; border-radius: 4px 10px 10px 4px; transform: rotate(6deg); letter-spacing: .04em; }
.cv-week { font-weight: 800; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.cv-the { font: 700 46px/1 var(--hand); color: var(--yellow); margin: 26px 0 -6px; transform: rotate(-4deg); display: inline-block; }
.cv-title { font: 800 76px/.9 var(--head); letter-spacing: -.045em; margin: 0; }
.cv-region { display: inline-block; background: var(--ink); color: var(--yellow); font: 800 26px/1 var(--head); padding: 8px 14px 9px; margin-top: 14px; letter-spacing: -.01em; transform: rotate(-1.5deg); }
.cv-collage { position: relative; height: 270px; margin-top: 26px; }
.polaroid { position: absolute; background: #fff; padding: 8px 8px 26px; box-shadow: 0 8px 18px rgba(0, 0, 0, .3); }
.polaroid img { width: 100%; height: 100%; object-fit: cover; background: #eee; }
.polaroid span { position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font: 700 16px/1 var(--hand); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 8px; }
.cv-stats { position: absolute; left: 38px; right: 38px; bottom: 32px; display: flex; justify-content: space-between; align-items: flex-end; font-weight: 800; }
.cv-stats b { display: block; font: 800 40px/1 var(--head); }
.cv-stats small { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .85; }
.cv-open { font: 700 22px var(--hand); color: var(--yellow); }

/* ---- welcome ---- */
.wel-intro { font-size: 17px; line-height: 1.55; color: var(--ink-2); margin: 0 0 20px; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 22px; }
.stat { background: var(--paper-2); border-radius: 10px; padding: 12px 12px 10px; }
.stat b { display: block; font: 800 32px/1 var(--head); color: var(--red); }
.stat span { font-size: 12px; font-weight: 700; color: var(--ink-2); }
.tips { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.tips li { display: grid; grid-template-columns: 36px 1fr; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.tips i { font-style: normal; width: 36px; height: 36px; border-radius: 50%; background: var(--yellow); display: grid; place-items: center; }
.tips i .ico { width: 19px; height: 19px; }
.tips b { display: block; font-size: 15px; }
.howto { margin-top: 20px; font: 700 21px/1.25 var(--hand); color: var(--teal); transform: rotate(-1deg); }

/* ---- contents ---- */
.toc-sub { font: 800 12px var(--body); letter-spacing: .12em; text-transform: uppercase; color: var(--red); margin: 14px 0 4px; padding-top: 8px; border-top: 1.5px solid var(--line); }
.toc-sub:first-of-type { border-top: 0; margin-top: 4px; padding-top: 0; }
.toc-row { display: flex; align-items: baseline; gap: 8px; padding: 3px 0; font-size: 14.5px; cursor: pointer; text-decoration: none; color: var(--ink); border-radius: 4px; }
.toc-row:hover { background: var(--yellow-l); }
.toc-row .no { flex: none; width: 26px; height: 22px; border-radius: 11px; background: var(--ink); color: #fff; font-size: 11.5px; font-weight: 800; display: grid; place-items: center; align-self: center; }
.toc-row .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.toc-row .dots { flex: 1; border-bottom: 2px dotted #d3c7b1; min-width: 14px; transform: translateY(-4px); }
.toc-row .d { flex: none; font-size: 12px; color: var(--muted); font-weight: 700; }
.toc-row .p { flex: none; font-weight: 800; width: 24px; text-align: right; }
.toc-row.cancelled .t { text-decoration: line-through; color: var(--muted); }
.toc-more { font-size: 12px; color: var(--muted); margin-top: 8px; font-style: italic; }

/* ---- map page ---- */
.map-svg { width: 100%; height: 560px; display: block; background: var(--map-bg); border-radius: 10px; }
.map-note { font-size: 13px; color: var(--ink-2); margin-top: 10px; }
.map-pin { cursor: pointer; }
.map-pin circle { fill: var(--red); }
.map-pin.cancelled circle { fill: #9b948a; }
.map-pin:hover circle { fill: var(--ink); }
.map-svg .cbd rect { fill: var(--ink); }
.map-svg .cbd text { fill: var(--yellow); }

/* ---- sale page ---- */
.page.sale { padding-top: 26px; }
.sp-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sp-no { flex: none; width: 50px; height: 50px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font: 700 30px/1 var(--hand); transform: rotate(-6deg); box-shadow: 0 2px 0 var(--red-d); }
.sp-sub { font: 800 13px var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-days { display: flex; gap: 4px; }
.sp-days span { background: var(--ink); color: #fff; font-size: 11px; font-weight: 800; padding: 4px 8px; border-radius: 6px; letter-spacing: .04em; }
.sp-photos { display: grid; gap: 8px; height: 262px; margin-bottom: 14px; }
.sp-photos.n1 { grid-template-columns: 1fr; }
.sp-photos.n2 { grid-template-columns: 1.6fr 1fr; }
.sp-photos.n3 { grid-template-columns: 1.6fr 1fr; grid-template-rows: 1fr 1fr; }
.sp-photos.n3 .p0 { grid-row: 1 / 3; }
.sp-photos a { display: block; overflow: hidden; border-radius: 8px; background: var(--paper-2); position: relative; }
.sp-photos img { width: 100%; height: 100%; object-fit: cover; }
.sp-more { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 6px; }
.sp-title { font: 800 26px/1.08 var(--head); letter-spacing: -.02em; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-addr { font-size: 15px; color: var(--ink-2); margin: 0 0 12px; font-weight: 600; }
.sp-when { background: var(--yellow); border-radius: 4px 12px 12px 4px; padding: 9px 14px 9px 30px; position: relative; margin-bottom: 12px; transform: rotate(-.5deg); }
.sp-when::before { content: ''; position: absolute; left: 11px; top: 50%; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--page); }
.sp-when div { display: flex; justify-content: space-between; font-size: 14.5px; font-weight: 600; }
.sp-when b { font-weight: 800; }
.sp-desc { font-size: 14px; line-height: 1.5; color: var(--ink-2); margin: 0 0 10px; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.sp-cats { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 10px; }
.sp-cats span { font-size: 11.5px; font-weight: 700; border: 1.5px solid var(--line); border-radius: 999px; padding: 2px 8px; color: var(--ink-2); }
.sp-facts { font-size: 12.5px; font-weight: 700; color: var(--teal); display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 8px; }
.sp-facts span { display: inline-flex; align-items: center; gap: 5px; }
.sp-facts .ico { width: 15px; height: 15px; }
.sp-acts { position: absolute; left: 36px; right: 36px; bottom: 44px; display: flex; gap: 8px; }
.sp-acts .btn { font-size: 13px; padding: 8px 14px; }
.stamp { position: absolute; top: 300px; left: 50%; transform: translateX(-50%) rotate(-14deg); border: 6px solid var(--red); color: var(--red); font: 800 54px/1 var(--head); padding: 6px 20px 10px; border-radius: 10px; letter-spacing: .04em; background: rgba(255, 253, 247, .85); z-index: 3; }

/* ---- back cover ---- */
.page.backcover { background: var(--ink); color: #fff; text-align: center; padding: 56px 44px; }
.page.backcover::after { display: none; }
.bc-tag { display: inline-block; font: 700 30px/1 var(--hand); color: var(--yellow); transform: rotate(-4deg); }
.bc-h { font: 800 46px/1 var(--head); letter-spacing: -.03em; margin: 10px 0 12px; }
.bc-p { font-size: 17px; opacity: .85; margin: 0 auto 26px; max-width: 380px; line-height: 1.45; }
.bc-qr { width: 190px; height: 190px; background: #fff; border-radius: 16px; padding: 14px; margin: 0 auto 12px; }
.bc-qr img { width: 100%; height: 100%; }
.bc-url { font-weight: 800; font-size: 18px; color: var(--yellow); word-break: break-all; }
.bc-foot { position: absolute; left: 0; right: 0; bottom: 34px; font-size: 13px; opacity: .6; }
.bc-logo { width: 56px; margin: 0 auto 8px; }

/* ---- notes / filler ---- */
.notes-lines { margin-top: 14px; }
.notes-lines div { height: 38px; border-bottom: 1.5px solid #e7dcc6; }
.notes-art { position: absolute; right: 36px; bottom: 60px; width: 150px; opacity: .9; }

/* ---- empty week ---- */
.empty-pg { text-align: center; padding-top: 140px; }
.empty-pg p { font-size: 17px; color: var(--ink-2); }

/* ---- printing: every page on its own sheet ---- */
@media print {
  @page { size: 540px 760px; margin: 0; }
  .book-body { background: #fff; height: auto; overflow: visible; display: block; }
  .book-bar, .book-foot, .turn, .loading-book { display: none !important; }
  .stage { display: block; overflow: visible; }
  .book-scale { transform: none !important; zoom: 1 !important; width: auto !important; height: auto !important; }
  .book { transform: none !important; perspective: none; height: auto; }
  .leaf { position: static !important; transform: none !important; visibility: visible !important; width: auto !important; }
  .face { position: relative !important; inset: auto; width: 540px; height: 760px; transform: none !important; visibility: visible !important; box-shadow: none; border-radius: 0 !important; break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .face:empty, .face:not(:has(.page)) { display: none; }
  .shade, .sp-acts { display: none; }
}
.map-svg text { font-family: var(--body); }

/* ---- sponsor pages ---- */
.adp-list { display: grid; gap: 16px; margin-top: 4px; }
.adp-list.one .adp img { height: 300px; }
.adp { display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); background: var(--paper); box-shadow: 0 0 0 1px var(--line); min-height: 0; }
.adp img { width: 100%; height: 170px; object-fit: cover; flex: none; }
.adp-b { flex: 1; }
.adp-b { padding: 12px 14px 14px; }
.adp-biz { font-size: 12px; font-weight: 700; color: var(--muted); }
.adp-h { font: 800 19px/1.2 var(--head); margin-top: 3px; }
.adp-t { font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adp-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 13px; }
.adp-cta { font-weight: 800; color: var(--red-d); }
.adp-ph { color: var(--ink-2); font-weight: 600; }
.adp-note { font-size: 11.5px; color: var(--muted); margin-top: 10px; }
.adp-note a { color: inherit; }
