/* ==========================================================================
   Home page (templates/home.html) — owner redesign, 2026-10-31
   (mockup: home-mockup-2026-10-31.png). Shared pieces (.notice, .sheet, .tack,
   .tag-pill, .cd-pill, .live-badge, .goal, .event-art, tints) live in board.css.

   Top to bottom:
     welcome strip   signed-in only; quick links 4 across, 2×2 on phones
     carousel        admin-managed HomeSlides; 5:2, 16:10 on phones
     three cards     event / sale / news; 3 across ≥ 900px, else one column
                     (cover beside the text 641–899px, stacked on phones)
     two cards       new Pufflings + latest art; 2 across ≥ 900px; each holds a
                     3-across mini grid at every width
   ========================================================================== */

/* ---------- Welcome strip ---------- */
.welcome-strip{ display:flex; align-items:center; gap:20px; margin-bottom:36px; padding:20px 22px 18px; }
.welcome-strip .avatar{ width:84px; height:84px; margin:0; flex:0 0 auto; border-width:3px; }
.welcome-strip .avatar-placeholder{ width:100%; height:100%; }
.welcome-strip .ph-img{ width:100%; height:100%; }
.ws-body{ flex:1; min-width:0; }
.welcome-strip h2.greeting{ font-size:21px; line-height:1.25; margin:0 0 10px; min-width:0; max-width:100%; overflow-wrap:anywhere; word-break:break-word; }
.welcome-strip h2.greeting b{ overflow-wrap:anywhere; word-break:break-all; }
.ws-links{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:10px 12px; }
.ws-links.three{ grid-template-columns:repeat(3, minmax(0,1fr)); }
.ws-btn{ display:flex; align-items:center; justify-content:center; gap:8px; min-height:44px; padding:6px 10px;
  border-radius:12px; background:var(--parch-2); border:2px solid var(--line); box-shadow:0 2px 0 var(--line);
  color:var(--ink); font-family:"Fredoka"; font-weight:500; font-size:15px; line-height:1.15; text-align:center;
  text-decoration:none; white-space:nowrap; min-width:0; }
.ws-btn:hover{ border-color:var(--rose-deep); color:var(--ink); }
.ws-btn:active{ transform:translateY(2px); box-shadow:none; }

/* ---------- Carousel ---------- */
.home-carousel{ padding:12px; margin-bottom:40px; }
.hc-viewport{ position:relative; aspect-ratio:5 / 2; border-radius:10px; overflow:hidden; background:var(--tint-lilac);
  touch-action:pan-y; -webkit-user-select:none; user-select:none; }
.hc-slide{ position:absolute; inset:0; opacity:0; visibility:hidden; transition:opacity .5s ease, visibility 0s linear .5s; }
.hc-slide.is-active{ opacity:1; visibility:visible; transition:opacity .5s ease; }
.hc-link{ display:block; position:relative; width:100%; height:100%; text-decoration:none; }
.hc-link img{ display:block; width:100%; height:100%; object-fit:cover; -webkit-user-drag:none; }
a.hc-link:focus-visible{ outline:4px solid var(--rose-deep); outline-offset:-4px; }
/* Text over a picture: fixed white on a dark scrim plus a shadow, the same in both themes
   (like the polaroid, a photo is not themed paper). */
.hc-caption{ position:absolute; inset:0; overflow:hidden; display:flex; flex-direction:column; justify-content:center; gap:6px;
  padding:0 40% 0 calc(6% + 34px); pointer-events:none;
  background:linear-gradient(90deg, rgba(24,16,44,.62) 0%, rgba(24,16,44,.38) 42%, rgba(24,16,44,0) 72%); }
.hc-title{ font-family:"Fredoka"; font-weight:700; font-size:clamp(24px, 4.4vw, 54px); line-height:1.05; color:#fff;
  text-shadow:0 2px 0 rgba(30,20,50,.55), 0 4px 16px rgba(20,12,40,.55); overflow-wrap:break-word; word-break:break-word;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; line-clamp:3; overflow:hidden; }
.hc-sub{ font-family:"Fredoka"; font-weight:600; font-size:clamp(14px, 1.8vw, 22px); line-height:1.25; color:#fff;
  text-shadow:0 1px 0 rgba(30,20,50,.6), 0 2px 10px rgba(20,12,40,.6); overflow-wrap:break-word;
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; }

.hc-arrow{ position:absolute; z-index:2; top:50%; margin-top:-22px; width:44px; height:44px; border-radius:50%;
  display:flex; align-items:center; justify-content:center; padding:0 0 3px; cursor:pointer;
  background:var(--card); color:var(--ink); border:2.5px solid var(--line); box-shadow:0 3px 0 rgba(0,0,0,.22);
  font-family:"Fredoka"; font-weight:700; font-size:28px; line-height:1; }
