/* Our Impact: an editorial timeline. Uses the CVF Editorial tokens (--cvf-*). */

/* Theme group wrappers pass straight through so the grid applies to the real items. */
.cvf-impact :is(.cvf-imp, .cvf-imp-item, .cvf-imp-body, .cvf-imp-era, .cvf-imp-feature__text, .cvf-imp-step) > .wp-block-group__inner-container { display: contents; }
.cvf-impact :is(.cvf-imp, .cvf-imp-item, .cvf-imp-body, .cvf-imp-era, .cvf-imp-feature__text, .cvf-imp-step) { padding-left: 0 !important; padding-right: 0 !important; }
.cvf-impact .entry-content > .cvf-lead { margin-left: 0 !important; margin-right: 0 !important; max-width: calc(46rem + 80px); }

:root { --cvf-imp-date: 8.5rem; --cvf-imp-gap: 3rem; --cvf-imp-line: calc(var(--cvf-imp-date) + var(--cvf-imp-gap) / 2); }

.cvf-imp { position: relative; margin: 1.5rem 0 3rem; }
.cvf-imp::before { /* the line */
  content: ""; position: absolute; top: .4rem; bottom: 1rem; left: calc(var(--cvf-imp-line) - 1px);
  width: 2px; border-radius: 2px; background: linear-gradient(var(--cvf-mauve, #E0B9E3), var(--cvf-mauve, #E0B9E3) 85%, transparent);
}

/* Era headings sit on the content side of the line */
.cvf-impact .cvf-imp-era { margin: 0 0 1.75rem; padding-left: calc(var(--cvf-imp-date) + var(--cvf-imp-gap)) !important; }
.cvf-imp-era h2 { margin: 0; font-size: var(--cvf-text-h3); color: var(--cvf-navy, #17304A); }
.cvf-imp-era:not(:first-child) { margin-top: 1.5rem; }

/* A milestone */
.cvf-imp-item { position: relative; display: grid; grid-template-columns: var(--cvf-imp-date) minmax(0, 1fr); column-gap: var(--cvf-imp-gap); margin: 0 0 2.4rem; }
.cvf-imp-item::before { /* the dot */
  content: ""; position: absolute; top: .45rem; left: calc(var(--cvf-imp-line) - 7px);
  width: 14px; height: 14px; border-radius: 50%; background: var(--cvf-warm-white, #FAF9F6); border: 3px solid var(--cvf-mauve-ink, #8A4690); box-sizing: border-box;
}
.cvf-imp-date { grid-column: 1; margin: 0; text-align: right; line-height: 1.15; color: var(--cvf-navy, #17304A); }
.cvf-imp-month { display: block; font-size: var(--cvf-text-eyebrow, .75rem); font-weight: 700; letter-spacing: var(--cvf-tracking-caps, .14em); text-transform: uppercase; color: var(--cvf-mauve-ink, #8A4690); }
.cvf-imp-year { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; }
.cvf-imp-body { grid-column: 2; max-width: 44rem; }
.cvf-imp-body > *, .cvf-imp-body p { margin-top: 0; }
.cvf-imp-label { margin: 0 0 .35rem !important; font-size: var(--cvf-text-eyebrow, .75rem); font-weight: 700; letter-spacing: var(--cvf-tracking-caps, .14em); text-transform: uppercase; color: var(--cvf-mauve-ink, #8A4690); }
.cvf-imp-title { margin: 0 0 .45rem !important; font-size: var(--cvf-text-h4) !important; line-height: 1.25; color: var(--cvf-navy, #17304A); }
.cvf-imp-body p:not([class]) { margin-bottom: .5rem; color: var(--cvf-ink-2, #4B5563); line-height: 1.6; }
.cvf-imp-more { margin: .35rem 0 0 !important; font-weight: 700; }
.cvf-imp-more a { color: var(--cvf-mauve-ink, #8A4690); text-underline-offset: 3px; }

/* Major changes: lilac feature with what-we-did → what-changed, and a photo */
.cvf-impact .cvf-imp-item--feature .cvf-imp-body {
  max-width: none; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.75rem; align-items: start;
  background: var(--cvf-mauve-soft, #F3E6F4); border-radius: var(--cvf-radius-lg, 20px); padding: 1.75rem !important;
}
.cvf-imp-item--feature::before { background: var(--cvf-mauve-ink, #8A4690); width: 18px; height: 18px; left: calc(var(--cvf-imp-line) - 9px); top: .35rem; }
.cvf-imp-item--feature .cvf-imp-title { font-size: var(--cvf-text-h3) !important; }
.cvf-imp-item--feature .cvf-imp-label { color: var(--cvf-plum, #4A254A); }
.cvf-impact .cvf-imp-step { position: relative; background: var(--cvf-white, #fff); border-radius: var(--cvf-radius, 12px); padding: .9rem 1.1rem !important; margin: .75rem 0 0; }
.cvf-imp-step p { margin: 0; color: var(--cvf-navy, #17304A); line-height: 1.55; font-size: .98rem; }
.cvf-imp-step__label { font-size: var(--cvf-text-eyebrow, .75rem) !important; font-weight: 800; letter-spacing: var(--cvf-tracking-caps, .14em); text-transform: uppercase; color: var(--cvf-mauve-ink, #8A4690) !important; margin-bottom: .25rem !important; }
.cvf-impact .cvf-imp-step--did { margin-bottom: 1.9rem; }
.cvf-imp-step--did::after { /* arrow from what we did to what changed */
  content: "\2193"; position: absolute; left: 1.1rem; bottom: -1.65rem; font-weight: 800; font-size: 1.1rem; line-height: 1; color: var(--cvf-mauve-ink, #8A4690);
}
.cvf-impact .cvf-imp-step--changed { margin-top: 0; border-left: 4px solid var(--cvf-mauve-ink, #8A4690); }
.cvf-imp-feature__photo { margin: 0 !important; }
.cvf-imp-feature__photo img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 30%; border-radius: var(--cvf-radius, 12px); }

/* Occasional full-width photo breaking up the timeline */
.cvf-imp-photo { margin: -.5rem 0 2.6rem calc(var(--cvf-imp-date) + var(--cvf-imp-gap)) !important; max-width: 44rem; }
.cvf-imp-photo img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; object-position: 50% 30%; border-radius: var(--cvf-radius-lg, 20px); }
.cvf-imp-photo figcaption { font-size: .85rem; color: var(--cvf-ink-2, #4B5563); margin-top: .5rem; }

/* Closing band */
.cvf-impact-end h2 { max-width: 40rem; margin: .25rem auto 1rem; }
.cvf-impact-end .cvf-lead, .cvf-impact-end p { max-width: 40rem; margin-left: auto; margin-right: auto; }
.cvf-impact-end .wp-block-buttons { justify-content: center; margin-top: 1.5rem; }
.cvf-impact-end { text-align: center; }

@media (max-width: 900px) {
  .cvf-impact .cvf-imp-item--feature .cvf-imp-body { grid-template-columns: 1fr; }
  .cvf-imp-feature__photo img { aspect-ratio: 16 / 9; }
}
@media (max-width: 760px) {
  .cvf-imp::before { left: 6px; }
  .cvf-impact .cvf-imp-item { grid-template-columns: 1fr; padding-left: 2.25rem !important; margin-bottom: 2rem; }
  .cvf-imp-item::before, .cvf-imp-item--feature::before { left: 0; }
  .cvf-imp-date { text-align: left; margin-bottom: .4rem; display: flex; gap: .5rem; align-items: baseline; }
  .cvf-imp-month, .cvf-imp-year { display: inline; }
  .cvf-imp-year { font-size: 1.25rem; }
  .cvf-imp-body { grid-column: 1; }
  .cvf-impact .cvf-imp-era { padding-left: 2.25rem !important; }
  .cvf-imp-photo { margin-left: 2.25rem !important; }
  .cvf-impact .cvf-imp-item--feature .cvf-imp-body { padding: 1.15rem !important; }
}

/* Clean air in healthcare: keep the barrister and the CO2 monitor in the crop. */
.cvf-imp-feature__photo img.wp-image-847 { object-position: 50% 40%; }
/* The CO2 monitor photo: show it whole (landscape) so his shoulder and the monitor are both in view. */
.cvf-imp-feature__photo img.wp-image-847 { aspect-ratio: auto !important; height: auto; }
.cvf-imp-photo img.wp-image-847 { aspect-ratio: 16 / 9; object-position: 50% 30%; }
/* Photo captions and credits in the lilac features. */
.cvf-imp-feature__photo figcaption { font-size: .85rem; color: var(--cvf-ink-2, #4B5563); margin: .5rem 0 0; line-height: 1.45; }
.cvf-impact figcaption .cvf-credit { display: inline-block; font-size: .78rem; opacity: .8; }

/* Features with a landscape photo: add the class "cvf-imp-feature__photo--wide" to the image block.
   The photo is never cropped to portrait; on desktop the title runs across the card and the photo (with its caption) fills the height of the two text boxes beside it. */
.cvf-imp-feature__photo--wide img { aspect-ratio: auto !important; height: auto; contain: none !important; } /* WordPress sizes lazy images with a 3000x1500 placeholder: ignore it */
@media (min-width: 901px) {
  .cvf-impact .cvf-imp-item--feature:has(.cvf-imp-feature__photo--wide) .cvf-imp-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); row-gap: 0; column-gap: 1.75rem; }
  .cvf-imp-item--feature:has(.cvf-imp-feature__photo--wide) .cvf-imp-feature__text { display: contents; }
  .cvf-imp-item--feature:has(.cvf-imp-feature__photo--wide) :is(.cvf-imp-label, .cvf-imp-title) { grid-column: 1 / -1; }
  .cvf-imp-item--feature:has(.cvf-imp-feature__photo--wide) .cvf-imp-title { margin-bottom: 0 !important; }
  .cvf-imp-item--feature:has(.cvf-imp-feature__photo--wide) :is(.cvf-imp-step, .cvf-imp-more) { grid-column: 1; }
  .cvf-imp-item--feature:has(.cvf-imp-feature__photo--wide) .cvf-imp-step p { font-size: .95rem; }
  .cvf-impact .cvf-imp-feature__photo--wide { grid-column: 2; grid-row: 3 / 5; align-self: stretch; display: grid; grid-template-rows: minmax(0, 1fr) auto; margin-top: .75rem !important; }
  .cvf-imp-feature__photo--wide img { contain: size !important; contain-intrinsic-size: 0 0 !important; width: 100%; height: 100% !important; min-height: 0; object-fit: cover; object-position: 50% 40% !important; }
  .cvf-imp-feature__photo--wide img.wp-image-850 { object-position: 70% 50% !important; } /* keep the air filter in view */
}

/* Access Association flyer: show it whole so its title and date are not cut off. */
.cvf-imp-photo img.wp-image-861 { aspect-ratio: auto; }

/* Alternate sides: add the class "cvf-imp-item--flip" to a lilac milestone to put its photo on the left (desktop only). */
@media (min-width: 901px) {
  .cvf-impact .cvf-imp-item--flip .cvf-imp-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .cvf-imp-item--flip .cvf-imp-feature__text { grid-column: 2; grid-row: 1; }
  .cvf-imp-item--flip .cvf-imp-feature__photo { grid-column: 1; grid-row: 1; }
  .cvf-impact .cvf-imp-item--feature.cvf-imp-item--flip:has(.cvf-imp-feature__photo--wide) .cvf-imp-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .cvf-imp-item--feature.cvf-imp-item--flip:has(.cvf-imp-feature__photo--wide) :is(.cvf-imp-step, .cvf-imp-more) { grid-column: 2; }
  .cvf-impact .cvf-imp-item--flip .cvf-imp-feature__photo--wide { grid-column: 1; grid-row: 3 / 5; }
}

/* Smaller portrait photo: add the class "cvf-imp-feature__photo--small" to the image block (desktop only). */
@media (min-width: 901px) {
  .cvf-impact .cvf-imp-item--feature:has(.cvf-imp-feature__photo--small) .cvf-imp-body { grid-template-columns: minmax(0, 1.5fr) minmax(0, .7fr); }
  .cvf-impact .cvf-imp-item--feature.cvf-imp-item--flip:has(.cvf-imp-feature__photo--small) .cvf-imp-body { grid-template-columns: minmax(0, .7fr) minmax(0, 1.5fr); }
}

/* A square poster shows in full rather than cropped to the portrait photo shape. */
.cvf-imp-feature__photo--square img { aspect-ratio: 1 / 1 !important; object-fit: contain !important; }

/* Hero in the front-page style: the placard photo fades in from the right, the opening line sits beside it */
.cvf-impact .entry-content > .cvf-fade-hero { position: relative; isolation: isolate; overflow: hidden; min-height: clamp(380px, 38vw, 480px); display: flex; align-items: center; margin-top: 1.5rem !important; margin-bottom: clamp(2rem, 4vw, 3rem) !important; border-radius: var(--cvf-radius-lg, 20px); background: var(--cvf-warm-white, #FAF9F6); }
.cvf-impact .cvf-fade-hero__img { position: absolute; z-index: -1; top: 0; right: 0; width: 50%; height: 100% !important; max-width: none; object-fit: cover; object-position: 50% 42%; border-radius: 0 var(--cvf-radius-lg, 20px) var(--cvf-radius-lg, 20px) 0; -webkit-mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.4) 6%, rgba(0,0,0,.85) 13%, #000 20%); mask-image: linear-gradient(90deg, transparent 0%, rgba(0,0,0,.4) 6%, rgba(0,0,0,.85) 13%, #000 20%); }
.cvf-impact .cvf-fade-hero::before { content: ""; position: absolute; z-index: 1; left: -6%; bottom: -16%; width: 52%; height: 30%; background: var(--cvf-mauve, #E0B9E3); clip-path: polygon(0 55%, 22% 22%, 100% 0, 92% 70%, 60% 100%, 0 100%); opacity: .95; pointer-events: none; }
.cvf-impact .cvf-fade-hero__text { position: relative; z-index: 2; width: min(46%, 540px); padding: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(3rem, 5vw, 4.25rem) clamp(1.25rem, 3vw, 2.5rem); }
.cvf-impact .cvf-fade-hero__text .cvf-lead { margin: 0 !important; max-width: none; font-size: clamp(1.25rem, 1rem + .8vw, 1.6rem); line-height: 1.35; font-weight: 600; color: var(--cvf-navy, #17304A); }
@media (max-width: 760px) {
	.cvf-impact .entry-content > .cvf-fade-hero { display: block; min-height: 0; border-radius: 0; background: none; margin-top: 1.25rem !important; }
	.cvf-impact .cvf-fade-hero__img { position: relative; z-index: 0; width: 100%; height: auto !important; aspect-ratio: 4 / 3; object-position: 50% 40%; border-radius: var(--cvf-radius-lg, 20px); -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent 100%); mask-image: linear-gradient(180deg, #000 70%, transparent 100%); }
	.cvf-impact .cvf-fade-hero::before { display: none; }
	.cvf-impact .cvf-fade-hero__text { width: auto; margin-top: -.75rem; padding: 0; }
	.cvf-impact .cvf-fade-hero__text .cvf-lead { font-size: 1.2rem; }
}
