/*
 * AI/GEO teacher hub additions.
 * The global brand system is loaded first from /style.css and
 * /includes/site-header.css. This file only styles page-specific content.
 */

:root {
    --hub-purple: #8e2de2;
    --hub-purple-deep: #4a00e0;
    --hub-gold: #d6b25e;
    --hub-gold-light: #f2d78b;
    --hub-text: #1c1c1e;
    --hub-muted: #6e6e73;
    --hub-bg: #fafafa;
    --hub-card: rgba(255, 255, 255, 0.9);
    --hub-line: rgba(28, 28, 30, 0.1);
    --hub-purple-soft: rgba(142, 45, 226, 0.07);
    --hub-gold-soft: rgba(214, 178, 94, 0.12);
    --hub-shadow: 0 8px 28px rgba(0, 0, 0, 0.06);
    --hub-width: 1180px;
}

.ith-ai-hub {
    margin: 0;
    overflow-x: hidden;
    color: var(--hub-text);
    background: var(--hub-bg);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    line-height: 1.65;
    letter-spacing: 0.01em;
    -webkit-font-smoothing: antialiased;
}

.ith-ai-hub *,
.ith-ai-hub *::before,
.ith-ai-hub *::after {
    box-sizing: border-box;
}

.ith-ai-hub a {
    color: inherit;
}

.ith-ai-hub button,
.ith-ai-hub input,
.ith-ai-hub select {
    font: inherit;
}

.skip-link {
    position: fixed;
    top: 8px;
    left: 8px;
    z-index: 3000;
    padding: 10px 14px;
    color: #fff;
    background: var(--hub-purple-deep);
    border-radius: 10px;
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.ith-ai-hub .topbar {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", sans-serif;
}

.ith-ai-hub .topbar .main-title {
    white-space: nowrap;
}

.ith-ai-hub .topbar .sub-title {
    white-space: nowrap;
}

.ith-ai-hub main {
    display: block;
}

.hero {
    width: min(calc(100% - 40px), var(--hub-width));
    min-height: 470px;
    margin: 0 auto;
    padding: 58px 0 64px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
    gap: clamp(44px, 7vw, 92px);
}

.hero-copy {
    width: min(100%, 880px);
    margin: 0 auto;
    text-align: center;
}

.eyebrow,
.panel-kicker,
.mini-label {
    margin: 0 0 16px;
    color: var(--hub-purple);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.hero h1,
.section-heading h2,
.closing h2 {
    margin: 0;
    color: var(--hub-text);
    font-family: "SF Pro Display", -apple-system, BlinkMacSystemFont, "PingFang SC", sans-serif;
    font-weight: 700;
    letter-spacing: -0.045em;
}

.hero h1 {
    max-width: 960px;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(42px, 5.2vw, 68px);
    line-height: 1.1;
}

.hero h1 em {
    color: var(--hub-purple);
    font-style: normal;
    background: linear-gradient(90deg, var(--hub-purple), var(--hub-purple-deep));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-lead {
    max-width: 710px;
    margin: 30px auto 0;
    color: var(--hub-muted);
    font-size: clamp(16px, 1.6vw, 20px);
    line-height: 1.9;
}

.hero-actions {
    margin-top: 36px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.button {
    min-height: 48px;
    padding: 11px 21px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 14px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-2px);
}

.button-primary {
    color: #fff !important;
    background: linear-gradient(90deg, var(--hub-purple), var(--hub-purple-deep));
    box-shadow: 0 8px 22px rgba(142, 45, 226, 0.2);
}

.button-quiet {
    color: var(--hub-text) !important;
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--hub-line);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.04);
}

.hero-panel {
    position: relative;
    min-height: 390px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: #fff;
    background:
        radial-gradient(circle at 85% 10%, rgba(255, 216, 128, 0.42), transparent 34%),
        linear-gradient(145deg, var(--hub-purple), var(--hub-purple-deep));
    border-radius: 24px;
    box-shadow: 0 18px 46px rgba(91, 31, 178, 0.2);
    overflow: hidden;
}

.hero-panel::before {
    content: "";
    position: absolute;
    top: 28px;
    right: 28px;
    width: 116px;
    height: 116px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    box-shadow: 0 0 0 20px rgba(255, 255, 255, 0.045), 0 0 0 40px rgba(255, 255, 255, 0.025);
}

.hero-panel .panel-kicker {
    color: #ffe6a5;
}

.hero-panel > strong {
    font-family: "SF Pro Display", -apple-system, sans-serif;
    font-size: 96px;
    font-weight: 700;
    line-height: 0.9;
}

.hero-panel > span {
    margin-top: 10px;
    font-size: 17px;
}

.hero-panel dl {
    margin: 26px 0 18px;
    padding-top: 20px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
}

.hero-panel dt {
    font-size: 25px;
    font-weight: 700;
}

.hero-panel dd {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, 0.72);
    font-size: 10px;
    line-height: 1.35;
}

