/**
 * Our Projects — map + listings grid.
 *
 * Values come from the Figma variable set (Doral Renewables Design V1). Proxima Nova is
 * not installed yet; --doral-font carries a close fallback stack so the layout is correct
 * now and swapping in the licensed font is a one-line change.
 */

.doral-projects {
	/* colour */
	--doral-primary: #005050;
	--doral-primary-light: #007373;
	--doral-primary-800: #002828;
	--doral-tint-50: #e6eded;
	--doral-tint-100: #cddbdb;
	--doral-tint-200: #9bb7b7;
	--doral-ink: #0e1a1a;
	--doral-ink-2: #2a3838;
	--doral-ink-3: #5a6a6a;
	--doral-paper: #fff;

	/* spacing scale */
	--doral-s1: 8px;
	--doral-s2: 16px;
	--doral-s3: 24px;
	--doral-s4: 32px;
	--doral-s8: 64px;
	--doral-s10: 80px;
	--doral-s14: 112px;

	--doral-radius-card: 8px;
	--doral-radius-input: 4px;
	--doral-gutter: 80px;
	--doral-maxw: 1440px;

	/*
	 * Served by the Adobe Fonts kit Kadence loads (use.typekit.net/mts3rgl).
	 * The kit ships 400 and 700 only — no 500/600 — so the 600 weights below resolve
	 * up to 700, which is the closest match to the design's Semibold.
	 */
	--doral-font: "proxima-nova", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
		"Helvetica Neue", Arial, sans-serif;
	--doral-font-display: "proxima-nova-extra-condensed", "proxima-nova", var(--doral-font);

	font-family: var(--doral-font);
	color: var(--doral-ink);
}

.doral-projects *,
.doral-projects *::before,
.doral-projects *::after {
	box-sizing: border-box;
}

.doral-projects .doral-hero__inner,
.doral-projects .doral-filters__inner,
.doral-projects .doral-results__inner {
	max-width: var(--doral-maxw);
	margin-inline: auto;
	padding-inline: var(--doral-gutter);
}

/* icons inherit colour so one asset serves both the dark hero and the light cards */
.doral-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex: 0 0 auto;
}

.doral-icon svg {
	width: 100%;
	height: 100%;
	display: block;
}

.doral-icon--sm {
	width: 14px;
	height: 14px;
}

/* ------------------------------------------------------------------ hero + map */

.doral-hero {
	background: var(--doral-primary-800);
	color: var(--doral-paper);
	padding-block: var(--doral-s14) var(--doral-s10);
}

.doral-hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: var(--doral-s4);
}

.doral-hero__eyebrow {
	margin: 0 0 var(--doral-s3);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--doral-tint-200);
}

.doral-hero__title {
	margin: 0;
	font-family: var(--doral-font-display);
	font-size: clamp(44px, 6vw, 72px);
	font-weight: 700;
	/* Kadence sets an oblique on some headings; the display face is upright. */
	font-style: normal;
	line-height: 0.9;
	letter-spacing: -1px;
	text-transform: uppercase;
	color: var(--doral-paper);
}

.doral-legend {
	background: rgba(14, 26, 26, 0.3);
	border-radius: var(--doral-radius-card);
	padding: var(--doral-s4);
	display: flex;
	flex-direction: column;
	gap: var(--doral-s2);
}

.doral-legend__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.5;
}

.doral-legend__items {
	display: flex;
	flex-wrap: wrap;
	gap: var(--doral-s4);
	margin: 0;
	padding: 0;
	list-style: none;
}

.doral-legend__item {
	display: flex;
	align-items: center;
	gap: var(--doral-s1);
	font-size: 16px;
	line-height: 1.5;
	color: var(--doral-paper);
}

/* icons carry the accent, labels stay white — matches the map block's legend */
.doral-legend__item .doral-icon {
	color: var(--doral-primary-light);
}

