/* ==========================================================================
   News board + post (pages/news_board.html, _news_grid.html, news_detail.html) and the
   Adoption board + sale (sales/*). Brief §7, images news-board-*, news-post-*,
   sales-board-*, sale-page-*. Ported from the mock CSS (reference/mocks/pufflings.css)
   with tokens only: every text colour here is a pair tests_contrast.py already holds
   (--ink / --ink-soft / --rose-ink on --card / --parch-2). The social marks and the
   status dot are graphics beside a text label, never the only signal.
   ========================================================================== */

/* ---------- Shared bits ---------- */
.byline{ font-size:13px; font-weight:700; color:var(--ink-soft); min-width:0; overflow-wrap:anywhere; }
.btn-row{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.pager{ display:flex; justify-content:center; margin-top:34px; }
.pager .pagination{ margin-top:0; background:var(--card); border:2.5px solid var(--line); border-radius:999px; padding:4px 14px; }
.post-head{ display:flex; align-items:center; gap:8px 10px; flex-wrap:wrap; }
.post-head .post-edit{ margin-left:auto; }
.result-count{ margin-top:24px; }
/* The count under an HTMX-swapped grid is not a direct child of the board, so it takes
   board.css's board-text label here (cream on the dark-wood label; the felt in dark mode). */
#sale-results > .result-count{ width:fit-content; max-width:100%; padding:2px 12px; border-radius:10px; font-weight:700;
  color:#fff3dc; text-shadow:0 1px 0 rgba(0,0,0,.35); background:rgba(60,40,22,.6); }
:root[data-theme="dark"] #sale-results > .result-count{ background:none; padding-left:0; padding-right:0; }

/* The detail pages' big sheet (the mock's .article): flat, long text. */
.news-sheet h1, .sale-sheet h1{ font-size:32px; line-height:1.15; margin:10px 0 6px; overflow-wrap:anywhere; }
.news-sheet .body{ font-size:16px; line-height:1.7; overflow-wrap:anywhere; }
.news-sheet .body img{ max-width:100%; height:auto; }
.hero-img{ height:260px; border-radius:12px; border:2.5px solid var(--line); margin:18px 0 20px; overflow:hidden; position:relative;
  background:var(--tint-lilac); display:flex; align-items:center; justify-content:center; }
.hero-img img{ width:100%; height:100%; object-fit:cover; }
.hero-img.art img{ object-fit:contain; }
.hero-img .thumb-placeholder{ font-size:48px; }
.prev-next{ display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; margin-top:18px; padding-top:6px; border-top:2px dashed var(--line); }

/* Side notes on a detail page: .notice with these lists inside. */
.detail-side .notice h2{ font-size:17px; margin:0 0 10px; }
.mini-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.mini-list a{ display:flex; flex-direction:column; align-items:flex-start; gap:3px; min-height:44px; text-decoration:none; color:var(--ink);
  background:var(--parch-2); border:2px solid transparent; border-radius:10px; padding:8px 10px; }
.mini-list a:hover{ border-color:var(--line); color:var(--ink); }
.mini-list b{ font-family:"Fredoka"; font-weight:600; font-size:14.5px; line-height:1.2; overflow-wrap:anywhere; }
.mini-list small{ font-size:11.5px; font-weight:700; color:var(--ink-soft); }
.kv{ display:grid; grid-template-columns:auto minmax(0,1fr); gap:6px 14px; font-size:14px; margin:0; }
.kv dt{ font-weight:800; color:var(--ink-soft); }
.kv dd{ margin:0; font-weight:700; overflow-wrap:anywhere; }

/* An event or a bid box set into a sheet. */
.bid-box{ background:var(--parch-2); border:2px solid var(--line); border-radius:12px; padding:14px; display:flex; flex-direction:column; gap:10px; margin:0 0 18px; }
.bid-box .big{ font-family:"Fredoka"; font-weight:600; font-size:28px; line-height:1.1; overflow-wrap:anywhere; }
.bid-box p{ margin:0; }
.bid-box .bid-top{ display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap; }

/* ---------- News board ---------- */
/* .calm narrows a grid to 180px image cards; these are text cards, so keep them wide. */
.bulletin-grid.news-grid, .bulletin-grid.sales-grid{ grid-template-columns:repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap:30px 22px; align-items:start; }
.news-grid .bulletin .cover{ background:var(--tint-butter); }
.news-grid .bulletin.pinned .cover{ height:auto; min-height:220px; aspect-ratio:16 / 9; }
.news-grid .bulletin.pinned .cover img{ object-fit:cover; }

/* ---------- Adoption board ---------- */
.sales-grid .pid, .sale-sheet .pid{ display:block; font-size:11.5px; font-weight:800; letter-spacing:.04em; color:var(--ink-soft); }
.stamp-over{ position:absolute; top:42%; left:50%; transform:translate(-50%,-50%) rotate(-12deg); z-index:3; pointer-events:none;
  font-family:"Fredoka"; font-weight:700; font-size:24px; letter-spacing:.08em; text-transform:uppercase;
  color:var(--rose-ink); background:var(--card); border:4px solid var(--rose-ink); border-radius:12px; padding:2px 16px; }
.price-line{ display:flex; align-items:baseline; justify-content:space-between; gap:8px; flex-wrap:wrap; }
.price-line b{ font-family:"Fredoka"; font-weight:600; font-size:17px; color:var(--ink); overflow-wrap:anywhere; }
.sales-grid .meta{ flex-wrap:wrap; }
.sale-chips{ display:flex; gap:4px; flex-wrap:wrap; }

/* ---------- One sale ---------- */
.thumbs{ display:flex; gap:10px; flex-wrap:wrap; margin-top:-6px; margin-bottom:16px; }
.thumbs button{ width:72px; height:72px; border-radius:10px; border:2.5px solid var(--line); background:var(--tint-lilac); padding:4px; cursor:pointer; }
.thumbs button[aria-pressed="true"]{ border-color:var(--rose-deep); }
.thumbs img{ width:100%; height:100%; object-fit:contain; }
.sale-rules > summary{ cursor:pointer; font-family:"Fredoka"; font-weight:600; font-size:19px; min-height:44px; display:flex; align-items:center; gap:8px; list-style:none; }
.sale-rules > summary::-webkit-details-marker{ display:none; }
.sale-rules > summary::before{ content:"▸"; font-size:14px; color:var(--ink-soft); }
.sale-rules[open] > summary::before{ content:"▾"; }
.social-row{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
.social-btn{ display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; border-radius:12px; border:2.5px solid var(--line);
  background:var(--card); color:var(--ink); font-family:"Fredoka"; font-weight:600; font-size:15px; text-decoration:none; padding:4px 8px; }
.social-btn:hover{ border-color:var(--rose-deep); color:var(--ink); }
.social-btn .mark{ width:24px; height:24px; flex:0 0 auto; border-radius:7px; display:flex; align-items:center; justify-content:center;
  font-size:11px; font-weight:800; color:#fff; background:#555; }
.social-btn .mark-discord{ background:#5865f2; }
.social-btn .mark-x{ background:#111; }
.social-btn .mark-deviantart{ background:#05803a; }
.social-btn .mark-toyhouse{ background:#3f7bc0; }

@media (max-width:480px){
  .news-sheet h1, .sale-sheet h1{ font-size:26px; }
  .hero-img{ height:auto; aspect-ratio:1 / 1; }
  .news-grid .bulletin.pinned .cover{ min-height:0; }
  .bid-box .big{ font-size:24px; }
}

/* One sale on a phone: bidding is the only thing to do here, so "You can bid here" comes
   straight after the art, ahead of the rules and the about box. The two columns dissolve
   (display:contents) into one ordered column. */
@media (max-width:640px){
  .sale-cols{ flex-direction:column; flex-wrap:nowrap; align-items:stretch; }
  .sale-cols > :is(.detail-main, .detail-side){ display:contents; }
  .sale-cols .sale-sheet{ order:1; }
  .sale-cols .sale-bid{ order:2; }
  .sale-cols .sale-rules-sheet{ order:3; margin-top:0; }
  .sale-cols .detail-side > :not(.sale-bid){ order:4; }
}
