/* bazaar.css — the ads: the list, one ad, the owner's table and the form.
   ---------
   The cards, filters, tables, buttons and details lists are the site's own
   (style.css, listings.css); this file adds only what an ad has of its own: the
   kind tag's colours, the price, the pictures and the contact block. Every
   colour and every space comes from the tokens in style.css. */

/* ---- The kind of ad: a tag, in the shared tag look (listings.css) ---- */
.bz-kind-sell { color: var(--tag-free-text);     border-color: var(--tag-free-border);     background: var(--tag-free-bg); }
.bz-kind-buy  { color: var(--tag-players-text);  border-color: var(--tag-players-border);  background: var(--tag-players-bg); }
.bz-kind-swap { color: var(--tag-hybrid-text);   border-color: var(--tag-hybrid-border);   background: var(--tag-hybrid-bg); }
.bz-kind-give { color: var(--tag-inperson-text); border-color: var(--tag-inperson-border); background: var(--tag-inperson-bg); }

/* ---- A card in the list: the picture beside the words ---- */
.bz-card .bz-card-row { display: flex; align-items: flex-start; gap: var(--space-3); margin-bottom: var(--space-3); }
.bz-card-text { min-width: 0; }   /* the text column may shrink, so a long word wraps instead of pushing the thumbnail out */
.bz-card-text > :last-child { margin-bottom: 0; }

.bz-card-thumb {
	flex: 0 0 auto; display: block; width: 96px; height: 96px;   /* design-ok: a square thumbnail, two lines of the excerpt tall */
	border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden;
}
.bz-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bz-card-thumb:hover { border-color: var(--card-border-hover); }

.bz-card-meta {
	margin: 0; font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text-muted);
}

/* The price sits at the end of the card's footer line, opposite the poster */
.bz-price {
	flex: 0 0 auto; font-family: var(--font-caps); font-size: var(--fs-ui);
	letter-spacing: .04em; color: var(--text-heading); white-space: nowrap;
}

/* ---- One ad ---- */
.bz-view-price {
	margin: 0 0 var(--space-4); font-family: var(--font-caps); font-size: var(--fs-h2);
	letter-spacing: .04em; color: var(--text-heading);
}
.bz-updated { font-family: var(--font-ui); font-size: var(--fs-sm); color: var(--text-faint); letter-spacing: normal; }
.bz-view .dateline > .bz-updated::before { content: "\00b7"; margin: 0 var(--space-2); }

/* The seller's line in the details list: the avatar and the name on one line */
.bz-seller { display: inline-flex; align-items: center; gap: var(--space-2); text-decoration: none; }

/* The pictures on the left; the title, price, details and the message button on the right.
   The description runs under both. Without pictures the right side takes the whole width. */
.bz-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-6); margin-bottom: var(--space-5); }
.bz-top:not(:has(> .bz-gallery)) { grid-template-columns: minmax(0, 1fr); }
.bz-buy .lst-view-meta { margin-bottom: var(--space-4); }
.bz-message { display: block; text-align: center; }

/* Lists in the description keep the paragraphs' spacing and a small indent */
.bz-view .lst-view-description ul, .bz-view .lst-view-description ol { margin: 0 0 var(--space-2); padding: 0 0 0 var(--space-5); }

/* ---- Pictures: the first one big, the rest under it. Each links to its own
        file, so there is no gallery script and no lightbox. ---- */
.bz-gallery { margin: 0; }
.bz-gallery-main {
	display: block; border: 1px solid var(--card-border); border-radius: var(--radius);
	background: var(--panel-bg); overflow: hidden;
}
.bz-gallery-main img { display: block; width: 100%; max-width: 100%; max-height: 32rem; object-fit: contain; }   /* design-ok: a tall photo is capped so the ad's text stays in view */
.bz-gallery-main:hover { border-color: var(--card-border-hover); }

.bz-gallery-thumbs {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2);   /* four to a row, as wide as the big picture */
	margin: var(--space-2) 0 0; padding: 0; list-style: none;
}
.bz-gallery-thumbs a {
	display: block; aspect-ratio: 1;   /* square thumbnails */
	border: 1px solid var(--card-border); border-radius: var(--radius); overflow: hidden;
}
.bz-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bz-gallery-thumbs a:hover { border-color: var(--card-border-hover); }

.bz-photo-warn { margin-bottom: var(--space-4); color: var(--danger); font-family: var(--font-ui); font-size: var(--fs-ui); }

/* ---- Contact: the phone and e-mail are rows of the details list for signed-in players;
        the rest get a line about why not ---- */
.bz-contact-gate { margin: 0 0 var(--space-3); font-family: var(--font-ui); font-size: var(--fs-ui); color: var(--text-muted); }

/* ---- The owner's row of actions on their own ad ---- */
.bz-owner-tools {
	display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2);
	margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--card-border);
}
.bz-owner-label {
	font-family: var(--font-caps); font-size: var(--fs-xs); letter-spacing: .08em; color: var(--card-rule-event);
}
.bz-owner-list { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* ---- The owner's own ads ---- */
.bz-mine .bz-table-wrap { margin-bottom: 0; }
.bz-mine .bz-table-wrap .tbl { margin-bottom: 0; }
.bz-mine-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); }

/* ---- The form ---- */
.bz-form .bz-check label { font-family: var(--font-ui); font-size: var(--fs-ui); }
.bz-contact-fields, .bz-photo-fields {
	margin: 0 0 var(--space-5); padding: var(--space-4) var(--space-5);
	border: 1px solid var(--card-border); border-radius: var(--radius); background: var(--panel-bg);
}
.bz-contact-fields legend, .bz-photo-fields legend {
	padding: 0 var(--space-2); font-family: var(--font-caps); font-size: var(--fs-ui);
	letter-spacing: .06em; color: var(--text-heading);
}
.bz-contact-fields > :last-child, .bz-photo-fields > :last-child { margin-bottom: 0; }

/* The pictures already on the ad, each with the box that takes it off on save */
.bz-photo-edit {
	display: flex; flex-wrap: wrap; gap: var(--space-3);
	margin: 0 0 var(--space-4); padding: 0; list-style: none;
}
.bz-photo-item { width: 96px; font-family: var(--font-ui); font-size: var(--fs-xs); color: var(--text-muted); }   /* design-ok: the same square as the list's thumbnail */
.bz-photo-item img {
	display: block; width: 96px; height: 96px; object-fit: cover;   /* design-ok: as above */
	border: 1px solid var(--card-border); border-radius: var(--radius);
}
.bz-photo-item label { display: flex; align-items: center; gap: var(--space-1); margin-top: var(--space-1); }

@media (max-width: 700px) {
	/* One column: the title, date and tag first, then the pictures, then the price, details and button */
	.bz-top { display: flex; flex-direction: column; gap: 0; }
	.bz-buy { display: contents; }
	.bz-buy > .lst-view-header { order: -1; }
	.bz-gallery { margin-bottom: var(--space-5); }
}

@media (max-width: 480px) {
	/* Phones: the thumbnails give the words more room */
	.bz-card-thumb { width: 72px; height: 72px; }   /* design-ok: as above, one size down */
	.bz-gallery-main img { max-height: 18rem; }   /* design-ok: as above, on a phone screen */
	.bz-contact-fields, .bz-photo-fields { padding: var(--space-3) var(--space-4); }
}
