.teacher-team-page {
    --tt-ink: #172126;
    --tt-muted: #5b6b72;
    --tt-line: #dbe3e1;
    --tt-surface: #ffffff;
    --tt-soft: #eef6f4;
    --tt-teal: #087f83;
    --tt-teal-dark: #075f63;
    --tt-gold: #f0b541;
    --tt-coral: #df5a4f;
    --tt-shadow: 0 12px 30px rgba(23, 33, 38, 0.08);
    width: calc(100% - 32px);
    max-width: 1220px;
    padding-bottom: 68px;
    color: var(--tt-ink);
    letter-spacing: 0;
}

.teacher-team-page *,
.teacher-team-page *::before,
.teacher-team-page *::after {
    box-sizing: border-box;
    letter-spacing: 0;
}

.teacher-team-page [hidden] {
    display: none !important;
}

.teacher-team-hero {
    position: relative;
    min-height: 248px;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding: 42px 52px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background:
        linear-gradient(rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
        linear-gradient(118deg, #111a1e 0%, #13383b 58%, #0a7377 100%);
    background-size: 28px 28px, 28px 28px, auto;
    box-shadow: 0 18px 42px rgba(17, 26, 30, 0.18);
    color: #ffffff;
}

.teacher-team-hero::before {
    position: absolute;
    top: 0;
    right: 22%;
    bottom: 0;
    width: 1px;
    background: rgba(255, 255, 255, 0.16);
    content: "";
    transform: skewX(-18deg);
}

.teacher-team-hero::after {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 32%;
    height: 5px;
    background: linear-gradient(90deg, var(--tt-gold), var(--tt-coral));
    content: "";
}

.teacher-team-hero__content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.teacher-team-hero__eyebrow,
.teacher-team-directory__eyebrow {
    margin: 0 0 12px;
    color: #92e3dc;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.teacher-team-hero__eyebrow .fa {
    margin-right: 7px;
    color: var(--tt-gold);
}

.teacher-team-hero h1 {
    margin: 0;
    color: #ffffff;
    font-size: 42px;
    font-weight: 800;
    line-height: 1.2;
}

.teacher-team-hero__subtitle {
    max-width: 620px;
    margin: 16px 0 0;
    color: rgba(255, 255, 255, 0.86);
    font-size: 18px;
    line-height: 1.75;
}

.teacher-team-hero__visual {
    position: absolute;
    z-index: 1;
    top: 32px;
    right: 42px;
    bottom: 32px;
    width: 245px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    color: rgba(255, 255, 255, 0.32);
    pointer-events: none;
}

.teacher-team-hero__symbol {
    color: rgba(255, 255, 255, 0.24);
    font-family: Consolas, Monaco, monospace;
    font-size: 58px;
    font-weight: 700;
    line-height: 1;
}

.teacher-team-hero__line {
    color: rgba(255, 255, 255, 0.52);
    font-family: Consolas, Monaco, monospace;
    font-size: 11px;
}

.teacher-team-hero__index {
    color: var(--tt-gold);
    font-family: Consolas, Monaco, monospace;
    font-size: 24px;
    font-weight: 700;
}

.teacher-team-directory {
    padding-top: 42px;
}

.teacher-team-directory__header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 22px;
}

.teacher-team-directory__eyebrow {
    margin-bottom: 7px;
    color: var(--tt-teal);
}

.teacher-team-directory__header h2 {
    margin: 0;
    color: var(--tt-ink);
    font-size: 28px;
    font-weight: 750;
    line-height: 1.35;
}

.teacher-team-directory__count {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin: 0;
    color: var(--tt-muted);
    white-space: nowrap;
}

.teacher-team-directory__count strong {
    color: var(--tt-teal-dark);
    font-size: 26px;
    line-height: 1;
}

.teacher-team-directory__count span {
    font-size: 14px;
}

.teacher-team-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 22px;
}

.teacher-card {
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--tt-line);
    border-radius: 8px;
    background: var(--tt-surface);
    box-shadow: var(--tt-shadow);
    transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.teacher-card:hover {
    transform: translateY(-3px);
    border-color: rgba(8, 127, 131, 0.38);
    box-shadow: 0 17px 36px rgba(23, 33, 38, 0.13);
}

.teacher-card__media {
    position: relative;
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
    border-bottom: 1px solid var(--tt-line);
    background:
        linear-gradient(135deg, rgba(8, 127, 131, 0.08), rgba(240, 181, 65, 0.08)),
        #edf3f1;
}

.teacher-card__image {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: center;
}

.teacher-card__image-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(7, 95, 99, 0.34);
    font-size: 34px;
}

