/* whatsnew.css — public "What's New" feed + the admin visual editor.
   Extends /assets/style.css + /assets/account.css (same tokens). */

/* ───────────────────────── public feed ───────────────────────── */

.wn-wrap {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(28px, 4vw, 52px) 0 clamp(56px, 7vw, 88px);
}

.wn-head {
  margin-bottom: 8px;
}

.wn-head .eyebrow {
  margin-bottom: 10px;
}

.wn-head h1 {
  max-width: none;
  margin: 0;
  font-size: clamp(2.1rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.08;
  text-align: left;
}

.wn-head p {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.6;
}

.wn-feed {
  display: grid;
  gap: 22px;
  margin-top: 34px;
}

.wn-post {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow-tight);
}

.wn-post.pinned {
  border-color: rgba(75, 53, 255, 0.32);
  background: linear-gradient(180deg, #ffffff, #f8f7ff);
}

.wn-post-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

/* Bold, clean post title. */
.wn-title {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: balance;
}

.wn-title a { color: inherit; }
.wn-title a:hover { color: var(--violet); }

.wn-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* Auto post date. */
.wn-date {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.wn-pin-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  background: #f1efff;
  color: var(--violet);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.wn-cover {
  display: block;
  width: 100%;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* Rendered post body (server-sanitized HTML). */
.wn-body {
  margin-top: 16px;
  color: var(--ink-soft, #3a414f);
  font-size: 1.02rem;
  line-height: 1.72;
}

.wn-body > *:first-child { margin-top: 0; }
.wn-body p { margin: 14px 0 0; }
.wn-body h2 { margin: 28px 0 0; font-size: 1.5rem; font-weight: 900; line-height: 1.25; color: var(--ink); }
.wn-body h3 { margin: 22px 0 0; font-size: 1.2rem; font-weight: 850; line-height: 1.3; color: var(--ink); }
.wn-body h4 { margin: 18px 0 0; font-size: 1.02rem; font-weight: 850; color: var(--ink); }
.wn-body ul, .wn-body ol { margin: 14px 0 0; padding-left: 24px; display: grid; gap: 7px; }
.wn-body ul { list-style: disc; }
.wn-body ol { list-style: decimal; }
.wn-body li::marker { color: var(--muted); }
.wn-body a { color: var(--violet); font-weight: 700; }
.wn-body a:hover { text-decoration: underline; }
.wn-body strong, .wn-body b { color: var(--ink); font-weight: 800; }
.wn-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0 0; }
.wn-body figure { margin: 18px 0 0; }
.wn-body figcaption { margin-top: 8px; color: var(--muted); font-size: 0.86rem; text-align: center; }
.wn-body blockquote {
  margin: 16px 0 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--violet);
  color: var(--muted);
  font-style: italic;
}
.wn-body hr { margin: 24px 0 0; border: 0; border-top: 1px solid var(--line); }
.wn-body code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-soft);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 0.86em;
}
.wn-body pre {
  margin: 16px 0 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-soft);
}
.wn-body pre code { padding: 0; border: 0; background: none; }
.wn-body mark { background: #fff3bf; padding: 0 3px; border-radius: 3px; }

.wn-empty,
.wn-loading {
  margin-top: 34px;
  padding: 44px 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.96rem;
  text-align: center;
}

/* ───────────────────────── admin editor ───────────────────────── */

.wn-admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* posts list (manage view) */
.wn-list { display: grid; gap: 8px; margin-top: 16px; }

.wn-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(247, 248, 251, 0.6);
}

.wn-item .wn-item-body { flex: 1 1 auto; min-width: 0; }
.wn-item .wn-item-title { font-size: 0.96rem; font-weight: 850; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wn-item .wn-item-sub { margin-top: 3px; color: var(--muted); font-size: 0.82rem; }
.wn-item .wn-item-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; }

.wn-order-btns { display: inline-flex; flex-direction: column; gap: 2px; }
.wn-order-btns button {
  width: 26px; height: 20px; padding: 0;
  border: 1px solid var(--line); border-radius: 6px;
  background: #fff; color: var(--muted); cursor: pointer; font-size: 0.7rem; line-height: 1;
}
.wn-order-btns button:hover { color: var(--ink); border-color: var(--line-strong); }
.wn-order-btns button[disabled] { opacity: 0.4; pointer-events: none; }

