/*
 * commitments.css
 * Independent clean-room implementation from a written spec (no source
 * file was read to produce this). Homepage "why us" / commitments
 * section: a numbered list of promises with a connecting vertical
 * line, plus an image column.
 *
 * The double-underscore selectors ("__grid", "__list", "__media") are
 * kept alongside the single-hyphen ones for parity with the spec, but
 * no template in this theme emits them today -- only the hyphenated
 * names are live.
 *
 * 2026-09-12 "commitment steps = option B" (skin/commitment-b): owner
 * picked option B from the 4-way commitment-steps mock -- the numbered
 * circle is now outlined (not filled) with the number itself in the
 * accent color, the connecting line between items is dotted instead of
 * solid, and each item's body copy is muted. Only .ocf-commitment-num,
 * the ::before connector, and .ocf-commitment p changed; markup is
 * untouched (CSS-only, per the option's own engine_note).
 */

.ocf-commitments {
	background: var(--ocf-bg-alt);
}

.ocf-commitments-grid,
.ocf-commitments__grid {
	gap: clamp(2rem, 6vw, 4rem);
	grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
	/*
	 * 2026-09-15 process-image-size fix: was `start` (top-anchored). Now that
	 * the image frame below is capped below its column's full width (see
	 * .ocf-commitments-image-wrap's --ocf-commitments-image-max), a
	 * top-anchored, shorter frame left a gap under it that read as
	 * unbalanced against the three-item commitment list beside it. Centering
	 * matches Gallery's own commitments-grid override (looks/gallery.css),
	 * which already does this.
	 */
	align-items: center;
	display: grid;
}

.ocf-commitments-content {
	gap: clamp(1.85rem, 3vw, 2.4rem);
	display: grid;
}

.ocf-commitments-description {
	max-width: 58ch;
	margin: 1rem 0 0;
}

.ocf-commitments-list,
.ocf-commitments__list {
	gap: 0;
	display: grid;
}

.ocf-commitments .ocf-commitments-list,
.ocf-commitments .ocf-commitments__list {
	position: relative;
}

.ocf-commitment {
	padding: 1.2rem 0;
	background: transparent;
	border: 0;
	gap: clamp(1rem, 2vw, 1.35rem);
	grid-template-columns: auto 1fr;
	align-items: start;
	display: grid;
}

.ocf-commitment:first-child {
	padding-top: 0;
}

.ocf-commitment:last-child {
	padding-bottom: 0;
}

.ocf-commitments .ocf-commitment {
	position: relative;
}

.ocf-commitments .ocf-commitment:not(:last-child)::before {
	background: none;
	border-left: 2px dotted var(--ocf-border-light);
	width: 0;
	left: calc(1.625rem - 1px);
	bottom: calc(-1.2rem - 1px);
	top: calc(3.25rem - 1px);
	z-index: 2;
	position: absolute;
	content: "";
}

.ocf-commitments .ocf-commitment:not(:last-child)::after {
	background: var(--ocf-border-light);
	height: 1px;
	left: calc(3.25rem + clamp(1rem, 2vw, 1.35rem));
	bottom: -1px;
	right: 0;
	z-index: 3;
	position: absolute;
	content: "";
}

.ocf-commitment + .ocf-commitment {
	border-top: 1px solid var(--ocf-border-light);
}

.ocf-commitment-num {
	line-height: 1;
	font-weight: var(--font-weight-bold);
	font-size: var(--font-h3-size);
	color: var(--ocf-primary);
	background: var(--ocf-bg);
	border: 2px solid var(--ocf-primary);
	border-radius: var(--radius-full);
	block-size: 3.25rem;
	inline-size: 3.25rem;
	place-items: center;
	display: inline-grid;
	z-index: 3;
	position: relative;
}

.ocf-commitment h3 {
	font-weight: var(--font-weight-bold);
	font-size: var(--font-h3-size);
	color: var(--ocf-heading);
	margin: 0 0 0.35rem;
}

.ocf-commitment p {
	color: color-mix(in srgb, var(--ocf-body) 70%, var(--ocf-bg));
	margin: 0;
}

.ocf-commitments-image,
.ocf-commitments__media {
	box-shadow: var(--image-shadow);
	background: var(--ocf-bg);
	border-radius: var(--image-radius);
	border: var(--card-border-width) solid var(--card-border-color);
	overflow: hidden;
}

/*
 * 2026-09-15 process-image-size fix (owner: the frame is "too large on the
 * template -- every future site should get an image that is slightly
 * smaller than this one, only a tiny bit", live on the Bold-look Top View
 * Roofing site). Bold/Craftsman/Friendly all reuse this shared frame with no
 * size override of their own (only Gallery does, with its own portrait/
 * landscape .ocf-commitments-image img rule above, untouched here), so one
 * change here reaches all three. --ocf-commitments-image-max is the one
 * token to tune: 91% is an ~9% reduction from the frame's previous full-
 * column width, inside the 8-10% the owner asked for. justify-self: start
 * keeps the now-narrower frame anchored to the inner (text-side) edge of its
 * grid column, matching how it already sat before shrinking, rather than
 * stretching or re-centering inside the column.
 */
.ocf-commitments-image-wrap {
	--ocf-commitments-image-max: 91%;
	max-width: var(--ocf-commitments-image-max);
	justify-self: start;
}

/*
 * 2026-09-15 process-image-ratio fix: this section has no photo slot of its
 * own (see parts/home-commitments.php's $photo docblock) -- it reuses the
 * home page's own hero photo, requested at the fixed oneclick_img_at()
 * 1024x683 crop, which is a 3:2 landscape. A 1:1 frame forced that 3:2
 * source through object-fit:cover, cropping away roughly a third of the
 * image's width on every Bold/Craftsman/Friendly-look build (measured live,
 * 466c7c13-top-view-roofing-and-restoration.sites.ruufpro.com, Bold look) --
 * the reused photo "doesn't look the right size" because most of it isn't
 * shown. The frame ratio now matches the exact size the photo is requested
 * at, so object-fit:cover only scales, it never crops. (Gallery is the one
 * look that intentionally departs from this frame with its own portrait/
 * landscape override further down the cascade in looks/gallery.css --
 * left untouched.)
 */
.ocf-commitments-image img,
.ocf-commitments__media img {
	object-fit: cover;
	aspect-ratio: 1024 / 683;
	width: 100%;
}

@media (max-width: 860px) {
	.ocf-commitments-grid,
	.ocf-commitments__grid {
		grid-template-columns: 1fr;
	}
}