.teacher-card__media.is-image-error .teacher-card__image {
    display: none;
}

.teacher-card__body {
    min-height: 260px;
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: flex-start;
    padding: 20px 20px 18px;
}

.teacher-card__name {
    margin: 0;
    color: var(--tt-ink);
    font-size: 22px;
    font-weight: 750;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.teacher-card__role,
.teacher-detail__role {
    margin: 7px 0 0;
    color: var(--tt-teal-dark);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.55;
}

.teacher-card__summary {
    display: -webkit-box;
    overflow: hidden;
    margin: 14px 0 18px;
    color: var(--tt-muted);
    font-size: 14px;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.teacher-card__highlights,
.teacher-detail__highlights {
    width: 100%;
    margin: 13px 0 0;
}

.teacher-card__highlights > div,
.teacher-detail__highlights > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
    line-height: 1.55;
}

.teacher-card__highlights dt,
.teacher-detail__highlights dt {
    color: var(--tt-teal-dark);
    font-weight: 700;
}

.teacher-card__highlights dd,
.teacher-detail__highlights dd {
    min-width: 0;
    margin: 0;
    color: var(--tt-muted);
    overflow-wrap: anywhere;
}

.teacher-card__action {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 9px 15px;
    border: 1px solid var(--tt-teal);
    border-radius: 6px;
    background: var(--tt-teal);
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.teacher-card__action:hover,
.teacher-card__action:focus {
    transform: translateY(-1px);
    border-color: var(--tt-teal-dark);
    background: var(--tt-teal-dark);
    color: #ffffff;
}

.teacher-card__action:focus-visible,
.teacher-pagination button:focus-visible,
.teacher-modal button:focus-visible,
.teacher-lightbox button:focus-visible,
.teacher-certificate:focus-visible {
    outline: 3px solid rgba(240, 181, 65, 0.72);
    outline-offset: 3px;
}

.teacher-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 34px;
}

.teacher-pagination__pages {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.teacher-pagination button {
    min-width: 40px;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    border: 1px solid var(--tt-line);
    border-radius: 6px;
    background: #ffffff;
    color: var(--tt-ink);
    font-size: 14px;
    font-weight: 650;
    line-height: 1;
}

.teacher-pagination button:hover:not(:disabled),
.teacher-pagination button.is-active {
    border-color: var(--tt-teal);
    background: var(--tt-teal);
    color: #ffffff;
}

.teacher-pagination button:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.teacher-team-empty {
    margin-top: 36px;
    padding: 52px 24px;
    border: 1px solid var(--tt-line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--tt-muted);
    text-align: center;
}

.teacher-team-empty .fa {
    color: var(--tt-teal);
    font-size: 34px;
}

.teacher-team-empty h2 {
    margin: 14px 0 8px;
    color: var(--tt-ink);
    font-size: 22px;
}

.teacher-team-empty p {
    margin: 0;
    font-size: 15px;
}

body.teacher-modal-open {
    position: fixed;
    right: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
}

.teacher-modal,
.teacher-lightbox {
    position: fixed;
    z-index: 2050;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.teacher-modal__backdrop,
.teacher-lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(11, 18, 21, 0.78);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.teacher-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 1000px);
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: #f8fbfa;
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.34);
}

.teacher-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--tt-line);
    background: #ffffff;
}

.teacher-modal__header p {
    margin: 0 0 4px;
    color: var(--tt-teal);
    font-size: 11px;
    font-weight: 750;
}

.teacher-modal__header h2 {
    margin: 0;
    color: var(--tt-ink);
    font-size: 24px;
    font-weight: 750;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.teacher-modal__close,
.teacher-lightbox__close {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--tt-line);
    border-radius: 50%;
    background: #ffffff;
    color: var(--tt-ink);
    font-size: 17px;
}

.teacher-modal__close:hover,
.teacher-lightbox__close:hover {
    border-color: var(--tt-coral);
    color: var(--tt-coral);
}

.teacher-modal__body {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
}

.teacher-detail {
    display: grid;
    grid-template-columns: minmax(260px, 38%) minmax(0, 62%);
    align-items: start;
    gap: 26px;
}

.teacher-detail__portrait {
    position: sticky;
    top: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--tt-line);
    border-radius: 8px;
    background: #edf3f1;
    cursor: zoom-in;
    text-align: inherit;
}

.teacher-detail__portrait img {
    width: 100%;
    height: auto;
    max-height: 520px;
    display: block;
    object-fit: contain;
}

.teacher-detail__content {
    min-width: 0;
}

.teacher-detail__role {
    margin-top: 0;
    font-size: 16px;
}

.teacher-detail__text {
    margin-top: 18px;
}

