/* ==========================================================================
   CSR projects (/csr-projects and /csr-projects/{slug})
   Styled only through tokens.css, so the coming dark mode needs nothing here.
   A petroleum-blue hero under the transparent header, a quiet filter bar,
   then cards on the alternate surface. Gold marks the accents only.
   ========================================================================== */

.cpx { color: var(--d-text); font-family: var(--d-body); }
.cpx, .cpx * { box-sizing: border-box; transition: none; }
.cpx h1, .cpx h2, .cpx h3 { font-family: var(--d-display); color: var(--d-ink); text-wrap: balance; }
.cpx a:focus-visible, .cpx select:focus-visible, .cpx button:focus-visible { outline: none; box-shadow: var(--d-focus); border-radius: var(--d-radius); }

.cpx-eyebrow {
  display: inline-block; margin-bottom: 14px;
  font: 600 12px/1.3 var(--d-display); letter-spacing: .22em; text-transform: uppercase; color: var(--d-gold);
}
.cpx-eyebrow--ink { color: var(--d-gold-ink); }
[dir="rtl"] .cpx-eyebrow { letter-spacing: 0; }

.cpx-h2 { font-size: 24px; font-weight: 600; margin: 0 0 26px; }
.cpx-h2::after { content: ""; display: block; width: 44px; height: 3px; background: var(--d-gold); margin-top: 12px; }

/* --- Hero ---------------------------------------------------------------- */

.cpx-hero {
  position: relative; overflow: hidden;
  padding: 200px 0 72px;
  background: radial-gradient(110% 90% at 85% 0%, #0a6ea6 0%, var(--d-blue) 45%, var(--d-blue-night) 100%);
  color: var(--d-on-blue);
}
/* Survey contour rings, the motif from the homepage's business band. */
.cpx-hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-radial-gradient(circle at 92% 110%, transparent 0 34px, rgba(241, 196, 43, .09) 34px 35px);
  -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000 85%);
          mask-image: linear-gradient(90deg, transparent 30%, #000 85%);
}
[dir="rtl"] .cpx-hero::after { -webkit-mask-image: linear-gradient(270deg, transparent 30%, #000 85%); mask-image: linear-gradient(270deg, transparent 30%, #000 85%); }
.cpx-hero .container { position: relative; z-index: 1; }
.cpx-hero h1 { color: var(--d-on-blue); font-size: 46px; font-weight: 600; line-height: 1.12; margin: 0; max-width: 18ch; }
.cpx-hero h1::after { content: ""; display: block; width: 60px; height: 4px; background: var(--d-gold); border-radius: 3px; margin-top: 18px; }
.cpx-hero__intro { max-width: 62ch; margin: 22px 0 0; font-size: 18px; font-weight: 300; line-height: 1.65; color: rgba(255, 255, 255, .88); }

.cpx-hero--story { padding-bottom: 150px; }
.cpx-hero--story h1 { font-size: 40px; max-width: 24ch; }
.cpx-back {
  display: inline-flex; align-items: center; gap: 10px; margin-bottom: 26px;
  font: 600 13px/1 var(--d-display); color: rgba(255, 255, 255, .85); text-decoration: none;
}
.cpx-back:hover { color: var(--d-gold); text-decoration: none; }
[dir="rtl"] .cpx-back i, [dir="rtl"] .cpx-btn i { transform: scaleX(-1); }

/* --- Focus areas: each pillar has its own accent (tokens.css) ------------- */

.cpx-area--education_training { --area: var(--d-area-education); }
.cpx-area--healthcare         { --area: var(--d-area-health); }
.cpx-area--environment        { --area: var(--d-area-environment); }
.cpx-area--municipal_services { --area: var(--d-area-municipal); }

/* The pillar's icon, white on a disc of its colour. */
.cpx-disc {
  flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: var(--area, var(--d-blue)); color: #fff; font-size: 11px; line-height: 1;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18);
}

/* --- Meta row: focus tag + year ------------------------------------------ */

.cpx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; font-size: 13px; }
.cpx-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font: 600 12px/1 var(--d-display); color: var(--d-blue); text-decoration: none;
}
.cpx-tag { gap: 9px; color: var(--area, var(--d-blue)); }
.cpx-tag .cpx-disc { width: 22px; height: 22px; font-size: 10px; }
.cpx-year { color: var(--d-muted); font-variant-numeric: tabular-nums; }
.cpx-meta--light { margin-bottom: 16px; }
.cpx-meta--light .cpx-tag { color: var(--d-on-blue); padding: 4px 14px 4px 4px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .25); border-radius: 99px; }
.cpx-meta--light .cpx-tag:hover { border-color: var(--d-gold); text-decoration: none; }
.cpx-meta--light .cpx-year { color: rgba(255, 255, 255, .75); }

