/* ==========================================================================
   ABOUT

   /about and /about/board. Both are template-driven pages whose problem was
   the same one: a reading-measure column sitting at the left edge of a 1664px
   container, with the right half of the screen empty. Everything here is about
   filling the width honestly -- by giving the space to a second element, not by
   stretching the line length past what anyone can read.
   ========================================================================== */

/* --- Band grounds --------------------------------------------------------
 *
 * A band with no ground of its own shows the <body>, and My Listing sets
 * `body { background: #f4f4f4 }` -- which is within two points of our own
 * --kbia-surface-alt (#f4f6f8). So the white -> pale grey alternation that
 * docs/design-reference.md §3 describes, and that .kbia-band--alt implements,
 * comes out as grey -> grey: on this page three consecutive bands with no
 * visible boundary between them.
 *
 * Stating the white ground explicitly is the whole fix. It is scoped to these
 * two templates rather than applied to .kbia-band, because .kbia-band is on
 * every page of the site and this is not the change to make site-wide by way
 * of an About redesign.
 */
.kbia-archive--about .kbia-band,
.kbia-archive--board .kbia-band {
	background: var(--kbia-surface);
}

.kbia-archive--about .kbia-band--alt,
.kbia-archive--board .kbia-band--alt {
	background: var(--kbia-surface-alt);
}

/* --- The hero: copy left, badge right ------------------------------------
 *
 * One column became two, and the badge is what the second one is for. Below
 * 64rem they stack and the badge goes first, because on a phone the road-sign
 * logo is a faster "you are on the right site" than a heading is.
 */
.kbia-abouthero {
	display: grid;
	gap: clamp(2rem, 5vw, 4rem);
}

.kbia-abouthero__badge {
	order: -1;
	max-width: 20rem;
}

.kbia-abouthero__logo {
	display: block;
	width: 100%;
	height: auto;
}

@media (min-width: 64rem) {
	.kbia-abouthero {
		grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
		align-items: center;
	}

	.kbia-abouthero__badge {
		order: 0;
		justify-self: end;
		max-width: 28rem;
	}
}

/* The motto is the best line on the page and the reason the hero exists, so it
   is set at h3 rather than at --kbia-fs-hero-lede. That token is deliberately a
   step *below* body copy, which is right for the homepage -- a long sentence
   under 104px type -- and wrong for eight words that are the BIA's own slogan.

   Capped at a measure rather than left to the grid track, and balanced, so it
   breaks into two even lines instead of one long one and a short one. */
.kbia-abouthero__lede {
	max-width: 42ch;
	margin-top: 1rem;
	font-size: var(--kbia-fs-h3);
	line-height: var(--kbia-lh-heading);
	color: #fff;
	text-wrap: balance;
}

/* --- A section band: heading left, prose right ---------------------------
 *
 * The editorial two-column that fixes the original complaint. The heading sits
 * in its own column and the prose keeps its reading measure in the other, so
 * the band is full-width while no line of text is any longer than it was. On a
 * single column it simply stacks, which is the layout the page had -- correct
 * there, because at that width there is no spare half to leave empty.
 */
.kbia-about__section {
	display: grid;
	gap: clamp(1rem, 3vw, 3rem);
}

@media (min-width: 64rem) {
	.kbia-about__section {
		grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
		align-items: start;
	}

	/* The heading holds its place while the prose beside it scrolls past. The
	   bands are short enough that this is a small movement, and it is what
	   keeps the left column from reading as an orphaned line at the top of a
	   tall block of text. */
	.kbia-about__heading {
		position: sticky;
		top: calc(var(--kbia-header-h) + 1.5rem);
	}

	.kbia-about__heading .kbia-band__title {
		margin-bottom: 0;
	}
}

/* Prose in a band that has already been given a column does not need the
   global cap again -- the grid track is the constraint now. Without this the
   text would stop at --kbia-measure inside a track that is itself narrower,
   which is a cap applied twice. */
.kbia-about__prose,
.kbia-prose.kbia-about__prose {
	max-width: 68ch;
}

/* --- The portrait gallery ------------------------------------------------
 *
 * Seven medium-format portraits of owners in front of their own storefronts.
 * They are all 1024x860, and they are printed at their own ratio rather than
 * cropped to a house one: the film rebate down the edge of each frame is part
 * of the picture, and a cover-crop to 3:2 cuts it off on every single one.
 *
 * Seven into a four-column grid leaves three on the second row, so the grid is
 * auto-fit and the last row is allowed to be short. Forcing the seventh to
 * stretch would break the one thing the set depends on, which is that every
 * frame is the same size.
 */
.kbia-about__galleryband {
	/* Directly beneath the section it illustrates, and on the same ground, so
	   it drops its own top padding and reads as part of that band rather than
	   as a new one. The gap left is the section band's bottom padding. */
	padding-block-start: 0;
}

