/*
 * CALIF Our Work – styles for page-templates/calif-our-work.php only.
 * Loaded by functions.php after calif-site.css (tokens, buttons, shared intro, jump links, CTA band).
 * Mobile first: base = phone, 600px = tablet, 960px = desktop. Sizes in px (OceanWP sets 1rem = 10px).
 */

.calif-our-work .calif-page-intro__media img {
	object-position: center 30%;
}

/* ---------- Category sections ---------- */

.calif-work {
	padding: var(--calif-section) 0;
}

.calif-work--ivory {
	background: var(--calif-ivory);
}

.calif-work__header {
	display: grid;
	gap: 16px;
	justify-items: start;
	margin-bottom: 32px;
}

.calif-work__heading {
	max-width: 640px;
}

.calif-work__heading p:last-child {
	margin-bottom: 0;
}

/* ---------- Mosaic gallery ----------
   Phones: 2 columns. Desktop: 3 columns with fixed row heights; items span by size. */

.calif-mosaic {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	grid-auto-rows: 170px;
	grid-auto-flow: dense;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.calif-mosaic__item {
	margin: 0;
	overflow: hidden;
}

.calif-mosaic__item--lg {
	grid-column: span 2;
	grid-row: span 2;
}

.calif-mosaic__item--wide {
	grid-column: span 2;
}

.calif-mosaic__item--tall {
	grid-row: span 2;
}

.calif-mosaic figure {
	position: relative;
	height: 100%;
	margin: 0;
}

.calif-mosaic picture {
	height: 100%;
}

.calif-our-work .calif-mosaic img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Caption over a soft gradient at the foot of each photo. */
.calif-mosaic figcaption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 36px 14px 12px;
	background: linear-gradient(0deg, rgba(22, 21, 20, 0.62) 0%, rgba(22, 21, 20, 0) 100%);
	color: var(--calif-white);
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.02em;
	line-height: 1.35;
}

@media (prefers-reduced-motion: no-preference) {
	.calif-our-work .calif-mosaic img {
		transition: transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
	}

	.calif-mosaic__item:hover img {
		transform: scale(1.03);
	}
}

/* ---------- More projects (no photos yet – text only) ---------- */

/* Follows a white section, so a brass rule (inside the gutters) separates it instead of padding. */
.calif-section--compact-top {
	padding-top: 0;
}

.calif-more-projects {
	display: grid;
	gap: 16px;
	padding-top: 48px;
	background: linear-gradient(var(--calif-brass), var(--calif-brass)) no-repeat center top / calc(100% - 2 * var(--calif-gutter)) 1px;
}

.calif-our-work .calif-more-projects h2 {
	font-size: clamp(30px, 22px + 1.6vw, 42px);
}

.calif-more-projects p {
	max-width: 620px;
}

/* Phones/tablets (2 columns): a portrait photo that would sit alone in its row (the last of a
   category) becomes a full-width square instead of leaving a hole. Its focal point keeps the
   installer's head in frame. */
@media (max-width: 959px) {
	.calif-mosaic__item--lg + .calif-mosaic__item--tall:last-child,
	.calif-mosaic__item--tall:nth-child(3):last-child {
		grid-column: span 2;
	}
}

/* ---------- Tablet ---------- */

@media (min-width: 600px) {
	.calif-mosaic {
		grid-auto-rows: 220px;
		gap: 14px;
	}
}

/* ---------- Desktop ---------- */

@media (min-width: 960px) {
	.calif-work__header {
		grid-template-columns: 1fr auto;
		align-items: end;
		gap: 48px;
		margin-bottom: 40px;
	}

	.calif-mosaic {
		grid-template-columns: repeat(3, 1fr);
		grid-auto-rows: 250px;
		gap: 16px;
	}

	.calif-mosaic figcaption {
		padding: 48px 18px 16px;
		font-size: 14px;
	}

	.calif-more-projects {
		grid-template-columns: 5fr 7fr;
		gap: 64px;
		align-items: start;
	}
}