.hc-arrow:hover{ border-color:var(--rose-deep); color:var(--rose-ink); }
.hc-arrow:focus-visible{ outline:3px solid var(--rose-deep); outline-offset:2px; }
.hc-arrow.prev{ left:22px; }
.hc-arrow.next{ right:22px; }

/* Dots and the pause button share one small pill so the glyph never floats on its own. */
.hc-dots{ position:absolute; z-index:2; left:50%; bottom:18px; transform:translateX(-50%); display:flex; align-items:center;
  padding:0 6px; border-radius:999px; background:rgba(24,16,44,.55); }
/* Each dot is a 44px target with a small painted dot inside. */
.hc-dot{ width:32px; height:44px; padding:0; border:0; background:none; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.hc-dot::before{ content:""; display:block; width:10px; height:10px; border-radius:999px; background:rgba(255,255,255,.75);
  border:2px solid rgba(40,28,60,.55); transition:width .2s ease; }
.hc-dot[aria-current="true"]::before{ width:24px; background:var(--card); border-color:var(--ink); }
.hc-dot:focus-visible{ outline:3px solid var(--rose-deep); outline-offset:-6px; border-radius:10px; }
.hc-dot.hc-play{ width:44px; color:#fff; font-size:11px; letter-spacing:-1px; text-shadow:0 1px 3px rgba(0,0,0,.8); }
.hc-dot.hc-play::before{ content:none; }
@media (prefers-reduced-motion: reduce){
  .hc-slide, .hc-slide.is-active, .hc-dot::before{ transition:none; }
}

/* ---------- Event / sale / news ---------- */
.home-cards{ display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:34px 24px; align-items:stretch; margin-bottom:44px; }
.home-card{ display:flex; flex-direction:column; padding:0; min-width:0; }
.home-card .hc-cover-link{ display:block; text-decoration:none; }
.home-card .card-cover{ position:relative; display:flex; align-items:center; justify-content:center; height:170px; overflow:hidden;
  border-radius:11px 11px 0 0; border-bottom:2.5px solid var(--line); }
.home-card .card-cover > img, .home-card .card-cover .thumb-placeholder > img{ width:100%; height:100%; object-fit:contain; }
.home-card .card-cover.photo > img{ object-fit:cover; }
.home-card .card-cover .thumb-placeholder{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size:40px; }
.home-card .card-cover.empty{ font-size:52px; }
.home-card .card-cover.event-art .big-moon{ top:22px; right:30px; width:72px; height:72px; }
.home-card .card-body{ flex:1; display:flex; flex-direction:column; gap:8px; padding:14px 18px 14px; min-width:0; }
.home-card .pill-row{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.home-card h2{ font-size:19px; line-height:1.2; margin:0; overflow-wrap:break-word; -webkit-hyphens:auto; hyphens:auto; }
.home-card .card-title{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; line-clamp:2; overflow:hidden; }
.home-card .card-title{ color:inherit; text-decoration:none; max-width:100%; padding:10px 0; margin:-10px 0; } /* 44px target */
.home-card .card-title:hover{ color:var(--rose-ink); text-decoration:underline; }
.home-card .card-meta{ margin:0; font-size:13px; font-weight:700; line-height:1.45; color:var(--ink-soft); }
.home-card .card-price{ margin:0; font-family:"Fredoka"; font-weight:600; font-size:16.5px; color:var(--ink); overflow-wrap:anywhere; }
.home-card .card-summary{ margin:0; font-size:13.5px; line-height:1.5; color:var(--ink-soft);
  display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; line-clamp:3; overflow:hidden; }
.home-card .card-date{ font-size:12.5px; font-weight:700; color:var(--ink-soft); }
.home-card .goal{ margin-top:2px; }
.home-card .card-foot{ margin-top:auto; padding-top:6px; display:flex; align-items:center; justify-content:space-between; gap:6px 10px; flex-wrap:wrap; }
.home-card .card-foot .button{ min-height:44px; display:inline-flex; align-items:center; }
.home-card .card-foot .note-link{ margin-left:auto; }

/* "Bid on D X DA TH": the platforms in their own colours, white letters (tested AA). */
.home-card .bid-on{ display:flex; align-items:center; flex-wrap:wrap; gap:4px; }
.bid-mark{ display:inline-flex; align-items:center; justify-content:center; min-width:24px; height:22px; padding:0 4px;
  border-radius:6px; font-size:11px; font-weight:800; line-height:1; color:#fff; }
.bid-d{ background:#4752c4; }
.bid-x{ background:#1b1b1b; }
.bid-da{ background:#0a7a3e; }
.bid-th{ background:#2b5f97; }
:root[data-theme="dark"] .bid-x{ box-shadow:0 0 0 1.5px #fff6; }

/* ---------- New Pufflings + latest art ---------- */
.home-pair{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:34px 24px; align-items:stretch; }
.home-grid-card{ min-width:0; }
.home-grid-card .notice-head{ align-items:center; margin-bottom:8px; }
.home-grid-card .notice-head h2{ font-size:20px; line-height:1.2; }
.trio{ list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:10px; }
.trio a{ display:flex; flex-direction:column; height:100%; text-decoration:none; color:var(--ink); background:var(--card);
  border:2px solid var(--line); border-radius:12px; overflow:hidden; transition:transform .14s ease, border-color .14s ease; }
.trio a:hover{ border-color:var(--rose-deep); color:var(--ink); transform:translateY(-2px); }
.trio .pic{ display:flex; align-items:center; justify-content:center; aspect-ratio:4 / 3; border-bottom:2px solid var(--line); overflow:hidden; }
.trio .pic img{ width:100%; height:100%; object-fit:contain; }
.trio .pic .thumb-placeholder{ width:100%; height:100%; display:flex; align-items:center; justify-content:center; font-size:30px; }
.trio .pic .ph-img{ width:70%; height:70%; object-fit:contain; }
.trio .cap{ display:block; padding:6px 9px 8px; min-width:0; }
.trio .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:14.5px; line-height:1.2;
  overflow-wrap:break-word; -webkit-hyphens:auto; hyphens:auto; }
.trio .cap small{ display:block; font-size:11.5px; font-weight:700; color:var(--ink-soft); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.empty-line{ margin:0; font-size:14px; color:var(--ink-soft); }
@media (prefers-reduced-motion: reduce){ .trio a, .trio a:hover{ transition:none; transform:none; } }

/* ---------- Narrower screens ---------- */
@media (max-width:859px){
  .ws-links, .ws-links.three{ grid-template-columns:repeat(2, minmax(0,1fr)); }
}
@media (max-width:899px){
  .home-cards{ grid-template-columns:minmax(0,1fr); }
  .home-pair{ grid-template-columns:minmax(0,1fr); }
}
/* Tablets: each of the three cards lies on its side, cover left, text right. */
@media (min-width:641px) and (max-width:899px){
  .home-card{ flex-direction:row; }
  .home-card .hc-cover-link, .home-card > .card-cover{ flex:0 0 38%; display:flex; }
  .home-card .card-cover{ width:100%; height:auto; min-height:200px; border-radius:11px 0 0 11px; border-bottom:0; border-right:2.5px solid var(--line); }
  .home-card > .card-cover{ width:auto; }
}
@media (max-width:640px){
  /* The greeting sits beside the avatar; the links take a full-width 2×2 row under both. */
  .welcome-strip{ flex-wrap:wrap; gap:12px 14px; padding:20px 14px 14px; }
  .welcome-strip .avatar{ width:56px; height:56px; }
  .ws-body{ display:contents; }
  .welcome-strip h2.greeting{ flex:1 1 0; font-size:18px; margin:0; }
  .ws-links, .ws-links.three{ flex:1 1 100%; grid-template-columns:repeat(2, minmax(0,1fr)); }
  .ws-btn{ font-size:14px; padding:6px 6px; gap:6px; }
  .home-carousel{ padding:8px; }
  .hc-viewport{ aspect-ratio:16 / 10; }
  /* Arrows are 44px circles at 6px in, so text keeps 56px clear on both sides; the
     bottom padding clears the 44px dots pill. */
  .hc-caption{ padding:0 58px 44px 58px; gap:3px; justify-content:center; }
  .hc-title{ font-size:clamp(16px, 5vw, 19px); line-height:1.1; -webkit-line-clamp:2; line-clamp:2; }
  .hc-sub{ font-size:13px; line-height:1.2; -webkit-line-clamp:1; line-clamp:1; }
  .hc-arrow{ margin-top:-22px; font-size:26px; }
  .hc-arrow.prev{ left:6px; }
  .hc-arrow.next{ right:6px; }
  .hc-dots{ bottom:10px; }
  .home-card .card-cover{ height:150px; }
  .trio{ gap:8px; }
  .trio .cap{ padding:5px 5px 7px; }
  .trio .cap b{ font-size:12.5px; }
}
@media (max-width:420px){
  .hc-sub{ display:none; }
}
@media (max-width:359px){
  .home-carousel{ padding:4px; }
  .welcome-strip{ padding:20px 10px 12px; }
  .ws-btn{ font-size:13px; padding:6px 4px; gap:4px; }
}
@media (max-width:420px){
  .trio .cap{ padding:5px 4px 6px; }
  .trio .cap b{ font-size:12px; }
  .trio .cap small{ font-size:11px; }
  .home-grid-card .notice-head{ flex-wrap:nowrap; }
  .home-grid-card .notice-head h2{ font-size:18px; }
  .home-grid-card .note-link{ white-space:nowrap; }
}