/* editor view */
.wn-editor { margin-top: 18px; }

.wn-title-input {
  width: 100%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  font-family: inherit;
  font-size: 1.5rem;
  font-weight: 900;
  line-height: 1.2;
}
.wn-title-input::placeholder { color: var(--muted); font-weight: 800; }
.wn-title-input:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-color: var(--violet); }

.wn-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--paper-soft);
  position: sticky;
  top: 60px;
  z-index: 5;
}

.wn-tb-group { display: inline-flex; gap: 4px; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--line); }
.wn-tb-group:last-child { border-right: 0; }

.wn-toolbar button {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease;
}
.wn-toolbar button:hover { background: #fff; border-color: var(--line); }
.wn-toolbar button:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; }
.wn-toolbar button.active { background: #f1efff; color: var(--violet); border-color: rgba(75,53,255,0.3); }
.wn-toolbar button b { font-weight: 900; }
.wn-toolbar button i { font-style: italic; }
.wn-toolbar button u { text-decoration: underline; }

.wn-canvas {
  min-height: 340px;
  max-height: 60vh;
  overflow-y: auto;
  padding: 18px 18px;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: #fff;
  color: var(--ink-soft, #3a414f);
  font-size: 1.02rem;
  line-height: 1.7;
}
.wn-canvas:focus-visible { outline: 2px solid var(--violet); outline-offset: -1px; }
.wn-canvas:empty::before { content: attr(data-placeholder); color: var(--muted); }
/* live formatting inside the editor mirrors the published look */
.wn-canvas h2 { font-size: 1.5rem; font-weight: 900; margin: 20px 0 8px; color: var(--ink); }
.wn-canvas h3 { font-size: 1.2rem; font-weight: 850; margin: 16px 0 6px; color: var(--ink); }
.wn-canvas ul, .wn-canvas ol { padding-left: 24px; margin: 10px 0; }
.wn-canvas ul { list-style: disc; }
.wn-canvas ol { list-style: decimal; }
.wn-canvas blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid var(--violet); color: var(--muted); font-style: italic; }
.wn-canvas img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 10px 0; }
.wn-canvas a { color: var(--violet); font-weight: 700; }
.wn-canvas pre { background: var(--paper-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; overflow-x: auto; }
.wn-canvas code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; }

.wn-editor-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.wn-editor-opts { display: inline-flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.wn-editor-opts label { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; font-weight: 700; }
.wn-editor-actions { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.wn-save-state { color: var(--muted); font-size: 0.84rem; }

/* emoji quick palette */
.wn-emoji-pop {
  position: absolute;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  max-width: 280px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}
.wn-emoji-pop button {
  width: 30px; height: 30px; padding: 0;
  border: 0; border-radius: 6px; background: transparent;
  font-size: 1.1rem; cursor: pointer;
}
.wn-emoji-pop button:hover { background: var(--paper-soft); }

/* 2FA step-up code modal (reused for every mutating action) */
.wn-code-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.wn-code-modal[hidden] { display: none; }
.wn-code-backdrop { position: absolute; inset: 0; background: rgba(15,17,23,0.45); backdrop-filter: blur(4px); }
.wn-code-card {
  position: relative;
  z-index: 1;
  width: min(380px, 100%);
  padding: 26px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}
.wn-code-card h3 { font-size: 1.2rem; font-weight: 900; }
.wn-code-card p { margin-top: 8px; color: var(--muted); font-size: 0.9rem; line-height: 1.5; }
.wn-code-card input {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  text-align: center;
}
.wn-code-card input:focus-visible { outline: 2px solid var(--violet); outline-offset: 1px; border-color: var(--violet); }
.wn-code-actions { display: flex; gap: 8px; margin-top: 16px; }
.wn-code-actions .button { flex: 1; }
.wn-code-error { margin-top: 10px; color: #c22944; font-size: 0.85rem; font-weight: 700; min-height: 1em; }

@media (max-width: 560px) {
  .wn-toolbar { top: 0; }
}
