/* Listing detail and post layout.
   Color comes from the shared marketplace tokens on body:has(.market-home):
   --red #C0392B, --red-dark, --on-primary, --blue, --muted, --card, --border. */

.market-sheet { font-family: Inter, system-ui, sans-serif; padding-bottom: 56px; }
.market-sheet [hidden] { display: none !important; }
.market-sheet .market-note a,
.market-sheet .market-pickup a,
.market-sheet #listing-missing a { color: var(--blue); }
.market-sheet .market-note a:hover,
.market-sheet .market-pickup a:hover,
.market-sheet #listing-missing a:hover { color: var(--text); }

.market-back {
  display: inline-block;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}
.market-sheet a.market-back { color: var(--muted); }
.market-sheet a.market-back:hover { color: var(--text); }

.market-detail {
  display: grid;
  grid-template-columns: minmax(0, 520px) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 8px;
}

.market-gallery { min-width: 0; }
.market-gallery .market-photo-media {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid var(--border);
}
.market-gallery-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: color-mix(in srgb, var(--darker) 82%, transparent);
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.market-gallery-prev { left: 10px; }
.market-gallery-next { right: 10px; }
.market-gallery-nav:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.market-thumbs {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.market-thumbs::-webkit-scrollbar { display: none; }
.market-thumbs button {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  padding: 0;
  border-radius: 10px;
  border: 2px solid transparent;
  background: var(--card);
  overflow: hidden;
  cursor: pointer;
}
.market-thumbs button[aria-current="true"] { border-color: var(--red); }
.market-thumbs button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.market-thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.market-detail-buy { min-width: 0; padding-top: 4px; }
.market-detail-buy .market-photo-price {
  font-size: 28px;
  letter-spacing: -0.03em;
}
.market-detail-buy h1 {
  margin: 6px 0 4px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
}
.market-detail-buy .market-photo-meta { white-space: normal; }

.market-contact {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  margin-top: 14px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: var(--on-primary);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.market-contact:hover { background: var(--red-dark); color: var(--on-primary); }
.market-contact:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}
.market-contact-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  max-width: 36em;
}

.market-description {
  margin: 16px 0 0;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.market-sheet .listing-dl { margin-top: 18px; }
.market-sheet .listing-dl dt { color: var(--muted); }
.market-sheet .listing-dl dd { color: var(--text); }

.market-continue {
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.market-continue:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.market-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}
.market-post-preview {
  width: 100%;
  max-width: 320px;
  border-radius: 12px;
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
}
.market-post-preview-col { min-width: 0; }
.market-post-preview-col .market-photo-price { margin-top: 8px; }
.market-sheet .form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.market-sheet .form-card h2 { color: var(--text); }
.market-sheet .btn-primary {
  background: var(--red);
  color: var(--on-primary);
  border: 0;
  border-radius: 999px;
}
.market-sheet .btn-primary:hover {
  background: var(--red-dark);
  color: var(--on-primary);
  filter: none;
  transform: none;
}
.market-sheet input:focus,
.market-sheet select:focus,
.market-sheet textarea:focus { border-color: var(--red); }
.market-sheet .market-note { color: var(--muted); }
.market-sheet .status.ok { color: var(--blue); }

@media (max-width: 800px) {
  .market-detail,
  .market-post-layout { grid-template-columns: 1fr; }
  .market-post-preview { max-width: none; }
  .market-detail-buy h1 { font-size: 20px; }
  .market-detail-buy .market-photo-price { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  .market-gallery-nav { transition: none; }
}
.field-help { color: var(--mid); font-size: 13px; margin: 6px 0 0; line-height: 1.45; }
.market-category-help { padding-left: 18px; }
.market-report-form { margin-top: 10px; } .market-report-form fieldset { border: 0; padding: 0; margin: 0 0 8px; }
.market-disclaimer { font-size: 12px; color: var(--mid); }

/* Mobile polish: 44px back link */
.market-back { display: inline-flex; align-items: center; min-height: 44px; }
