/*
 * Mitgliedschaften — the membership grid on the Partner page.
 *
 * Was a numbered list of names. The numbers implied a ranking the memberships
 * do not have, and a bare name asks the visitor to already know the
 * organisation; a logo is how most people recognise one. Entries are edited in
 * wp-admin — see inc/mitgliedschaften.php.
 */
.mitglied-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
	gap: clamp(14px, 1.8vw, 24px);
	margin: 14px 0 0;
	padding: 0;
	list-style: none;
	font-family: 'Open Sans', sans-serif;
}

/* Three across from here up, rather than as many as fit. Left to auto-fill,
   1440px fits five: the logo panels shrink below the point where a mark is
   easy to recognise, and the longer names (ÖGKV, AFNB) wrap to three lines.
   A short last row — 3/3/2 with eight entries — is the lesser cost. */
@media (min-width: 1000px) {
	.mitglied-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.mitglied-card {
	/* The containing block for the stretched link — see .mitglied-link. */
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	background-color: #fff;
	border: 1px solid #e2e2dc;
	border-radius: 8px;
	overflow: hidden;
	transition:
		border-color 0.2s ease,
		box-shadow 0.25s ease,
		transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Only cards with a website respond, so the lift means what it looks like it
   means. :has(:focus-visible) rather than :focus-within for the reason the
   publication cards give: these open a new tab, and a click would otherwise
   leave the card stuck raised on return. */
.mitglied-card--linked:hover,
.mitglied-card--linked:has(.mitglied-link:focus-visible) {
	border-color: var(--brand-teal-ink);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
	transform: translateY(-2px);
}

.mitglied-card:has(.mitglied-link:focus-visible) {
	outline: 3px solid var(--brand-teal-ink);
	outline-offset: 3px;
}

/* --- Logo ---------------------------------------------------------------- */
/*
 * A fixed panel, so logos of every proportion — AFNB's wide arch, proEthik's
 * near-square column, JBZ's long wordmark — sit on one line across a row. A
 * logo is capped at 80px tall (the panel less its padding) and 220px wide, and
 * scales to whichever it meets first.
 *
 * The width cap is what keeps the row even. Bounded only by the panel, a long
 * heavy wordmark like JBZ's ran to 316px on desktop and outweighed every mark
 * beside it; at 220px it lands level with AEM and AFNB, which reach their
 * height limit first and are unaffected.
 *
 * White, not tinted: several logos ship with a white background of their own,
 * and on any other colour they would show as a white box.
 */
.mitglied-logo {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 124px;
	padding: 22px 28px;
	background-color: #fff;
	border-bottom: 1px solid #efefea;
}

/* Two classes, because bar.css sets `.bar img { max-width: 100% }` for editor
   content, and at one class this rule loses to it on specificity and the
   220px cap never applies. */
.mitglied-logo .mitglied-logo-img {
	display: block;
	width: auto;
	height: auto;
	max-width: min(100%, 220px);
	max-height: 100%;
	object-fit: contain;
}

.mitglied-logo-none {
	font-size: 34px;
	line-height: 1;
	color: var(--brand-teal);
	opacity: 0.45;
}

/* --- Text ---------------------------------------------------------------- */
.mitglied-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	flex: 1;
	padding: 14px 18px 16px;
}

.mitglied-name {
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	color: #1c1c1c;
	text-wrap: pretty;
}

.mitglied-link {
	color: inherit;
	text-decoration: none;
}

/* Stretches the name's link over the whole card, so the card is the target
   while the accessibility tree still holds one link named by the name. */
.mitglied-link::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.mitglied-card--linked:hover .mitglied-link,
.mitglied-link:focus-visible {
	color: var(--brand-teal-ink);
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* The ring goes round the card instead — see .mitglied-card:has(...). */
.mitglied-link:focus-visible {
	outline: none;
}

.mitglied-note {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: #5d5d5d;
	text-wrap: pretty;
}

/* Pushed to the foot of the card, so the addresses line up along a row even
   when the names above them wrap to different lengths. */
.mitglied-site {
	margin: auto 0 0;
	padding-top: 8px;
	font-size: 12px;
	font-weight: 600;
	color: var(--brand-teal-ink);
}

.mitglied-site .fa-external-link-alt {
	margin-left: 4px;
	font-size: 10px;
}

@media (prefers-reduced-motion: reduce) {
	.mitglied-card {
		transition: none;
	}
	.mitglied-card--linked:hover {
		transform: none;
	}
}
