/* ZHI — featured off-plan
   Desktop: one big project pinned on screen; the other projects rise up over
   its lower half as the page scrolls (see assets/js/sections/featured-offplan.js).
   Phones and tablets: a normal swipe row. The "view more" button floats at the
   bottom of the screen for as long as the section is in view. */
.offplan { background: radial-gradient(70% 50% at 100% 0%, rgba(43, 179, 186, 0.14), transparent 60%), var(--navy-900); }
.offplan .section-head { margin-bottom: clamp(1.5rem, 1rem + 2vw, 2.5rem); }

.offplan__grid { display: grid; gap: var(--space-4); }
.ocard { position: relative; border-radius: var(--radius-lg); overflow: hidden; background: var(--navy-800); }
.ocard article { position: relative; height: 100%; min-height: 420px; display: flex; align-items: flex-end; padding: var(--space-3); }
.ocard__media { position: absolute; inset: 0; transition: transform 1400ms var(--ease-cinema); }
.ocard__media img { width: 100%; height: 100%; object-fit: cover; }
.ocard__media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(6, 21, 33, 0.78), transparent 60%); }
.ocard:hover .ocard__media { transform: scale(1.05); }
.ocard__panel { position: relative; width: 100%; padding: var(--space-4); border-radius: var(--radius); }
.ocard__meta { display: flex; align-items: center; gap: 0.4rem; font-size: 0.6875rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--bronze-300); margin-bottom: var(--space-2); }
.ocard__title { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.15; margin-bottom: var(--space-3); }
.ocard__meta .icon { width: 14px; height: 14px; flex: none; }
.ocard__title { margin-bottom: var(--space-2); }
.ocard__dev { margin: 0 0 var(--space-3); font-size: var(--fs-sm); color: var(--teal-300); font-weight: 500; }
.ocard__dev { position: relative; }
.ocard__dev.has-logo { padding-right: 6.5rem; }
.ocard__dev .ocard__devlogo { position: absolute; right: 0; top: 0; bottom: 0; margin: auto 0; left: auto; transform: none !important; width: auto !important; height: 1.6rem !important; max-width: 6rem; object-fit: contain !important; object-position: right center; background: #f2f2f2; border: 0; padding: 5px; border-radius: 5px; }
.ocard__photos {
	position: absolute; z-index: 3; top: var(--space-4); right: var(--space-4); display: inline-flex; align-items: center; gap: 0.4rem; height: 34px; padding: 0 0.8rem 0 0.65rem;
	border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(7, 27, 41, 0.55); color: #fff; font: inherit; font-size: 0.8125rem; font-weight: 500;
	-webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; transition: background-color 300ms;
}
.ocard__photos .icon { width: 16px; height: 16px; }
.ocard__photos:hover { background: rgba(7, 27, 41, 0.85); }
.ocard__photos:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 2px; }
.ocard__media { cursor: default; }
.ocard:has(.ocard__photos) .ocard__media { cursor: zoom-in; }
.ocard__panel { container-type: inline-size; --amen-fg: #fff; --amen-line: rgba(255, 255, 255, 0.4); --amen-hover-bg: #fff; --amen-hover-fg: var(--navy-900); }
.ocard__extra { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-top: var(--space-3); }
.ocard__extra .amen { min-width: 0; }
.ocard__details {
	flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.8rem 0 0.65rem; border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.4); background: transparent; color: #fff; font: inherit; font-size: 0.8125rem; font-weight: 500; cursor: pointer; transition: background-color 300ms, color 300ms, border-color 300ms;
}
.ocard__details .icon { width: 15px; height: 15px; }
.ocard__details:hover { background: #fff; color: var(--navy-900); border-color: #fff; }
.ocard__details:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 2px; }
.ocard__actions { display: flex; gap: 0.5rem; margin-top: var(--space-4); }
.ocard__act {
	flex: 1 1 auto; min-width: 0; height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; padding: 0 0.8rem;
	border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.4); color: #fff; font: inherit; font-size: var(--fs-sm); font-weight: 500;
	text-decoration: none; white-space: nowrap; cursor: pointer; transition: background-color 300ms, color 300ms, border-color 300ms;
}
.ocard__act .icon { width: 16px; height: 16px; flex: none; }
.ocard__act--wa { flex-grow: 1.5; background: #fff; color: var(--navy-900); border-color: #fff; }
.ocard__act:hover { background: rgba(255, 255, 255, 0.18); color: #fff; }
.ocard__act--wa:hover { background: var(--teal-300); color: var(--navy-900); border-color: var(--teal-300); }
.ocard__act:focus-visible { outline: 2px solid var(--teal-300); outline-offset: 2px; }
.ocard__facts { display: grid; grid-template-columns: repeat(3, minmax(0, auto)); gap: var(--space-3) var(--space-4); justify-content: start; padding-top: var(--space-3); border-top: 1px solid rgba(255, 255, 255, 0.16); }
.ocard__facts dt { font-size: 0.625rem; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255, 255, 255, 0.65); margin-bottom: 0.2rem; }
.ocard__facts dd { font-size: var(--fs-sm); font-weight: 500; white-space: nowrap; }

/* Floating "view more" bar: sticks to the bottom of the screen while the
   section is in view, then settles under the cards. */
.offplan__cta {
	position: sticky; bottom: max(1rem, env(safe-area-inset-bottom)); z-index: 6;
	display: flex; justify-content: center; margin-top: var(--space-5); pointer-events: none;
}
.offplan__cta .btn { pointer-events: auto; box-shadow: 0 14px 36px -8px rgba(0, 0, 0, 0.55); }

/* Desktop, no scripting or reduced motion: a plain grid, big project on top, the rest below. */
@media (min-width: 900px) {
	.offplan__grid { --cols: 3; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--space-5); }
	.offplan__grid[data-cards="2"] { --cols: 1; }
	.offplan__grid[data-cards="3"] { --cols: 2; }
	.ocard--feature { grid-column: 1 / -1; }
	.ocard--feature article { min-height: clamp(420px, 40vw, 520px); padding: var(--space-5); align-items: flex-start; }
	.ocard--feature .ocard__panel { max-width: 520px; padding: var(--space-5); }
	.ocard--stack article { min-height: 420px; }
}

