/**
 * nc/all-plans — all available floor plans grouped by series.
 *
 * The markup reuses the shared .sd-cgrid / .sd-cplans / .sd-pcard classes (in
 * assets/css/sd.css) so the header, cards, eyebrow, gold divider and pill buttons
 * already match the Figma "Move-In Plans" mockup. Only this block's deltas live here:
 * the section background, the between-series rhythm, the gradient series headings and
 * the fixed 3-up card grid.
 */

/* Section background, matching the sibling community-plans / homes sections. */
.sd-aplans {
	background-color: #faf8f5;
}

.sd-aplans .sd-cgrid__inner {
	max-width: 1440px; /* 1200px content row + a 24px gutter each side */
	margin: 0 auto;
}

/* Figma spacing: ~64px header → first series, ~120px between series groups. */
.sd-aplans .sd-cplans__group {
	margin-top: clamp( 56px, 9vw, 80px );
	padding-top: 0;
}

.sd-aplans .sd-cplans__group:first-of-type {
	margin-top: clamp( 40px, 5vw, 64px );
}

/* Figma: series headings use the brand gradient (community-plans renders them dark).
   The shared rule sets `background: none !important`, so the gradient needs !important. */
.sd-aplans .sd-cplans__series {
	background: var( --sd-gradient-brand ) !important;
	-webkit-background-clip: text !important;
	background-clip: text !important;
	-webkit-text-fill-color: transparent;
	color: transparent;
	font-size: clamp( 2rem, 4vw, 3rem );
	font-weight: 700;
	line-height: 1;
	margin: 0 auto 34px;
	text-transform: capitalize;
	width: fit-content;
}

/* Figma grid: three 384px cards with 24px gutters, centered in a 1200px row. Keeps the
   shared flex layout (so the breakpoints stay consistent) but tightens the gutter from
   30px to the mockup's 24px and recomputes the card basis to match. */
.sd-aplans .sd-cgrid__grid {
	max-width: 1440px;
	margin: 0 auto;
	gap: 24px;
}

.sd-aplans .sd-cgrid__grid > .sd-pcard {
	flex: 0 0 calc( ( 100% - 48px ) / 3 );
	max-width: calc( ( 100% - 48px ) / 3 );
}

@media ( max-width: 1024px ) {
	.sd-aplans .sd-cgrid__grid > .sd-pcard {
		flex-basis: calc( ( 100% - 24px ) / 2 );
		max-width: calc( ( 100% - 24px ) / 2 );
	}
}

@media ( max-width: 600px ) {
	.sd-aplans .sd-cgrid__grid > .sd-pcard {
		flex-basis: 100%;
		max-width: 100%;
	}
}

/* ── Share popup (opened by the card Share button; markup injected by view.js) ──── */

/* Scroll-lock the page while the modal is open. */
html.sd-share-lock {
	overflow: hidden;
}

.sd-share[hidden] {
	display: none;
}

