/* Team grid and popup. Colours and fonts come from the logopraxis-site tokens. */

.lp-team__grid { display: grid; gap: 24px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lp-team--compact .lp-team__grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }

.lp-team__card { height: 100%; }
.lp-team button.lp-team__open {
	all: unset;
	box-sizing: border-box;
	display: flex; flex-direction: column;
	width: 100%; height: 100%;
	background: var(--lp-white, #fff);
	border-radius: var(--lp-radius, 12px);
	box-shadow: var(--lp-shadow, 0 6px 24px rgba(0, 0, 0, .08));
	overflow: hidden;
	cursor: pointer;
	text-align: left;
	color: var(--lp-navy, #1F3556);
	font-family: var(--lp-font-body, sans-serif);
	transition: transform .15s ease, box-shadow .15s ease;
}
.lp-team button.lp-team__open:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(31, 53, 86, .14); }
.lp-team button.lp-team__open:focus-visible { outline: 3px solid var(--lp-honey, #F2B84B); outline-offset: 3px; }

.lp-team__photo { display: block; aspect-ratio: 4 / 5; background: var(--lp-sage-soft, #E3EEE5); overflow: hidden; }
.lp-team__photo .lp-team__img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.lp-team .lp-team__placeholder {
	display: flex; align-items: center; justify-content: center;
	width: 100%; height: 100%;
	font-family: var(--lp-font-head, serif); font-size: 2.6rem;
	color: var(--lp-navy, #1F3556); background: var(--lp-sage-soft, #E3EEE5);
}

.lp-team__body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.lp-team__name { overflow-wrap: anywhere; font-family: var(--lp-font-head, serif); font-size: 1.25rem; line-height: 1.25; }
.lp-team__title { color: var(--lp-navy-soft, #44546B); font-size: .95rem; }
.lp-team__locs { font-size: .85rem; font-weight: 700; color: var(--lp-terracotta-text, #9C4A30); }
.lp-team__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.lp-team__chips .lp-chip { font-size: .8rem; padding: 3px 10px; }
.lp-team__langs { font-size: .85rem; color: var(--lp-navy-soft, #44546B); }
.lp-team__more { margin-top: auto; padding-top: 6px; font-weight: 700; font-size: .9rem; color: var(--lp-terracotta-text, #9C4A30); }
.lp-team--compact .lp-team__body { padding: 12px 14px 14px; gap: 4px; }
.lp-team--compact .lp-team__name { font-size: 1.05rem; }
.lp-team--compact .lp-team__title { font-size: .85rem; }
.lp-team--compact .lp-team__more { display: none; }

/* Full grid: cards share the parent grid's rows (subgrid), so photo, name, title, locations,
   focus chips, languages and "Mehr erfahren" line up across each row of cards. */
@supports (grid-template-rows: subgrid) {
	.lp-team:not(.lp-team--compact) .lp-team__grid { row-gap: 0; }
	.lp-team:not(.lp-team--compact) .lp-team__card { display: grid; grid-row: span 7; grid-template-rows: subgrid; row-gap: 0; margin-bottom: 24px; }
	.lp-team:not(.lp-team--compact) button.lp-team__open { display: grid; grid-row: 1 / -1; grid-template-rows: subgrid; row-gap: 8px; }
	.lp-team:not(.lp-team--compact) .lp-team__body { display: contents; }
	.lp-team:not(.lp-team--compact) .lp-team__body > * { padding-inline: 20px; }
	.lp-team:not(.lp-team--compact) .lp-team__photo { margin-bottom: 10px; }
	.lp-team:not(.lp-team--compact) .lp-team__more { padding-bottom: 20px; align-self: end; }
	.lp-team:not(.lp-team--compact) .lp-team__chips { align-content: start; }
}

/* Full grid: an incomplete last row is centered. Each card spans two half-columns,
   so the first card of the last row can start half a card further in. */
.lp-team:not(.lp-team--compact) .lp-team__grid { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) {
	.lp-team:not(.lp-team--compact) .lp-team__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
	.lp-team:not(.lp-team--compact) .lp-team__card { grid-column: span 2; }
	/* 2 per row, 1 left over */
	.lp-team:not(.lp-team--compact) .lp-team__card:nth-child(2n+1):last-child { grid-column: 2 / span 2; }
}
@media (min-width: 1000px) {
	.lp-team:not(.lp-team--compact) .lp-team__grid { grid-template-columns: repeat(8, minmax(0, 1fr)); }
	.lp-team:not(.lp-team--compact) .lp-team__card:nth-child(2n+1):last-child { grid-column: span 2; }
	/* 4 per row: 3, 2 or 1 left over */
	.lp-team:not(.lp-team--compact) .lp-team__card:nth-child(4n+1):nth-last-child(3) { grid-column: 2 / span 2; }
	.lp-team:not(.lp-team--compact) .lp-team__card:nth-child(4n+1):nth-last-child(2) { grid-column: 3 / span 2; }
	.lp-team:not(.lp-team--compact) .lp-team__card:nth-child(4n+1):last-child { grid-column: 4 / span 2; }
}

/* Dialog */
.lp-team__dialog {
	border: 0; padding: 0;
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - 48px);
	border-radius: var(--lp-radius, 12px);
	background: var(--lp-cream, #FBF6EE);
	color: var(--lp-navy, #1F3556);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	overflow: hidden;
}
.lp-team__dialog::backdrop { background: rgba(31, 53, 86, .6); }
.lp-team__dialog-inner { position: relative; max-height: calc(100vh - 48px); overflow-y: auto; overscroll-behavior: contain; padding: 32px 36px 24px; box-sizing: border-box; }
html.lp-team-open { overflow: hidden; }

.lp-team button.lp-team__close {
	all: unset;
	position: sticky; top: 0; float: right;
	width: 40px; height: 40px; margin: -16px -20px 0 0;
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%;
	background: var(--lp-white, #fff); color: var(--lp-navy, #1F3556);
	font-size: 28px; line-height: 1; cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	z-index: 2;
}
.lp-team button.lp-team__close:focus-visible { outline: 3px solid var(--lp-honey, #F2B84B); }

.lp-team__head { display: flex; gap: 24px; align-items: center; margin-bottom: 20px; }
.lp-team__head-photo { flex: 0 0 160px; height: 200px; border-radius: var(--lp-radius, 12px); overflow: hidden; display: block; }
.lp-team__head-photo .lp-team__img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.lp-team .lp-team__head-photo .lp-team__placeholder { display: flex; font-size: 2.2rem; }
.lp-team__dname { font-size: 1.8rem; margin: 0; }
.lp-team__pronouns { margin: 2px 0 8px; color: var(--lp-navy-soft, #44546B); font-size: .9rem; }
.lp-team__titles { margin: 0 0 10px; }
.lp-team__meta { list-style: none; padding: 0; margin: 0; font-size: .95rem; color: var(--lp-navy-soft, #44546B); }

.lp-team__quote { margin: 0 0 20px; padding: 4px 0 4px 20px; border-left: 4px solid var(--lp-honey, #F2B84B); }
.lp-team__quote p { font-family: var(--lp-font-head, serif); font-style: italic; font-size: 1.15rem; line-height: 1.5; margin: 0; }
.lp-team__quote footer { margin-top: 6px; font-size: .9rem; color: var(--lp-navy-soft, #44546B); }
.lp-team__bio p { margin: 0 0 12px; }
.lp-team__h3 { font-size: 1.15rem; margin: 20px 0 10px; }
.lp-team__focus { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }

.lp-team__trainings { margin-top: 20px; background: var(--lp-white, #fff); border-radius: var(--lp-radius, 12px); }
.lp-team__trainings summary { cursor: pointer; padding: 14px 18px; font-weight: 700; }
.lp-team__trainings ul { margin: 0; padding: 0 18px 16px 36px; columns: 2 280px; column-gap: 32px; font-size: .92rem; }
.lp-team__trainings li { break-inside: avoid; margin-bottom: 6px; }
.lp-team__extra { margin-top: 16px; font-size: .95rem; overflow-wrap: anywhere; }

.lp-team__nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid rgba(31, 53, 86, .12); }
.lp-team .lp-team__nav button {
	all: unset; cursor: pointer;
	font-family: var(--lp-font-body, sans-serif); font-weight: 700; color: var(--lp-navy, #1F3556);
	padding: 8px 14px; border-radius: 999px;
}
.lp-team .lp-team__nav button:hover { background: var(--lp-honey-soft, #FBEBC8); }
.lp-team .lp-team__nav button:focus-visible { outline: 3px solid var(--lp-honey, #F2B84B); }
.lp-team .lp-team__nav button[hidden] { display: none; }

@media (max-width: 600px) {
	.lp-team__dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; margin: 0; }
	.lp-team__dialog-inner { max-height: 100dvh; height: 100%; padding: 24px 18px 20px; }
	.lp-team__head { flex-direction: column; align-items: flex-start; }
	.lp-team__head-photo { flex-basis: auto; width: 140px; height: 175px; }
	.lp-team button.lp-team__close { margin: -8px -4px 0 0; }
	.lp-team--compact .lp-team__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
