/* ==========================================================================
   Team component
   TYPO3 Content Blocks
   ========================================================================== */

.team {
    --team-background: #f4f1eb;
    --team-surface: #ffffff;
    --team-text: #4d4d4d;
    --team-muted: #6d716c;
    --team-accent: #ffba00;
    --team-accent-dark: #173744;
    --team-border: rgba(48, 51, 47, 0.12);
    --team-shadow:
        0 14px 38px rgba(36, 40, 35, 0.08),
        0 2px 8px rgba(36, 40, 35, 0.04);
    --team-shadow-hover:
        0 26px 60px rgba(36, 40, 35, 0.14),
        0 8px 20px rgba(36, 40, 35, 0.08);
    --team-radius: 25px;

    position: relative;
    width: 100%;
}

/* ==========================================================================
   Grid
   ========================================================================== */

.team__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(2rem, 3.5vw, 3.75rem) clamp(1.5rem, 3vw, 2.8rem);
    align-items: stretch;
}

/* ==========================================================================
   Card
   ========================================================================== */

.team-card {
    position: relative;
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(48, 51, 47, 0.06);
    border-radius: var(--team-radius);
    background: var(--team-surface);
    box-shadow: var(--team-shadow);
    transition:
        transform 350ms cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 350ms ease,
        border-color 350ms ease;
}

.team-card:hover {
    transform: translateY(-8px);
    border-color: rgba(146, 153, 125, 0.24);
    box-shadow: var(--team-shadow-hover);
}

.team-card__image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 800 / 590;
    margin: 0;
    background: var(--team-background);
}

.team-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1);
    transition:
        transform 700ms cubic-bezier(0.22, 1, 0.36, 1),
        filter 500ms ease;
}

.team-card:hover .team-card__image {
    transform: scale(1.045);
}

/* ==========================================================================
   Card content
   ========================================================================== */

.team-card__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: clamp(1.5rem, 2.3vw, 2rem);
}

.team-card__heading {
    display: flex;
    height: 100%;
    flex-direction: column;
}

.team-card__heading::before {
    width: 2.4rem;
    height: 2px;
    margin-bottom: 1rem;
    background: var(--team-accent-dark);
    content: "";
}

.team-card__heading > :first-child {
    margin-top: 0;
}

.team-card__heading > :last-child {
    margin-bottom: 0;
}

.team-card__heading h2,
.team-card__heading h3,
.team-card__heading h4 {
    margin: 0 0 0.85rem;
    color: var(--team-text);
    font-size: clamp(1.4rem, 1.5vw, 1.8rem);
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.08;
    text-wrap: balance;
}

.team-card__heading p {
    margin: 0;
    color: var(--team-muted);
    font-size: clamp(0.96rem, 1.15vw, 1.05rem);
    line-height: 1.65;
}

.team-card__heading strong {
    display: block;
    margin: 0 0 0.55rem;
    color: var(--team-accent-dark);
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.065em;
    line-height: 1.45;
    text-transform: uppercase;
}

.team-card__heading br {
    content: "";
}

.team-card__heading br::after {
    content: " ";
}

/* ==========================================================================
   Quote button
   ========================================================================== */

.team-card__button {
    position: absolute;
    right: 1.05rem;
    bottom: 1.05rem;
    display: grid;
    place-items: center;
    width: 3.6rem;
    height: 3.6rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #ffffff;
    background: var(--team-accent);
    box-shadow:
        0 10px 25px rgba(36, 40, 35, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.22);
    cursor: pointer;
    transition:
        transform 250ms cubic-bezier(0.22, 1, 0.36, 1),
        background-color 250ms ease,
        box-shadow 250ms ease;
}