.doral-map {
	/* 1056px is the map frame width in the Figma comp */
	max-width: 1056px;
	margin: var(--doral-s10) auto 0;
	padding-inline: var(--doral-gutter);
}

.doral-map__svg {
	width: 100%;
	height: auto;
	display: block;
	overflow: visible;
}

/*
 * Four visual states, driven entirely by JS toggling classes. The fills match the
 * doral/project-map block on the home page: inactive states recede into the panel and
 * states with projects come forward in the light tint.
 */
.doral-map__svg path {
	fill: var(--doral-primary);
	stroke: var(--doral-primary-800);
	stroke-width: 1;
	stroke-linejoin: round;
	transition: fill 0.15s ease;
}

.doral-map__svg path.has-projects {
	fill: var(--doral-tint-100);
	cursor: pointer;
}

.doral-map__svg path.has-projects:hover,
.doral-map__svg path.has-projects:focus-visible {
	fill: var(--doral-paper);
	outline: none;
}

.doral-map__svg path.is-selected {
	fill: var(--doral-paper);
	stroke: var(--doral-paper);
	stroke-width: 2;
}

.doral-map__svg path:focus-visible {
	stroke: var(--doral-paper);
	stroke-width: 2;
}

/* ------------------------------------------------------------------ filter bar */

.doral-filters {
	position: sticky;
	top: 0;
	z-index: 20;
	background: var(--doral-paper);
	border-bottom: 1px solid var(--doral-tint-100);
}

.doral-filters__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--doral-s2);
	padding-block: var(--doral-s3);
}

.doral-filters__pills {
	display: flex;
	flex-wrap: wrap;
	gap: var(--doral-s1);
}

.doral-pill {
	appearance: none;
	border: 1px solid var(--doral-tint-100);
	background: var(--doral-paper);
	color: var(--doral-ink-2);
	border-radius: 100px;
	padding: var(--doral-s1) 20px;
	font: inherit;
	font-size: 13px;
	line-height: 1.3;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

/* Same Kadence button-hover fill as the pagination — declare the background so the label
   never ends up teal-on-teal. Scoped through .doral-filters to outrank the theme rule. */
.doral-filters .doral-pill:hover:not(.is-active),
.doral-filters .doral-pill:focus-visible:not(.is-active) {
	background-color: var(--doral-tint-50);
	background-image: none;
	border-color: var(--doral-primary-light);
	color: var(--doral-primary-800);
}

.doral-pill.is-active {
	background: var(--doral-primary);
	border-color: var(--doral-primary);
	color: var(--doral-paper);
}

.doral-filters .doral-pill.is-active:hover,
.doral-filters .doral-pill.is-active:focus-visible {
	background-color: var(--doral-primary-800);
	background-image: none;
	border-color: var(--doral-primary-800);
	color: var(--doral-paper);
}

.doral-filters__selects {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--doral-s2);
}

.doral-select select {
	appearance: none;
	border: 1px solid var(--doral-tint-100);
	border-radius: var(--doral-radius-input);
	background: var(--doral-paper);
	background-image: linear-gradient(45deg, transparent 50%, var(--doral-ink-3) 50%),
		linear-gradient(135deg, var(--doral-ink-3) 50%, transparent 50%);
	background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%;
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
	padding: var(--doral-s1) var(--doral-s4) var(--doral-s1) 12px;
	font: inherit;
	font-size: 13px;
	line-height: 1.3;
	color: var(--doral-ink-2);
	cursor: pointer;
	min-height: 36px;
}

.doral-select select:focus-visible,
.doral-pill:focus-visible,
.doral-clear:focus-visible {
	outline: 2px solid var(--doral-primary-light);
	outline-offset: 2px;
}

.doral-clear {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	font: inherit;
	font-size: 13px;
	color: var(--doral-ink-3);
	text-decoration: underline;
	cursor: pointer;
}

.doral-clear:hover,
.doral-clear:focus-visible {
	/* it is a <button>, so the theme would otherwise fill it teal too */
	background: none;
	color: var(--doral-primary-light);
}

