/* News (3.27.0, site theme 4.0.0): the latest post is a featured card, older ones form a clean list.
   Each post carries a "posted" block (small label, the relative time pressed into a gold seal, the exact local time),
   a like pill with a bubble burst, Markdown text and an optional poll. Uses site.css tokens only. */
.announcements { scroll-margin-top: 110px; }
.announcements[hidden] { display: none; }

:root {
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --news-ink-soft: var(--line-soft);
}

.news-feed { display: grid; gap: clamp(26px, 3.4vw, 40px); }
.news-feed[aria-busy="true"] { min-height: 120px; }

/* ------------------------------------------------------------------ the posted block */
.news-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 22px; }
.news-who { display: flex; align-items: center; gap: clamp(12px, 2vw, 18px); min-width: 0; max-width: 100%; }
.news-avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--well-2);
  border: 1px solid var(--gold);
  box-shadow: 0 4px 10px rgba(0, 0, 0, .45);
}
.news-posted { display: grid; justify-items: start; gap: 7px; min-width: 0; max-width: 100%; }
.news-label {
  font: 700 12px/1 var(--body);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.news-exact { font: 400 14px/1.3 var(--body); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }

/* the seal: the relative time on forged gold */
.news-slab {
  display: inline-block;
  max-width: 100%;
  padding: .2em .5em .16em;
  color: var(--on-gold);
  font: 800 clamp(18px, 2.6vw, 22px)/1.06 var(--display);
  letter-spacing: .01em;
  font-variant-numeric: lining-nums;
  background: var(--ember);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 207, 138, .55) inset, 0 8px 16px rgba(0, 0, 0, .45);
  overflow-wrap: anywhere;
}