.sd-share {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.sd-share__overlay {
	position: absolute;
	inset: 0;
	background: rgba( 31, 36, 46, 0.55 );
}

.sd-share__dialog {
	position: relative;
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
	padding: 28px 24px;
	background: #fff;
	border-radius: 20px;
	box-shadow: 0 12px 40px rgba( 0, 0, 0, 0.25 );
	font-family: 'Lexend', sans-serif;
	animation: sd-share-in 0.18s ease-out;
}

@keyframes sd-share-in {
	from { transform: translateY( 12px ); opacity: 0; }
	to   { transform: translateY( 0 ); opacity: 1; }
}

.sd-share__close {
	position: absolute;
	top: 12px;
	right: 14px;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	color: #737a87;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.sd-share__close:hover,
.sd-share__close:focus-visible {
	background: #f6f4ee;
	color: #1f242e;
	outline: none;
}

.sd-share__title {
	margin: 0 0 18px;
	font-size: 1.25rem;
	font-weight: 700;
	color: #1f242e;
}

.sd-share__copy {
	display: flex;
	gap: 8px;
	margin: 0 0 16px;
}

.sd-share__url {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	font-family: 'Lexend', sans-serif;
	font-size: 0.875rem;
	color: #1f242e;
	background: #f6f4ee;
	border: 0.5px solid #c8c8c8;
	border-radius: 20px;
}

.sd-share__copy-btn {
	flex: 0 0 auto;
	height: 40px;
	padding: 0 18px;
	font-family: 'Lexend', sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	color: #fff;
	background: #ea6e24;
	border: 0;
	border-radius: 20px;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.sd-share__copy-btn:hover,
.sd-share__copy-btn:focus-visible {
	background: #d75b14;
	outline: none;
}

.sd-share__copy-btn.is-copied {
	background: #2e7d4f;
}

.sd-share__opts {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sd-share__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	padding: 0 18px;
	font-size: 0.875rem;
	font-weight: 700;
	text-decoration: none;
	color: #1f242e;
	background: #faf8f5;
	border: 0.5px solid #a5a7ab;
	border-radius: 20px;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.sd-share__opt:hover,
.sd-share__opt:focus-visible {
	border-color: #1f242e;
	outline: none;
}

.sd-share__opt svg {
	flex: 0 0 auto;
}

.sd-share__opt--fb svg {
	color: #1877f2;
}

.sd-share__opt--fb:hover,
.sd-share__opt--fb:focus-visible {
	background: #1877f2;
	border-color: #1877f2;
	color: #fff;

}

.sd-share__opt--fb:hover svg, .sd-share__opt--fb:focus-visible svg {
    color: #fff;
}

.sd-share__opt--email:hover,
.sd-share__opt--email:focus-visible {
	background: #ea6e24;
	border-color: #ea6e24;
	color: #fff;
}

@media ( prefers-reduced-motion: reduce ) {
	.sd-share__dialog {
		animation: none;
	}
}

/* ─────────────────────────────────────────────────────────────────────────────
   Community branding — moved from the top-right corner (where it stacked under the
   pennant flag and crowded the status badges) to the BOTTOM-LEFT of the photo, so
   status (top) and branding (bottom) read as separate tiers and never overlap.
   ───────────────────────────────────────────────────────────────────────────── */
.sd-cplans .sd-pcard--plan .sd-pcard__community-badge {
	top: 25px;
	right: 14px;
	bottom: auto;
	left: auto;
	max-width: calc( 100% - 28px );
}

/* Larger corner pennant flag (top-right) so the status graphic reads clearly. */
.sd-cplans .sd-pcard--plan .sd-pcard__flag {
	width: 140px;
}

/* Logo variant: a white rounded chip holding the community logo (cleaner + more
   recognizable than the uppercase name). Sized by height so wide or tall logos
   both sit neatly; the name pill is the fallback when a community has no logo. */
.sd-pcard--plan .sd-pcard__community-badge--logo {
	display: inline-flex;
	align-items: center;
	padding: 4px 4px;
	background: rgba( 255, 255, 255, 0.92 );
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba( 31, 36, 46, 0.14 );
	overflow: visible;
}

.sd-pcard--plan .sd-pcard__community-badge--logo img {
	display: block;
	height: 24px;
	width: auto;
	max-width: 120px;
	object-fit: contain;
}

/* ─────────────────────────────────────────────────────────────────────────────
   "Available in" — ONLY on the grouped all-plans card (.sd-aplans__card, built by
   sd_aplans_card_html() in this block's render.php). Scoped under .sd-aplans so it
   can never reach nc/community-plans' own cards even if both blocks sit on the same
   page. Plain inline text links, comma-separated (not buttons/pills/chips) — each
   one is that community's own plan-page URL, underlined like a normal text link so
   it still reads as clickable, with the brand orange on hover, matching the
   .sd-pcard__payment "View details" link elsewhere on this same card family.
   ───────────────────────────────────────────────────────────────────────────── */
.sd-aplans .sd-aplans__card .sd-pcard__info {
	display: flex;
	flex-direction: column;
}

.sd-aplans .sd-aplans__communities {
	/* Sits in normal flow, right after the meta stats; .sd-pcard__actions (below it)
	   already carries its own margin-top: auto, so the View/Download/Share/Contact row
	   still lands on the same bottom edge across every card regardless of how many
	   communities a given plan lists. */
	margin: 0;
	padding-top: 14px;
	font-family: var( --sd-font-display );
	font-size: 0.8rem;
	line-height: 1.5;
	color: var( --sd-color-dark );
}

.sd-aplans .sd-aplans__communities-label {
	font-weight: 600;
	color: #8a8f98;
}

.sd-aplans .sd-aplans__community-link {
	color: var( --sd-color-dark );
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.15s ease;
}

.sd-aplans .sd-aplans__community-link:hover,
.sd-aplans .sd-aplans__community-link:focus-visible {
	color: var( --sd-color-orange );
}

.sd-aplans .sd-aplans__community-link:focus-visible {
	outline: 2px solid var( --sd-color-orange );
	outline-offset: 2px;
}