/* ------------------------------------------------------------------ results */

.doral-results {
	background: var(--doral-tint-50);
	padding-block: var(--doral-s4) var(--doral-s14);
}

.doral-results__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 40px;
	margin-bottom: var(--doral-s3);
}

.doral-results__count {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--doral-ink);
}

/* ---- view toggle (Figma 904:789) ---- */

.doral-view-toggle {
	display: flex;
	align-items: center;
	gap: 2px;
	padding: 2px;
	background: #ededed;
	border: 1px solid #d1d1d1;
	border-radius: 7px;
}

.doral-view-toggle[hidden] {
	display: none;
}

.doral-view {
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 6px 10px;
	border: 0;
	border-radius: 5px;
	background: transparent;
	cursor: pointer;
	color: #808080;
}

.doral-view.is-active {
	background: var(--doral-paper);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
	color: var(--doral-ink);
}

.doral-view:focus-visible {
	outline: 2px solid var(--doral-primary-light);
	outline-offset: 1px;
}

/* icons are plain rectangles in the comp, so they are built from spans rather than art */
.doral-view__icon {
	position: relative;
	display: block;
	width: 16px;
	height: 16px;
}

.doral-view__icon i {
	position: absolute;
	background: currentColor;
	border-radius: 1px;
}

.doral-view__icon--grid i {
	width: 6px;
	height: 6px;
}

.doral-view__icon--grid i:nth-child(1) { top: 0; left: 0; }
.doral-view__icon--grid i:nth-child(2) { top: 0; left: 9px; }
.doral-view__icon--grid i:nth-child(3) { top: 9px; left: 0; }
.doral-view__icon--grid i:nth-child(4) { top: 9px; left: 9px; }

.doral-view__icon--list i {
	left: 0;
	width: 16px;
	height: 2px;
}

.doral-view__icon--list i:nth-child(1) { top: 1px; }
.doral-view__icon--list i:nth-child(2) { top: 7px; }
.doral-view__icon--list i:nth-child(3) { top: 13px; }

.doral-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--doral-s4);
}

.doral-empty {
	margin: var(--doral-s8) 0;
	text-align: center;
	font-size: 16px;
	color: var(--doral-ink-3);
}

/* ------------------------------------------------------------------ card */

.doral-card {
	display: flex;
	flex-direction: column;
	background: var(--doral-paper);
	border-radius: var(--doral-radius-card);
	overflow: hidden;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.13);
}

.doral-card[hidden] {
	display: none;
}

.doral-card__media {
	display: block;
	height: 140px;
	background: var(--doral-tint-100);
	flex: 0 0 auto;
}

.doral-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.doral-card__body {
	display: flex;
	flex-direction: column;
	gap: var(--doral-s2);
	padding: var(--doral-s3);
	flex: 1 1 auto;
}

/* Figma's header-stack: title, meta and type sit tighter than the 16px body rhythm. */
.doral-card__head {
	display: flex;
	flex-direction: column;
	gap: var(--doral-s1);
}

.doral-card__title {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	color: #000;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.doral-card__title a {
	color: inherit;
	text-decoration: none;
}

.doral-card__title a:hover {
	color: var(--doral-primary-light);
}

.doral-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--doral-s1);
}

.doral-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	border: 1px solid var(--doral-tint-100);
	border-radius: 100px;
	/*
	 * line-height 1 collapses the half-leading that was pushing the label above the optical
	 * centre. With it collapsed, symmetric padding centres the text: 1px border + 5px + 13px
	 * text + 5px + 1px border = the 25px badge height in the comp.
	 */
	padding: 5px var(--doral-s1);
	font-size: 13px;
	line-height: 1;
	color: var(--doral-ink-2);
	white-space: nowrap;
}

.doral-badge__label {
	display: block;
	line-height: 1;
}

.doral-badge__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--doral-primary);
	flex: 0 0 auto;
}

