/*
 * BLAC — Community Power Building Hub
 * Enqueued by blac-functionality.php. Page content lives in the database;
 * everything visual that a block attribute cannot express lives here so it
 * deploys as a file.
 *
 * Built 2026-12-02 from docs/hub/design/hub-desktop.dc.html (1440) and
 * hub-mobile.dc.html (390). Brand values: docs/brand.md (live-site column).
 */

/* ------------------------------------------------------------------ *
 * Header — featured "Hub" item, set apart at the far right
 * ------------------------------------------------------------------ */

.blac-hub-nav-button .wp-block-button__link {
	background-color: #5d338a;
	color: #ffffff;
	border-radius: 999px;
	padding: 9px 22px;
	box-shadow: 0 0 0 2px #edbc4b;
	white-space: nowrap;
}

.blac-hub-nav-button .wp-block-button__link:hover,
.blac-hub-nav-button .wp-block-button__link:focus-visible {
	background-color: #6b377b;
	color: #ffffff;
}

.blac-hub-nav-button .wp-block-button__link:focus-visible {
	outline: 3px solid #fccc63;
	outline-offset: 4px;
}

/* The Hub button shares the header's nav row. Spectra forces width:100% on
   every direct child of a container, which would make the button split the row
   with the navigation; flex-basis wins over width in flex layout, so sizing it
   to its content leaves the whole remaining row to the nav and drops the pill
   at the far right edge. */
.blac-hub-nav-button {
	flex: 0 0 max-content;
	align-self: center;
}

@media (min-width: 600px) {
	.blac-hub-nav-button {
		margin-inline-start: 22px;
		padding-inline-start: 22px;
		border-inline-start: 1px solid #4a4a4a;
	}
}

@media (max-width: 599px) {
	/* Collapsed header: Hub pill, then the menu toggle, on one line.
	   Without nowrap the 100%-wide nav pushes the button onto its own row. */
	.wp-block-uagb-container.uagb-layout-flex:has(> .blac-hub-nav-button) {
		flex-wrap: nowrap;
	}

	.wp-block-uagb-container.uagb-layout-flex:has(> .blac-hub-nav-button) > .wp-block-navigation {
		flex: 1 1 auto;
		min-width: 0;
	}

	.blac-hub-nav-button {
		order: -1;
		margin-inline-end: 12px;
	}
}

/* ------------------------------------------------------------------ *
 * Hub page
 * ------------------------------------------------------------------ */

.blac-hub-section {
	scroll-margin-top: 24px;
}

/* Hero. The !important margins keep these left-aligned: core's constrained
   layout centres every child narrower than the content width, also with
   !important. */
.blac-hub-hero .blac-hub-h1 {
	max-width: 1020px;
	text-wrap: balance;
}

.blac-hub-lede {
	max-width: 760px;
	text-wrap: pretty;
}

.blac-hub-hero .blac-hub-h1,
.blac-hub-lede {
	margin-inline-start: 0 !important;
	margin-inline-end: auto !important;
}

/* Buttons on the page */
.blac-hub-btn .wp-block-button__link {
	border-radius: 999px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	padding: 18px 32px;
}

.blac-hub-btn--gold .wp-block-button__link {
	background-color: #edbc4b;
	color: #1e1e1e;
	border: 0;
}

.blac-hub-btn--gold .wp-block-button__link:hover,
.blac-hub-btn--gold .wp-block-button__link:focus-visible {
	background-color: #fccc63;
	color: #1e1e1e;
}

.blac-hub-btn--outline .wp-block-button__link {
	background-color: transparent;
	color: #ffffff;
	border: 2px solid #ffffff;
	padding: 16px 30px;
}

.blac-hub-btn--outline .wp-block-button__link:hover,
.blac-hub-btn--outline .wp-block-button__link:focus-visible {
	background-color: #ffffff;
	color: #1e1e1e;
}

.blac-hub-btn .wp-block-button__link:focus-visible {
	outline: 3px solid #fccc63;
	outline-offset: 3px;
}

/* How to use the map */
.blac-hub-step__n {
	font-family: var(--wp--preset--font-family--recoleta);
	font-weight: 900;
}

/* The Hub map */
.blac-hub-map__frame {
	margin: 0;
}

.blac-hub-map__iframe {
	display: block;
	width: 100%;
	height: 80dvh;
	min-height: 420px;
	border: 2px solid #edbc4b;
	border-radius: 12px;
	background-color: #262626;
}

@media (max-width: 781px) {
	/* Edge to edge on phones, as in the 390 design. !important because core's
	   constrained-layout rule centres every child with its own !important. */
	.blac-hub-map__frame {
		margin-inline: calc(-1 * clamp(20px, 2.2vw, 32px)) !important;
	}

	.blac-hub-map__iframe {
		height: 600px;
		min-height: 0;
		border-radius: 0;
		border-width: 2px 0;
	}
}

/* Stories — placeholder until the Story Map lands */
.blac-hub-stories__text {
	flex: 1 1 420px;
}

.blac-hub-stories__cta {
	flex: 0 0 auto;
}

.blac-hub-badge {
	display: inline-block;
	background-color: #edbc4b;
	color: #1e1e1e;
	padding: 6px 14px;
	border-radius: 999px;
}

/* By state */
.blac-hub-card {
	background-color: #2a2a2a;
	border-radius: 12px;
	overflow: hidden;
	/* The card picks up core's global padding, which would inset the photo from
	   the card edges. The design runs the photo edge to edge; the card body
	   carries its own padding. */
	padding-inline: 0;
}

.blac-hub-photo,
.blac-hub-thumb {
	margin: 0;
	display: grid;
	place-content: center;
	text-align: center;
	background-color: #2a2a2a;
	background-image: repeating-linear-gradient(135deg, #2f2f2f 0 12px, #2a2a2a 12px 24px);
}

.blac-hub-photo {
	height: 280px;
	padding: 24px;
	font-size: 15px;
	color: #bdbdbd;
}

/* A real photo in a state card fills the same box the placeholder tile did. */
.blac-hub-card .blac-hub-photo-img {
	margin: 0;
	/* core gives .wp-block-image figures display:table, which shrinks the
	   figure to its content and leaves the photo narrower than the card. */
	display: block;
	width: 100%;
}

.blac-hub-card .blac-hub-photo-img img {
	display: block;
	width: 100%;
	height: 280px;
	object-fit: cover;
}

/* Learn more */
.blac-hub-thumb {
	aspect-ratio: 16 / 9;
	border-radius: 8px;
	font-size: 40px;
	line-height: 1;
	color: #ffffff;
}

.blac-hub-episode {
	margin: 0;
	border-top: 1px solid #3a3a3a;
	padding: 18px 0;
	font-size: 17px;
	line-height: 1.4;
}

.blac-hub-episode__meta {
	display: block;
	font-size: 14px;
	font-weight: 400;
	color: #bdbdbd;
}

@media (max-width: 781px) {
	.blac-hub-photo,
	.blac-hub-card .blac-hub-photo-img img {
		height: 200px;
	}
}
