/* ==========================================================================
   Character and item detail pages — Puffling, Seeker, Trait, Item, Card,
   Furniture, Gallery piece. the noticeboard redesign,
   images/puffling-page-*.

   .char-top     art sheet + info sheet: two columns from 1000px, one below
   .char-notes   the pinned notes under them (Traits, Bonded Seeker, Featured Art,
                 Ownership history …): auto-fit columns, one column on phones
   .char-wide    a full-width sheet between the two (mod notes, vouchers)
   ========================================================================== */

.char-top{ display:grid; grid-template-columns:minmax(0, 1fr); gap:30px 26px; align-items:start; }
@media (min-width:1000px){
  .char-top{ grid-template-columns:minmax(0, 5fr) minmax(0, 6fr); }
  .char-top.art-narrow{ grid-template-columns:minmax(0, 4fr) minmax(0, 7fr); }
}
.char-top > .sheet{ margin-top:0; }   /* board.css spaces stacked sheets; the grid gap does it here */
.char-wide{ margin-top:34px; }

/* Art sheet: the framed art on a tinted mat, then the toggle / hint row. */
.char-art{ padding:22px; }
.char-art .detail-art{ max-width:none; flex:none; }
.char-art .detail-art--framed{ border:2px solid var(--line); border-radius:12px; }
.char-art .detail-art > img, .char-art .detail-art > .zoom-trigger img,
.char-art .detail-art > .detail-art-placeholder{ border-radius:12px; }
.char-art .art-toggle{ display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 12px;
  margin-top:12px; text-align:left; }
.char-art .art-toggle .button{ min-height:44px; }
.art-hint{ font-size:12.5px; font-weight:700; color:var(--ink-soft); }

/* Info sheet: id, name, chips, then a key/value list. Left-aligned like the mock. */
.char-info .detail-header{ align-items:flex-start; gap:6px; }
.char-info .detail-header h1{ margin:0; font-size:30px; line-height:1.15; }
.char-info .detail-header-row{ justify-content:flex-start; margin:4px 0 6px; }
.char-info .puffling-id, .char-info .kicker{ font-family:"Fredoka"; font-size:13px; letter-spacing:.08em; color:var(--ink-soft); }
.char-info .detail-meta{ gap:9px 18px; font-size:15px; margin-top:12px; }
.char-info .detail-meta dd{ font-weight:700; min-width:0; overflow-wrap:anywhere; }
.char-info .detail-description{ font-size:15px; line-height:1.65; }
.char-info .description-edit-link{ margin:14px 0 4px; }
.char-info .detail-actions{ display:flex; flex-wrap:wrap; gap:8px; margin:12px 0 0; }
.char-info .detail-actions .button{ min-height:44px; }
.char-info .detail-actions p{ margin:0; align-self:center; }
.char-info .detail-section{ border-top:2px dashed var(--line); margin-top:16px; padding-top:12px; }
.char-info .detail-section h2{ font-size:17px; }
.char-info .favorite-btn{ min-height:44px; }
.char-info h1 .button{ display:inline-flex; align-items:center; min-height:44px; vertical-align:middle; }
.char-info .description-edit-link a{ display:inline-flex; align-items:center; min-height:44px; }

/* The notes row. */
.char-notes{ display:grid; grid-template-columns:repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap:34px 26px; align-items:start;
  margin-top:40px; }
.char-notes > .notice{ min-width:0; }
.char-notes .notice h2{ font-size:19px; margin:0 0 10px; }
.note-more{ margin:8px 0 0 !important; }

/* Traits (and any short list of links) inside a note. */
.mini-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.mini-list a{ display:flex; flex-direction:column; gap:3px; min-height:44px; justify-content:center; 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.3; }
.mini-list small{ font-size:11.5px; font-weight:700; color:var(--ink-soft); }
.mini-list .rarity-chip{ font-size:10.5px; vertical-align:2px; }