.teacher-detail__text p {
    margin: 0 0 12px;
    color: #3f4f55;
    font-size: 15px;
    line-height: 1.85;
    overflow-wrap: anywhere;
}

.teacher-detail__certificates {
    grid-column: 1 / -1;
    padding-top: 6px;
}

.teacher-detail__certificates h3 {
    margin: 0 0 14px;
    color: var(--tt-ink);
    font-size: 18px;
    font-weight: 750;
}

.teacher-certificate-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.teacher-certificate {
    position: relative;
    min-width: 0;
    overflow: hidden;
    padding: 7px;
    border: 1px solid var(--tt-line);
    border-radius: 6px;
    background: #ffffff;
    cursor: zoom-in;
}

.teacher-certificate img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.teacher-certificate__zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(7, 95, 99, 0.9);
    color: #ffffff;
    font-size: 14px;
}

.teacher-lightbox {
    z-index: 2150;
}

.teacher-lightbox__dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 1120px);
    height: min(88vh, 850px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.teacher-lightbox__dialog > img {
    max-width: 100%;
    max-height: 100%;
    display: block;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
}

.teacher-lightbox__close {
    position: absolute;
    z-index: 2;
    top: 0;
    right: 0;
}

@media (max-width: 1199px) {
    .teacher-team-page {
        width: calc(100% - 24px);
    }

    .teacher-team-hero {
        min-height: 230px;
        padding: 36px 40px;
    }

    .teacher-team-hero h1 {
        font-size: 36px;
    }

    .teacher-team-hero__visual {
        right: 32px;
        width: 190px;
    }

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

    .teacher-detail {
        grid-template-columns: minmax(220px, 40%) minmax(0, 60%);
        gap: 20px;
    }
}

@media (max-width: 767px) {
    .teacher-team-page {
        width: 100%;
        padding-bottom: 48px;
    }

    .teacher-team-hero {
        min-height: 220px;
        padding: 32px 28px;
    }

    .teacher-team-hero h1 {
        font-size: 32px;
    }

    .teacher-team-hero__subtitle {
        max-width: 78%;
        font-size: 16px;
    }

    .teacher-team-hero__visual {
        top: 34px;
        right: 24px;
        bottom: 26px;
        width: 130px;
    }

    .teacher-team-hero__symbol {
        font-size: 42px;
    }

    .teacher-team-hero__line {
        display: none;
    }

    .teacher-team-directory {
        padding-top: 32px;
    }

    .teacher-team-directory__header h2 {
        font-size: 24px;
    }

    .teacher-modal {
        align-items: stretch;
        padding: 8px;
    }

    .teacher-modal__dialog {
        width: 100%;
        max-height: calc(100vh - 16px);
        max-height: calc(100dvh - 16px);
    }

    .teacher-modal__header {
        padding: 14px 16px;
    }

    .teacher-modal__header h2 {
        font-size: 21px;
    }

    .teacher-modal__body {
        padding: 16px;
    }

    .teacher-detail {
        grid-template-columns: minmax(0, 1fr);
    }

    .teacher-detail__portrait {
        position: static;
    }

    .teacher-detail__portrait img {
        max-height: none;
    }

    .teacher-detail__certificates {
        grid-column: 1;
    }

    .teacher-lightbox {
        padding: 8px;
    }

    .teacher-lightbox__dialog {
        height: calc(100vh - 16px);
        height: calc(100dvh - 16px);
        padding: 42px 6px 6px;
    }
}

@media (max-width: 640px) {
    .teacher-team-hero {
        min-height: 230px;
        padding: 30px 22px;
    }

    .teacher-team-hero h1 {
        font-size: 29px;
    }

    .teacher-team-hero__subtitle {
        max-width: 88%;
    }

    .teacher-team-hero__visual {
        opacity: 0.64;
    }

    .teacher-team-directory__header {
        align-items: flex-start;
    }

    .teacher-team-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .teacher-card__body {
        min-height: 240px;
    }

    .teacher-certificate-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 380px) {
    .teacher-team-hero {
        min-height: 238px;
        padding: 28px 18px;
    }

    .teacher-team-hero__visual {
        right: 16px;
        width: 96px;
    }

    .teacher-team-directory__header {
        gap: 12px;
    }

    .teacher-team-directory__count {
        flex-direction: column;
        align-items: flex-end;
        gap: 3px;
    }

    .teacher-pagination {
        gap: 6px;
    }

    .teacher-pagination button {
        min-width: 36px;
        min-height: 38px;
        padding: 7px 9px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .teacher-card,
    .teacher-card__action {
        transition-duration: 0.001ms !important;
    }
}
