/* The Souls Gazette — public issues site (smply.gg/gazette/issues). */

body.issues-site {
  background: #1d1b19 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4' shape-rendering='crispEdges'%3E%3Crect width='4' height='4' fill='%231d1b19'/%3E%3Crect width='1' height='1' fill='%23242220'/%3E%3Crect x='2' y='2' width='1' height='1' fill='%23181715'/%3E%3C/svg%3E") 0 0 / 16px 16px;
  overflow-x: hidden;
  /* footer always sits at the bottom of the window, even when there's little above it */
  display: flex; flex-direction: column; min-height: 100vh;
}

/* ---------- Header: Minecraft title screen ---------- */

.site-head { position: relative; overflow: hidden; padding-bottom: 34px;
  background: linear-gradient(#0d1b1f, rgba(13, 27, 31, 0) 100%); }
.site-nav { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; padding: 12px 18px; }   /* narrow: buttons wrap under, on the right */
.site-nav .grow { flex: 1; }
.account { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; font-size: 16px; }
.account .avatar { width: 32px; height: 32px; }

.title-screen { position: relative; z-index: 1; text-align: center; padding: 18px 16px 0; }
.big-logo { display: block; margin: 0 auto 6px; width: 96px; height: 96px; image-rendering: pixelated; filter: drop-shadow(5px 5px 0 #000); animation: bob 4s ease-in-out infinite; }
.title-screen h1 { margin: 8px 0 0; font: 400 86px/1 var(--title); color: #f3eee3; text-shadow: 6px 6px 0 #000; }
.title-screen p { margin: 10px auto 0; max-width: 560px; color: #c9c4ba; }
@keyframes bob { 50% { transform: translateY(-6px); } }

/* drifting souls */
.souls { position: absolute; inset: 0; pointer-events: none; }
.souls i {
  position: absolute; bottom: -10px;
  width: 6px; height: 6px;
  background: #3ee6f0; box-shadow: 0 0 10px #3ee6f0;
  opacity: 0;
  animation: rise linear infinite;
}
@keyframes rise { 10% { opacity: .8; } 90% { opacity: .6; } to { transform: translate(var(--dx), -420px); opacity: 0; } }

/* ---------- Shelf of covers ---------- */

#shelf-view { padding: 0 0 40px; }
#shelf-view, #reader { min-width: 0; }   /* let the shelf scroll sideways instead of widening the page */
.shelf-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 0 22px; }
.shelf-head h2 { margin: 0; font: 24px var(--mc); color: #fff; text-shadow: 2px 2px 0 #000; }
.shelf-head .hint { font-size: 16px; color: #9a948a; }
.shelf {
  display: flex; gap: 26px;
  overflow-x: auto; overflow-y: hidden;   /* sideways only: covers sliding in mustn't add a scrollbar */
  scroll-snap-type: x mandatory; scroll-padding: 0 22px;
  padding: 26px 22px 34px;
  scrollbar-color: #6f6f6f #1d1b19;
}
.shelf:focus-visible { outline: 2px solid #fff; outline-offset: -4px; }
.cover {
  flex: none; scroll-snap-align: start;
  font: inherit;
  width: 260px;
  padding: 0; border: 0; background: none; color: inherit; text-align: left; cursor: pointer;
  opacity: 0; animation: enter .6s cubic-bezier(.2, .8, .2, 1) forwards;
}
@keyframes enter { from { opacity: 0; transform: translateY(30px) scale(.96); } to { opacity: 1; transform: none; } }
.cover .thumb {
  display: block;
  position: relative;
  width: 260px; height: 368px;          /* A4 proportions */
  overflow: hidden;
  border: 2px solid #000;
  box-shadow: 6px 6px 0 #000;
  transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
  background: #f3eee3;
}
.cover .thumb .page { position: absolute; top: 0; left: 0; margin: 0; transform-origin: 0 0; box-shadow: none; pointer-events: none; }
.cover:hover .thumb, .cover:focus-visible .thumb { transform: translateY(-10px) rotate(-1.2deg); box-shadow: 10px 14px 0 #000; }
.cover:focus-visible { outline: none; }
.cover:focus-visible .thumb { outline: 3px solid #ffff55; }
.cover .label { display: block; margin-top: 14px; font-size: 16px; color: #fff; text-shadow: 2px 2px 0 #000; }
.cover .headline { display: block; margin-top: 4px; font-size: 16px; color: #c9c4ba; }
.cover .stats { display: block; margin-top: 6px; font-size: 16px; color: #9a948a; }
.cover .new {
  position: absolute; top: 12px; right: -34px; z-index: 2;
  width: 130px; padding: 3px 0; text-align: center;
  font: 16px var(--mc); color: #fff; background: #3c8527; border: 2px solid #000;
  transform: rotate(35deg);
}
.cover .vis {
  position: absolute; left: 8px; top: 8px; z-index: 2;
  padding: 2px 6px; font: 16px var(--mc); color: #fff; background: #555; border: 2px solid #000;
}
.empty-shelf { margin: 30px auto; max-width: 420px; text-align: center; }

/* ---------- Reader ---------- */

.reader { padding: 0 0 50px; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; } }
.reader-bar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 18px; background: rgba(16, 15, 14, .94); border-bottom: 2px solid #000;
}
.reader-bar .grow { flex: 1; }
.reader-title { font-size: 16px; color: #fff; }
.reader-body { display: flex; gap: 22px; align-items: flex-start; justify-content: center; padding: 22px 18px; }
.reader-page { flex: 0 1 auto; min-width: 0; }
.reader-page .page { cursor: zoom-in; }
.reader-page.zoomed {
  height: calc(100vh - 80px);
  overflow: auto;
  flex: none;
  border: 2px solid #000;
  background: #141312;
  user-select: none;
}
.reader-page.zoomed .page { cursor: grab; margin: 0; }
.reader-page img { -webkit-user-drag: none; user-select: none; }   /* dragging pans the page, not the picture */
.reader-page.zoomed.panning .page { cursor: grabbing; }
.reader-page.pressing .page, .reader-page.nozoom .page { cursor: default; }
.zoom-ctl { display: inline-flex; align-items: center; gap: 4px; }
.zoom-ctl span { min-width: 48px; text-align: center; font-size: 16px; color: #fff; }
.reader-page .page { margin: 0; box-shadow: 8px 8px 0 #000; }
.reader-main { flex: 0 1 auto; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; }
.tap-hint { display: none; }

/* Phone viewer: the page full screen. Pinch zooming is done by the page itself (not the
   browser), so one finger still scrolls around natively, with momentum. */
.viewer { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; background: #141312; }
.viewer[hidden] { display: none; }
.viewer-bar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #1b1a18; border-bottom: 2px solid #000; }
.viewer-bar .grow { flex: 1; }
.viewer-bar #viewerZoom { min-width: 48px; text-align: center; font-size: 16px; color: #fff; }
.viewer-tip { font-size: 16px; color: #9a948a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.viewer-box { flex: 1; overflow: auto; scrollbar-gutter: stable;   /* Fit stays the same size with or without a scrollbar */
  touch-action: pan-x pan-y; overscroll-behavior: contain; -webkit-user-select: none; user-select: none; }
.viewer-box img { -webkit-user-drag: none; }
.viewer-pad { width: max-content; padding: 12px; }
.viewer-pad .page { margin: 0; box-shadow: 6px 6px 0 #000; }
html.viewing, html.viewing body { overflow: hidden; }
@media (max-width: 700px), (hover: none) and (pointer: coarse) {
  .tap-hint { display: inline-flex; }
  #zoomCtl, #zoomToggle { display: none !important; }
  .reader-page .page, .reader-page.nozoom .page { cursor: zoom-in; }
}
@media (max-width: 420px) { .viewer-tip { display: none; } }

.talk { flex: 0 0 340px; display: grid; gap: 14px; position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }

.vote-row { display: flex; gap: 10px; }
.vote { flex: 1; font-size: 16px; gap: 8px; }
.cover .stats [data-px], .stats [data-px] { vertical-align: middle; }
.vote[aria-pressed="true"] { background: var(--green); box-shadow: inset 2px 2px 0 #6fbf55, inset -2px -3px 0 #24561a; }
#down[aria-pressed="true"] { background: var(--red); box-shadow: inset 2px 2px 0 #d8665e, inset -2px -3px 0 #6a1b16; }
.vote.pop { animation: pop .35s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes pop { 40% { transform: scale(1.18); } }

.comment-form { display: grid; gap: 8px; margin-bottom: 12px; }
.comment-form textarea { resize: vertical; min-height: 70px; font-size: 16px; line-height: 24px; }
.comment-form .form-row { display: flex; align-items: center; gap: 8px; }
.comment-form .grow { flex: 1; }
.comment-form .check { display: flex; align-items: center; gap: 6px; font-size: 16px; cursor: pointer; }
.comment-form .check input { width: 16px; height: 16px; accent-color: var(--green); }
.as { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 16px; }
.as .avatar { width: 24px; height: 24px; }
.as form { display: flex; gap: 6px; flex: 1; min-width: 200px; }
.as .mc-input { min-height: 30px; padding: 3px 8px; font-size: 16px; }
.comment-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.comment-list li {
  display: grid; grid-template-columns: 32px 1fr; gap: 9px;
  padding: 8px; background: #d6d6d6; box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #8b8b8b;
  animation: fade .4s ease both;   /* fade, not slide: sliding pokes out of the box and flashes a scrollbar */
}
.comment-list .avatar { width: 32px; height: 32px; }
.comment-list .anon { filter: grayscale(1) brightness(.85); }
.comment-list .who { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 16px; color: #1e1e1e; }
.comment-list .first-star { display: inline-flex; filter: drop-shadow(0 0 3px rgba(255, 216, 61, .8)); }
.comment-list .when { font-size: 16px; color: #6a6a6a; }
.comment-list .text { margin-top: 3px; font-size: 16px; line-height: 24px; white-space: pre-wrap; overflow-wrap: anywhere; color: #2e2e2e; }
.comment-list .tools { display: flex; gap: 4px; margin-top: 6px; opacity: .45; transition: opacity .15s; }
.comment-list li:hover > div > .tools, .comment-list .tools:focus-within { opacity: 1; }
.comment-list .tool {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px; padding: 0;
  background: #c6c6c6; border: 0; cursor: pointer;
  box-shadow: inset 2px 2px 0 #fff, inset -2px -2px 0 #8b8b8b;
}
.comment-list .tool:hover, .comment-list .tool:focus-visible { background: #e2e2e2; outline: none; }
.comment-list .tool:hover svg { transform: translateY(-1px); }
.comment-list li.pinned { background: #e6dcae; box-shadow: inset 2px 2px 0 #fff8d8, inset -2px -2px 0 #a8995a; }
.comment-list .pin-note { display: flex; align-items: center; gap: 4px; margin-bottom: 2px; font-size: 16px; color: #6b5a1a; }
.comment-list .replies { list-style: none; margin: 8px 0 0; padding: 0 0 0 8px; display: grid; gap: 6px; border-left: 2px solid #8b8b8b; }
.comment-list .replies li { grid-template-columns: 24px 1fr; padding: 6px; background: #e4e4e4; box-shadow: none; }
.comment-list .replies .avatar { width: 24px; height: 24px; }
.comment-list .reply-box { display: grid; gap: 6px; margin-top: 8px; }
.comment-list .reply-box[hidden] { display: none; }
.comment-list .reply-box textarea { min-height: 52px; font-size: 16px; resize: vertical; }
.comment-list .reply-box .form-row { display: flex; gap: 6px; }
.comment-list .reply-box .grow { flex: 1; }
.no-comments { font-size: 16px; color: #555; }

.site-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 18px 22px 26px; font-size: 16px; color: #9a948a; border-top: 2px solid #000; }
.site-foot a { color: #c9c4ba; }

@media (max-width: 700px) {
  .title-screen h1 { font-size: 43px; }
}
@media (max-width: 980px) {
  .reader-body { flex-direction: column; align-items: center; }
  .talk { position: static; max-height: none; width: 100%; max-width: 640px; flex-basis: auto; }
}
@media (max-width: 560px) {
  .cover, .cover .thumb { width: 210px; }
  .cover .thumb { height: 297px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .souls { display: none; }
}

@media print {
  .site-head, #shelf-view, .reader-bar, .talk, .site-foot, .tap-hint, .viewer { display: none !important; }
  body.issues-site { background: none; }
  .reader, .reader-body { display: block; padding: 0; }
  .reader-page .page { box-shadow: none; }
  .reader-page.zoomed { height: auto; overflow: visible; border: 0; width: auto !important; }
}