/* status hues — the dot is the only element that changes */
.doral-badge--operational .doral-badge__dot { background: #26ccc2; }
.doral-badge--under-construction .doral-badge__dot { background: #e8a33d; }
.doral-badge--pre-construction .doral-badge__dot { background: #7a9cc6; }
.doral-badge--advanced-development .doral-badge__dot { background: var(--doral-primary-light); }
.doral-badge--early-stage .doral-badge__dot { background: var(--doral-tint-200); }

.doral-card__state {
	font-size: 13px;
	line-height: 1.3;
	color: var(--doral-ink-3);
	white-space: nowrap;
}

.doral-card__type {
	display: flex;
	align-items: center;
	gap: var(--doral-s1);
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: var(--doral-ink-2);
}

.doral-card__type .doral-icon {
	color: var(--doral-primary-light);
}

.doral-card__divider {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--doral-tint-100);
}

.doral-card__stats {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: var(--doral-s2);
}

.doral-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.doral-stat__value {
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--doral-ink);
	/* never let an unusually long figure push the neighbouring stat out of the card */
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.doral-stat__label {
	font-size: 13px;
	line-height: 1.3;
	color: var(--doral-ink-3);
	white-space: nowrap;
}

.doral-card__footer {
	margin: 0;
	padding-top: var(--doral-s1);
	display: flex;
	justify-content: flex-end;
	margin-top: auto;
}

.doral-card__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 13px;
	line-height: 1.3;
	color: var(--doral-primary-light);
	text-decoration: none;
}

.doral-card__link:hover {
	text-decoration: underline;
}

/* ------------------------------------------------------------------ list view

   The same cards, relaid out — no second markup path, so filtering, pagination and the
   map/grid sync keep working untouched.

   NOTE: the Figma file exposes a Grid View frame only (its component library has no
   horizontal row variant), so this layout is derived from the grid card using the same
   tokens rather than traced from a comp. */

.doral-grid--list {
	grid-template-columns: minmax(0, 1fr);
	gap: var(--doral-s2);
}

.doral-grid--list .doral-card {
	flex-direction: row;
	align-items: stretch;
}

.doral-grid--list .doral-card__media {
	position: relative;
	flex: 0 0 232px;
	width: 232px;
	height: auto;
	min-height: 148px;
}

/*
 * The row stretches the media to the card height, but that height stays `auto` as far as
 * the child is concerned, so a height:100% image collapses. Pinning it to the box gives
 * object-fit something definite to work against.
 */
.doral-grid--list .doral-card__media img {
	position: absolute;
	inset: 0;
}

/* side by side there is room to keep the badge and state together instead of spread apart */
.doral-grid--list .doral-card__meta {
	justify-content: flex-start;
	gap: var(--doral-s2);
}

.doral-grid--list .doral-card__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	column-gap: var(--doral-s8);
	gap: var(--doral-s8);
}

/* the rule the grid card uses to separate head from stats is redundant side-by-side */
.doral-grid--list .doral-card__divider {
	display: none;
}

.doral-grid--list .doral-card__title {
	white-space: normal;
	overflow: visible;
}

.doral-grid--list .doral-card__stats {
	gap: var(--doral-s8);
}

.doral-grid--list .doral-card__footer {
	margin-top: 0;
	padding-top: 0;
	white-space: nowrap;
}

@media (max-width: 1100px) {
	.doral-grid--list .doral-card__body {
		column-gap: var(--doral-s4);
		gap: var(--doral-s4);
	}
	.doral-grid--list .doral-card__media {
		flex-basis: 180px;
		width: 180px;
	}
}

/* below this the row has nowhere left to go — fall back to the stacked card */
@media (max-width: 780px) {
	.doral-grid--list .doral-card {
		flex-direction: column;
	}
	.doral-grid--list .doral-card__media {
		flex: 0 0 auto;
		width: 100%;
		height: 140px;
	}
	.doral-grid--list .doral-card__body {
		display: flex;
		flex-direction: column;
		gap: var(--doral-s2);
	}
	.doral-grid--list .doral-card__divider {
		display: block;
	}
	.doral-grid--list .doral-card__footer {
		margin-top: auto;
		padding-top: var(--doral-s1);
	}
}

