/* campaign.css: the campaign builder page (its three steps, goal and size tiles, kit cards, total) and its home page block, in the site's own look (over styles.css, brand.css and matrix.css). */

/* page head */
.cb-head { padding: 6px 0 4px; max-width: 72ch; }
.cb-head h1 { color: var(--forest); }
.cb-head .lede { color: var(--text); margin: 0; }

/* steps: a numbered heading, then the choices */
.cb-step { margin: 30px 0 0; scroll-margin: 16px 0 28px; }
.cb-set { border: 0; padding: 0; min-width: 0; }
.cb-set > legend { float: left; width: 100%; padding: 0; }
.cb-set > legend + * { clear: both; }
.cb-h { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; font: 700 clamp(1.15rem, 2.6vw, 1.4rem)/1.2 var(--display); color: var(--forest); }
.cb-n { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--forest); color: #fff; font: 700 15px/1 var(--display); }
.cb [hidden] { display: none !important; }

/* goal and size tiles: the product page's tiles, with a drawing, a name and one line */
.cb .tiles { max-width: none; margin-top: 0; grid-template-columns: minmax(0, 1fr); }
.cb .tile-label { font-weight: 700; font-size: 16px; }
.cb .tile-sub { flex-basis: auto; order: 0; font-size: 14px; line-height: 1.4; }
.cb .tile.cb-goal { display: grid; grid-template-columns: 28px minmax(0, 1fr); column-gap: 14px; row-gap: 2px; align-content: start; }
.cb-goal .cb-icon { grid-row: 1 / span 2; margin-top: 2px; color: var(--forest); }
.cb-goal .tile-label, .cb-goal .tile-sub { grid-column: 2; }
.cb .tile.cb-size { justify-content: flex-start; gap: 3px; min-height: 0; }

