/* Area styles: owned by the catalogue sweep story (U35, U36). Tokens only. */

/* ---- Item info icon (U97) ----
   Small icon button next to item names to open the details modal.
   The icon itself is an <svg> from the shared sprite via components/icon.html.
   It must not trigger parent row click handlers (onclick stops propagation).
   no-print hides it from printed output.
*/
.wm-item-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--wm-size-touch);
  height: var(--wm-size-touch);
  padding: 0;
  margin-left: var(--wm-space-1);
  color: var(--wm-text-muted);
  background: transparent;
  border: none;
  border-radius: var(--wm-radius-sm);
  text-decoration: none;
  vertical-align: middle;
}

.wm-item-info:hover,
.wm-item-info:focus {
  color: var(--wm-accent);
  background: var(--wm-surface-raised);
  text-decoration: none;
  outline: none;
}

.wm-item-info:focus-visible {
  outline: var(--wm-focus-outline);
  outline-offset: 2px;
}

.wm-item-info .wm-icon {
  width: 1em;
  height: 1em;
}


/* ---- Shop colour presets: --wm-shop-tint (soft) and --wm-shop-edge (deep) ---- */
.wm-shop-banner--parchment, .wm-shop-card--parchment { --wm-shop-tint: var(--wm-shop-parchment-soft); --wm-shop-edge: var(--wm-shop-parchment-deep); }
.wm-shop-banner--forest, .wm-shop-card--forest { --wm-shop-tint: var(--wm-shop-forest-soft); --wm-shop-edge: var(--wm-shop-forest-deep); }
.wm-shop-banner--ember, .wm-shop-card--ember { --wm-shop-tint: var(--wm-shop-ember-soft); --wm-shop-edge: var(--wm-shop-ember-deep); }
.wm-shop-banner--ocean, .wm-shop-card--ocean { --wm-shop-tint: var(--wm-shop-ocean-soft); --wm-shop-edge: var(--wm-shop-ocean-deep); }
.wm-shop-banner--violet, .wm-shop-card--violet { --wm-shop-tint: var(--wm-shop-violet-soft); --wm-shop-edge: var(--wm-shop-violet-deep); }
.wm-shop-banner--stall, .wm-street-lot--stall { --wm-shop-tint: var(--wm-stall-soft); --wm-shop-edge: var(--wm-stall-deep); }
.wm-shop-banner--slate, .wm-shop-card--slate { --wm-shop-tint: var(--wm-shop-slate-soft); --wm-shop-edge: var(--wm-shop-slate-deep); }

/* ---- Shop list ---- */
.wm-shop-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--wm-space-3); grid-template-columns: 1fr; }
@media (min-width: 768px) { .wm-shop-list { grid-template-columns: repeat(2, 1fr); } }
.wm-shop-card { display: flex; flex-wrap: wrap; align-items: center; gap: var(--wm-space-2) var(--wm-space-3); padding: var(--wm-space-4);
  background: var(--wm-shop-tint); color: var(--wm-text); border: 1px solid var(--wm-border); border-left: var(--wm-space-2) solid var(--wm-shop-edge);
  border-radius: var(--wm-radius-md); box-shadow: var(--wm-shadow-1); }
.wm-shop-card-name { font-family: var(--wm-font-heading); font-size: var(--wm-text-xl); color: var(--wm-text); font-weight: 600; min-height: var(--wm-size-touch); display: inline-flex; align-items: center; }
.wm-shop-card-keeper { flex-basis: 100%; color: var(--wm-text); font-size: var(--wm-text-sm); }
.wm-shop-symbol { font-size: 1.4em; }

/* ---- Shop page: title, banner, counter ---- */
.wm-shop-title-row { display: flex; align-items: center; gap: var(--wm-space-2); margin: 0 0 var(--wm-space-4); }
.wm-shop-title-side { flex: 0 0 var(--wm-size-touch); text-align: left; }
.wm-shop-title { flex: 1 1 auto; min-width: 0; text-align: center; margin: 0; overflow-wrap: anywhere; }
.wm-shop-closed { text-align: center; margin: calc(-1 * var(--wm-space-2)) 0 var(--wm-space-3); }
.wm-shop-banner { background: var(--wm-shop-tint); margin: 0 calc(-1 * var(--wm-space-4)); padding: var(--wm-space-4) var(--wm-space-4) 0;
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--wm-space-4);
  grid-template-areas: "keeper actions" "about about"; align-items: end; }