/* Desktop with motion: the big project is pinned on screen, then fades away
   as the other projects rise to take its place at full height.
   (JavaScript sets --t on each rising card and --v on the big one; see
   assets/js/sections/featured-offplan.js.) */
@media (min-width: 900px) and (prefers-reduced-motion: no-preference) {
	.js .offplan__stage { --pin-h: clamp(30rem, calc(100svh - var(--header-h) - 8.5rem), 42rem); height: calc(var(--pin-h) + 170vh); }
	.js .offplan__pin { position: sticky; top: calc(var(--header-h) + 12px); height: var(--pin-h); border-radius: 24px; overflow: hidden; }
	.js .offplan__grid { height: 100%; gap: var(--space-4); padding: var(--space-4); grid-template-rows: minmax(0, 1fr); }
	.js .offplan__grid[data-cards="1"] { grid-template-columns: 1fr; }
	.js .ocard--feature {
		grid-row: 1; margin: calc(var(--space-4) * -1); border-radius: 0;
		opacity: calc(1 - var(--v, 0)); transform: scale(calc(1 - var(--v, 0) * 0.05)); will-change: transform, opacity;
	}
	.js .ocard--feature article { min-height: 0; padding: var(--space-6); }
	.js .ocard--feature .ocard__media::after { background: linear-gradient(to bottom, rgba(6, 21, 33, 0.55), transparent 55%); }
	.js .ocard--stack:nth-child(2) { grid-column: 1; }
	.js .ocard--stack:nth-child(3) { grid-column: 2; }
	.js .ocard--stack:nth-child(4) { grid-column: 3; }
	.js .ocard--stack {
		grid-row: 1; z-index: 2; box-shadow: 0 24px 50px -16px rgba(0, 0, 0, 0.6);
		transform: translate3d(0, calc((1 - var(--t, 0)) * 115%), 0); opacity: calc(var(--t, 0) * 2); will-change: transform;
	}
	.js .ocard--stack article { min-height: 0; padding: var(--space-4); }
	.js .ocard--feature .ocard__media { transform: scale(calc(1 + var(--p, 0) * 0.06)); }
}

/* Tablet: feature card on top, the rest below */
@media (min-width: 600px) and (max-width: 899px) {
	.offplan__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ocard--feature { grid-column: 1 / -1; }
	.ocard--feature article { min-height: 460px; }
}
@media (max-width: 599px) {
	.ocard__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 284px) {
	.ocard__act--mail, .ocard__act--call { flex: 0 0 44px; padding: 0; }
	.ocard__lbl { display: none; }
}
@media (max-width: 759px) {
	.ocard--feature { grid-column: auto; grid-row: auto; }
	.ocard article, .ocard--feature article { min-height: 400px; }
}

/* Long, multi-paragraph intros: align the heading with the first line of text */
@media (min-width: 900px) { .offplan .section-head--top { align-items: start; } }