/* Newsstand overlay: striped wallpaper, walnut shelves, brass rods, folded papers with price tags. */
.newsstand {
  --walnut: #5b3a2c;
  --walnut-2: #7a5039;
  --brass: #c9a25a;
  --ns-ink: #3b2a24;
  position: absolute; inset: 0; z-index: 12; overflow-y: auto; overflow-x: hidden;
  color: var(--ns-ink);
  background:
    repeating-linear-gradient(90deg, #f6ecdb 0 26px, #f2e4cf 26px 28px, #f6ecdb 28px 54px),
    #f6ecdb;
  opacity: 0; transition: opacity .35s ease;
}
.newsstand[data-open] { opacity: 1; }
.ns-light {
  position: fixed; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 45% at 50% 0%, #fffaf0f2, transparent 70%),
    radial-gradient(ellipse at 50% 120%, #3b2a2433, transparent 60%);
}
.ns-close, .ns-reader-close {
  width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--ns-ink); background: #fffaf0;
  color: var(--ns-ink); font-size: 24px; line-height: 1; cursor: pointer; box-shadow: 0 6px 16px -8px #3b2a24aa;
}
.ns-close { position: fixed; top: 22px; right: 26px; z-index: 4; }

.ns-head { position: relative; text-align: center; padding: 46px 16px 8px; }
.ns-kicker { margin: 0; font-size: 11px; letter-spacing: .4em; font-weight: 700; color: #9a6b45; }
.ns-head h2 {
  margin: 10px 0 0; font-family: "Noto Serif SC", "Songti SC", serif; font-weight: 900;
  font-size: clamp(34px, 4.4vw, 60px); letter-spacing: .12em; color: var(--ns-ink);
}
.ns-sub {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 0; width: min(760px, 100%); margin: 14px auto 0; padding: 7px 0;
  border-top: 3px double var(--ns-ink); border-bottom: 1px solid var(--ns-ink); font-size: 12px; letter-spacing: .08em;
}
.ns-sub span { padding: 0 16px; }
.ns-sub span + span { border-left: 1px solid #3b2a2455; }

.ns-rack { position: relative; width: min(1120px, 92%); margin: 34px auto 60px; padding: 0 0 10px; }
.ns-shelf { position: relative; margin-bottom: 46px; }
.ns-rod {
  position: relative; z-index: 3; height: 10px; margin: 0 2%; border-radius: 6px;
  background: linear-gradient(180deg, #f1d9a0 0%, var(--brass) 45%, #8a6a32 100%);
  box-shadow: 0 3px 6px -2px #3b2a2466;
}
.ns-rod i { position: absolute; top: -10px; width: 14px; height: 30px; border-radius: 4px; background: linear-gradient(90deg, #8a6a32, var(--brass), #8a6a32); }
.ns-rod i:first-child { left: -6px; }
.ns-rod i:last-child { right: -6px; }
.ns-papers { position: relative; z-index: 2; display: flex; justify-content: center; gap: clamp(14px, 2.4vw, 34px); margin-top: -4px; }
.ns-ledge {
  position: relative; z-index: 1; height: 26px; margin-top: -18px; border-radius: 4px;
  background: linear-gradient(180deg, var(--walnut-2), var(--walnut) 60%, #43291e);
  box-shadow: 0 18px 24px -14px #3b2a24aa, inset 0 2px 0 #ffffff22;
}

.ns-paper {
  position: relative; flex: 0 1 230px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; color: inherit; text-align: left;
  transform: rotate(var(--tilt)); transform-origin: 50% 0; transition: transform .45s cubic-bezier(.2,.8,.2,1.15); will-change: transform;
  animation: ns-hang .7s cubic-bezier(.2,.8,.2,1.2) backwards; animation-delay: calc(var(--i) * 60ms);
}
@keyframes ns-hang { from { opacity: 0; transform: translateY(-30px) rotate(var(--tilt)); } }
.ns-sheet {
  position: relative; display: block; aspect-ratio: 0.78; overflow: hidden; background: #fbf7ee;
  border-radius: 2px 2px 3px 3px; box-shadow: 0 14px 22px -12px #3b2a24b3, 0 2px 0 #0000000d;
}
.ns-paper::before {
  content: ''; position: absolute; left: 4%; right: 4%; top: 8%; aspect-ratio: 0.78; z-index: -1; border-radius: 4px;
  box-shadow: 0 34px 44px -14px #3b2a24cc; opacity: 0; transition: opacity .35s ease;
}
.ns-sheet::after { content: ''; position: absolute; inset: 0; background: #2a1d18; opacity: 0; transition: opacity .3s ease; pointer-events: none; }
.ns-sheet img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.ns-fold {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, #3b2a2440 0, transparent 14px),
    linear-gradient(90deg, transparent 49.6%, #3b2a2414 50%, transparent 50.4%),
    linear-gradient(180deg, transparent 70%, #3b2a2422 100%);
}
.ns-tag {
  position: relative; display: block; width: 86%; margin: 12px auto 0; padding: 8px 10px 9px; background: #fffaf0;
  border: 1px solid #3b2a2455; border-radius: 3px; box-shadow: 0 6px 12px -8px #3b2a24aa;
}
.ns-tag::before { content: ''; position: absolute; left: 50%; top: -12px; width: 1px; height: 12px; background: #3b2a2466; }
.ns-tag small { display: block; font-size: 10px; letter-spacing: .08em; color: #9a6b45; font-weight: 700; }
.ns-tag b { display: block; margin-top: 3px; font-family: "Noto Serif SC", "Songti SC", serif; font-weight: 900; font-size: 14px; line-height: 1.4; }
.ns-tag em { display: block; margin-top: 2px; font-style: normal; font-size: 11px; color: #7d6a5e; }

@media (hover: hover) {
  .ns-papers:hover .ns-paper:not(:hover) .ns-sheet::after { opacity: .12; }
  .ns-paper:hover, .ns-paper:focus-visible { z-index: 5; transform: translateY(-34px) scale(1.1) rotate(0deg); }
  .ns-paper:hover::before, .ns-paper:focus-visible::before { opacity: 1; }
}
.ns-paper:focus-visible { outline: none; }
.ns-paper:focus-visible .ns-sheet { outline: 3px solid var(--brass); outline-offset: 3px; }

/* reader */
.newsstand.is-reading { overflow: hidden; }
.ns-reader { position: fixed; inset: 0; z-index: 6; display: grid; place-items: center; padding: 20px; background: #2a1d18b3; }
.ns-reader[hidden] { display: none; }
.ns-reader-card { width: min(1000px, 100%); height: calc(100svh - 40px); display: flex; flex-direction: column; background: #fbf7ee; border-radius: 6px; box-shadow: 0 30px 60px -20px #000a; overflow: hidden; }
.ns-reader-card header { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 3px double var(--ns-ink); }
.ns-reader-meta { font-size: 11px; letter-spacing: .08em; font-weight: 700; color: #9a6b45; }
.ns-reader-card h3 { margin: 2px 0 0; font-family: "Noto Serif SC", "Songti SC", serif; font-weight: 900; font-size: 20px; }
.ns-reader-card nav { display: flex; align-items: center; gap: 8px; flex: none; }
.ns-reader-card nav button:not(.ns-reader-close) { width: 38px; height: 38px; border-radius: 50%; border: 1.5px solid var(--ns-ink); background: #fffaf0; color: var(--ns-ink); font-size: 16px; cursor: pointer; }
.ns-open { padding: 8px 14px; border: 1.5px solid var(--ns-ink); border-radius: 999px; color: var(--ns-ink); text-decoration: none; font-size: 12px; font-weight: 700; }
.ns-reader-body { flex: 1; min-height: 0; background: #e9e1d3; }
.ns-reader-body iframe { width: 100%; height: 100%; border: 0; display: block; }

@media (max-width: 760px) {
  .ns-papers { flex-wrap: wrap; row-gap: 26px; }
  .ns-paper { flex-basis: 42%; }
  .ns-sub span:last-child { display: none; }
  .ns-reader-card header { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .newsstand, .ns-paper, .ns-sheet, .ns-tag { transition: none; animation: none; } }
