/* Marketing: transport rates (drivers who know a place) and promotions.
   Owned by public/js/marketing.js and loaded after /styles.css. Class names here belong to this module;
   a look shared by several modules goes in /styles.css (npm run check-styles enforces this). */

/* ---------- promotions ---------- */
.promo-msg { background: var(--out-bubble); padding: .8rem 1rem; border-radius: 12px 12px 12px 2px; max-width: 34rem; }
.audience-check { border: 1px dashed var(--border); border-radius: 8px; padding: .5rem .7rem; }

/* Transport rates: the full list of drivers who know a place, folded away until asked for */
.drivers-cell { min-width: 16rem; }
.drivers-list { width: 100%; margin-top: .45rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.drivers-list td { padding: .3rem .55rem; border-bottom: 1px solid var(--border); font-size: .82rem; }
.drivers-list tr:last-child td { border-bottom: 0; }

/* Transport rates: drivers who know a place as tags, the rest in a tidy scrolling list */
.drivers-cell { min-width: 18rem; }
.driver-chips { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.driver-chip { display: inline-flex; align-items: center; gap: .4rem; padding: .18rem .3rem .18rem .6rem; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); font-size: .8rem; white-space: nowrap; }
.driver-chip b { min-width: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: .72rem; text-align: center; }
.more-chip { padding: .2rem .65rem; border: 1px dashed var(--border-strong); border-radius: 999px; background: none; color: var(--link); font: inherit;
  font-size: .8rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.more-chip:hover, .more-chip[aria-expanded="true"] { border-style: solid; background: var(--accent-soft); }
.drivers-list { display: block; max-height: 260px; overflow-y: auto; }
.drivers-list tbody { display: table; width: 100%; }

/* ---------- market insights ---------- */
.market-layout { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 1000px) { .market-layout { grid-template-columns: minmax(0, 1fr) 360px; } }
.insight-card { display: grid; gap: .45rem; border-left: 4px solid var(--border); }
.insight-card.k-competitor { border-left-color: #e8743b; }
.insight-card.k-customer { border-left-color: #2a6fdb; }
.insight-card.k-market { border-left-color: #22a06b; }
.insight-card.k-product { border-left-color: #8a5cf6; }
.insight-card.k-content { border-left-color: #d4a017; }
.insight-top { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.insight-by { margin-left: auto; }
.insight-title { margin: 0; font-size: 1rem; }
.insight-facts { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); }
.insight-facts b { color: var(--text); font-weight: 600; }
.insight-details { margin: 0; white-space: pre-wrap; }
.insight-action { padding: .45rem .6rem; border-radius: 8px; background: var(--accent-soft); }
.insight-buttons { display: flex; gap: .4rem; flex-wrap: wrap; }
.badge.insight-kind { background: var(--surface-2); color: var(--text); }
.badge.insight-status.s-new { background: #fff1c2; color: #7a5600; }
.badge.insight-status.s-seen { background: var(--surface-2); color: var(--muted); }
.badge.insight-status.s-planned { background: #dfe9ff; color: #24408f; }
.badge.insight-status.s-done { background: #d9f5e5; color: #1f7a4d; }
@media (prefers-color-scheme: dark) {
  .badge.insight-status.s-new { background: #4a3a0c; color: #ffd866; }
  .badge.insight-status.s-planned { background: #1c2b52; color: #9db6ff; }
  .badge.insight-status.s-done { background: #123d2a; color: #6fe0a5; }
}
.market-board { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.market-board li { display: flex; justify-content: space-between; padding: .4rem .2rem; border-bottom: 1px solid var(--border); }
.market-board li:last-child { border-bottom: 0; }
.market-layout .card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.market-layout .card-head h2 { margin: 0; }
/* The side column keeps to its width: its cards scroll inside if a table is ever wider */
.market-layout > * { min-width: 0; }
.market-layout .card { min-width: 0; overflow-x: auto; }
@media (min-width: 1000px) { .market-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, 340px); } }

/* ---------- product catalogue as cards (GAKA 1.60.0): a big picture, "Granite Rock Common from Senta A", prices ---------- */
.cat-group { margin: 1rem 0 1.4rem; }
.cat-group-head { font-size: 1rem; margin: 0 0 .6rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: .9rem; }
.cat-card { display: grid; grid-template-rows: auto 1fr; padding: 0; overflow: hidden; }
/* The picture fills the top of the card (4:3), so the brick or the heap is easy to recognise */
.cat-pic { display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; border-bottom: 1px solid var(--border);
  background: var(--surface-2, #f1f4f9); cursor: pointer; overflow: hidden; }
.cat-pic img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s ease; }
.cat-pic:hover img { transform: scale(1.03); }
.cat-pic.empty { color: var(--muted); font-size: .9rem; border-bottom-style: dashed; }
.cat-body { display: grid; gap: .55rem; padding: .8rem .9rem .9rem; align-content: start; }
.cat-name { margin: 0; font-size: 1.05rem; line-height: 1.3; }
.cat-tags { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .5rem; }
.cat-prices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem .8rem; }
.cat-prices strong { font-variant-numeric: tabular-nums; }
