/*
 * Weekly article cards (ArticleCards): the product card(s) a post shows for
 * its linked products. Themes match their palette through the --wkac-*
 * custom properties; no rule needs overriding.
 *
 * The photo sits on a white plate in both skins: store photography is shot on
 * white, and a plate keeps it honest instead of cutting it out of a dark card.
 */

.wkac {
  --wkac-bg: #ffffff;
  --wkac-fg: #111827;
  --wkac-muted: #5b6474;
  --wkac-line: rgba(17, 24, 39, .1);
  --wkac-accent: #1d4ed8;
  --wkac-accent-fg: #ffffff;
  --wkac-plate: #ffffff;
  --wkac-radius: 18px;
  --wkac-in: #15803d;
  --wkac-pre: #b45309;
  --wkac-out: #6b7280;
  container-type: inline-size;
  box-sizing: border-box;
  background: var(--wkac-bg);
  color: var(--wkac-fg);
  border: 1px solid var(--wkac-line);
  border-radius: var(--wkac-radius);
  padding: 16px;
  font-family: inherit;
  line-height: 1.4;
  text-align: left;
}
.wkac--dark {
  --wkac-bg: #171a21;
  --wkac-fg: #f3f4f6;
  --wkac-muted: #9aa3b2;
  --wkac-line: rgba(255, 255, 255, .1);
  --wkac-accent: #e5e7eb;
  --wkac-accent-fg: #111827;
  --wkac-in: #4ade80;
  --wkac-pre: #fbbf24;
  --wkac-out: #9aa3b2;
}
.wkac *, .wkac *::before, .wkac *::after { box-sizing: border-box; }
.wkac p, .wkac ul { margin: 0; padding: 0; }
.wkac a { color: inherit; text-decoration: none; }
.wkac a:focus-visible { outline: 2px solid var(--wkac-accent); outline-offset: 2px; border-radius: 6px; }
.wkac--content { margin: 28px 0; }

.wkac-kicker { font-size: 13px; font-weight: 700; color: var(--wkac-muted); margin-bottom: 12px !important; }

/* Plate */
.wkac-plate {
  display: flex; align-items: center; justify-content: center;
  background: var(--wkac-plate);
  border-radius: calc(var(--wkac-radius) - 6px);
  aspect-ratio: 4 / 3; overflow: hidden;
}
.wkac-plate img { width: 100%; height: 100%; object-fit: contain; padding: 7%; margin: 0; max-width: none; border-radius: 0; box-shadow: none; }

/* Single */
.wkac-in { display: grid; grid-template-columns: minmax(0, 38%) minmax(0, 1fr); gap: 22px; align-items: center; }
.wkac-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wkac-brand { font-size: 12.5px; font-weight: 600; color: var(--wkac-muted); }
.wkac .wkac-name { font-size: 20px; font-weight: 750; line-height: 1.2; letter-spacing: -.01em; }
.wkac-name a:hover { text-decoration: underline; text-underline-offset: 3px; }
.wkac-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 4px 0 2px !important; }
.wkac-chips li { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--wkac-line); color: var(--wkac-fg); margin: 0; }
.wkac-chips li::before { content: none; }
.wkac-chips .wkac-chips-n { border-style: dashed; color: var(--wkac-muted); }
.wkac-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 6px !important; }
.wkac-from { font-size: 13px; font-weight: 600; color: var(--wkac-muted); }
.wkac-amount { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.05; }
.wkac-was { font-size: 14px; color: var(--wkac-muted); }
.wkac-status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--wkac-out); }
.wkac-status i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }
.wkac-status--in { color: var(--wkac-in); }
.wkac-status--pre { color: var(--wkac-pre); }
.wkac-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; margin-top: 10px; }
.wkac-cta {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 22px;
  border-radius: 999px; background: var(--wkac-accent); color: var(--wkac-accent-fg) !important;
  font-size: 15px; font-weight: 700; white-space: nowrap;
}
.wkac-cta:hover { filter: brightness(1.06); }

/* Other stores: an overlapping stack of store icons */
.wkac-stores { display: inline-flex; align-items: center; }
.wkac-store {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; display: inline-flex; align-items: center; justify-content: center;
  background: #fff; color: #111827; font-size: 12px; font-weight: 700;
  box-shadow: 0 0 0 2px var(--wkac-bg); margin-left: -6px; position: relative;
}
.wkac-store:first-child { margin-left: 0; }
.wkac-store img { width: 100%; height: 100%; object-fit: cover; margin: 0; }
.wkac-store:hover, .wkac-store:focus-visible { z-index: 1; transform: translateY(-1px); }
.wkac-store--more { background: var(--wkac-line); color: var(--wkac-muted); font-size: 11px; }