.team-card__button:hover {
    transform: translateY(-3px) scale(1.07);
    background: var(--team-accent-dark);
    box-shadow:
        0 14px 30px rgba(36, 40, 35, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.team-card__button:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.team-card__button svg {
    width: 1.55rem;
    height: 1.55rem;
}

/* ==========================================================================
   Modal
   ========================================================================== */

.team-modal {
    position: fixed;
    inset: 0;
    margin: auto;

    width: min(1120px, calc(100% - 2rem));
    max-width: none;
    max-height: calc(100dvh - 2rem);
    padding: 0;
    overflow: visible;
    border: 0;
    color: var(--team-text);
    background: transparent;
}

.team-modal[open] {
    animation: team-modal-show 240ms ease-out;
}

.team-modal::backdrop {
    background: rgba(25, 29, 25, 0.78);
    backdrop-filter: blur(8px);
    animation: team-backdrop-show 240ms ease-out;
}

.team-modal__window {
    position: relative;
    max-height: calc(100dvh - 2rem);
    overflow: auto;
    border-radius: var(--team-radius);
    background: var(--team-surface);
    box-shadow:
        0 32px 80px rgba(20, 24, 20, 0.28),
        0 8px 24px rgba(20, 24, 20, 0.16);
    overscroll-behavior: contain;
}

.team-modal__content {
    min-height: min(690px, calc(100dvh - 2rem));
}

.team-modal__member {
    display: grid;
    grid-template-columns: minmax(320px, 0.92fr) minmax(380px, 1.08fr);
    min-height: inherit;
}

.team-modal__image-column {
    min-height: 620px;
    overflow: hidden;
    background: var(--team-background);
}

.team-modal__image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 620px;
    object-fit: cover;
}

.team-modal__text-column {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(3.5rem, 7vw, 6.5rem);
}

.team-modal__heading {
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--team-border);
}

.team-modal__heading > :first-child {
    margin-top: 0;
}

.team-modal__heading > :last-child {
    margin-bottom: 0;
}

.team-modal__heading h2,
.team-modal__heading h3,
.team-modal__heading h4 {
    margin: 0 0 0.8rem;
    color: var(--team-text);
    font-size: clamp(1.4rem, 1.5vw, 1.8rem);
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.05;
}

.team-modal__heading p {
    margin: 0;
    color: var(--team-muted);
    font-size: clamp(1rem, 1.5vw, 1.12rem);
    line-height: 1.65;
}

.team-modal__heading strong {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--team-accent-dark);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.065em;
    text-transform: uppercase;
}

/* ==========================================================================
   Quote in modal
   ========================================================================== */

.team-modal__quote {
    position: relative;
    margin: 2.35rem 0 0;
    padding: 0;
    border: 0;
}

.team-modal__quote-mark {
    display: block;
    height: 2.75rem;
    color: var(--team-accent);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 5.5rem;
    line-height: 1;
}

.team-modal__quote-text {
    max-width: 30ch;
    color: var(--team-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(1.35rem, 2.4vw, 2.05rem);
    font-style: italic;
    line-height: 1.45;
}

.team-modal__quote-text p {
    margin: 0;
}

/* ==========================================================================
   Modal controls
   ========================================================================== */

.team-modal__close {
    position: absolute;
    z-index: 5;
    top: 1.15rem;
    right: 1.15rem;
    display: grid;
    place-items: center;
    width: 2.8rem;
    height: 2.8rem;
    padding: 0 0 0.12rem;
    border: 1px solid rgba(48, 51, 47, 0.14);
    border-radius: 50%;
    color: var(--team-text);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 5px 16px rgba(32, 37, 32, 0.12);
    font-family: Arial, sans-serif;
    font-size: 2rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition:
        transform 180ms ease,
        background-color 180ms ease,
        box-shadow 180ms ease;
}

.team-modal__close:hover {
    transform: rotate(5deg) scale(1.06);
    background: #ffffff;
    box-shadow: 0 8px 20px rgba(32, 37, 32, 0.16);
}

.team-modal__navigation {
    position: fixed;
    z-index: 5;
    top: 50%;
    display: grid;
    place-items: center;
    width: 3.6rem;
    height: 3.6rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: #ffffff;
    background: rgba(30, 34, 30, 0.42);
    cursor: pointer;
    backdrop-filter: blur(5px);
    transform: translateY(-50%);
    transition:
        background-color 180ms ease,
        transform 180ms ease,
        border-color 180ms ease;
}

.team-modal__navigation:hover {
    border-color: rgba(255, 255, 255, 0.55);
    background: rgba(30, 34, 30, 0.72);
}

.team-modal__navigation--previous {
    left: max(1rem, calc((100vw - 1240px) / 2));
}

.team-modal__navigation--previous:hover {
    transform: translate(-3px, -50%);
}

.team-modal__navigation--next {
    right: max(1rem, calc((100vw - 1240px) / 2));
}

.team-modal__navigation--next:hover {
    transform: translate(3px, -50%);
}

.team-modal__close:focus-visible,
.team-modal__navigation:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 980px) {
    .team__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .team-modal {
        width: min(760px, calc(100% - 1.25rem));
        max-height: calc(100dvh - 1.25rem);
    }

    .team-modal__window {
        max-height: calc(100dvh - 1.25rem);
    }

    .team-modal__member {
        grid-template-columns: 1fr;
    }

    .team-modal__image-column {
        min-height: auto;
        aspect-ratio: 16 / 10;
    }

    .team-modal__image {
        min-height: 0;
    }

    .team-modal__text-column {
        padding: 3rem clamp(1.5rem, 6vw, 3.5rem) 4.8rem;
    }

    .team-modal__navigation {
        position: absolute;
        top: auto;
        bottom: 1rem;
        width: 3rem;
        height: 3rem;
        color: var(--team-text);
        background: rgba(255, 255, 255, 0.92);
        border-color: var(--team-border);
        transform: none;
    }

    .team-modal__navigation--previous {
        right: 4.75rem;
        left: auto;
    }

    .team-modal__navigation--next {
        right: 1rem;
    }

    .team-modal__navigation--previous:hover {
        transform: translateX(-3px);
    }

    .team-modal__navigation--next:hover {
        transform: translateX(3px);
    }
}