/* --- Filters ------------------------------------------------------------- */

.cpx-filters { background: var(--d-bg); border-bottom: 1px solid var(--d-line); }
.cpx-filters__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px; padding-top: 18px; padding-bottom: 18px; }
.cpx-areas { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.cpx-areas a {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
  font: 600 13px/1 var(--d-display); color: var(--d-ink); text-decoration: none;
  border: 1px solid var(--d-line); border-radius: 99px; background: var(--d-bg);
}
.cpx-areas a i { color: var(--area, var(--d-gold-ink)); font-size: 15px; }
.cpx-areas a:hover { border-color: var(--area, var(--d-blue)); color: var(--area, var(--d-blue)); text-decoration: none; }
.cpx-areas a.is-on { background: var(--area, var(--d-blue)); border-color: var(--area, var(--d-blue)); color: var(--d-on-blue); }
.cpx-areas a.is-on i { color: inherit; }

.cpx-yearform { display: inline-flex; align-items: center; gap: 10px; }
.cpx-yearform label { margin: 0; font: 600 12px/1 var(--d-display); letter-spacing: .12em; text-transform: uppercase; color: var(--d-muted); }
.cpx-yearform select {
  height: 40px; min-width: 140px; padding: 0 12px; font: 500 14px/1 var(--d-body); color: var(--d-ink);
  background: var(--d-bg); border: 1px solid var(--d-line); border-radius: var(--d-radius);
}
.cpx-yearform__go {
  height: 40px; padding: 0 16px; font: 600 13px/1 var(--d-display); color: var(--d-on-blue);
  background: var(--d-blue); border: 0; border-radius: var(--d-radius); cursor: pointer;
}
.cpx-yearform.is-auto .cpx-yearform__go { display: none; }

/* --- Listing ------------------------------------------------------------- */

.cpx-list { background: var(--d-surface); padding: 56px 0 90px; }
.cpx-count { margin: 0 0 22px; font-size: 14px; color: var(--d-muted); }

.cpx-feature {
  display: grid; grid-template-columns: 1.25fr 1fr; margin-bottom: 48px;
  background: var(--d-card); border: 1px solid var(--d-line); border-radius: var(--d-radius); overflow: hidden;
  box-shadow: var(--d-shadow);
}
.cpx-feature__media { display: block; min-height: 340px; background: var(--d-blue-night); }
.cpx-feature__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpx-feature__body { padding: 44px 44px 40px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.cpx-feature__body .cpx-eyebrow { margin: 0; }
.cpx-feature__title { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.25; }
.cpx-feature__title a { color: inherit; text-decoration: none; }
.cpx-feature__title a:hover { color: var(--d-blue); }
.cpx-feature__text { margin: 0; font-size: 16px; line-height: 1.7; }
.cpx-feature .cpx-btn { margin-top: auto; }
.cpx-feature__facts { display: flex; flex-wrap: wrap; gap: 14px 28px; width: 100%; margin: 4px 0 8px; padding: 16px 0 0; border-top: 1px solid var(--d-line); }
.cpx-feature__facts div { min-width: 0; }
.cpx-feature__facts dt { font: 600 10.5px/1.2 var(--d-display); letter-spacing: .14em; text-transform: uppercase; color: var(--d-muted); }
.cpx-feature__facts dd { margin: 6px 0 0; font-size: 14.5px; color: var(--d-ink); }
.cpx-feature__facts dd.is-figure { font: 700 20px/1 var(--d-display); color: var(--d-blue); font-variant-numeric: tabular-nums; }
[dir="rtl"] .cpx-feature__facts dt { letter-spacing: 0; }

.cpx-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; }

/* Card: photo with its focus area and year, then title, partner and place,
   then a footer that always sits on the same line across a row and carries
   the project's one quotable figure. */
.cpx-card {
  position: relative; display: flex; flex-direction: column; min-width: 0;
  background: var(--d-card); border: 1px solid var(--d-line); border-radius: 6px; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.cpx-card:hover { transform: translateY(-4px); border-color: transparent; box-shadow: 0 22px 40px -24px rgba(1, 42, 68, .45), 0 2px 6px rgba(1, 42, 68, .06); }
.cpx-card:focus-within { box-shadow: var(--d-focus); }
.cpx-card__title a:focus-visible { box-shadow: none; outline: none; }

.cpx-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--d-blue-night); overflow: hidden; }
.cpx-card__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.cpx-card:hover .cpx-card__media img { transform: scale(1.06); }
/* A soft fade at the foot of the photo keeps the focus label legible on any picture. */
.cpx-card__media::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(180deg, rgba(1, 30, 48, 0), rgba(1, 30, 48, .55)); pointer-events: none; }