.wkac-credit { display: block; margin-top: 12px; font-size: 11px; color: var(--wkac-muted) !important; text-align: right; }
.wkac-credit:hover { color: var(--wkac-fg) !important; }

/* Narrow column (and every sidebar): stack */
@container (max-width: 520px) {
  .wkac-in { grid-template-columns: 1fr; gap: 14px; }
  .wkac-plate { aspect-ratio: 16 / 10; }
  .wkac .wkac-name { font-size: 18px; }
  .wkac-amount { font-size: 26px; }
}
.wkac--sidebar .wkac-in { grid-template-columns: 1fr; gap: 12px; }
.wkac--sidebar .wkac-plate { aspect-ratio: 16 / 10; }
.wkac--sidebar .wkac-name { font-size: 16px; }
.wkac--sidebar .wkac-amount { font-size: 24px; }
.wkac--sidebar .wkac-actions { flex-direction: column; align-items: stretch; gap: 10px; }
.wkac--sidebar .wkac-cta { width: 100%; }
.wkac--sidebar .wkac-stores { justify-content: center; }

/* Set: compact rows */
.wkac-rows { list-style: none; }
.wkac-rows li { margin: 0; padding: 0; }
.wkac-rows li::before { content: none; }
.wkac-rows li + li { border-top: 1px solid var(--wkac-line); }
.wkac-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 10px 2px; }
.wkac-plate--sm { aspect-ratio: 1; border-radius: 10px; }
.wkac-plate--sm img { padding: 6%; }
.wkac-row-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.wkac-row .wkac-name { font-size: 15px; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wkac-row:hover .wkac-name { text-decoration: underline; text-underline-offset: 3px; }
.wkac-row .wkac-status { font-size: 12px; }
.wkac-row-price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.wkac-row .wkac-amount { font-size: 17px; font-weight: 800; }
.wkac-row .wkac-from { font-size: 11px; }
.wkac-row-host { font-size: 11px; color: var(--wkac-muted); }
.wkac--sidebar .wkac-row { grid-template-columns: 56px minmax(0, 1fr); }
.wkac--sidebar .wkac-row-price { grid-column: 2; flex-direction: row; align-items: baseline; gap: 6px; justify-content: flex-start; }
.wkac--sidebar .wkac-row .wkac-name { font-size: 14px; }
@container (max-width: 380px) {
  .wkac-row { grid-template-columns: 52px minmax(0, 1fr); }
  .wkac-row-price { grid-column: 2; flex-direction: row; align-items: baseline; gap: 6px; }
}

[dir="rtl"] .wkac { text-align: right; }
[dir="rtl"] .wkac-store { margin-left: 0; margin-right: -6px; }
[dir="rtl"] .wkac-store:first-child { margin-right: 0; }
[dir="rtl"] .wkac-credit { text-align: left; }
[dir="rtl"] .wkac-row-price { align-items: flex-start; text-align: left; }
@media (prefers-reduced-motion: reduce) { .wkac-store { transition: none; } }

/* Compact summaries keep the existing product sheet and theme palette. */
.wkac .wkp--article-summary { margin:0; padding:0; border:0; background:transparent; box-shadow:none; min-width:0; }
.wkac-summary-head { display:grid; grid-template-columns:80px minmax(0,1fr); gap:16px; align-items:center; }
.wkac-summary-image { background:var(--wkac-plate); border-radius:14px; overflow:hidden; }
.wkac-summary-image img { width:100%; aspect-ratio:1; object-fit:contain; }
.wkac .wkp--article-summary .wkp-price-row { margin:16px 0 8px; flex-wrap:wrap; }
.wkac .wkp--article-summary .wkp-price { font-size:1.65rem; color:var(--wkac-fg); }
.wkac .wkp--article-summary .wkp-buy { margin-top:16px; width:100%; min-width:0; background:var(--wkac-accent); color:var(--wkac-accent-fg); }
.wkac .wkp--article-summary .wkac-name { margin:0; overflow-wrap:anywhere; }

.wkac:has(.wkp--article-summary) { container-type:normal; }
.wkac .wkp--article-summary .wkp-buy,
.wkac .wkp--article-summary .wkp-buy:is(:link,:visited,:hover,:focus),
.wkac .wkp--article-summary .wkp-buy * { color:var(--wkac-accent-fg); }
.wkac .wkp--article-summary .wkp-sheet-var-name { white-space:normal; overflow:visible; text-overflow:clip; overflow-wrap:anywhere; }
