/* ==========================================================================
   Play pages on the board (the noticeboard redesign;
   mocks SitePlayHub / SiteStory): the events hub and the per-category hubs, the
   stories library, a story's page, and All quests.
   Loaded after board.css (and quests/stories.css where the story pages need it).
   Colours are tokens only; tilt only through .tilt-N.
   ========================================================================== */

/* ---------- Hubs: sheets of story bulletins ---------- */
/* The sheet under the Open / Past paper tabs joins them: no tacks, square top-left corner. */
.hub-sheet.tabbed{ border-top-left-radius:0; padding-top:26px; }
.hub-sheet + .hub-sheet{ margin-top:34px; }
.hub-sheet > h2{ margin-bottom:16px; }
.hub-sheet .sec-head:first-child, .hub-sheet > h2 + .sec-head{ margin-top:0; }
.hub-sheet .bulletin-grid + .sec-head{ margin-top:30px; }
.hub-sheet .sec-head h2{ font-size:17px; }
.hub-empty{ padding:18px 6px 8px; }
.hub-empty p{ margin:0 0 4px; }

/* Event flyers want room for their art: two across on a desktop sheet, one on phones. */
.bulletin-grid.event-grid{ grid-template-columns:repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.bulletin-grid.story-grid{ grid-template-columns:repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

/* ---------- One story card (quests/stories/_story_card.html) ---------- */
/* The title link stretches over the card (::after), so the whole card opens the story;
   the mod's Edit button sits above that overlay. */
.story-card .story-card-link{ color:inherit; text-decoration:none; }
.story-card .story-card-link::after{ content:""; position:absolute; inset:0; z-index:1; border-radius:12px; }
.story-card:hover .story-card-link{ color:var(--ink); }
.story-card .story-card-link:focus-visible{ outline:none; }
.story-card:has(.story-card-link:focus-visible){ outline:3px solid var(--accent-dark); outline-offset:3px; }
.story-card-edit{ position:relative; z-index:2; }
.story-card .cover .thumb-placeholder{ font-size:2.4rem; }
.story-card .cover img{ object-fit:cover; }
.story-card-body{ display:flex; flex-direction:column; gap:8px; min-width:0; }
.story-card-status{ display:flex; align-items:center; justify-content:space-between; gap:6px 8px; flex-wrap:wrap; }
.story-card-title{ overflow-wrap:anywhere; }
.story-card-blurb{ display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:3; line-clamp:3; overflow:hidden; }
.story-card-meta{ font-size:12.5px; font-weight:700; color:var(--ink-soft); line-height:1.4; }
.story-card-foot{ display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; margin-top:auto; }
.story-card-foot .note-link{ min-height:0; }
.story-card--draft{ border-style:dashed; }

/* The events-hub flyer: art across the top, edge to edge. */
.story-card--big{ padding:0; }
.story-card--big .cover{ height:170px; border:none; border-bottom:2.5px solid var(--line); border-radius:11px 11px 0 0; }
.story-card--big .story-card-body{ padding:12px 16px 14px; }
.story-card--big .goal-top{ font-size:12.5px; }
.story-card--big .goal-bar{ height:12px; }

/* ---------- Story page ---------- */
.story-event{ padding:0; margin-bottom:34px; }
.story-hero{ height:260px; border-radius:11px 11px 0 0; overflow:hidden; border-bottom:2.5px solid var(--line); }
.story-hero img{ width:100%; height:100%; object-fit:cover; display:block; }
.story-event-body{ display:flex; flex-direction:column; gap:12px; padding:18px 24px 22px; }
.story-event-body .eb-top{ display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.story-scene{ font-size:13px; font-weight:700; color:var(--ink-soft); }
.story-event-body .eb-main{ display:flex; align-items:center; justify-content:space-between; gap:10px 16px; flex-wrap:wrap; }
.story-event-body h1{ margin:0; font-size:28px; line-height:1.15; overflow-wrap:anywhere; min-width:0; }
.story-start{ display:flex; gap:10px; flex-wrap:wrap; align-items:center; }
.story-blurb{ margin:0; font-size:15px; color:var(--ink); }
.story-state{ margin:0; font-weight:700; color:var(--ink-soft); }
.story-event-body > p.muted{ margin:0; }

/* Chapters note (side) + Quests sheet (main): side by side from 1000px, else stacked. */
.story-cols{ display:grid; grid-template-columns:minmax(0,1fr); gap:34px 26px; align-items:start; }
@media (min-width:1000px){
  .story-cols{ grid-template-columns:minmax(0,1fr) minmax(0,2fr); }
  .story-cols.solo{ grid-template-columns:minmax(0, 440px); }
}
.story-chapters h2, .story-quests h2{ font-size:20px; margin:0 0 12px; }
.story-chapters > p{ margin:0; }

.play-list{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px; }
.play-list li{ display:flex; gap:6px; align-items:center; }
.play-list a.story-chapter-row{ flex:1; min-width:0; display:flex; align-items:center; gap:10px; min-height:44px; padding:8px 10px; border-radius:11px;
  background:var(--parch-2); border:2px solid transparent; color:var(--ink); text-decoration:none; }
.play-list a.story-chapter-row:hover{ border-color:var(--line); color:var(--ink); }
.play-list .hicon{ background:var(--card); border:2px solid var(--line); font-family:"Fredoka"; font-weight:600; color:var(--ink); }
.play-list .t{ flex:1; min-width:0; }
.play-list .t b{ display:block; font-family:"Fredoka"; font-weight:600; font-size:15px; line-height:1.2; overflow-wrap:anywhere; }
.play-list .t span{ font-size:12.5px; color:var(--ink-soft); font-weight:700; }
.story-row-edit{ flex:none; }

/* Quest rows: <details>; the summary is the row and the body opens inside the same box. */
.story-quest-rows{ display:flex; flex-direction:column; gap:10px; }
.story-quest{ border:2px solid var(--line); border-radius:12px; background:var(--card); overflow:hidden; }
.story-quest > summary{ list-style:none; display:flex; align-items:center; gap:6px 10px; flex-wrap:wrap; min-height:48px;
  position:relative; padding:8px 34px 8px 12px; background:var(--parch-2); cursor:pointer; }
.story-quest > summary::-webkit-details-marker{ display:none; }
.story-quest > summary::after{ content:"▾"; position:absolute; right:12px; top:50%; margin-top:-.6em; line-height:1.2; color:var(--ink-soft); transition:transform .15s; }
.story-quest[open] > summary{ border-bottom:2px dashed var(--line); }
.story-quest[open] > summary::after{ transform:rotate(180deg); }
.story-quest > summary:hover{ background:var(--tab); }
.story-quest > summary:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:-3px; border-radius:10px; }
.story-row-title{ flex:1 1 160px; min-width:0; font-family:"Fredoka"; font-weight:600; font-size:15.5px; line-height:1.25; overflow-wrap:anywhere; }
.story-quest-count{ flex:none; color:var(--ink-soft); font-size:12.5px; font-weight:700; white-space:nowrap; }
.story-quest--closed > summary .story-row-title{ color:var(--ink-soft); }
.story-quest-body{ padding:12px 14px 14px; }
.story-quest-body > :first-child{ margin-top:0; }
.story-quest-blurb{ margin:0 0 10px; font-size:15.5px; }
.story-quest-heading{ margin:6px 0 6px; font-size:16px; }
.story-quest-body .rich-text{ font-size:14.5px; }
.story-quest-body .quest-reward-summary{ margin-top:10px; font-size:14px; }
.story-quest-body .quest-reward-heading{ margin:6px 0 2px; font-weight:800; }
.story-quest-body .quest-reward-bonus-note{ font-size:13px; margin:4px 0 0; }
.story-quest-body .quest-meta{ font-size:13px; color:var(--ink-soft); margin:8px 0 0; }
.story-quest-actions{ display:flex; gap:8px 10px; flex-wrap:wrap; align-items:center; margin-top:12px; }
.story-quest-actions .muted{ font-size:13.5px; }
@media (prefers-reduced-motion: reduce){
  .story-quest > summary::after{ transition:none; }
}

/* ---------- All quests (/quests/) ---------- */
/* "Jump to": links to the category Play pages, styled as links (an arrow, no pressed
   state) so they don't read as filters. The Lucky Potion one leads, with a dashed rose edge. */
.quest-jump{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin:0 0 26px; }
.quest-jump-list{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:8px 10px; }
.quest-jump-link{ display:inline-flex; align-items:center; gap:6px; min-height:44px; padding:0 14px;
  font-family:"Fredoka"; font-weight:600; font-size:15px; color:var(--ink); text-decoration:underline;
  text-decoration-color:var(--line); text-underline-offset:3px;
  background:var(--card); border:2px solid var(--line); border-radius:10px; }
.quest-jump-link:hover{ border-color:var(--rose-deep); text-decoration-color:currentColor; color:var(--ink); }
.quest-jump-link:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:2px; }
.quest-jump-link--potion{ border-color:var(--rose-deep); border-style:dashed; }
.corkboard > .page-back{ margin:-12px 0 22px; }
/* Category groups flow side by side; each grows in proportion to how many cards it
   holds (qg-n1…qg-n4, four meaning "four or more"), so small categories share a row. */
.quest-groups{ display:flex; flex-wrap:wrap; align-items:flex-start; gap:30px 26px; }
.quest-group{ min-width:0; flex:var(--qg-n) 1 calc(var(--qg-n) * 270px); }
.qg-n1{ --qg-n:1; } .qg-n2{ --qg-n:2; } .qg-n3{ --qg-n:3; } .qg-n4{ --qg-n:4; flex-basis:100%; }
.quest-group > .section-label{ margin-bottom:16px; }
.quest-group > .board-note{ margin:0; }
.quest-card-edit{ display:inline-flex; align-items:center; min-height:44px; padding:0 6px; font-size:13.5px; font-weight:700; color:var(--ink-soft); }
.quest-card-edit:hover{ color:var(--ink); }
.bulletin-grid.quest-grid{ grid-template-columns:repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
.quest-card{ gap:6px; }
.quest-card .cover{ height:130px; }
.quest-card .cover img{ object-fit:cover; }
.quest-card .quest-new-badge{ left:auto; }
.quest-card-title a{ display:inline-flex; align-items:center; min-height:44px; color:var(--ink); text-decoration:none; overflow-wrap:anywhere; }
.quest-card-title a:hover{ color:var(--rose-ink); text-decoration:underline; }
.quest-card-scene{ font-style:italic; }
.quest-card .meta{ margin-top:2px; }
.quest-card-details > summary{ display:inline-flex; align-items:center; min-height:44px; cursor:pointer; font-family:"Fredoka"; font-weight:500;
  font-size:13.5px; color:var(--rose-ink); list-style:none; }
.quest-card-details > summary::-webkit-details-marker{ display:none; }
.quest-card-details > summary::after{ content:"▾"; margin-left:6px; }
.quest-card-details[open] > summary::after{ content:"▴"; }
.quest-card-details[open] > summary .when-closed, .quest-card-details:not([open]) > summary .when-open{ display:none; }
.quest-card-details > summary:focus-visible{ outline:3px solid var(--accent-dark); outline-offset:2px; border-radius:8px; }
.quest-card-details .quest-reward-heading{ margin:6px 0 2px; font-size:13px; font-weight:800; color:var(--ink-soft); }
.quest-card-actions{ display:flex; gap:8px; flex-wrap:wrap; align-items:center; margin-top:auto; padding-top:6px; }
.quest-card-actions .muted{ font-size:13px; }

/* ---------- Tap targets (§4.2 rule 5) ---------- */
/* Buttons on these pages and the item links in reward lists are 44px on phones. */
@media (max-width:640px){
  :is(.board-head, .story-event, .story-quest-actions, .quest-card-actions, .story-card-foot) .button{ min-height:44px; display:inline-flex; align-items:center; }
  .quest-reward-list a.quest-item-name{ display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; }
}

/* ---------- Phones ---------- */
@media (max-width:640px){
  .story-hero{ height:200px; }
  .story-event-body{ padding:16px 16px 18px; }
  .story-event-body h1{ font-size:26px; }
}
@media (max-width:480px){
  .story-hero{ height:170px; }
  .hub-sheet.tabbed{ padding-top:22px; }
  .story-card--big .cover{ height:150px; }
  .bulletin-grid.story-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
  .story-grid .story-card-blurb{ -webkit-line-clamp:4; line-clamp:4; font-size:12.5px; }
  .story-grid .story-card-meta{ font-size:11.5px; }
  .story-quest > summary{ padding:8px 30px 8px 10px; }
  .story-quest > summary::after{ right:10px; }
  .story-quest-body{ padding:12px 10px 12px; }
}