/* ------------------------------------------------------------------ the like pill */
.news-like {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 18px 8px 14px;
  color: var(--text);
  font: 700 15px/1 var(--display);
  background: rgba(255, 138, 61, .05);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background-color .15s ease, transform .15s var(--ease-out), border-color .15s ease;
}
.news-like:hover { background: rgba(255, 138, 61, .11); border-color: var(--gold); }
.news-like:active { transform: translateY(1px); }
.news-like svg { flex: none; width: 22px; height: 22px; transition: transform .25s var(--ease-out); }
.news-like:hover svg { transform: rotate(-9deg) scale(1.08); }
.news-like .n { color: var(--gold); font-variant-numeric: lining-nums tabular-nums; }
.news-like .u { font: 500 14px/1 var(--body); letter-spacing: .02em; color: var(--muted); }
.news-like .max { display: none; font: 500 13px/1 var(--body); letter-spacing: .03em; color: var(--gold-hi); }
.news-like.has-liked { background: var(--panel-hi); border-color: var(--gold); }
.news-like.has-liked svg { fill: var(--gold); stroke: var(--gold); }
.news-like.is-maxed { cursor: default; color: var(--text); background: var(--teal); border-color: rgba(255, 122, 42, .55); }
.news-like.is-maxed:hover { background: var(--teal); }
.news-like.is-maxed:active { transform: none; }
.news-like.is-maxed svg { fill: var(--ember); stroke: var(--ember); }
.news-like.is-maxed .u { color: var(--gold-hi); }
.news-like.is-maxed .max { display: inline; }
.news-like .n.pop { display: inline-block; }
.news-like-wrap { position: relative; display: inline-flex; }
.news-like-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the burst lives in a fixed layer so particles can drift past any edge without adding a scrollbar */
.news-burst { position: fixed; inset: 0; z-index: 90; overflow: hidden; pointer-events: none; }
.news-p { position: absolute; left: 0; top: 0; will-change: transform, opacity; line-height: 1; user-select: none; }
.news-p.is-emoji { text-shadow: 0 2px 2px rgba(0, 0, 0, .35); }
.news-p.is-bubble {
  border-radius: 50%;
  border: 1.5px solid rgba(255, 216, 138, .8);
  background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .7) 0 12%, rgba(255, 138, 61, .22) 13% 60%, rgba(255, 138, 61, .05) 61%);
}
.news-p.is-spark { background: var(--gold); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.news-p.is-plus { color: var(--gold); font: 800 19px/1 var(--display); }

/* ------------------------------------------------------------------ posts */
.news-card { position: relative; min-width: 0; color: var(--text); }
.news-feature {
  padding: clamp(20px, 3.4vw, 34px);
  background: var(--well);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.news-feature .news-avatar { width: 58px; height: 58px; }
.news-feature .news-slab { font-size: clamp(24px, 3.4vw, 36px); }
.news-feature .news-exact { font-size: 15px; }
.news-feature .news-like { min-height: 48px; font-size: 17px; padding-inline: 16px 20px; }
.news-feature .news-like svg { width: 25px; height: 25px; }
.news-feature .news-copy { margin-top: clamp(20px, 2.6vw, 28px); }

.news-subhead { font: 700 18px/1.15 var(--display); color: var(--text); margin: 0 0 4px; }
.news-list { list-style: none; margin: 0; padding: 0; display: grid; }
.news-list > li { padding: 24px 0 26px; }
.news-list > li + li { border-top: 1px solid var(--line-soft); }
.news-list > li:first-child { padding-top: 14px; }
.news-list > li:last-child { padding-bottom: 6px; }
.news-list .news-copy { margin-top: 16px; }
.news-list .news-avatar { width: 40px; height: 40px; }

.news-copy.is-clamped { max-height: 11.5em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 72%, transparent); mask-image: linear-gradient(#000 72%, transparent); }
.news-image-link { display: block; width: fit-content; max-width: 100%; margin: 16px 0 0; }
.news-image { display: block; max-width: 100%; max-height: 420px; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #050404; }
.news-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; margin-top: 16px; }
.news-foot:empty { display: none; }
.news-card a.news-link,
.news-toggle {
  padding: 0;
  border: 0;
  background: none;
  color: var(--gold);
  font: 700 15px/1.4 var(--body);
  text-decoration: underline;
  text-decoration-color: var(--gold-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.news-card a.news-link:hover,
.news-toggle:hover { color: var(--gold-hi); text-decoration-color: var(--gold-hi); }

/* ------------------------------------------------------------------ Markdown text (also used by the admin preview) */
.md { max-width: 68ch; font-size: 17px; line-height: 1.65; overflow-wrap: anywhere; color: var(--text); }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre, .md hr { margin: 0 0 .9em; }
.md h3, .md h4, .md h5, .md h6 { font-family: var(--display); font-weight: 700; line-height: 1.2; color: var(--text); margin: 1.35em 0 .45em; text-wrap: balance; }
.md h3 { font-size: 22px; }
.md h4 { font-size: 19px; }
.md h5, .md h6 { font-size: 17px; }
.md strong { font-weight: 700; color: var(--gold-hi); }
.md del { color: var(--muted); }
.md ul, .md ol { padding-left: 1.5em; }
.md li { margin: .25em 0; padding-left: .2em; }
.md li > ul, .md li > ol { margin: .25em 0 .1em; }
.md li::marker { color: var(--gold); font-weight: 700; }
.md code { padding: .08em .38em; font: 500 .86em var(--mono); color: var(--gold-hi); background: var(--well-2); border: 1px solid var(--line-soft); border-radius: 4px; }
.md pre { padding: 14px 16px; overflow-x: auto; background: var(--well-2); border: 1px solid var(--line-soft); border-radius: 6px; }
.md pre code { padding: 0; font-size: 14px; line-height: 1.55; color: var(--text); background: none; border: 0; white-space: pre; }
.md blockquote { padding: 12px 18px; color: var(--text); background: rgba(255, 138, 61, .04); border: 1px solid var(--line-soft); border-radius: 8px; font-style: italic; }
.md blockquote > :last-child { margin-bottom: 0; }
.md hr { height: 1px; border: 0; background: var(--line); }
.md img { display: block; max-width: 100%; height: auto; margin: .6em 0; border: 1px solid var(--line); border-radius: 6px; background: #050404; }
.md a { font-weight: 700; text-decoration-color: var(--gold-deep); }
.md-plain { margin: 0; max-width: 68ch; font-size: 17px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); }

/* ------------------------------------------------------------------ the poll */
.news-poll { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.news-poll fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.news-poll-q { display: block; width: 100%; margin: 0 0 14px; padding: 0; font: 700 clamp(17px, 2.1vw, 20px)/1.25 var(--display); color: var(--gold-hi); overflow-wrap: anywhere; }
.news-opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 560px; }
.news-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 10px 14px;
  cursor: pointer;
  background: var(--well);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  transition: background-color .15s ease, border-color .15s ease;
  overflow-wrap: anywhere;
}
.news-opt:hover { background: rgba(255, 138, 61, .06); border-color: var(--line); }
.news-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.news-opt .dot { flex: none; width: 20px; height: 20px; background: var(--well-2); border: 1px solid var(--line); border-radius: 50%; transition: background-color .15s ease, border-color .15s ease; }
.news-opt:has(input:checked) { border-color: var(--gold); background: var(--panel-hi); }
.news-opt:has(input:checked) .dot { background: var(--gold); border-color: var(--gold); box-shadow: inset 0 0 0 4px var(--well-2); }
.news-opt:has(input:focus-visible) { outline: 2px solid var(--gold-hi); outline-offset: 3px; }
.news-poll-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 16px; }
.news-poll .btn { min-height: 44px; padding: 12px 20px; font-size: 15px; }
.news-poll-meta { font: 400 14px/1.4 var(--body); color: var(--muted); font-variant-numeric: lining-nums tabular-nums; }
.news-poll-error { margin: 10px 0 0; font-size: 15px; font-weight: 700; color: var(--bad); }
.news-poll-error:empty { display: none; }

.news-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; max-width: 560px; }
.news-result-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 14px; align-items: baseline; }
.news-result-text { font-weight: 700; overflow-wrap: anywhere; }
.news-result-text .mine { margin-left: 8px; padding: 1px 8px 2px; font: 700 11px/1.5 var(--body); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); border: 1px solid var(--line); border-radius: 999px; white-space: nowrap; vertical-align: 1px; }
.news-result-pct { font: 800 16px/1 var(--display); color: var(--text); font-variant-numeric: lining-nums tabular-nums; }
.news-result-pct small { font: 400 13px var(--body); color: var(--muted); margin-left: 6px; }
.news-track { grid-column: 1 / -1; height: 10px; overflow: hidden; background: var(--well-2); border: 1px solid var(--line-soft); border-radius: 999px; }
.news-fill { height: 100%; width: 100%; background: rgba(255, 138, 61, .38); border-radius: 999px; transform-origin: left center; transform: scaleX(0); transition: transform .9s var(--ease-out); }
.news-result-row.is-lead .news-fill { background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }

/* ------------------------------------------------------------------ loading / empty / error */
.news-state { padding: clamp(26px, 5vw, 44px) 12px; text-align: center; color: var(--muted); }
.news-state strong { display: block; margin-bottom: 8px; font: 800 20px/1.2 var(--display); color: var(--text); }
.news-state .btn { margin-top: 18px; min-height: 44px; font-size: 15px; padding: 12px 20px; }
.news-skel { display: grid; gap: 14px; padding: clamp(20px, 3.4vw, 34px); background: var(--well); border: 1px solid var(--line-soft); border-radius: 8px; }
.news-skel i { display: block; height: 14px; border-radius: 6px; background: rgba(255, 138, 61, .07); animation: news-pulse 1.4s ease-in-out infinite; }
.news-skel i:nth-child(1) { width: 18%; height: 11px; }
.news-skel i:nth-child(2) { width: min(260px, 70%); height: 46px; border-radius: 6px; }
.news-skel i:nth-child(3) { width: 92%; }
.news-skel i:nth-child(4) { width: 64%; }
@keyframes news-pulse { 50% { opacity: .45; } }

.ann-more {
  display: block;
  margin: 26px auto 0;
  padding: 13px 24px;
  color: var(--gold-hi);
  background: rgba(255, 138, 61, .05);
  border: 0;
  border-radius: 10px;
  box-shadow: 0 0 0 1px var(--line) inset;
  font: 700 15px/1.2 var(--display);
  letter-spacing: .02em;
  cursor: pointer;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s var(--ease-out);
}
.ann-more:hover { background: rgba(255, 138, 61, .11); box-shadow: 0 0 0 1px var(--gold) inset; }
.ann-more:active { transform: translateY(1px); }
.ann-more[hidden] { display: none; }

.news-card a.news-link:focus-visible,
.news-toggle:focus-visible,
.ann-more:focus-visible,
.news-like:focus-visible,
.news-image-link:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 4px; }

/* the one authored moment: the latest post's seal is pressed down when the feed first appears */
@keyframes news-stamp {
  from { transform: scale(1.2); filter: blur(3px); opacity: .2; }
  to { transform: none; filter: blur(0); opacity: 1; }
}
.news-feed.is-fresh .news-feature .news-slab { animation: news-stamp .55s var(--ease-out) both; }

@media (max-width: 560px) {
  .news-feature { padding: 18px 16px; }
  .news-feature .news-avatar { width: 44px; height: 44px; }
  .news-like .max { display: none !important; }
  .news-like .u { font-size: 13px; }
  .news-list > li { padding: 20px 0 22px; }
  .md { font-size: 16.5px; }
  .md h3 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .news-fill { transition: none; }
  .news-like, .news-like svg { transition: none; }
  .news-like:hover svg { transform: none; }
  .news-feed.is-fresh .news-feature .news-slab { animation: none; }
  .news-skel i { animation: none; }
}

/* the studio default avatar is the wide dragon emblem: show all of it inside the circle */
.news-avatar[src*="dungeon-blitz-logo"] { object-fit: contain; padding: 4px; }