.kbia-portraits {
	display: grid;
	/* Fixed counts rather than auto-fit. Seven portraits at a 15rem minimum
	   collapse to a single column on a phone, which is seven full-width
	   photographs to scroll past before the next heading. Two up is small but
	   perfectly legible -- these are head-and-shoulders frames -- and turns
	   that scroll into half of it. */
	grid-template-columns: repeat(2, 1fr);
	gap: clamp(0.75rem, 1.5vw, 1.25rem);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 40rem) {
	.kbia-portraits { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 64rem) {
	.kbia-portraits { grid-template-columns: repeat(4, 1fr); }
}

.kbia-portraits__item {
	margin: 0;
	overflow: hidden;
	border-radius: var(--kbia-radius-lg);
	background: var(--kbia-blue-800);
}

.kbia-portraits__img {
	display: block;
	width: 100%;
	height: 100%;
	aspect-ratio: 1024 / 860;
	object-fit: cover;
}

/* --- The map -------------------------------------------------------------
 *
 * Full width under the directions, the same shape the portrait gallery takes
 * under "Who we are", so the page reads as one rhythm: a section, then the
 * thing that section is about.
 *
 * Sized by ratio rather than by a fixed height. A map given a flat height is
 * either a letterbox slot on a phone or a postage stamp on a desktop; a ratio
 * that opens out as the viewport widens keeps roughly the same amount of street
 * visible at every size. Capped so it cannot eat a tall desktop screen.
 */
.kbia-map {
	overflow: hidden;
	border-radius: var(--kbia-radius-lg);
	background: var(--kbia-surface-alt);
	aspect-ratio: 4 / 3;
	max-height: 34rem;
}

@media (min-width: 40rem) {
	.kbia-map { aspect-ratio: 16 / 9; }
}

@media (min-width: 64rem) {
	.kbia-map { aspect-ratio: 21 / 8; }
}

.kbia-map__frame {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}

.kbia-map__address {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	align-items: baseline;
	margin: 1rem 0 0;
	color: var(--kbia-muted);
	font-family: var(--kbia-font-mono);
	font-size: var(--kbia-fs-eyebrow);
	letter-spacing: var(--kbia-ls-eyebrow);
	text-transform: uppercase;
}

/* --- "More about the BIA" link cards -------------------------------------
 *
 * Text cards, not image cards. The three child pages have no photography of
 * their own, and a stock image or a repeated placeholder on each would be three
 * pictures that mean nothing. The 8px accent rule under the title is the
 * system's signature mark (docs/design-reference.md §4) and is enough to make
 * these read as cards.
 */
.kbia-linkcard {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	height: 100%;
	padding: clamp(1.25rem, 2.5vw, 2rem);
	border-radius: var(--kbia-radius-xl);
	background: var(--kbia-surface-alt);
	text-decoration: none;
	transition: background-color var(--kbia-dur) var(--kbia-ease-out),
	            transform var(--kbia-dur) var(--kbia-ease-out);
}

/* On a pale-grey band the card's own pale grey would vanish, so there it
   inverts to white. Keyed off the band, so a card never has to know which one
   it was dropped into. */
.kbia-band--alt .kbia-linkcard {
	background: var(--kbia-surface);
}

.kbia-linkcard__title {
	margin: 0;
	padding-bottom: 0.4rem;
	border-bottom: 8px solid var(--kbia-accent);
	align-self: flex-start;
	font-family: var(--kbia-font-heading);
	font-size: var(--kbia-fs-h3);
	font-weight: 700;
	color: var(--kbia-heading);
	transition: color var(--kbia-dur) var(--kbia-ease-out);
}

.kbia-linkcard__blurb {
	margin: 0.5rem 0 0;
	color: var(--kbia-body);
	line-height: var(--kbia-lh-body);
}

/* Pushed to the bottom so the arrow sits on one line across all three cards
   however long their blurbs are. */
.kbia-linkcard__go {
	margin-top: auto;
	padding-top: 1rem;
	color: var(--kbia-accent);
	font-size: var(--kbia-fs-h3);
	line-height: 1;
	transition: transform var(--kbia-dur) var(--kbia-ease-out);
}

.kbia-linkcard:hover,
.kbia-linkcard:focus-visible {
	transform: translateY(-2px);
}

.kbia-linkcard:hover .kbia-linkcard__title,
.kbia-linkcard:focus-visible .kbia-linkcard__title {
	color: var(--kbia-accent);
}

.kbia-linkcard:hover .kbia-linkcard__go {
	transform: translateX(4px);
}

/* --- Board cards ---------------------------------------------------------
 *
 * The media is the member's *business*, not the member: six of the nine sit in
 * the directory with a storefront photograph already attached, and none of the
 * nine has a portrait. The card was built for a face -- 3:4 portrait -- and a
 * storefront in a 3:4 box is cropped to a doorway, so the ratio moves to the
 * house landscape one.
 *
 * Those six photographs are 1:1, 4:3, 3:2 and 8:3 as stored. Every card is
 * nonetheless exactly the same size: the box is fixed at 3:2 and the image
 * covers it, so the source dimensions decide how much of a frame is used and
 * never how big the card is. The remaining three fall back to the branded
 * "photo coming soon" tile, which is already sized to whatever box it is given.
 */
.kbia-archive--board .kbia-card--person .kbia-card__media {
	aspect-ratio: var(--kbia-ratio-news);
}

/* Equal height, and a shared baseline for the text under the image. A board
   whose business names run to one line and two lines otherwise leaves the grid
   with cards of two different heights and roles that do not line up. */
.kbia-archive--board .kbia-grid { align-items: stretch; }

.kbia-archive--board .kbia-card--person {
	height: 100%;
	padding-bottom: 0.25rem;
}

/* The bio takes the slack, so everything above it stays aligned across the
   row. */
.kbia-archive--board .kbia-card__summary { margin-top: auto; }

/* The wide-banner case. The box does not change -- only what the image does
   inside it: the whole picture is shown, letterboxed against the card's own
   navy, which is the same ground the "photo coming soon" tiles already use, so
   a contained banner and a placeholder sit in the grid as the same kind of
   object. The inset stops the artwork touching the rounded corners. */
.kbia-card__media--contain img {
	object-fit: contain;
	padding: clamp(0.5rem, 1.5vw, 1rem);
}
