.team-page .team-main {
    width: calc(100% - 80px);
    max-width: 1240px;
    margin: 0 auto;
    padding: 56px 0 80px;
    scroll-margin-top: 120px;
}
.team-page .team-intro { margin-bottom: 40px; }
.team-page .team-intro h1 {
    margin: 0;
    color: var(--site-ink);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(30px, 4vw, 52px);
    font-weight: 400;
    line-height: 1.18;
    letter-spacing: -.025em;
}
.team-page .team-intro h1::after {
    content: '';
    display: block;
    width: 54px;
    height: 2px;
    margin-top: 24px;
    background: var(--site-wine);
}
.team-page .team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 40px 28px;
}
.team-page .team-card { display: flex; flex-direction: column; min-width: 0; }
.team-page .team-portrait {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    background: #e8e3dd;
}
.team-page .team-card-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 22px 0 16px;
    background: transparent;
    border-top: 1px solid var(--site-wine);
}
.team-page .team-card h2 {
    margin: 0 0 8px;
    color: var(--site-ink);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(23px, 2.1vw, 28px);
    font-weight: 400;
    line-height: 1.3;
    overflow-wrap: break-word;
}
.team-page .team-role { margin: 0; color: #5e5755; font-size: 14px; }
.team-page .team-card .team-role { margin-bottom: 20px; }
.team-page .team-profile-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    min-height: 44px;
    margin-top: auto;
    padding: 10px 0 0;
    border-top: 1px solid #d4b9b6;
    color: var(--site-wine);
    font-size: 13px;
    font-weight: 500;
}
.team-page .team-profile-link:hover { text-decoration: underline !important; text-underline-offset: 4px; }
.team-page .team-profile-link span { font-size: 20px; line-height: 1; }

/* Profiles remain regular, linked sections when JavaScript is unavailable. */
.team-page .team-profile {
    margin-top: 48px;
    border-top: 2px solid var(--site-wine);
    background: var(--site-paper);
    scroll-margin-top: 120px;
}
.team-page .team-close { display: none; }
.team-page .team-profile-content { padding: 32px; }
.team-page .team-profile-heading { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--site-line); }
.team-page .team-profile-heading h2 {
    margin: 0 0 10px;
    color: var(--site-ink);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(27px, 3vw, 38px);
    font-weight: 400;
    line-height: 1.25;
    overflow-wrap: break-word;
}
.team-page .team-profile-heading h2:focus { outline: none; }
.team-page .team-profile-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: start; gap: 32px; }
.team-page .team-profile-portrait { display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; }
.team-page .team-bio { min-width: 0; font-size: 16px; line-height: 1.75; }
.team-page .team-bio p { margin: 0 0 24px; }
.team-page .team-email {
    display: block;
    padding: 18px 0 4px;
    border-top: 1px solid var(--site-line);
    color: var(--site-wine);
    font-size: 14px;
    overflow-wrap: anywhere;
    text-decoration: underline !important;
    text-underline-offset: 4px;
}
.team-page.team-profile-open { overflow: hidden; }
.team-page .team-dialog {
    width: min(940px, calc(100% - 48px));
    max-width: none;
    max-height: calc(100vh - 48px);
    max-height: calc(100dvh - 48px);
    margin: auto;
    padding: 0;
    border: 0;
    border-top: 3px solid var(--site-wine);
    background: var(--site-paper);
    color: var(--site-ink);
    overscroll-behavior: contain;
}
.team-page .team-dialog::backdrop { background: rgb(25 20 20 / 65%); }
.team-page .team-dialog .team-profile { margin: 0; border: 0; }
.team-page .team-dialog .team-profile-toolbar {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    padding: 8px 16px;
    background: var(--site-paper);
}
.team-page .team-dialog .team-close {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--site-line);
    background: transparent;
    color: var(--site-wine);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
}
.team-page .team-close span:last-child { font-size: 26px; line-height: 1; }
.team-page .team-close:hover { background: var(--site-tint); }
.team-page .team-dialog .team-profile-content { padding-top: 0; }

@media (max-width: 991.98px) {
    .team-page .team-main { width: calc(100% - 64px); padding: 36px 0 56px; }
    .team-page .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
    .team-page .team-profile-layout { grid-template-columns: 180px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 767.98px) {
    .team-page .team-main { width: calc(100% - 40px); padding-top: 24px; }
    .team-page .team-intro { margin-bottom: 28px; }
    .team-page .team-intro h1 { font-size: clamp(30px, 6vw, 42px); }
    .team-page .team-intro h1::after { margin-top: 20px; }
    .team-page .team-card-info { padding: 18px 0 14px; }
    .team-page .team-dialog { width: calc(100% - 24px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
    .team-page .team-profile-content { padding: 20px; }
    .team-page .team-dialog .team-profile-toolbar { padding: 8px; }
}
@media (max-width: 639.98px) {
    .team-page .team-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .team-page .team-card h2 { font-size: 27px; }
    .team-page .team-profile-layout { grid-template-columns: minmax(0, 1fr); }
    .team-page .team-profile-portrait { width: min(180px, 100%); }
}