/* Bonded Seeker, shown LARGE (owner request): one column of tall art cards. */
.big-cards{ display:grid; grid-template-columns:repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap:14px; }
.big-card{ display:flex; flex-direction:column; text-decoration:none; color:var(--ink); background:var(--parch-2);
  border:2px solid var(--line); border-radius:12px; overflow:hidden; transition:border-color .14s ease; }
.big-card:hover{ border-color:var(--rose-deep); color:var(--ink); }
.big-card .pic{ height:220px; display:flex; align-items:center; justify-content:center; border-bottom:2px solid var(--line); }
.big-card .pic img{ width:100%; height:100%; object-fit:contain; }
.big-card .pic .thumb-placeholder{ font-size:48px; }
.big-card .pic .ph-img{ width:60%; height:auto; }
.big-card .cap{ display:block; padding:8px 12px 10px; background:var(--card); }
.big-card .cap b{ display:block; font-family:"Fredoka"; font-weight:600; font-size:16px; line-height:1.2; }
.big-card .cap small{ font-size:12px; font-weight:700; color:var(--ink-soft); }
.big-card:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:3px; box-shadow:none; }

/* Puffling page: column 1 = art + traits, column 2 = the info sheet stretched to match.
   Below 1000px the column wrapper dissolves: art, info, then traits (the facts a visitor
   came for come before the supporting list). */
.char-top--stack{ align-items:stretch; }
.char-col{ display:flex; flex-direction:column; gap:30px; min-width:0; }
.char-col > .sheet{ margin-top:0; }
.char-col .char-traits{ flex:1 1 auto; }
.char-traits h2{ font-size:19px; margin:0 0 10px; }
.char-top--stack > .char-info{ height:100%; }
@media (max-width:999px){
  .char-top--stack > .char-col{ display:contents; }
  .char-top--stack .char-art{ order:1; }
  .char-top--stack > .char-info{ order:2; height:auto; }
  .char-top--stack .char-traits{ order:3; }
}

/* Seeker page: Bonded Pufflings on one row that scrolls sideways (never wraps). */
.char-bonds{ margin-top:34px; }
.char-bonds h2{ font-size:19px; margin:0 0 10px; }
.bond-row{ display:flex; gap:14px; overflow-x:auto; scroll-snap-type:x proximity; padding:2px 2px 12px;
  overscroll-behavior-x:contain; scrollbar-width:thin; }
.bond-row:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:3px; border-radius:12px; }
.bond-row > .big-card{ flex:0 0 calc((100% - 28px) / 3); scroll-snap-align:start; min-width:0; }
.bond-row--more > .big-card{ flex-basis:calc((100% - 28px) / 3.35); }   /* a sliver of the next one says "scroll" */
/* Cards share the row's height: caption fills the rest, names clamp to two lines, so a long
   name never leaves a blank band or an uneven bottom edge. */
.bond-row > .big-card{ align-self:stretch; }
.bond-row .big-card .cap{ flex:1 1 auto; }
.bond-row .big-card .cap b{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2;
  overflow:hidden; overflow-wrap:anywhere; }
/* "There is more": a thin visible scrollbar and a fade on the right edge (only when the row
   holds more cards than fit). */