/* ------------------------------------------------------------------ pagination */

.doral-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin-top: var(--doral-s8);
}

.doral-pagination:empty {
	display: none;
}

.doral-page {
	appearance: none;
	min-width: 40px;
	height: 40px;
	padding: 0 var(--doral-s1);
	border: 1px solid var(--doral-tint-100);
	border-radius: var(--doral-radius-input);
	background: var(--doral-paper);
	font: inherit;
	font-size: 14px;
	color: var(--doral-ink-2);
	cursor: pointer;
}

/*
 * Kadence fills buttons with the global teal on :hover. Left alone that teal lands behind
 * our teal label and the number disappears, so the background is declared explicitly here
 * (and scoped through .doral-pagination to outrank the theme rule) rather than inherited.
 * The tint keeps hover clearly distinct from both the white idle state and the solid teal
 * current-page state.
 */
.doral-pagination .doral-page:hover:not(:disabled),
.doral-pagination .doral-page:focus-visible:not(:disabled) {
	background-color: var(--doral-tint-100);
	background-image: none;
	border-color: var(--doral-primary-light);
	color: var(--doral-primary-800);
}

/* the current page keeps its fill on hover — just deepens */
.doral-pagination .doral-page.is-current:hover,
.doral-pagination .doral-page.is-current:focus-visible {
	background-color: var(--doral-primary-800);
	background-image: none;
	border-color: var(--doral-primary-800);
	color: var(--doral-paper);
}

.doral-page.is-current {
	background: var(--doral-primary);
	color: var(--doral-paper);
}

.doral-page:disabled {
	opacity: 0.35;
	cursor: default;
}

.doral-page:focus-visible {
	outline: 2px solid var(--doral-primary-light);
	outline-offset: 2px;
}

.doral-pagination__gap {
	padding: 0 4px;
	color: var(--doral-ink-3);
}

/* ------------------------------------------------------------------ editor content
 *
 * Editor-authored content below the grid. Flow children sit in the same column as the
 * rest of the page; Kadence rows and .alignfull blocks carry their own width, so those
 * are left to run edge to edge instead of being boxed in twice.
 */

.doral-content {
	background: var(--doral-paper);
}

.doral-content__inner > * {
	max-width: var(--doral-maxw);
	margin-inline: auto;
	padding-inline: var(--doral-gutter);
}

.doral-content__inner > .alignfull,
.doral-content__inner > .wp-block-kadence-rowlayout {
	max-width: none;
	padding-inline: 0;
}

.doral-content__inner > *:first-child {
	margin-block-start: 0;
}

.doral-content__inner > *:last-child {
	margin-block-end: 0;
}

/* ------------------------------------------------------------------ responsive */

@media (max-width: 1200px) {
	.doral-projects { --doral-gutter: 40px; }
	.doral-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
	.doral-projects { --doral-gutter: 24px; }
	.doral-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.doral-hero { padding-block: var(--doral-s8) var(--doral-s8); }
	.doral-hero__inner { align-items: flex-start; }
	.doral-legend { width: 100%; }
	.doral-map { margin-top: var(--doral-s8); }
	.doral-filters__inner { justify-content: flex-start; }
}

@media (max-width: 600px) {
	.doral-grid { grid-template-columns: minmax(0, 1fr); }
	.doral-filters { position: static; }
	.doral-filters__pills { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
	.doral-pill { white-space: nowrap; }
	.doral-filters__selects { width: 100%; }
	.doral-select { flex: 1 1 auto; }
	.doral-select select { width: 100%; }
	.doral-results { padding-block: var(--doral-s3) var(--doral-s8); }
}

@media (prefers-reduced-motion: reduce) {
	.doral-projects * { transition: none !important; }
}
