/*
 * Close the Gap blocks.
 *
 * Everything sits inside one :is(body, #ctg) block (native CSS nesting). It always matches, but it
 * counts as an ID, so these rules out-rank the pillar theme's ".page.page.page h1/p/a/main" rules
 * without !important. Scoped under .ctg so nothing leaks out to the rest of the site.
 */

:is(body, #ctg) {

	& .ctg {
		--navy: #05374e;
		--navy-deep: #032636;
		--navy-ink: #021b27;
		--green: #c8da5b;
		--green-soft: #e4edaa;
		--green-rgb: 200, 218, 91;
		--mist: #f1f4f6;
		--rule: #dbe3e8;
		--ink: #13232b;
		--ink-soft: #4a5d66;
		--display: "Oswald", "Arial Narrow", sans-serif;
		--body: "Source Sans 3", system-ui, sans-serif;
		--wrap: 1180px;
		font-family: var(--body);
		font-size: 18px;
		line-height: 1.6;
		color: var(--ink);
		-webkit-font-smoothing: antialiased;
	}
	& .ctg *,
	& .ctg *::before,
	& .ctg *::after { box-sizing: border-box; }
	& .ctg p,
	& .ctg li { font-family: inherit; font-size: inherit; line-height: inherit; letter-spacing: inherit; }
	& .ctg a { color: inherit; text-decoration: none; }
	& .ctg .lead a,
	& .ctg .body a { text-decoration: underline; }
	& main.ctg-page { width: auto; max-width: none; margin: 0; padding: 0; }
	& .ctg-page > .ctg { width: auto; max-width: none; margin: 0; }
	& .ctg img { display: block; max-width: 100%; }
	& .ctg p { margin: 0 0 18px; }
	& .ctg h1,
	& .ctg h2,
	& .ctg h3 { font-family: var(--display); color: inherit; }
	& .ctg .ctg-wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
	& .ctg .eyebrow {
		font-family: var(--display); font-weight: 500; text-transform: uppercase; letter-spacing: .18em;
		font-size: 14px; line-height: 1.4; color: var(--green); margin: 0 0 14px;
	}

	/* Buttons (override Hello Elementor's reset + kit button styles) */
	& .ctg .ctg-btn {
		display: inline-flex; align-items: center; justify-content: center; gap: 10px;
		font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .12em; font-size: 17px; line-height: 1.2;
		padding: 18px 30px; border-radius: 4px; text-decoration: none; border: 2px solid transparent; cursor: pointer;
		transition: transform .15s ease, background-color .15s ease;
	}
	& .ctg .ctg-btn:hover { transform: translateY(-1px); text-decoration: none; }
	& .ctg .ctg-btn-light,
	& .ctg .ctg-btn-light:hover,
	& .ctg .ctg-btn-light:focus { color: var(--navy); }
	& .ctg .ctg-btn-light { background: #fff; }
	& .ctg .ctg-btn-light:hover { background: var(--green-soft); }
	& .ctg .ctg-btn-navy,
	& .ctg .ctg-btn-navy:hover,
	& .ctg .ctg-btn-navy:focus { color: #fff; }
	& .ctg .ctg-btn-navy { background: var(--navy); }
	& .ctg .ctg-btn-navy:hover { background: var(--navy-deep); }

	& .ctg .ctg-sr {
		position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
		overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
	}

	/* Editor-only helpers */
	& .ctg-notice {
		margin: 0 0 12px; padding: 12px 16px; background: #fff4e5; border-left: 4px solid #e08a00; font: 14px/1.4 system-ui, sans-serif; color: #3b2a00;
	}
	& .ctg .ctg-placeholder {
		display: grid; place-items: center; background: #dfe6ea; color: var(--ink-soft); font-size: 14px; aspect-ratio: 3 / 2;
	}

	/* ------------------------------------------------------------------ HERO */
	& .ctg-hero { position: relative; color: #fff; background: var(--navy-ink); overflow: hidden; isolation: isolate; }
	& .ctg-hero::before {
		content: ""; position: absolute; inset: 0; z-index: -2;
		background: var(--bg, none) center 40% / cover no-repeat;
		filter: grayscale(.4) blur(1px); transform: scale(1.03);
	}
	& .ctg-hero::after {
		content: ""; position: absolute; inset: 0; z-index: -1;
		background:
		linear-gradient(90deg, rgba(3,38,54,.97) 0%, rgba(5,55,78,.88) 48%, rgba(5,55,78,.72) 100%),
		linear-gradient(0deg, rgba(2,27,39,.9) 0%, rgba(2,27,39,0) 45%);
	}
	& .ctg-hero .hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 64px; align-items: center; padding: 96px 0 56px; }
	& .ctg-hero h1 {
		font-weight: 700; text-transform: uppercase; line-height: .88; letter-spacing: .01em; color: #fff;
		font-size: clamp(64px, 9vw, 124px); margin: 0 0 88px;
	}
	& .ctg-hero h1 .line { display: flex; align-items: stretch; }

	/* The dash is the gap: its length tracks the amount remaining (set inline as --dash) */
	& .ctg-hero .gap-slot { position: relative; flex: none; width: calc(var(--dash) + .26em); }
	& .ctg-hero .gap-slot .dash {
		position: absolute; left: .13em; right: .13em; top: 46%; height: .1em; margin-top: -.05em;
		background: var(--green); border-radius: 3px; box-shadow: 0 0 24px rgba(var(--green-rgb), .35);
	}
	& .ctg-hero .gap-slot .tick {
		position: absolute; left: 50%; top: calc(46% + .08em); bottom: -12px; width: 1px;
		background: linear-gradient(rgba(var(--green-rgb), .6), rgba(var(--green-rgb), 0));
		transition: opacity .6s ease;
	}
	& .ctg-hero .gap-slot .gap-amt {
		position: absolute; left: 50%; top: calc(100% + 18px); transform: translateX(-50%);
		font-size: 20px; font-weight: 600; letter-spacing: .14em; line-height: 1; white-space: nowrap; color: var(--green);
		transition: opacity .6s ease, transform .6s ease;
	}
	& .ctg-hero .gap-slot .gap-amt b { font-weight: 700; color: #fff; letter-spacing: .04em; font-size: 26px; margin-right: 6px; }
	& .ctg-hero.is-complete .gap-slot .dash,
	& .ctg-hero.is-complete .gap-slot .tick { opacity: 0; }

	/* Motion (only once the script is running; see pillar_ctg_js_flag) */
	.ctg-js & .ctg-hero .gap-slot { width: calc(var(--dash-start) + .26em); }
	.ctg-js & .ctg-hero.is-complete .gap-slot .dash { opacity: 1; }
	.ctg-js & .ctg-hero .gap-slot.is-shrinking { width: calc(var(--dash) + .26em); transition: width 2.6s cubic-bezier(.5, 0, .2, 1); }
	.ctg-js & .ctg-hero .gap-slot:not(.is-settled) .gap-amt { opacity: 0; transform: translate(-50%, 6px); }
	.ctg-js & .ctg-hero .gap-slot:not(.is-settled) .tick { opacity: 0; }
	.ctg-js & .ctg-hero.is-complete .gap-slot.is-settled .dash { opacity: 0; transition: opacity .3s ease; }

	& .ctg-hero .lead { font-size: 20px; line-height: 1.6; color: rgba(255,255,255,.86); max-width: 34em; margin: 0 0 28px; }
	& .ctg-hero .lead p { margin: 0 0 12px; }
	& .ctg-hero .lead strong { color: #fff; }
	& .ctg-hero .period { display: flex; gap: 24px; flex-wrap: wrap; font-size: 15px; color: rgba(255,255,255,.7); }
	& .ctg-hero .period b {
		display: block; font-family: var(--display); font-weight: 500; letter-spacing: .14em; text-transform: uppercase; font-size: 12px; color: var(--green);
	}

	& .ctg-hero .hero-card {
		background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16); border-radius: 6px;
		padding: 36px 36px 32px; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
	}
	& .ctg-hero .hero-card .only {
		font-family: var(--display); text-transform: uppercase; letter-spacing: .2em; font-size: 15px; color: var(--green);
	}
	& .ctg-hero .hero-card .big {
		font-family: var(--display); font-weight: 700; font-size: clamp(60px, 7vw, 92px); line-height: 1; margin: 6px 0 8px;
		font-variant-numeric: tabular-nums; letter-spacing: -.01em;
	}
	& .ctg-hero .hero-card .sub { color: rgba(255,255,255,.8); margin: 0 0 24px; font-size: 18px; }
	& .ctg-hero .hero-card .days {
		display: flex; align-items: center; gap: 14px; padding: 16px 0; border-top: 1px solid rgba(255,255,255,.14); margin-bottom: 24px;
		font-size: 16px; line-height: 1.4; color: rgba(255,255,255,.8);
	}
	& .ctg-hero .hero-card .days-num { font-family: var(--display); font-size: 34px; font-weight: 600; color: #fff; line-height: 1; }
	& .ctg-hero .hero-card .ctg-btn { width: 100%; }

	/* Progress */
	& .ctg-hero .progress { padding: 8px 0 72px; }
	& .ctg-hero .progress-head {
		display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap;
	}
	& .ctg-hero .progress-head .raised { font-family: var(--display); font-size: 28px; font-weight: 600; line-height: 1; }
	& .ctg-hero .progress-head .raised small { font-family: var(--body); font-size: 16px; font-weight: 400; color: rgba(255,255,255,.7); margin-left: 8px; }
	& .ctg-hero .progress-head .goal {
		font-family: var(--display); letter-spacing: .14em; text-transform: uppercase; font-size: 15px; color: rgba(255,255,255,.75);
	}
	& .ctg-hero .bar {
		position: relative; height: 26px; border-radius: 3px; overflow: hidden; display: flex;
		background: repeating-linear-gradient(-45deg, rgba(var(--green-rgb), .22) 0 6px, rgba(var(--green-rgb), .06) 6px 12px);
		box-shadow: inset 0 0 0 1px rgba(var(--green-rgb), .4);
	}
	& .ctg-hero .bar .seg { height: 100%; }
	& .ctg-hero .bar .seg-start { background: #fff; width: var(--start-pct, 0); }
	& .ctg-hero .bar .seg-campaign { background: var(--green); width: var(--campaign-pct, 0); }
	& .ctg-hero .fan { position: relative; height: 112px; }
	& .ctg-hero .connector { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
	& .ctg-hero .connector polygon { fill: rgba(var(--green-rgb), .1); }
	& .ctg-hero .connector line {
		stroke: rgba(var(--green-rgb), .55); stroke-width: 1; vector-effect: non-scaling-stroke; stroke-dasharray: 3 4;
	}
	& .ctg-hero .legend {
		position: absolute; left: 0; top: 14px; display: flex; gap: 22px; flex-wrap: wrap; font-size: 14px; color: rgba(255,255,255,.7);
	}
	& .ctg-hero .key {
		display: inline-block; width: 12px; height: 12px; border-radius: 2px; margin-right: 8px; vertical-align: -1px;
	}
	& .ctg-hero .key-start { background: #fff; }
	& .ctg-hero .key-campaign { background: var(--green); }
	& .ctg-hero .key-gap {
		background: repeating-linear-gradient(-45deg, rgba(var(--green-rgb), .7) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--green);
	}
	& .ctg-hero .zoom {
		border: 1px solid rgba(var(--green-rgb), .4); border-radius: 0 0 6px 6px; padding: 22px 24px 20px; background: rgba(2,27,39,.45);
	}
	& .ctg-hero .zoom-title { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
	& .ctg-hero .zoom-title h2 {
		margin: 0; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; font-size: 15px; line-height: 1.4; color: var(--green);
	}
	& .ctg-hero .zoom-title p { margin: 0; font-size: 15px; color: rgba(255,255,255,.75); }
	& .ctg-hero .zoom-bar {
		height: 48px; border-radius: 3px; position: relative; overflow: hidden;
		background: repeating-linear-gradient(-45deg, rgba(var(--green-rgb), .22) 0 8px, rgba(var(--green-rgb), .06) 8px 16px);
		box-shadow: inset 0 0 0 1px rgba(var(--green-rgb), .4);
	}
	& .ctg-hero .zoom-bar .fill { position: absolute; inset: 0 auto 0 0; width: var(--gap-closed, 0); background: var(--green); }
	& .ctg-hero .zoom-legend {
		display: flex; justify-content: space-between; gap: 16px; margin-top: 12px; font-size: 15px; color: rgba(255,255,255,.8); flex-wrap: wrap;
	}
	& .ctg-hero .zoom-legend b {
		color: #fff; font-family: var(--display); font-weight: 600; font-size: 20px; letter-spacing: .02em; margin-right: 6px;
	}

	.ctg-js & .ctg-hero:not(.is-ready) .bar .seg,
	.ctg-js & .ctg-hero:not(.is-ready) .zoom-bar .fill { width: 0; }
	.ctg-js & .ctg-hero .bar .seg,
	.ctg-js & .ctg-hero .zoom-bar .fill { transition: width 1.8s cubic-bezier(.2, .7, .1, 1); }
	.ctg-js & .ctg-hero .bar .seg-campaign { transition-delay: .6s; }
	.ctg-js & .ctg-hero .zoom-bar .fill { transition-delay: .9s; }

	& .ctg-hero .confetti { position: absolute; inset: 0; pointer-events: none; z-index: 2; }

	/* ------------------------------------------------------------------ WHY */
	& .ctg-why { background: #fff; padding: 104px 0; }
	& .ctg-why .why-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
	& .ctg-why .photo-stack { position: relative; padding: 0 0 72px; }
	& .ctg-why .photo-stack .main {
		width: 88%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 4px; box-shadow: 0 20px 50px rgba(5,55,78,.18);
	}
	& .ctg-why .photo-stack .inset {
		position: absolute; right: 0; bottom: 0; width: 52%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 4px;
		border: 8px solid #fff; box-shadow: 0 16px 40px rgba(5,55,78,.2);
	}
	& .ctg-why .photo-stack .tag {
		position: absolute; left: 20px; bottom: 96px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 3px;
		font-family: var(--display); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; line-height: 1.4;
	}
	& .ctg-why h2 {
		font-weight: 700; text-transform: uppercase; font-size: clamp(36px, 4vw, 52px); line-height: 1; margin: 0 0 22px; color: var(--navy);
	}
	& .ctg-why .eyebrow { color: var(--navy); opacity: .7; }
	& .ctg-why .body p { color: var(--ink-soft); margin: 0 0 18px; }
	& .ctg-why .checks { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 14px; }
	& .ctg-why .checks li {
		display: grid; grid-template-columns: 28px 1fr; gap: 12px; align-items: start; font-weight: 600; color: var(--ink); margin: 0;
	}
	& .ctg-why .checks li::before {
		content: ""; width: 24px; height: 24px; margin-top: 2px; border-radius: 50%;
		background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 14px no-repeat;
	}

	/* ------------------------------------------------------------------ GIVE */
	& .ctg-give {
		background: var(--navy); color: #fff; padding: 96px 0; position: relative; overflow: hidden; scroll-margin-top: 40px;
	}
	& .ctg-give::before {
		content: ""; position: absolute; right: -120px; top: -120px; width: 480px; height: 480px; border-radius: 50%;
		border: 70px solid rgba(var(--green-rgb), .07);
	}
	& .ctg-give .give-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; align-items: center; position: relative; }
	& .ctg-give h2 {
		font-weight: 700; text-transform: uppercase; font-size: clamp(40px, 5vw, 64px); line-height: .95; margin: 0 0 20px; color: #fff;
	}
	& .ctg-give .give-grid > div:first-child > p:not(.eyebrow) { color: rgba(255,255,255,.8); margin: 0; max-width: 30em; }
	& .ctg-give .give-box {
		background: #fff; color: var(--ink); border-radius: 6px; padding: 32px; box-shadow: 0 30px 60px rgba(0,0,0,.25);
	}
	& .ctg-give .give-box h3 {
		margin: 0 0 16px; text-transform: uppercase; letter-spacing: .14em; font-size: 15px; font-weight: 500; line-height: 1.4; color: var(--ink-soft);
	}
	& .ctg-give .amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 16px; }
	& .ctg-give .amounts button,
	& .ctg-give .amounts button:focus {
		font-family: var(--display); font-size: 22px; font-weight: 600; line-height: 1.2; padding: 14px 8px; border-radius: 4px;
		border: 2px solid var(--rule); background: #fff; color: var(--navy); cursor: pointer; transition: all .15s ease;
	}
	& .ctg-give .amounts button:hover { border-color: var(--navy); background: #fff; color: var(--navy); }
	& .ctg-give .amounts button[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
	& .ctg-give .impact {
		background: var(--mist); border-radius: 4px; padding: 14px 16px; font-size: 16px; color: var(--ink-soft); margin-bottom: 18px;
	}
	& .ctg-give .impact b { color: var(--navy); }
	& .ctg-give .give-box .ctg-btn { width: 100%; }
	& .ctg-give .give-box .fine { font-size: 13px; color: var(--ink-soft); text-align: center; margin: 12px 0 0; }

	/* ------------------------------------------------------------------ VERSE */
	& .ctg-verse { padding: 96px 0; text-align: center; background: var(--mist); }
	& .ctg-verse blockquote {
		margin: 0 auto; padding: 0; border: 0; max-width: 860px; font-size: clamp(22px, 2.4vw, 30px); line-height: 1.45;
		font-style: italic; color: var(--navy); quotes: none;
	}
	& .ctg-verse cite {
		display: block; margin-top: 20px; font-style: normal; font-family: var(--display); text-transform: uppercase; letter-spacing: .18em; font-size: 14px; color: var(--ink-soft);
	}

	/* ------------------------------------------------------------------ SMALLER SCREENS */
	@media (max-width: 960px) {
		& .ctg-hero .hero-grid,
		& .ctg-why .why-grid,
		& .ctg-give .give-grid { grid-template-columns: 1fr; gap: 40px; }
		& .ctg-hero .hero-grid { padding-top: 64px; }
		& .ctg-why { padding: 72px 0; }
	}
	@media (max-width: 560px) {
		& .ctg { font-size: 17px; }
		& .ctg .ctg-wrap { width: calc(100% - 32px); }
		& .ctg-hero .hero-card { padding: 26px 22px; }
		& .ctg-give .amounts { grid-template-columns: repeat(2, 1fr); }
		& .ctg-give .give-box { padding: 24px 20px; }
		& .ctg-hero .zoom { padding: 18px 16px; }
	}

	@media (prefers-reduced-motion: reduce) {
		.ctg-js & .ctg-hero .gap-slot { width: calc(var(--dash) + .26em); }
		.ctg-js & .ctg-hero *,
		.ctg-js & .ctg-hero *::before { transition: none !important; }
	}
}