.cpx-card__area {
  position: absolute; inset-inline-start: 12px; bottom: 12px; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px; max-width: calc(100% - 24px);
  padding: 4px 13px 4px 4px; border-radius: 99px;
  background: rgba(255, 255, 255, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 6px 16px -6px rgba(1, 30, 48, .45);
  font: 600 12px/1.2 var(--d-display); color: var(--d-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background .25s ease, color .25s ease;
}
/* On hover the whole pill takes the pillar's colour. */
.cpx-card:hover .cpx-card__area { background: var(--area); color: #fff; }
.cpx-card:hover .cpx-card__area .cpx-disc { background: rgba(255, 255, 255, .22); box-shadow: none; }
.cpx-card__year {
  position: absolute; inset-inline-end: 14px; top: 14px; z-index: 1;
  padding: 6px 10px; border-radius: 99px; background: var(--d-card); color: var(--d-ink);
  font: 700 11.5px/1 var(--d-display); letter-spacing: .06em; font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(1, 30, 48, .18);
}

.cpx-card__body { flex: 1; padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 10px; }
.cpx-card__title { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.38; }
.cpx-card__title a { color: inherit; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cpx-card__title a::after { content: ""; position: absolute; inset: 0; z-index: 2; }
.cpx-card:hover .cpx-card__title a { color: var(--d-blue); }
/* The site's gold heading rule, drawn under the title and lengthened on hover. */
.cpx-card__title::after { content: ""; display: block; width: 28px; height: 2px; margin-top: 12px; background: var(--d-gold); transition: width .35s ease; }
.cpx-card:hover .cpx-card__title::after { width: 64px; }

.cpx-card__with, .cpx-card__where { margin: 0; display: flex; align-items: baseline; gap: 9px; font-size: 13.5px; line-height: 1.45; color: var(--d-text); }
.cpx-card__with i, .cpx-card__where i { flex: none; width: 14px; text-align: center; color: var(--d-gold-ink); }
.cpx-card__with span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cpx-card__where { color: var(--d-muted); font-size: 13px; }

.cpx-card__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  margin: 0 22px; padding: 16px 0 20px; border-top: 1px solid var(--d-line);
}
.cpx-card__fig { margin: 0; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.cpx-card__fig strong { font: 700 20px/1 var(--d-display); color: var(--d-blue); font-variant-numeric: tabular-nums; }
.cpx-card__fig span { font: 600 10.5px/1.2 var(--d-display); letter-spacing: .14em; text-transform: uppercase; color: var(--d-muted); }
.cpx-card__read { font: 600 12px/1 var(--d-display); letter-spacing: .08em; text-transform: uppercase; color: var(--d-blue); }
.cpx-card__go {
  flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  border: 1px solid var(--d-line); color: var(--d-blue); font-size: 15px;
  transition: background .25s ease, border-color .25s ease, color .25s ease;
}
.cpx-card__go i { transition: transform .25s ease; }
.cpx-card:hover .cpx-card__go { background: var(--d-gold); border-color: var(--d-gold); color: var(--d-on-gold); }
.cpx-card:hover .cpx-card__go i { transform: translateX(3px); }
[dir="rtl"] .cpx-card__go i { transform: scaleX(-1); }
[dir="rtl"] .cpx-card:hover .cpx-card__go i { transform: scaleX(-1) translateX(3px); }
[dir="rtl"] .cpx-card__fig span, [dir="rtl"] .cpx-card__read, [dir="rtl"] .cpx-card__year { letter-spacing: 0; }

/* Placeholder until a photo is uploaded: the focus area's icon on blue. */
.cpx-ph {
  display: grid; place-items: center; width: 100%; height: 100%; min-height: 180px;
  background: repeating-radial-gradient(circle at 80% 120%, transparent 0 26px, rgba(241, 196, 43, .12) 26px 27px),
              linear-gradient(135deg, var(--d-blue) 0%, var(--d-blue-night) 100%);
}
.cpx-ph i { font-size: 52px; color: var(--d-gold); opacity: .85; }

.cpx-empty { padding: 60px 20px; text-align: center; background: var(--d-card); border: 1px dashed var(--d-line); border-radius: var(--d-radius); }
.cpx-empty p { margin: 0 0 18px; font-size: 16px; }

.cpx-pages { margin-top: 44px; display: flex; justify-content: center; }
.cpx-pages .pagination { margin: 0; }
.cpx-pages .page-link { color: var(--d-blue); border-color: var(--d-line); background: var(--d-card); }
.cpx-pages .page-item.active .page-link { background: var(--d-blue); border-color: var(--d-blue); color: var(--d-on-blue); }
.cpx-pages .page-item.disabled .page-link { color: var(--d-muted); background: var(--d-card); }

.cpx-btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 14px 22px;
  font: 600 13px/1 var(--d-display); letter-spacing: .06em; text-transform: uppercase;
  color: var(--d-on-blue); background: var(--d-blue); border-radius: 2px; text-decoration: none;
}
.cpx-btn:hover { background: var(--d-blue-deep); color: var(--d-on-blue); text-decoration: none; }
.cpx-btn--gold { background: var(--d-gold); color: var(--d-on-gold); }
.cpx-btn--gold:hover { background: #e2b51d; color: var(--d-on-gold); }
[dir="rtl"] .cpx-btn { letter-spacing: 0; }

/* --- Story page ---------------------------------------------------------- */

.cpx-cover { position: relative; z-index: 2; margin: -100px 0 0; aspect-ratio: 16 / 7; max-width: 100%; border-radius: var(--d-radius); overflow: hidden; background: var(--d-blue-night); box-shadow: var(--d-shadow); }
.cpx-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.cpx-story { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 64px; padding: 56px 0 24px; }
.cpx-story__body { font-size: 17px; line-height: 1.8; max-width: 68ch; }
.cpx-story__body p { margin: 0 0 1.2em; }
.cpx-story__body h2, .cpx-story__body h3 { margin: 1.4em 0 .6em; font-size: 22px; }
.cpx-story__body a { color: var(--d-blue); }

.cpx-facts { align-self: start; position: sticky; top: 120px; padding: 26px 26px 10px; background: var(--d-surface); border-top: 3px solid var(--d-gold); border-radius: 0 0 var(--d-radius) var(--d-radius); }
.cpx-facts h2 { margin: 0 0 14px; font: 600 12px/1.3 var(--d-display); letter-spacing: .2em; text-transform: uppercase; color: var(--d-gold-ink); }
.cpx-facts dl { margin: 0; }
.cpx-facts dl > div { padding: 14px 0; border-top: 1px solid var(--d-line); }
.cpx-facts dt { font: 600 11.5px/1.3 var(--d-display); letter-spacing: .1em; text-transform: uppercase; color: var(--d-muted); }
.cpx-facts dd { margin: 6px 0 0; font-size: 16px; color: var(--d-ink); font-variant-numeric: tabular-nums; }
[dir="rtl"] .cpx-facts h2, [dir="rtl"] .cpx-facts dt { letter-spacing: 0; }

.cpx-share { padding: 16px 0 18px; border-top: 1px solid var(--d-line); }
.cpx-share h2 { margin: 0 0 12px; font: 600 11.5px/1.3 var(--d-display); letter-spacing: .1em; text-transform: uppercase; color: var(--d-muted); }
[dir="rtl"] .cpx-share h2 { letter-spacing: 0; }
.cpx-share .shx-list { gap: 6px; }
.cpx-share .shx-btn { width: 36px; height: 36px; font-size: 15px; border-radius: 9px; }

.cpx-gallery, .cpx-related { padding: 48px 0 8px; border-top: 1px solid var(--d-line); margin-top: 40px; }
.cpx-gallery__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.cpx-gallery__grid a { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--d-radius); }
.cpx-gallery__grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cpx-related { padding-bottom: 90px; }

/* --- Closing band -------------------------------------------------------- */

.cpx-cta { background: var(--d-blue); color: rgba(255, 255, 255, .85); padding: 72px 0; }
.cpx-cta__inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 56px; align-items: center; }
.cpx-cta h2 { color: var(--d-on-blue); font-size: 28px; font-weight: 600; margin: 0 0 12px; }
.cpx-cta__main p { margin: 0 0 26px; font-size: 16px; line-height: 1.7; max-width: 52ch; }
.cpx-cta__side { display: flex; gap: 20px; padding-inline-start: 40px; border-inline-start: 1px solid rgba(255, 255, 255, .25); }
.cpx-cta__side > i { font-size: 34px; color: var(--d-gold); }
.cpx-cta__side h3 { color: var(--d-on-blue); font-size: 17px; font-weight: 600; margin: 0 0 6px; }
.cpx-cta__side p { margin: 0 0 12px; font-size: 14.5px; line-height: 1.6; }
.cpx-cta__side a { color: var(--d-gold); font: 600 13px/1.3 var(--d-display); text-decoration: none; }
.cpx-cta__side a:hover { text-decoration: underline; }

/* --- Smaller screens ----------------------------------------------------- */

@media (max-width: 1199px) {
  .cpx-story { grid-template-columns: minmax(0, 1fr) 280px; gap: 44px; }
}
@media (max-width: 991px) {
  .cpx-hero { padding: 150px 0 56px; }
  .cpx-hero h1 { font-size: 36px; }
  .cpx-hero--story { padding-bottom: 110px; }
  .cpx-hero--story h1 { font-size: 32px; }
  .cpx-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
  .cpx-feature { grid-template-columns: 1fr; }
  .cpx-feature__media { min-height: 0; aspect-ratio: 16 / 9; }
  .cpx-feature__body { padding: 30px 28px 32px; }
  .cpx-story { grid-template-columns: 1fr; gap: 36px; }
  .cpx-facts { position: static; }
  .cpx-cta__inner { grid-template-columns: 1fr; gap: 36px; }
  .cpx-cta__side { padding-inline-start: 0; border-inline-start: 0; padding-top: 30px; border-top: 1px solid rgba(169, 192, 211, .25); }
  .cpx-gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 575px) {
  .cpx-hero { padding: 130px 0 44px; }
  .cpx-hero--story { padding-bottom: 100px; } /* clears the cover's -70px overlap */
  .cpx-hero h1, .cpx-hero--story h1 { font-size: 28px; }
  .cpx-hero__intro { font-size: 16px; }
  .cpx-grid { grid-template-columns: 1fr; }
  .cpx-areas { flex-wrap: nowrap; overflow-x: auto; margin: 0 -15px; padding: 0 15px 4px; scrollbar-width: none; }
  .cpx-areas a { white-space: nowrap; }
  .cpx-cover { margin-top: -70px; aspect-ratio: 4 / 3; }
  .cpx-feature__title { font-size: 22px; }
  .cpx-gallery__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  .cpx-card, .cpx-card__media img, .cpx-card__title::after, .cpx-card__go, .cpx-card__go i, .cpx-card__area { transition: none; }
  .cpx-card:hover { transform: none; }
  .cpx-card:hover .cpx-card__media img { transform: none; }
}