.bond-row{ scrollbar-color:var(--ink-soft) transparent; }
.bond-row::-webkit-scrollbar{ height:8px; }
.bond-row::-webkit-scrollbar-track{ background:transparent; }
.bond-row::-webkit-scrollbar-thumb{ background:var(--ink-soft); border-radius:8px; }
.bond-row--more{ -webkit-mask-image:linear-gradient(to right, #000 calc(100% - 44px), transparent);
  mask-image:linear-gradient(to right, #000 calc(100% - 44px), transparent); }
.bond-row .big-card .pic{ height:170px; }
@media (max-width:640px){
  .bond-row > .big-card, .bond-row--more > .big-card{ flex-basis:68%; }
  .bond-row .big-card .pic{ height:160px; }
}

/* Featured Art: three slots, each its own card; missing slots are ghost cards. */
.char-featured{ margin-top:34px; }
.char-featured .art-trio-wrap{ margin-top:0; }
.art-trio{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:18px; }
.art-card{ display:flex; flex-direction:column; min-width:0; text-decoration:none; color:var(--ink); background:var(--parch-2);
  border:2px solid var(--line); border-radius:12px; overflow:hidden; transition:border-color .14s ease; }
a.art-card:hover{ border-color:var(--rose-deep); color:var(--ink); }
a.art-card:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:3px; }
.art-card .pic{ height:200px; display:flex; align-items:center; justify-content:center; border-bottom:2px solid var(--line); }
.art-card .pic img{ width:100%; height:100%; object-fit:contain; }
.art-card .pic .thumb-placeholder{ font-size:36px; }
.art-card .cap{ display:block; padding:8px 12px 10px; background:var(--card); }
.art-card .cap b{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden;
  font-family:"Fredoka"; font-weight:600; font-size:15px; line-height:1.2; overflow-wrap:anywhere; }
.art-card .cap small{ font-size:12px; font-weight:700; color:var(--ink-soft); }
.art-card--empty{ align-items:center; justify-content:center; text-align:center; gap:4px; padding:22px 14px; min-height:200px;
  border-style:dashed; background:var(--parch-2); color:var(--ink); }
.art-card--empty .ghost{ font-size:40px; line-height:1; }
.art-card--empty b{ font-family:"Fredoka"; font-weight:600; font-size:15px; }
.art-card--empty small{ font-size:12.5px; font-weight:700; color:var(--ink-soft); }
.art-card--wide{ grid-column:1 / -1; min-height:150px; }
@media (max-width:640px){
  .art-trio{ display:flex; overflow-x:auto; scroll-snap-type:x proximity; gap:14px; padding-bottom:10px; }
  .art-trio > .art-card{ flex:0 0 72%; scroll-snap-align:start; }
  .art-trio > .art-card--wide{ flex-basis:100%; }
  .art-card .pic{ height:180px; }
}

/* Ownership history: a full-width fold at the very end of the page. */
.ownership-fold{ margin-top:40px; }
.ownership-fold > .owner-log, .ownership-fold > p{ margin-top:0; }

/* Ownership history */
.owner-log{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; font-size:13.5px; }
.owner-log li{ display:flex; flex-wrap:wrap; justify-content:space-between; gap:2px 10px; padding:8px 0; border-bottom:2px dashed var(--line); }
.owner-log li:last-child{ border-bottom:none; }
.owner-log .when{ color:var(--ink-soft); font-weight:700; }
.owner-log .log-note{ flex-basis:100%; }

/* A small grid of related cards inside a note or sheet (e.g. "Pufflings with this trait"). */
.char-grid{ margin-top:4px; }

@media (max-width:640px){
  .char-notes{ grid-template-columns:minmax(0, 1fr); gap:30px; margin-top:34px; }
  .char-info .detail-header h1{ font-size:26px; }
  .big-card .pic{ height:200px; }
}
@media (max-width:480px){
  .char-art{ padding:16px 12px 14px; }
  .char-info .detail-meta{ font-size:14px; gap:8px 12px; }
  /* Notes don't tilt on phones: they're full-width and hold lists. */
  .char-notes > .notice{ transform:none; }
}
div.big-card:hover{ border-color:var(--line); }

/* Non-framed detail art (traits, items, cards, furniture): the picture on a tinted mat. */
.detail-art--mat{ border:2px solid var(--line); border-radius:12px; padding:6%; }
.detail-art--mat img, .detail-art--mat .detail-art-placeholder, .detail-art--mat .zoom-trigger{ border:none; background:transparent; }
.detail-art--mat .detail-art-placeholder{ color:var(--ink); }

/* Related cards under a detail page ("Pufflings with this trait", a card's characters …). */
.char-related{ margin-top:40px; }

/* Gallery piece: the art is the point, so its sheet takes the wider column. */
@media (min-width:1000px){ .char-top.art-wide{ grid-template-columns:minmax(0, 7fr) minmax(0, 5fr); } }
.gallery-detail .detail-art--mat{ padding:3%; }
/* Link-only piece: no art sheet, so the details sheet is the whole row (the grid is already
   one column; this just keeps the 7fr/5fr art-wide split from leaving it a lonely 5/12). */
@media (min-width:1000px){ .char-top.gallery-detail--solo{ grid-template-columns:minmax(0, 1fr); } }
.gallery-detail .gallery-external-link{ margin:20px 0 4px; }
.gallery-detail .detail-actions{ display:flex; flex-wrap:wrap; gap:10px; }
.char-info .sprite-showcase > summary{ min-height:44px; display:flex; align-items:center; gap:6px; }
/* One column (below 1000px): keep the art a comfortable size rather than full-bleed. */
@media (max-width:999px){
  .char-art .detail-art{ max-width:460px; margin-left:auto; margin-right:auto; }
  .char-art .art-toggle{ max-width:460px; margin-left:auto; margin-right:auto; }
}

/* "Gift art: open / closed" — a status line, not a chip: no pill outline (a pill with a
   cross read as a removable filter). Open keeps the green, closed is plain muted text. */
.char-info .gift-badge{ border:none; border-radius:0; padding:0 4px; font-size:13.5px; }
.char-info .gift-badge.is-open{ border:none; }

/* Mod tools: every staff edit route in one fold at the end of the actions. */
.mod-tools{ flex-basis:100%; border-top:2px dashed var(--line); margin-top:6px; padding-top:4px; }
.mod-tools > summary{ display:inline-flex; align-items:center; gap:6px; min-height:44px; cursor:pointer; list-style:none;
  font-family:"Fredoka"; font-weight:600; font-size:14.5px; color:var(--ink-soft); }
.mod-tools > summary::-webkit-details-marker{ display:none; }
.mod-tools > summary::before{ content:"🛠"; }
.mod-tools > summary::after{ content:"▾"; font-size:12px; }
.mod-tools[open] > summary::after{ content:"▴"; }
.mod-tools > summary:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:2px; border-radius:8px; }
.mod-tools-body{ display:flex; flex-wrap:wrap; gap:8px; padding:4px 0 2px; }
.mod-tools-body .button{ min-height:44px; display:inline-flex; align-items:center; }

/* Featured Art is a pinned sheet like the others (tacks + heading on paper). */
.char-featured .notice-head{ margin-bottom:14px; }
.char-featured .notice-head h2{ font-size:19px; }

/* Info sheet stretched to the art column's height (Puffling page): the content stays at the
   top and the action buttons sink to the bottom instead of leaving a blank band under them. */
.char-top--stack > .char-info{ display:flex; flex-direction:column; }
.char-top--stack > .char-info > .detail-actions{ margin-top:auto; padding-top:12px; }
@media (max-width:999px){ .char-top--stack > .char-info > .detail-actions{ margin-top:12px; padding-top:0; } }

/* Link-only gallery piece: site.css caps .detail-body at 760px; the solo sheet is the page. */
.gallery-detail--solo .detail-body{ max-width:none; }
/* View external / Edit / Edit (mod) share one wrapping row. */
.gallery-detail .gallery-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin:20px 0 4px; }
.gallery-detail .gallery-actions .button{ display:inline-flex; align-items:center; min-height:44px; }

/* Creator / author links in the details list: a roomy hit area on touch screens. */
@media (max-width:640px){
  .char-info .detail-meta dd a{ display:inline-block; padding:12px 4px; margin:-12px -4px; }
}
