/* ============================================================================
   authors.css - the author box (section/sh-byline.php)
   ----------------------------------------------------------------------------
   Hand-written, not harvested: the box has no screen in the design exports.
   It borrows the exports' own vocabulary instead - Figtree, the #101010 /
   #3A3A3A text pair, the sand card surface (#FAF7F1 on #E6E3DC) the inner
   pages use for their cards, the 16px radius, and the #37B2E2 accent that the
   hero breadcrumbs and links carry. Loads on every inner page after
   design-fixes.css (functions.php); ux-fixes.css loads after this file and
   has no rule for it.

   Each head row carries an empty <details>; its summary (a chevron and a
   screen-reader label) is stretched over the row on a phone, beneath the
   name link, and :has() on the card reads the open state to show
   .ff-author-more: closed = head row only (a two-card box was 756px tall at
   390px), open = the bio in full. The name link stays outside the summary,
   so no interactive element nests in another. On a desktop the bio is
   always in full and the <details> is not rendered. A browser without
   :has() gets the bio in full everywhere.
   ============================================================================ */

.ff-authors {
	/* The harvested .w1170 rules are scoped to their own sections, so the
	   column is set here as well. */
	width: 100%;
	max-width: 1170px;
	margin: 40px auto 16px;
	font-family: 'Figtree', system-ui, sans-serif;
	color: #3A3A3A;
}

/* After the post nav, which ends flush; before the prefooter band. */
body.single-post .ff-authors {
	margin: 56px auto 72px;
}

.ff-authors-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 20px;
}

.ff-authors-grid--2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ff-author {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px 28px;
	background: #FAF7F1;
	border: 1px solid #E6E3DC;
	border-radius: 16px;
	box-shadow: 0 2px 14px rgba(16, 16, 16, 0.05);
}

.ff-author--reviewed {
	background: #ffffff;
}

/* ------------------------------------------------------ the head row */

.ff-authors .ff-author-head {
	position: relative;
	display: flex;
	align-items: center;
	gap: 18px;
	margin: 0;
}

.ff-author-toggle {
	margin: 0;
}

.ff-authors .ff-author-summary {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	margin: 0;
	padding: 0;
	list-style: none;
	cursor: pointer;
}

.ff-authors .ff-author-summary::-webkit-details-marker,
.ff-authors .ff-author-summary::marker {
	display: none;
	content: '';
}

.ff-authors .ff-author-summary:focus-visible {
	outline: 2px solid #37B2E2;
	outline-offset: -2px;
	border-radius: 8px;
}

.ff-author-photo {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center top;
	box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px #6BD1F4;
}

.ff-author-photo--empty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #37B2E2;
	color: #ffffff;
	font-size: 1.75rem;
	font-weight: 700;
}

.ff-author-id {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
}

.ff-author-role {
	display: block;
	margin-bottom: 4px;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #37B2E2;
}

.ff-authors .ff-author-name {
	display: block;
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.25;
	color: #101010;
}

.ff-authors .ff-author-name a {
	/* Above the summary that covers the row on a phone. */
	position: relative;
	z-index: 1;
	color: inherit;
	text-decoration: none;
	transition: color .2s;
}

.ff-authors .ff-author-name a:hover,
.ff-authors .ff-author-name a:focus-visible {
	color: #37B2E2;
	text-decoration: none;
}

.ff-authors .ff-author-title {
	display: block;
	margin: 2px 0 0;
	font-size: 0.9375rem;
	line-height: 1.4;
	color: #3A3A3A;
}

.ff-author-chevron {
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	opacity: 0.6;
	transition: transform .2s, opacity .2s;
}

.ff-author-summary:hover .ff-author-chevron {
	opacity: 1;
}

.ff-author-toggle[open] .ff-author-chevron {
	transform: rotate(180deg);
}

/* ------------------------------------------------------ bio and links */

.ff-author-more {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ff-authors .ff-author-bio {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.6;
	color: #3A3A3A;
}

.ff-authors .ff-author-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ff-author-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid #E6E3DC;
	border-radius: 999px;
	background: #ffffff;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.2;
	color: #101010;
	text-decoration: none;
	transition: color .2s, border-color .2s;
}

.ff-author--reviewed .ff-author-link {
	background: #FAF7F1;
}

.ff-author-link:hover,
.ff-author-link:focus-visible {
	color: #37B2E2;
	border-color: #37B2E2;
	text-decoration: none;
}

.ff-author-link img {
	width: 16px;
	height: 16px;
}

/* ------------------------------------------------------ dates */

.ff-authors .ff-authors-date {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	margin: 14px 0 0;
	font-size: 0.875rem;
	color: #3A3A3A;
}

.ff-authors-date time {
	font-weight: 600;
	color: #101010;
}

/* ------------------------------------------------------ no :has() */

@supports not selector(:has(*)) {
	.ff-author-toggle {
		display: none;
	}
}

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

/* Desktop: nothing to unfold, so there is no control at all. */
@media (min-width: 769px) {
	.ff-author-toggle {
		display: none;
	}
}

@media (max-width: 1200px) {
	.ff-authors {
		padding-left: 20px;
		padding-right: 20px;
	}
}

@media (max-width: 768px) {
	.ff-authors {
		margin: 24px auto 8px;
	}

	body.single-post .ff-authors {
		margin: 40px auto 48px;
	}

	/* One compact list instead of two cards: a row per person, hairlines
	   between, the bio folded under its row. */
	.ff-authors-grid,
	.ff-authors-grid--2 {
		grid-template-columns: 1fr;
		gap: 0;
		border-top: 1px solid #E6E3DC;
		border-bottom: 1px solid #E6E3DC;
	}

	.ff-author,
	.ff-author--reviewed {
		gap: 0;
		padding: 0;
		background: transparent;
		border: 0;
		border-radius: 0;
		box-shadow: none;
	}

	.ff-author + .ff-author {
		border-top: 1px solid #E6E3DC;
	}

	.ff-authors .ff-author-head {
		gap: 12px;
		min-height: 56px;
		padding: 8px 0;
		border-radius: 0;
	}

	/* The summary covers the whole row (a 56px tap target); the name link
	   sits above it. */
	.ff-authors .ff-author-summary {
		position: absolute;
		inset: 0;
		padding-right: 4px;
	}

	.ff-author-photo {
		flex-basis: 40px;
		width: 40px;
		height: 40px;
		box-shadow: 0 0 0 2px #ffffff, 0 0 0 3px #6BD1F4;
	}

	.ff-author-photo--empty {
		font-size: 1.125rem;
	}

	.ff-author-role {
		margin-bottom: 1px;
		font-size: 0.625rem;
		letter-spacing: 0.12em;
	}

	.ff-authors .ff-author-name,
	.ff-authors .ff-author-title {
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.ff-authors .ff-author-name {
		font-size: 1rem;
		line-height: 1.3;
	}

	.ff-authors .ff-author-title {
		margin-top: 0;
		font-size: 0.8125rem;
		line-height: 1.3;
	}

	/* Folded until the row is tapped; the text stays in the page for search
	   engines and screen readers that read the expanded state. */
	.ff-author-more {
		display: none;
		gap: 12px;
		padding: 0 0 16px 52px;
	}

	.ff-author:has(.ff-author-toggle[open]) .ff-author-more {
		display: flex;
	}

	.ff-authors .ff-authors-date {
		margin-top: 10px;
		font-size: 0.8125rem;
	}
}

@supports not selector(:has(*)) {
	@media (max-width: 768px) {
		.ff-author-more {
			display: flex;
		}
	}
}

@media (max-width: 400px) {
	.ff-author-more {
		padding-left: 0;
	}
}