.wm-shop-banner > * { min-width: 0; }
@media (min-width: 576px) { .wm-shop-banner { margin: 0 calc(-1 * var(--wm-space-6)); padding: var(--wm-space-5) var(--wm-space-6) 0; column-gap: var(--wm-space-5);
  grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "keeper about actions"; } }
.wm-shop-keeper-figure { grid-area: keeper; margin: 0; display: flex; flex-direction: column; align-items: center; gap: var(--wm-space-2); }
.wm-shop-silhouette { height: 88px; width: auto; display: block; }
@media (min-width: 576px) { .wm-shop-silhouette { height: 160px; } }
.wm-shop-keeper-name { max-width: 9rem; text-align: center; overflow-wrap: anywhere;
  font-family: var(--wm-font-heading); font-size: var(--wm-text-sm); font-weight: 600; color: var(--wm-text);
  background: var(--wm-surface-raised); border: 1px solid var(--wm-border); border-radius: var(--wm-radius-sm); padding: var(--wm-space-1) var(--wm-space-3); box-shadow: var(--wm-shadow-1); margin-bottom: var(--wm-space-2); }
@media (min-width: 576px) { .wm-shop-keeper-name { font-size: var(--wm-text-md); max-width: 12rem; } }
.wm-shop-about { grid-area: about; justify-self: stretch; align-self: center; display: flex; flex-direction: column; gap: var(--wm-space-3); }
.wm-shop-about-box { justify-self: stretch; align-self: center; text-align: left; overflow-wrap: anywhere; box-sizing: border-box;
  background: var(--wm-surface-raised); color: var(--wm-text); border: 1px solid var(--wm-border); border-radius: var(--wm-radius-md);
  padding: var(--wm-space-3) var(--wm-space-4); margin: var(--wm-space-3) 0; font-size: var(--wm-text-sm); }
@media (min-width: 576px) { .wm-shop-about-box { justify-self: center; max-width: 36rem; margin: 0; font-size: var(--wm-text-md); } }
.wm-shop-about-box[hidden] { display: none; }
.wm-shop-about-box h2 { font-size: var(--wm-text-xl); }
.wm-shop-about-box p:last-child { margin-bottom: 0; }
.wm-shop-actions { grid-area: actions; display: flex; flex-direction: column; align-items: flex-end; align-self: end; gap: var(--wm-space-2); }
.wm-shop-iconbar { margin: var(--wm-space-3) 0; }
.wm-shop-iconbar .btn { min-height: var(--wm-size-touch); min-width: var(--wm-size-touch); display: inline-flex; align-items: center; justify-content: center; }
.wm-shop-keeper-toggle { cursor: pointer; min-height: var(--wm-size-touch); }

/* The counter: a wood-toned top band across the banner, then the table. */
.wm-shop-counter { position: relative; margin: 0 calc(-1 * var(--wm-space-4)) var(--wm-space-5); padding: 0 var(--wm-space-4); }
@media (min-width: 576px) { .wm-shop-counter { margin: 0 calc(-1 * var(--wm-space-6)) var(--wm-space-5); padding: 0 var(--wm-space-6); } }
.wm-shop-counter::before { content: ""; display: block; height: 20px; margin: 0 calc(-1 * var(--wm-space-4)) var(--wm-space-3);
  background: linear-gradient(var(--wm-shop-parchment-deep), var(--wm-coin-cp)); box-shadow: var(--wm-shadow-1); }
@media (min-width: 576px) { .wm-shop-counter::before { margin: 0 calc(-1 * var(--wm-space-6)) var(--wm-space-3); } }
.wm-shop-stock .btn { min-height: var(--wm-size-touch); display: inline-flex; align-items: center; }
.wm-shop-stock td.actions { white-space: nowrap; }
.wm-your-inventory { margin-bottom: var(--wm-space-5); padding: var(--wm-space-4); }
.wm-your-inventory-junk:empty { display: none; }

