/* /challenges (public/challenges.php): the seasonal hill challenges. Built on the walk pages' head (walks.css) and site.css's colours and type; nothing here changes another page.
   The medals are inline SVG drawn with the classes below: no picture file, no request. Logical properties, so a right-to-left page would mirror by itself. */

.challenges-page .ch-sec { margin-top: 32px; }
.challenges-page .ch-sec h2 { margin: 0 0 14px; text-wrap: balance; }
.challenges-page .ch-sec p { max-width: 70ch; margin: 0 0 10px; }
.challenges-page .ch-sec h3 { margin: 18px 0 8px; font-size: 18px; }

/* where the app stands: the same tints as the devices page's pills */
.ch-status { margin: 4px 0 0; }
.ch-pill { display: inline-block; font: 700 12px/1 var(--sans); letter-spacing: .03em; padding: 6px 11px; border-radius: 999px; }
.ch-pill.is-now { background: #E3F1E6; color: #1F5A2C; }
.ch-pill.is-next { background: #E4ECF6; color: #1F4B7A; }

/* a card for each challenge */
.ch-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.ch-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px 20px 16px; display: grid; gap: 6px; align-content: start; scroll-margin-top: 90px; }
.challenges-page .ch-card h3 { margin: 0; font-size: 21px; text-wrap: balance; }
.ch-card p { margin: 0; }
.ch-blurb { color: var(--ink-soft); }
.ch-dates, .ch-list { font-size: 14.5px; color: var(--muted); }
.ch-tiers { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 0; }
.ch-tiers li { display: flex; align-items: center; gap: 14px; padding: 8px 0; border-top: 1px solid var(--line-soft); font-size: 15.5px; }
.ch-tiers .ch-medal { flex: none; width: 34px; height: 45px; }

/* the medals: a disc on a V of ribbon, in bronze, silver or gold; the number of hills on the disc */
.ch-medal { --disc: #B87333; --edge: #6B3F16; --ribbon: #2F5E8E; --ribbon2: #254B73; display: block; }
.ch-silver { --disc: #BCC2C8; --edge: #4C535A; }
.ch-gold { --disc: #E0B63A; --edge: #6A4D00; }
.ch-medal .ch-rib { fill: var(--ribbon); }
.ch-medal .ch-rib2 { fill: var(--ribbon2); }
.ch-medal .ch-disc { fill: var(--disc); stroke: var(--edge); stroke-width: 1.6; }
.ch-medal .ch-ring { fill: none; stroke: var(--edge); stroke-width: 1.2; opacity: .55; }
.ch-medal .ch-num { fill: var(--edge); font: 700 19px/1 var(--sans); }
.ch-medal .ch-star { fill: var(--edge); }

/* how it works: the steps, numbered in a round badge at the start edge */
.ch-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.ch-steps > li { counter-increment: step; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
                 padding: 14px 18px; padding-inline-start: 64px; min-height: 58px; line-height: 1.55; font-size: 15.5px; }
.ch-steps > li::before { content: counter(step); position: absolute; inset-inline-start: 16px; inset-block-start: 12px; width: 32px; height: 32px; border-radius: 50%;
                         background: var(--pine); color: #fff; font: 700 16px/32px var(--sans); text-align: center; }

.ch-points { margin: 0 0 12px; padding-inline-start: 20px; display: grid; gap: 8px; max-width: 70ch; line-height: 1.55; }

/* the safety section: quiet, set apart by a rule and not by colour */
.ch-safety { border-top: 1px solid var(--line); padding-top: 8px; }
.challenges-page .ch-safety .ch-note { margin-top: 14px; padding: 12px 16px; border-inline-start: 3px solid var(--pine); background: var(--paper-2); border-radius: 0 8px 8px 0; }

.ch-badges { margin: 14px 0 6px; }
.ch-links { margin: 14px 0 0; font-size: 15px; }
.ch-credit { margin-top: 18px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 480px) {
  .ch-card { padding: 16px 16px 12px; }
  .ch-steps > li { padding: 12px 14px; padding-inline-start: 54px; }
  .ch-steps > li::before { inset-inline-start: 12px; inset-block-start: 10px; }
}
