/* campaign list and campaign post pages. Loaded after common.css. */

/* ===== shared by both pages: state label, shops, period ===== */
.cp-state{background:var(--navy);color:#fff;font-size:12.5px;font-weight:700;letter-spacing:.08em;line-height:1.5;padding:4px 12px}
.cp-state.ended{background:#8b8d99}
.cp-shop{font-size:12.5px;font-weight:700;line-height:1.5;color:var(--navy);border:1px solid var(--navy);padding:3px 12px}
.cp-term{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;font-size:14.5px;font-weight:700;line-height:1.6;color:var(--ink,#12142e)}
.cp-term span{flex:none;font-size:11.5px;letter-spacing:.08em;color:var(--accent);border:1px solid currentColor;padding:1px 8px}

/* ===== list ===== */
.cp-count{margin:0 0 18px;text-align:center;font-size:13px;color:var(--muted);line-height:1.6}
.cp-count b{font-size:17px;font-weight:900;color:var(--navy);margin:0 2px}
.cp-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:22px}
.cp-card{display:flex;flex-direction:column;border-radius:6px;border:3px solid transparent;background:linear-gradient(#fff,#fff) padding-box,var(--gold-grad) border-box;box-shadow:0 14px 30px -18px rgba(18,20,46,.25);overflow:hidden;transition:transform .2s}
.cp-card:hover{transform:translateY(-3px)}
.cp-bnr img{width:100%;height:auto;aspect-ratio:3/1;object-fit:cover}
.cp-body{display:flex;flex-direction:column;flex:1;padding:14px 18px 16px}
.cp-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}
.cp-card h2,.cp-card h3{margin-top:10px;font-size:16.5px;font-weight:900;line-height:1.55;letter-spacing:.02em;color:var(--navy);text-wrap:pretty}
.cp-card .cp-term{margin-top:auto;padding-top:10px;font-size:13.5px}
.cp-empty{padding:44px 24px;text-align:center;background:#fff;border:1px solid var(--line);border-radius:6px;line-height:1.9}
.cp-empty b{font-size:17px;font-weight:900;color:var(--navy)}
.cp-empty p+p{margin-top:8px;color:var(--muted);font-size:14.5px}
.cp-empty .btn-navy{margin-top:22px}
.cp-list[hidden],.cp-count[hidden]{display:none}

/* ===== post: period under the title, ended notice, detail image ===== */
.post-head .cp-term{margin-top:14px;font-size:16px}
.post-head .cp-term span{font-size:12.5px;padding:2px 10px}
.cd-ended{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 20px;margin-top:16px;padding:16px 20px;background:#f1f1f4;border-left:5px solid #8b8d99;border-radius:6px;font-size:14.5px;line-height:1.8}
.cd-ended[hidden]{display:none}
.cd-ended b{font-weight:900;color:var(--navy)}
.cd-ended a{flex:none;font-weight:700;color:var(--blue);text-decoration:underline;text-underline-offset:3px}
/* the image keeps its own height: a 3:1 banner and a tall LP-like image both fit */
.cd-visual{margin-bottom:30px;border-radius:6px;overflow:hidden;border:3px solid transparent;background:var(--gold-grad) border-box}
.cd-visual img{width:100%;height:auto}
.cd-links{display:flex;justify-content:center;margin-top:28px}

@media (max-width:1100px){
  /* one column: the title and the list heading come before the market-rate block of the sidebar (order 2 in common.css) */
  #list,#article{order:1}
}
@media (max-width:900px){
  .cp-list{grid-template-columns:1fr;gap:16px}
  .cp-body{padding:12px 14px 14px}
  .cp-card h2,.cp-card h3{font-size:15.5px}
  .post-head .cp-term{font-size:14.5px}
  .cd-ended{padding:14px 16px;font-size:14px}
  .cd-visual{margin-bottom:22px}
  .cd-links .btn-navy{width:100%;min-width:0}
  .cp-empty{padding:32px 16px}
  .cp-empty .btn-navy{width:100%;min-width:0}
}

/* ===== post built from fields (ISSUE-180): the items' tiles and the flow ===== */
.post-body .cd-items{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.post-body a.cd-item{display:flex;flex-direction:column;border-radius:6px;border:2px solid transparent;background:linear-gradient(#fff,#fff) padding-box,var(--gold-grad) border-box;overflow:hidden;color:var(--navy);text-decoration:none;transition:transform .2s}
.post-body .cd-item:hover{transform:translateY(-2px)}
.post-body .cd-item img{aspect-ratio:1/1;object-fit:cover;border-radius:0}
.post-body .cd-item strong{background:none;padding:8px 6px;font-size:14px;font-weight:700;line-height:1.5;text-align:center;color:var(--navy)}
.post-body .cd-flow{list-style:none;padding:0;counter-reset:flow;display:grid;gap:12px}
.post-body .cd-flow li{counter-increment:flow;position:relative;padding:14px 18px 14px 64px;background:var(--paper);border-radius:6px;line-height:1.8}
.post-body .cd-flow li::before{content:counter(flow);position:absolute;left:16px;top:14px;width:32px;height:32px;border-radius:50%;background:var(--navy);color:#fff;font-weight:900;font-size:15px;line-height:32px;text-align:center}
.post-body .cd-flow strong{background:none;display:block;color:var(--navy);font-size:16px;font-weight:900}
.post-body .cd-flow p{font-size:14.5px}
@media (max-width:900px){
  .post-body .cd-items{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  .post-body .cd-flow li{padding:12px 14px 12px 56px}
  .post-body .cd-flow li::before{left:12px;top:12px}
}