.hero-panel > p:last-child {
    margin: 0;
    color: rgba(255, 255, 255, 0.62);
    font-size: 10px;
}

.identity-strip {
    width: min(calc(100% - 40px), var(--hub-width));
    margin: 0 auto 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.identity-strip > div {
    min-height: 150px;
    padding: 28px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 18px;
    background: var(--hub-card);
    border: 1px solid var(--hub-line);
    border-radius: 20px;
    box-shadow: var(--hub-shadow);
}

.identity-strip .number {
    color: var(--hub-gold);
    font-size: 13px;
    font-weight: 700;
}

.identity-strip p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 13px;
}

.identity-strip strong {
    display: block;
    margin-bottom: 10px;
    color: var(--hub-text);
    font-size: 19px;
    font-weight: 600;
}

.matching,
.faq {
    width: min(calc(100% - 40px), var(--hub-width));
    margin: 0 auto;
    padding: 78px 0;
}

.section-heading {
    margin-bottom: 38px;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.6fr);
    align-items: end;
    gap: 48px;
}

.section-heading h2,
.closing h2 {
    font-size: clamp(34px, 4.7vw, 56px);
    line-height: 1.16;
}

.section-heading > p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 14px;
}

.filter-panel {
    position: sticky;
    top: 74px;
    z-index: 1000;
    padding: 20px;
    display: block;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(214, 178, 94, 0.22);
    border-radius: 24px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.07);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.filter-primary,
.filter-secondary {
    display: grid;
    gap: 13px;
}

.filter-primary {
    grid-template-columns: minmax(280px, 1.6fr) repeat(2, minmax(170px, 1fr));
}

.advanced-filters {
    margin-top: 13px;
    border-top: 1px solid var(--hub-line);
}

.advanced-filters > summary {
    padding: 13px 2px 0;
    color: var(--hub-purple);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.advanced-filters[open] > summary {
    margin-bottom: 13px;
}

.filter-secondary {
    grid-template-columns: repeat(5, minmax(135px, 1fr));
}

.filter-panel label {
    min-width: 0;
}

.filter-panel label > span {
    display: block;
    margin: 0 0 7px 2px;
    color: var(--hub-muted);
    font-size: 11px;
    font-weight: 600;
}

.filter-panel input,
.filter-panel select,
.reset-button {
    width: 100%;
    min-height: 48px;
    padding: 10px 13px;
    color: var(--hub-text);
    background: #f7f7f8;
    border: 1px solid rgba(28, 28, 30, 0.07);
    border-radius: 14px;
    outline: none;
}

.filter-panel input:focus,
.filter-panel select:focus,
.reset-button:focus-visible {
    border-color: rgba(142, 45, 226, 0.48);
    box-shadow: 0 0 0 4px rgba(142, 45, 226, 0.08);
}

.reset-button {
    align-self: end;
    color: #fff;
    background: linear-gradient(90deg, var(--hub-gold-light), var(--hub-gold));
    border: 0;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(214, 178, 94, 0.2);
}

.data-note {
    margin: 22px 0 0;
    padding: 17px 20px;
    display: flex;
    align-items: baseline;
    gap: 16px;
    color: #715d2d;
    background: var(--hub-gold-soft);
    border: 1px solid rgba(214, 178, 94, 0.18);
    border-radius: 14px;
}

.data-note strong {
    flex: 0 0 auto;
    font-size: 13px;
}

.data-note p {
    margin: 0;
    font-size: 13px;
}

.results-toolbar {
    margin: 32px 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    color: var(--hub-muted);
    font-size: 13px;
}

.results-toolbar p {
    margin: 0;
}

.results-toolbar strong {
    color: var(--hub-purple);
    font-size: 27px;
    font-weight: 700;
}

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

/* Extend the website's existing teacher-card visual language for richer GEO data. */
.ith-ai-hub .teacher-grid .teacher-card {
    width: auto;
    min-width: 0;
    min-height: 0;
    height: auto;
    padding: 25px;
    align-items: stretch;
    text-align: left;
    cursor: default;
    background: var(--hub-card);
    border: 1px solid rgba(214, 178, 94, 0.2);
    border-radius: 20px;
    box-shadow: var(--hub-shadow);
    overflow: visible;
    scroll-margin-top: 155px;
}

.ith-ai-hub .teacher-grid .teacher-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(214, 178, 94, 0.2);
}

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

.card-topline {
    margin-bottom: 22px;
    padding-bottom: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--hub-muted);
    border-bottom: 1px solid var(--hub-line);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.resume-badge {
    padding: 4px 8px;
    color: #6f5315;
    background: var(--hub-gold-soft);
    border-radius: 999px;
    letter-spacing: 0;
    text-transform: none;
}