/* ---- Forms and tables in this area ---- */
.wm-stock-section { margin-top: var(--wm-space-6); }
@media (max-width: 575.98px) {
  .wm-inline-form .btn, .wm-quest-turnin .btn, td.actions .btn { min-height: var(--wm-size-touch); }
}

/* ---- Silhouette picker ---- */
.wm-silhouette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: var(--wm-space-2); }
.wm-silhouette-option { position: relative; display: flex; flex-direction: column; align-items: center; gap: var(--wm-space-1); padding: var(--wm-space-2);
  min-height: var(--wm-size-touch); border: 1px solid var(--wm-border); border-radius: var(--wm-radius-md); background: var(--wm-surface-raised); cursor: pointer; }
.wm-silhouette-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wm-silhouette-swatch { display: flex; justify-content: center; width: 100%; background: var(--wm-shop-parchment-soft); border-radius: var(--wm-radius-sm); padding: var(--wm-space-1); }
.wm-silhouette-swatch img { height: 64px; width: auto; }
.wm-silhouette-label { font-size: var(--wm-text-sm); text-align: center; }
.wm-silhouette-option:has(input:checked) { border-color: var(--wm-accent); box-shadow: 0 0 0 2px var(--wm-accent); }
.wm-silhouette-option:has(input:focus-visible) { outline: var(--wm-focus-outline); outline-offset: 2px; }

/* ---- Quests ---- */
.wm-quest-info { margin-bottom: var(--wm-space-3); }
.wm-quest-row { border: 1px solid var(--wm-border); border-radius: var(--wm-radius-md); padding: var(--wm-space-3); margin-bottom: var(--wm-space-3); }
.wm-quest-turnin { display: flex; flex-direction: column; gap: var(--wm-space-3); align-items: flex-start; }
.wm-shop-stock td { vertical-align: middle; }

/* U63: per-row sell form in Your inventory */
.wm-sell-form { flex-wrap: nowrap; }
.wm-sell-form input[type="number"] { width: 4.5rem; flex: 0 0 auto; min-height: var(--wm-size-touch); }
.wm-sell-form .btn { min-height: var(--wm-size-touch); white-space: nowrap; display: inline-flex; align-items: center; gap: var(--wm-space-1); }
.wm-sell-form .btn .coin { color: inherit; }
.wm-your-inventory td:last-child { text-align: right; }

/* ---- Item catalogue and ledger (U84 S14) ---- */
.wm-page-actions .wm-inline-form { margin: 0; }
.wm-item-detail dd > p:last-child { margin-bottom: 0; }
.wm-history-pager { margin-top: var(--wm-space-3); }
.wm-history-pager-count { color: var(--wm-text-muted, var(--bs-secondary-color)); font-size: var(--wm-text-sm); }
.wm-ledger-filter { display: flex; flex-wrap: wrap; gap: var(--wm-space-2); align-items: end; }
.wm-ledger-filter-actions { display: flex; flex-wrap: wrap; gap: var(--wm-space-2); align-items: center; }
@media (max-width: 575.98px) {
  /* Six tracks: three selects per row, then two wider fields per row. */
  .wm-ledger-filter { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: var(--wm-space-2); row-gap: var(--wm-space-1); }
  .wm-ledger-filter > div { grid-column: span 3; min-width: 0; }
  .wm-ledger-filter > .wm-ledger-filter-character, .wm-ledger-filter > .wm-ledger-filter-player, .wm-ledger-filter > .wm-ledger-filter-kind { grid-column: span 2; }
  .wm-ledger-filter .form-select, .wm-ledger-filter .form-control { width: 100%; }
  .wm-ledger-filter > .wm-ledger-filter-actions { grid-column: 1 / -1; }
  .wm-items-table td { height: var(--wm-size-touch); vertical-align: middle; }
  /* Area exception to "modal_frame is full screen below sm": this small table does not need it. */
  #app-modal .modal-dialog:has(.wm-where-to-buy) { width: auto; height: auto; min-height: 0; margin: var(--wm-space-3); max-width: none; }
  #app-modal .modal-dialog:has(.wm-where-to-buy) .modal-content { height: auto; border-radius: var(--wm-radius-md); }
}
