/* News & Subscription page. Articles and categories come live from the news backend. */
.nw {
  --nw-ink: #4f2846;
  --nw-soft: #8a5f7d;
  --nw-rose: #b0587a;
  --nw-deep: #9e4256;
  --nw-pale: #fbe9ef;
  --nw-line: #efd9e1;
  --nw-paper: #fffaf5;
  color: var(--nw-ink);
}
.nw *, .nw *::before, .nw *::after { box-sizing: border-box; }
.nw [hidden] { display: none !important; }
.nw .nw-intro { margin: 0 0 22px; color: var(--nw-soft); }
.nw .nw-intro span { display: block; }

/* subscribe card */
.nw .nw-subscribe {
  position: relative; margin: 0 0 30px; padding: 22px 24px 18px; border: 1px solid var(--nw-line); border-radius: 12px;
  background: linear-gradient(160deg, #fffaf5 0%, #fdf1f5 100%); box-shadow: 0 14px 30px -24px rgba(110, 40, 70, .55);
}
.nw .nw-subscribe h2 { margin: 0 0 4px; padding: 0; border: 0; font-size: 1.15em; font-weight: normal; color: var(--nw-deep); }
.nw .nw-subscribe h2::before { display: none; }
.nw .nw-subscribe .nw-lead { margin: 0 0 14px; font-size: .92em; color: var(--nw-soft); }
.nw .nw-fields { display: grid; grid-template-columns: 1.3fr 1fr; gap: 10px; align-items: end; }
.nw .nw-submit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; }
.nw .nw-submit .nw-fine { flex: 1 1 260px; margin: 0; }
/* While reading an article: the article first, the subscription offer after it */
.nw.nw-reading { display: flex; flex-direction: column; }
.nw.nw-reading .nw-intro { display: none; }
.nw.nw-reading #nw-read { order: 1; }
.nw.nw-reading .nw-subscribe { order: 2; margin: 30px 0 0; }
.nw label.nw-field { display: block; margin: 0; font-size: .85em; color: var(--nw-soft); }
.nw label.nw-field input {
  display: block; width: 100%; margin-top: 4px; padding: 9px 12px; border: 1px solid #e6c6d2; border-radius: 8px;
  background: #fff; color: var(--nw-ink); font: inherit; font-size: 15px;
}
.nw label.nw-field input:focus { outline: 2px solid #f3cbd8; border-color: var(--nw-rose); }
.nw .nw-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 20px; border: 1px solid var(--nw-rose);
  border-radius: 999px; background: var(--nw-rose); color: #fff; font: inherit; font-size: 15px; cursor: pointer; white-space: nowrap;
  transition: background .2s, transform .2s;
}
.nw .nw-btn:hover { background: var(--nw-deep); transform: translateY(-1px); }
.nw .nw-btn:disabled { opacity: .6; cursor: default; transform: none; }
.nw .nw-btn.ghost { background: transparent; color: var(--nw-rose); }
.nw .nw-choose { margin: 14px 0 4px; font-size: .85em; color: var(--nw-soft); }
.nw .nw-checks { display: flex; flex-wrap: wrap; gap: 6px; }
.nw .nw-check {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--nw-line); border-radius: 999px;
  background: #fff; font-size: .88em; cursor: pointer; user-select: none; transition: background .2s, border-color .2s;
}
.nw .nw-check input { margin: 0; accent-color: var(--nw-rose); }
.nw .nw-check:has(input:checked) { background: var(--nw-pale); border-color: #e3b1c3; }
.nw .nw-fine { margin: 10px 0 0; font-size: .8em; color: #a3899a; line-height: 1.6; }
.nw .nw-message { margin: 10px 0 0; padding: 10px 14px; border-radius: 8px; font-size: .92em; }
.nw .nw-message.ok { background: #eef6f0; color: #3f6f55; }
.nw .nw-message.error { background: #fbe9ec; color: #a23a4b; }
.nw .nw-honey { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* category tabs */
.nw .nw-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 6px; }
.nw .nw-tab {
  padding: 5px 14px; border: 1px solid var(--nw-line); border-radius: 999px; background: #fff; color: var(--nw-soft);
  font: inherit; font-size: .9em; cursor: pointer; transition: all .2s;
}
.nw .nw-tab:hover { border-color: var(--nw-rose); color: var(--nw-rose); }
.nw .nw-tab.on { background: var(--nw-rose); border-color: var(--nw-rose); color: #fff; }
.nw .nw-tab small { opacity: .75; margin-left: 4px; }
.nw .nw-tab-desc { min-height: 1.4em; margin: 0 0 14px; font-size: .85em; color: #a3899a; }

/* article list */
.nw .nw-list { display: grid; gap: 14px; }
.nw .nw-card {
  display: block; padding: 18px 20px; border: 1px solid var(--nw-line); border-radius: 12px; background: #fff;
  color: inherit; text-decoration: none; border-bottom: 1px solid var(--nw-line); transition: border-color .2s, box-shadow .2s, transform .2s;
}
.nw .nw-card:hover { border-color: #e3b1c3; box-shadow: 0 12px 26px -22px rgba(110, 40, 70, .6); transform: translateY(-1px); }
.nw .nw-card .nw-meta { font-size: .8em; color: #a3899a; }
.nw .nw-card h3 { margin: 4px 0 6px; padding: 0; font-size: 1.12em; font-weight: normal; color: var(--nw-deep); }
.nw .nw-card p { margin: 0; font-size: .93em; color: var(--nw-soft); }
.nw .nw-card .nw-more { display: inline-block; margin-top: 8px; font-size: .85em; color: var(--nw-rose); }
.nw .nw-badge { display: inline-block; margin-right: 4px; padding: 0 8px; border-radius: 999px; background: var(--nw-pale); color: var(--nw-deep); font-size: .95em; }
.nw .nw-empty, .nw .nw-loading { padding: 28px 10px; text-align: center; color: #a3899a; }
.nw .nw-pager { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }

/* reading view */
.nw .nw-back { display: inline-block; margin: 0 0 16px; font-size: .9em; }
.nw .nw-article { padding: 26px 30px; border: 1px solid var(--nw-line); border-radius: 12px; background: var(--nw-paper); }
.nw .nw-article > h2 { margin: 6px 0 6px; padding: 0; border: 0; font-size: 1.5em; font-weight: normal; color: var(--nw-deep); }
.nw .nw-article > h2::before { display: none; }
.nw .nw-article .nw-cover { display: block; width: 100%; height: auto; margin: 14px 0; border-radius: 8px; }
.nw .nw-article .nw-body img { max-width: 100%; height: auto; }
.nw .nw-article .nw-body { margin-top: 18px; overflow-wrap: anywhere; }
.nw .nw-article-foot { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 24px; padding-top: 16px; border-top: 1px dashed #e6c6d2; }
/* before the backend is connected */
.nw .nw-soon {
  margin: 6px 0 10px; padding: 34px 28px 28px; text-align: center; border: 1px solid var(--nw-line); border-radius: 14px;
  background: linear-gradient(160deg, #fffaf5 0%, #fdf1f5 100%); box-shadow: 0 14px 30px -24px rgba(110, 40, 70, .55);
}
.nw .nw-soon-mark {
  display: inline-grid; place-items: center; width: 54px; height: 54px; margin-bottom: 12px; border-radius: 16px;
  background: linear-gradient(135deg, #f6c9d6, #e8a0b4); color: #fff; font-size: 26px;
  animation: nw-float 4s ease-in-out infinite;
}
.nw .nw-soon h2 { margin: 0 0 10px; padding: 0; border: 0; font-size: 1.2em; font-weight: normal; color: var(--nw-deep); }
.nw .nw-soon h2::before { display: none; }
.nw .nw-soon p { margin: 0 0 6px; color: var(--nw-soft); }
.nw .nw-soon .nw-soon-zh { font-size: .95em; }
@keyframes nw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@media (prefers-reduced-motion: reduce) { .nw .nw-soon-mark { animation: none; } }
.nw .nw-unavailable { padding: 20px; border-radius: 10px; background: #fff7f9; border: 1px dashed #e6c6d2; color: var(--nw-soft); text-align: center; }

@media (max-width: 640px) {
  .nw .nw-fields { grid-template-columns: 1fr; }
  .nw .nw-subscribe { padding: 18px 16px 14px; }
  .nw .nw-article { padding: 20px 16px; }
}