.teacher-intro {
    display: flex;
    align-items: center;
    gap: 18px;
}

.avatar-shell {
    position: relative;
    width: 104px;
    height: 104px;
    flex: 0 0 104px;
    display: grid;
    place-items: center;
    color: var(--hub-muted);
    background: transparent;
    border-radius: 6px;
    box-shadow: none;
    border: 0;
    overflow: hidden;
    font-size: 28px;
    font-weight: 600;
}

.ith-ai-hub .avatar-shell .teacher-avatar {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    object-position: center top;
    transform: none;
    transform-origin: center top;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.ith-ai-hub .teacher-intro .teacher-name {
    margin: 0;
    color: var(--hub-text);
    font-size: 28px;
    font-weight: 600;
    line-height: 1.2;
}

.english-name,
.ith-ai-hub .teacher-type {
    margin: 5px 0 0;
    color: var(--hub-muted);
    font-size: 12px;
}

.ith-ai-hub .teacher-type {
    color: #8f6e20;
}

.ith-ai-hub .teacher-tags.tag-row {
    margin: 20px 0 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 7px;
}

.ith-ai-hub .teacher-tags.tag-row span {
    padding: 5px 10px;
    color: var(--hub-text);
    background: transparent;
    border: 1px solid rgba(214, 178, 94, 0.42);
    border-radius: 14px;
    box-shadow: inset 0 0 4px rgba(214, 178, 94, 0.12);
    font-size: 11px;
    font-weight: 500;
}

.card-bio {
    min-height: 70px;
    margin: 18px 0;
    display: -webkit-box;
    overflow: hidden;
    color: #3c3c43;
    font-size: 13px;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.quick-facts,
.profile-facts {
    margin: 0;
    display: grid;
    border-top: 1px solid var(--hub-line);
    border-left: 1px solid var(--hub-line);
}

.quick-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.profile-facts {
    margin: 16px 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-facts div,
.profile-facts div {
    min-width: 0;
    padding: 12px;
    border-right: 1px solid var(--hub-line);
    border-bottom: 1px solid var(--hub-line);
}

.quick-facts dt,
.profile-facts dt {
    color: var(--hub-muted);
    font-size: 10px;
    font-weight: 600;
}

.quick-facts dd,
.profile-facts dd {
    margin: 5px 0 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.5;
}

.profile-page-link {
    margin-top: 17px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff !important;
    background: linear-gradient(90deg, var(--hub-purple), var(--hub-purple-deep));
    border-radius: 12px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 650;
    box-shadow: 0 7px 18px rgba(94, 35, 190, 0.16);
}

.profile-page-link:hover,
.profile-page-link:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(94, 35, 190, 0.22);
}

.matching-summary {
    margin: 20px 0 18px;
    padding: 17px 18px;
    background: linear-gradient(135deg, rgba(142, 45, 226, 0.055), rgba(214, 178, 94, 0.08));
    border-left: 3px solid var(--hub-purple);
    border-radius: 4px 14px 14px 4px;
}

.matching-summary .mini-label {
    margin-bottom: 8px;
    font-size: 9px;
}

.matching-summary p:last-child {
    margin: 0;
    color: #3c3c43;
    font-size: 13px;
    line-height: 1.75;
}

.fact-grid {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-top: 1px solid var(--hub-line);
    border-left: 1px solid var(--hub-line);
}

.fact-grid div {
    min-width: 0;
    padding: 13px;
    border-right: 1px solid var(--hub-line);
    border-bottom: 1px solid var(--hub-line);
}

.fact-grid dt {
    color: var(--hub-muted);
    font-size: 10px;
    font-weight: 600;
}

.fact-grid dd {
    margin: 5px 0 0;
    color: var(--hub-text);
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.55;
}

.student-fit {
    margin-top: 18px;
}

.student-fit h4,
.details-body h4 {
    margin: 0 0 6px;
    color: var(--hub-text);
    font-size: 11px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.student-fit p,
.details-body p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 12px;
    line-height: 1.7;
}

.teacher-card > details {
    margin-top: 18px;
    border-top: 1px solid var(--hub-line);
}

.teacher-card > details summary {
    padding: 14px 0 0;
    color: var(--hub-purple);
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
}

.details-body {
    padding-top: 15px;
}

.details-body h4:not(:first-child) {
    margin-top: 15px;
}

.details-body p[lang="en"] {
    margin-top: 9px;
    padding-left: 11px;
    border-left: 2px solid rgba(142, 45, 226, 0.18);
}

.resume-panel {
    margin-top: 20px;
    padding: 16px;
    display: grid;
    grid-template-columns: 1fr 150px;
    align-items: start;
    gap: 18px;
    background: var(--hub-purple-soft);
    border: 1px solid rgba(142, 45, 226, 0.12);
    border-radius: 16px;
}

.resume-link {
    position: relative;
    display: block;
    overflow: hidden;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.resume-link img {
    width: 100%;
    aspect-ratio: 0.707;
    display: block;
    object-fit: cover;
    object-position: top;
}

.resume-link span {
    padding: 9px 8px;
    display: block;
    color: #fff;
    background: var(--hub-purple-deep);
    text-align: center;
    font-size: 11px;
    font-weight: 600;
}

.resume-private-note {
    margin-top: 18px !important;
    padding: 13px 15px;
    color: #6f5315 !important;
    background: var(--hub-gold-soft);
    border-radius: 12px;
}

.keyword-list {
    word-break: break-word;
}

.no-results {
    padding: 65px 22px;
    text-align: center;
    color: var(--hub-muted);
    background: #fff;
    border: 1px dashed rgba(142, 45, 226, 0.25);
    border-radius: 20px;
}

.no-results strong {
    display: block;
    color: var(--hub-text);
    font-size: 23px;
}

.method {
    padding: 100px max(20px, calc((100vw - var(--hub-width)) / 2));
    background: linear-gradient(180deg, rgba(142, 45, 226, 0.065), rgba(255, 255, 255, 0.7));
    border-top: 1px solid rgba(142, 45, 226, 0.08);
    border-bottom: 1px solid rgba(142, 45, 226, 0.08);
}

.method-steps {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    list-style: none;
}

.method-steps li {
    min-height: 230px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(142, 45, 226, 0.1);
    border-radius: 20px;
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.04);
}

.method-steps span {
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: #fff;
    background: linear-gradient(135deg, var(--hub-purple), var(--hub-purple-deep));
    border-radius: 50%;
    font-weight: 700;
}

.method-steps h3 {
    margin: 52px 0 8px;
    color: var(--hub-text);
    font-size: 21px;
    font-weight: 600;
}

.method-steps p {
    margin: 0;
    color: var(--hub-muted);
    font-size: 13px;
}

.faq-list {
    border-top: 1px solid var(--hub-line);
}

.faq-list details {
    border-bottom: 1px solid var(--hub-line);
}

.faq-list summary {
    padding: 23px 4px;
    color: var(--hub-text);
    cursor: pointer;
    font-size: 20px;
    font-weight: 600;
}

.faq-list p {
    max-width: 850px;
    margin: -7px 0 23px;
    color: var(--hub-muted);
}

.closing {
    padding: 105px 20px;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at center 5%, rgba(255, 220, 139, 0.28), transparent 34%),
        linear-gradient(135deg, var(--hub-purple), var(--hub-purple-deep));
}

.closing .eyebrow {
    color: #ffe5a0;
}

.closing h2 {
    color: #fff;
}

.closing p:not(.eyebrow) {
    max-width: 620px;
    margin: 25px auto 29px;
    color: rgba(255, 255, 255, 0.76);
}

.closing .button-primary {
    color: var(--hub-text) !important;
    background: linear-gradient(90deg, var(--hub-gold-light), var(--hub-gold));
    box-shadow: 0 8px 24px rgba(42, 14, 80, 0.2);
}

.ith-ai-hub .ith-footer {
    margin-top: 0;
}

@media (max-width: 1040px) {
    .hero {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .hero-panel {
        min-height: 330px;
    }

    .identity-strip {
        grid-template-columns: 1fr;
    }

    .identity-strip > div {
        min-height: auto;
    }

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

    .search-field {
        grid-column: span 2;
    }

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

    .teacher-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 720px) {
    .hero {
        min-height: auto;
        padding: 58px 0 66px;
    }

    .hero h1 {
        font-size: clamp(36px, 10.5vw, 48px);
    }

    .hero-panel {
        min-height: 360px;
        padding: 25px;
    }

    .matching,
    .faq,
    .method {
        padding-top: 72px;
        padding-bottom: 72px;
    }

    .section-heading {
        grid-template-columns: 1fr;
        gap: 17px;
    }

    .filter-primary,
    .filter-secondary {
        position: static;
        grid-template-columns: 1fr;
    }

    .search-field {
        grid-column: auto;
    }

    .data-note,
    .results-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .ith-ai-hub .teacher-grid .teacher-card {
        padding: 20px;
    }

    .teacher-intro {
        align-items: flex-start;
    }

    .avatar-shell {
        width: 88px;
        height: 88px;
        flex-basis: 88px;
    }

    .ith-ai-hub .teacher-intro .teacher-name {
        font-size: 24px;
    }

    .fact-grid,
    .quick-facts,
    .profile-facts {
        grid-template-columns: 1fr;
    }

    .resume-panel {
        grid-template-columns: 1fr;
    }

    .resume-link {
        width: min(100%, 230px);
    }

    .method-steps {
        grid-template-columns: 1fr;
    }

    .method-steps li {
        min-height: 200px;
    }
}

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