/* the kit */
.cb-kit-for { font: 700 1.05rem/1.3 var(--display); color: var(--ink); margin: -6px 0 6px; }
.cb-kit-for:empty { display: none; }
.cb-kit-note, .cb-change-note { color: var(--ink-2); max-width: 78ch; }
.cb-kit-note { margin: 0 0 18px; }
.cb-change-note { font-size: .9rem; margin: 14px 0 0; }
.cb-more { margin: 10px 0 0; }
.cb-static { padding-left: 20px; }
.cb-static li { margin: 0 0 10px; }
.cb-grid .pmain { container-type: inline-size; min-width: 0; }
.cb-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.cb-card { display: grid; grid-template-columns: 88px minmax(0, 1fr); grid-template-rows: 1fr auto auto; grid-template-areas: "img main" "buy buy" "act act"; gap: 12px 14px; padding: 14px; background: #fff; border: 1px solid var(--m-line, #d8dfda); border-radius: 14px; transition: background-color .2s ease, border-color .2s ease; }
.cb-card-img { grid-area: img; align-self: start; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--forest); transition: opacity .2s ease; }
.cb-card-img img, .cb-card-img .ph-empty { width: 100%; height: 100%; object-fit: cover; }
.cb-card-main { grid-area: main; min-width: 0; transition: opacity .2s ease; }
.cb-card-name { font: 700 1.05rem/1.25 var(--display); color: var(--ink); margin: 0 0 4px; }
.cb-card-why { margin: 0 0 4px; }
.cb-card-opts { margin: 0; font-size: .88rem; color: var(--ink-2); overflow-wrap: anywhere; }
.cb-card-opts:empty { display: none; }
/* phones: the quantity picker takes the card's width (its choices carry their prices), the line's price sits under it */
.cb-card-buy { grid-area: buy; display: flex; flex-direction: column; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.cb-card-qty { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cb-card-amount { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.cb-card-qty label { font-size: .82rem; color: var(--ink-2); }
.cb-qty { width: 100%; min-height: 44px; padding: 8px 12px; font: inherit; color: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 10px; }
.cb-qty:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.cb-card-price { font: 700 1.25rem/1.1 var(--display); color: var(--ink); margin: 0; font-variant-numeric: normal; }
.cb-card-each { margin: 3px 0 0; font-size: .82rem; color: var(--ink-2); }
.cb-card-each:empty { display: none; }
.cb-card-actions { grid-area: act; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 14px; }
.cb-include { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.cb-include-input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--forest); }
.cb-card-msg { margin-top: 8px; }
/* a product taken out of the kit stays in place, quieter, so it can be put back */
.cb-card.is-off { background: var(--ground); border-style: dashed; }
.cb-card.is-off .cb-card-img, .cb-card.is-off .cb-card-main { opacity: .55; }
.cb-card.is-off .cb-card-price { font: 400 .95rem/1.3 var(--font); color: var(--ink-2); }

/* the total card */
.cb-rail { padding-top: 4px; }
/* a long total ("12 208,49 $ CA" in French) goes under its label instead of breaking in two */
.cb-rail .rail-total-row { flex-wrap: wrap; gap: 4px 12px; }
.cb-rail .rail-label, .cb-rail .rail-total { white-space: nowrap; }
.cb-rail .rail-unit { text-align: left; margin-top: 6px; }
.cb-rail .rail-summary { margin: 2px 0 12px; }
.cb-rail .rail-msg { margin: 0 0 10px; }
.cb-rail .cur-note { font-size: 13px; color: var(--m-mut, var(--ink-2)); }
/* the phone bar: the total stays on one line beside the button, in French too ("1 097,92 $ CA" is longer than "CA$1,097.92") */
.cb-mbar { gap: 10px; }
.cb-mbar .mbar-price { flex: 1 1 auto; }
.cb-mbar .mbar-total { white-space: nowrap; font-size: clamp(13px, 4vw, 20px); }
.cb-mbar .mbar-unit { white-space: normal; line-height: 1.25; margin-top: 2px; }
.cb-mbar .btn-primary { padding: 10px 14px; }
.cb-mbar[hidden] { display: none; }

/* entrances: each step rises into place, the cards one after the other */
@keyframes cb-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.cb-step.cb-in { animation: cb-rise .38s cubic-bezier(.2, .7, .2, 1) both; }
.cb-card { animation: cb-rise .34s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(var(--cb-order, 0) * 55ms); }
@media (prefers-reduced-motion: reduce) {
  .cb-step.cb-in, .cb-card { animation: none; }
  .cb-card, .cb-card-img, .cb-card-main { transition: none; }
}

/* the home page block: text and button on the left, the eight goals on the right */
.cb-home { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin: 0 0 36px; padding: 24px 20px; background: var(--ground); }
.cb-home h2 { color: var(--forest); font-size: clamp(1.25rem, 3vw, 1.6rem); margin: 0 0 8px; }
.cb-home p { margin: 0 0 16px; max-width: 46ch; }
.cb-home-goals { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; align-content: center; }
.cb-home-goals a { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 14.5px; line-height: 1.25; transition: border-color .16s ease, box-shadow .16s ease; }
.cb-home-goals a:hover { border-color: var(--forest); box-shadow: 0 2px 10px rgba(31, 38, 34, .07); }
.cb-home-goals .cb-icon { flex: none; width: 22px; height: 22px; color: var(--forest); }

@media (min-width: 600px) {
  .cb .tiles.cb-goals { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cb .tiles.cb-sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 900px) {
  .cb .tiles.cb-goals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cb .tile.cb-goal { display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; padding-top: 16px; padding-bottom: 14px; }
  .cb-goal .cb-icon { margin: 0 0 6px; }
  .cb .tiles.cb-sizes { max-width: 980px; }
  .cb-home { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px; padding: 36px 40px; align-items: center; }
  .cb-home-goals { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cb-home-goals a { flex-direction: column; align-items: flex-start; gap: 8px; min-height: 86px; padding: 12px; }
}
/* the checked tile keeps its 1px smaller padding at every width (matrix.css), so nothing shifts when it is chosen */
@media (min-width: 900px) { .cb .tile-input:checked + .tile.cb-goal { padding-top: 15px; padding-bottom: 13px; } }

/* cards follow the width of their own column, not the screen: a wide column lays a card out in one row, a very wide one (large screens) in two columns */
@container (min-width: 640px) and (max-width: 1159px) {
  .cb-card { grid-template-columns: 132px minmax(0, 1fr) minmax(190px, 230px); grid-template-rows: 1fr auto; grid-template-areas: "img main buy" "img act act"; gap: 10px 18px; padding: 16px; }
  .cb-card-img { aspect-ratio: 4 / 3; }
  .cb-card-buy { border-top: 0; padding-top: 0; gap: 8px; }
  .cb-card-amount { display: block; text-align: right; }
  .cb-card-actions { align-self: end; }
}
@container (min-width: 1160px) {
  .cb-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
  .cb-card { grid-template-columns: 132px minmax(0, 1fr); padding: 16px; column-gap: 18px; }
  .cb-card-img { aspect-ratio: 4 / 3; }
  .cb-card-buy { flex-direction: row; align-items: flex-end; justify-content: space-between; gap: 14px; }
  .cb-card-qty { flex: 1 1 auto; max-width: 280px; }
  .cb-card-amount { display: block; flex: none; text-align: right; }
}
