/* ==========================================================================
   ZBIF · Challenge detail page
   Extracted from ui-revamp/css/styles.css
   ========================================================================== */

:root {
  --ink: #16133f;
  --magenta: #C41E85;
  --magenta-dk: #9E1569;
  --text: #1c1a2b;
  --muted: #5d5b6a;
  --soft: #8b8996;
  --paper: #f5f3ee;
  --line: #e3e0d8;
  --line-2: #d2cec4;
  --r: 6px;
  --r-lg: 10px;
  --font: "Inter", "Rubik", "Segoe UI", system-ui, sans-serif;
  --header-h: 76px;
}

/* Status & sector (hero + badges) */
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 4px; background: #fff; color: var(--ink);
  font-size: .75rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase;
}
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #16a34a; }
.status--closing::before { background: #f59e0b; }
.status--closed::before { background: var(--soft); }

.sector { display: inline-flex; align-items: center; gap: 8px; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sector::before { content: ""; width: 9px; height: 9px; background: var(--c); }
.sector--light { color: rgba(255, 255, 255, .85); }

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }

/* ---------- Challenge page: hero ---------- */
.ch-hero { position: relative; isolation: isolate; overflow: hidden; background: var(--ink); color: #fff; }
.ch-hero__img { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
.ch-hero__shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(14, 11, 43, .92) 0%, rgba(14, 11, 43, .75) 50%, rgba(14, 11, 43, .35) 100%);
}
.ch-hero__inner { padding-top: 40px; padding-bottom: 56px; }
.ch-hero__inner--plain { padding-block: 96px; }
.ch-hero .crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .88rem; color: rgba(255, 255, 255, .7); }
.ch-hero .crumbs a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.ch-hero .crumbs [aria-current] { color: #fff; font-weight: 600; }
.ch-hero__status { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 64px 0 18px; }
.ch-hero__left { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .95rem; }
.ch-hero__title { max-width: 24ch; margin-top: 12px; font-size: clamp(1.8rem, 1.2rem + 1.8vw, 2.6rem); line-height: 1.1; letter-spacing: -.03em; color: #fff; }
.ch-hero__org { display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: 1.05rem; color: rgba(255, 255, 255, .85); }
.ch-hero__inner--plain .btn { margin-top: 28px; }

/* ---------- Challenge page: section tabs ---------- */
.ch-tabs { position: sticky; top: var(--header-h); z-index: 20; background: #fff; border-bottom: 1px solid var(--line); }
.ch-tabs__inner { display: flex; gap: 28px; overflow-x: auto; scrollbar-width: none; }
.ch-tabs__inner::-webkit-scrollbar { display: none; }
.ch-tabs a {
  padding: 16px 0 14px; white-space: nowrap; font-size: .95rem; font-weight: 600; color: var(--muted);
  border-bottom: 3px solid transparent;
}
.ch-tabs a:hover { color: var(--ink); }
.ch-tabs a[aria-current] { color: var(--ink); border-bottom-color: var(--magenta); }

/* ---------- Challenge page: layout ---------- */
.ch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 64px; align-items: start; padding-top: 56px; padding-bottom: 96px; }
.ch-sec { padding-bottom: 48px; margin-bottom: 48px; border-bottom: 1px solid var(--line); scroll-margin-top: calc(var(--header-h) + 72px); }
.ch-sec:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }
.ch-sec h2 { font-size: clamp(1.6rem, 1.3rem + .8vw, 2rem); margin-bottom: 16px; }
.ch-sec h3 { margin: 28px 0 10px; font-size: 1.15rem; letter-spacing: -.01em; }
.ch-sec > p { max-width: 68ch; font-size: 1.04rem; }
.ch-sec > p.ch-lead { font-size: 1.25rem; line-height: 1.5; color: var(--ink); font-weight: 500; }

.facts { display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 28px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.facts div { padding: 16px 18px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.facts dd { margin-top: 4px; font-weight: 700; color: var(--ink); }
.tags--lg { margin-top: 20px; }
.tags--lg li { padding: 5px 11px; font-size: .85rem; }

.ticks, .dashes, .numbered { display: grid; gap: 12px; margin-top: 14px; max-width: 68ch; }
.ticks li, .dashes li { position: relative; padding-left: 30px; }
.ticks li::before {
  content: ""; position: absolute; left: 2px; top: .4em; width: 13px; height: 7px;
  border-left: 2.5px solid var(--magenta); border-bottom: 2.5px solid var(--magenta); transform: rotate(-45deg);
}
.dashes li::before { content: ""; position: absolute; left: 4px; top: .8em; width: 12px; height: 2px; background: var(--soft); }
.numbered { counter-reset: n; }
.numbered li { counter-increment: n; position: relative; padding: 14px 16px 14px 58px; border: 1px solid var(--line); border-radius: var(--r); }
.numbered li::before {
  content: counter(n, decimal-leading-zero); position: absolute; left: 18px; top: 14px;
  font-weight: 800; color: var(--magenta); font-variant-numeric: tabular-nums;
}

.criteria { display: grid; gap: 18px; margin-top: 18px; max-width: 640px; }
.criteria__head { display: flex; justify-content: space-between; gap: 12px; color: var(--ink); }
.criteria__head span { font-weight: 800; font-variant-numeric: tabular-nums; }
.criteria__bar { height: 8px; margin-top: 8px; border-radius: 4px; background: var(--paper); overflow: hidden; }
.criteria__bar span { display: block; height: 100%; background: var(--ink); border-radius: 4px; }
.criteria p { margin-top: 6px; font-size: .9rem; color: var(--muted); }

.tl { position: relative; display: grid; max-width: 640px; margin-top: 8px; }
.tl li { position: relative; display: grid; grid-template-columns: 170px 1fr; gap: 20px; padding: 0 0 26px 30px; }
.tl li::before {
  content: ""; position: absolute; left: 0; top: 5px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; border: 2.5px solid var(--line-2); box-sizing: border-box;
}
.tl li:not(:last-child)::after { content: ""; position: absolute; left: 6px; top: 22px; bottom: 2px; width: 2px; background: var(--line); }
.tl li.is-done::before { background: var(--ink); border-color: var(--ink); }
.tl li.is-now::before { background: var(--magenta); border-color: var(--magenta); box-shadow: 0 0 0 5px rgba(196, 30, 133, .15); }
.tl__date { font-weight: 800; color: var(--ink); }
.tl__label { color: var(--muted); }
.tl__label em { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 4px; background: #fdf1f7; font-style: normal; font-size: .78rem; font-weight: 800; color: var(--magenta); }

.resources { display: grid; gap: 10px; margin-top: 18px; }
.resources li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 16px; background: var(--paper); border-radius: var(--r); }
.resources .icon { margin-top: 3px; color: var(--soft); }
.resources strong { display: block; color: var(--ink); }
.resources span { font-size: .88rem; color: var(--muted); }

.brief-card {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px;
  margin-top: 28px; padding: 20px 22px; border: 1.5px solid var(--ink); border-radius: var(--r-lg);
}
.brief-card__icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: var(--r); background: var(--ink); color: #fff; }
.brief-card__icon .icon { width: 24px; height: 24px; }
.brief-card strong { display: block; font-size: 1.05rem; color: var(--ink); }
.brief-card span { font-size: .9rem; color: var(--muted); }

.qa { margin-top: 28px; }
.qa:empty { display: none; }
.qa h3 { margin: 0 0 10px; }
.qa__list { display: grid; gap: 10px; }
.qa__list li { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); }
.qa__q { color: var(--ink); font-weight: 600; }
.qa__a { margin-top: 6px; color: var(--text); }
.qa__meta { display: block; margin-top: 6px; font-size: .8rem; color: var(--soft); }
.ask { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-top: 28px; padding: 24px; background: var(--paper); border-radius: var(--r-lg); }
.ask h3 { margin: 0; }
.ask p { margin-top: 4px; color: var(--muted); }

/* ---------- Challenge page: sidebar ---------- */
.ch-side { position: sticky; top: calc(var(--header-h) + 76px); }
.side-card { display: grid; gap: 12px; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; box-shadow: 0 24px 50px -36px rgba(22, 19, 63, .5); }
.side-card__label { font-size: .75rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.side-card__budget { margin-top: -6px; font-size: 2.2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ink); }
.side-card__facts { display: grid; margin: 4px 0 10px; border-top: 1px solid var(--line); }
.side-card__facts div { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: .93rem; }
.side-card__facts dt { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.side-card__facts dt .icon { color: var(--soft); }
.side-card__facts dd { font-weight: 700; color: var(--ink); text-align: right; }
.side-card__share { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 6px; font-size: .9rem; font-weight: 600; color: var(--muted); }
.side-card__share:hover { color: var(--magenta); }
.side-card__note { font-size: .85rem; text-align: center; color: var(--muted); }
.side-card__note strong { color: var(--ink); }
[data-apply].is-applied { background: #15803d; }

.apply-bar { display: none; }

/* ---------- Responsive (challenge detail) ---------- */
@media (max-width: 1140px) {
  .ch-layout { grid-template-columns: 1fr; gap: 40px; padding-top: 40px; }
  .ch-side { position: static; order: -1; }
  .apply-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
    background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -10px 30px -20px rgba(22, 19, 63, .5);
  }
  .apply-bar__info { display: grid; line-height: 1.25; }
  .apply-bar__info strong { color: var(--ink); font-size: 1.05rem; }
  .apply-bar__info span { font-size: .82rem; color: var(--muted); }
  .apply-bar .btn { min-width: 150px; }
  body:has(.apply-bar) .site-footer { padding-bottom: 76px; }
}

@media (max-width: 760px) {
  :root { --header-h: 68px; }
  .ch-hero__status { margin-top: 40px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .tl li { grid-template-columns: 1fr; gap: 2px; }
  .brief-card { grid-template-columns: auto 1fr; }
  .brief-card .btn { grid-column: 1 / -1; }
  .ask .btn { width: 100%; }
}