/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 640px) {
    .team__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .team-card__content {
        padding: 1.35rem 1.25rem 1.5rem;
    }

    .team-card__heading h2,
    .team-card__heading h3,
    .team-card__heading h4 {
        font-size: 1.75rem;
    }

    .team-card__button {
        right: 0.8rem;
        bottom: 0.8rem;
        width: 3.15rem;
        height: 3.15rem;
    }

    .team-modal {
        width: min(100% - 0.75rem, 760px);
        max-height: calc(100dvh - 0.75rem);
    }

    .team-modal__window {
        max-height: calc(100dvh - 0.75rem);
    }

    .team-modal__image-column {
        aspect-ratio: 4 / 3;
    }

    .team-modal__text-column {
        padding: 2.5rem 1.35rem 4.8rem;
    }

    .team-modal__close {
        top: 0.75rem;
        right: 0.75rem;
    }

    .team-modal__heading h2,
    .team-modal__heading h3,
    .team-modal__heading h4 {
        font-size: 2rem;
    }

    .team-modal__quote-text {
        font-size: 1.35rem;
    }
}

/* ==========================================================================
   Motion
   ========================================================================== */

@keyframes team-modal-show {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes team-backdrop-show {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@media (prefers-reduced-motion: reduce) {
    .team *,
    .team *::before,
    .team *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.team blockquote.team-modal__quote:before {
	display:none;
}

/* Content-Block markup and accessibility */
.team-card__trigger {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
    flex-direction: column;
}
.team-card__trigger:focus-visible { outline: 3px solid var(--team-accent-dark); outline-offset: -3px; }
.team-card__trigger--static { cursor: default; }
.team-card__image-wrapper, .team-card__content, .team-card__heading { width: 100%; }
.team-card__name { display: block; margin: 0 0 .75rem; color: var(--team-text); font-size: clamp(1.4rem,1.5vw,1.8rem); font-weight: 600; line-height: 1.15; text-transform: none; letter-spacing: -.02em; }
.team-card__details, .team-modal__meta { color: var(--team-muted); line-height: 1.65; }
.team-card__details p, .team-modal__meta p { margin: 0; }
.team-modal__heading { margin: 0; color: var(--team-text); font-size: clamp(2rem,4vw,3.4rem); font-weight: 400; line-height: 1.05; }
.team-modal__navigation svg { width: 1.5rem; height: 1.5rem; }
.team blockquote.team-modal__quote::before { display: none; }
