/* =========================================================
   teachers.css — KIU O'qituvchilar sahifasi
   Подключается через functions.php: wp_enqueue_style()
   ========================================================= */

/* ─── TOKENS ─────────────────────────────────────────────── */
:root {
    --tc-green:        #1D9E75;
    --tc-green-dark:   #0F6E56;
    --tc-green-bg:     #E1F5EE;
    --tc-dark:         #0F2C2C;
    --tc-text:         #2C2C2A;
    --tc-muted:        #5F5E5A;
    --tc-subtle:       #888780;
    --tc-border:       #E8E6DE;
    --tc-border-soft:  #F1EFE8;
    --tc-bg:           #F7F6F2;
    --tc-white:        #ffffff;

    /* Аватары — 5 цветов, чередуются */
    --av1-bg: #E1F5EE; --av1-c: #085041;
    --av2-bg: #E6F1FB; --av2-c: #0C447C;
    --av3-bg: #FAEEDA; --av3-c: #633806;
    --av4-bg: #EEEDFE; --av4-c: #3C3489;
    --av5-bg: #FCEBEB; --av5-c: #791F1F;

    --tc-sidebar-w:   220px;
    --tc-meta-w:      180px;
    --tc-radius:      10px;
    --tc-radius-lg:   14px;
}

/* ─── LAYOUT ─────────────────────────────────────────────── */
.tc-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.tc-page {
    background: var(--tc-bg);
    padding: 48px 0 72px;
}

.tc-layout {
    display: grid;
    grid-template-columns: var(--tc-sidebar-w) 1fr var(--tc-meta-w);
    gap: 24px;
    align-items: start;
}

/* ─── BANNER ─────────────────────────────────────────────── */
.tc-banner {
    position: relative;
    background-color: var(--tc-dark);
    background-image: var(--tc-banner-bg);
    background-size: cover;
    background-position: center;
    padding: 80px 24px;
    text-align: center;
}

.tc-banner__overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 35, 30, 0.65);
}

.tc-banner__inner {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

.tc-banner__title {
    font-size: clamp(1.6rem, 4vw, 2.6rem);
    font-weight: 700;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.25;
}

.tc-banner__sub {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.05em;
    margin: 0;
}

/* ─── LEFT SIDEBAR ───────────────────────────────────────── */
.tc-sidebar {
    background: var(--tc-white);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.tc-sidebar__header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tc-border);
    font-size: 13px;
    font-weight: 600;
    color: var(--tc-text);
}

.tc-sidebar__icon {
    width: 16px;
    height: 16px;
    color: var(--tc-green);
    flex-shrink: 0;
}

.tc-sidebar__nav {
    display: flex;
    flex-direction: column;
    padding: 8px;
    gap: 2px;
}

.tc-sidebar__empty {
    font-size: 13px;
    color: var(--tc-muted);
    padding: 8px;
    margin: 0;
}

/* Filter buttons */
.tc-filter-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    background: transparent;
    border: none;
    border-radius: var(--tc-radius);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

.tc-filter-btn:hover {
    background: var(--tc-green-bg);
}

.tc-filter-btn.is-active {
    background: var(--tc-green);
}

.tc-filter-btn__label {
    font-size: 13px;
    color: var(--tc-text);
    line-height: 1.35;
    flex: 1;
    transition: color 0.15s;
}

.tc-filter-btn.is-active .tc-filter-btn__label {
    color: #fff;
    font-weight: 500;
}

.tc-filter-btn__count {
    font-size: 11px;
    font-weight: 600;
    color: var(--tc-muted);
    background: var(--tc-bg);
    border-radius: 20px;
    padding: 1px 7px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}

.tc-filter-btn.is-active .tc-filter-btn__count {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ─── MAIN CONTENT ───────────────────────────────────────── */
.tc-main {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.tc-main__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.tc-main__title {
    font-size: 17px;
    font-weight: 600;
    color: var(--tc-text);
    margin: 0;
    line-height: 1.35;
}

/* Search */
.tc-main__search {
    position: relative;
    flex-shrink: 0;
}

.tc-search__icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    color: var(--tc-subtle);
    pointer-events: none;
}

.tc-search__input {
    padding: 8px 12px 8px 32px;
    font-size: 13px;
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    background: var(--tc-white);
    color: var(--tc-text);
    width: 220px;
    outline: none;
    transition: border-color 0.18s;
}

.tc-search__input:focus {
    border-color: var(--tc-green);
}

/* ─── ACCORDION ──────────────────────────────────────────── */
.tc-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--tc-white);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    overflow: hidden;
}

/* Accordion item */
.tc-acc-item {
    border-bottom: 1px solid var(--tc-border-soft);
    transition: background 0.15s;
}

.tc-acc-item:last-child {
    border-bottom: none;
}

.tc-acc-item.is-open {
    background: #fafaf9;
}

/* Accordion button */
.tc-acc-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 13px 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.tc-acc-btn:hover {
    background: var(--tc-green-bg);
}

.tc-acc-item.is-open > .tc-acc-btn {
    background: var(--tc-green-bg);
}

.tc-acc-btn__left {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.tc-acc-btn__right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Avatar */
.tc-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    letter-spacing: -0.02em;
}

.tc-avatar--1 { background: var(--av1-bg); color: var(--av1-c); }
.tc-avatar--2 { background: var(--av2-bg); color: var(--av2-c); }
.tc-avatar--3 { background: var(--av3-bg); color: var(--av3-c); }
.tc-avatar--4 { background: var(--av4-bg); color: var(--av4-c); }
.tc-avatar--5 { background: var(--av5-bg); color: var(--av5-c); }

.tc-avatar__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
}

.tc-acc-btn__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.tc-acc-btn__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--tc-text);
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-acc-btn__pos {
    font-size: 12px;
    color: var(--tc-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-acc-btn__cat {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--tc-bg);
    color: var(--tc-muted);
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tc-acc-item.is-open .tc-acc-btn__cat {
    background: var(--tc-green-bg);
    color: var(--tc-green-dark);
}

/* Chevron */
.tc-acc-btn__chevron {
    width: 18px;
    height: 18px;
    color: var(--tc-subtle);
    transition: transform 0.25s ease;
    flex-shrink: 0;
}

.tc-acc-btn[aria-expanded="true"] .tc-acc-btn__chevron {
    transform: rotate(180deg);
}

/* ─── ACCORDION PANEL ────────────────────────────────────── */
.tc-acc-panel {
    border-top: 1px solid var(--tc-border-soft);
}

.tc-acc-panel__inner {
    display: flex;
    gap: 20px;
    padding: 20px 20px 20px 68px; /* отступ под аватар */
    align-items: flex-start;
}

/* Photo */
.tc-panel__photo {
    flex-shrink: 0;
    width: 100px;
    border-radius: var(--tc-radius);
    overflow: hidden;
    border: 1px solid var(--tc-border);
}

.tc-panel__img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Info */
.tc-panel__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.tc-panel__row {
    display: flex;
    gap: 8px;
    font-size: 13px;
    align-items: baseline;
}

.tc-panel__label {
    color: var(--tc-subtle);
    flex-shrink: 0;
    min-width: 110px;
}

.tc-panel__val {
    color: var(--tc-text);
    font-weight: 500;
}

.tc-panel__bio {
    font-size: 13px;
    color: var(--tc-muted);
    line-height: 1.65;
    border-left: 3px solid var(--tc-green-bg);
    padding-left: 12px;
    margin: 0;
}

.tc-panel__bio p { margin: 0; }

/* Contacts */
.tc-panel__contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tc-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: opacity 0.18s;
}

.tc-contact:hover { opacity: 0.8; }

.tc-contact svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.tc-contact--email {
    background: #E6F1FB;
    color: #0C447C;
    border: 1px solid rgba(24, 95, 165, 0.2);
}

.tc-contact--phone {
    background: var(--tc-green-bg);
    color: var(--tc-green-dark);
    border: 1px solid rgba(29, 158, 117, 0.2);
}

/* More link */
.tc-panel__more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tc-green);
    text-decoration: none;
    align-self: flex-start;
    transition: gap 0.18s, color 0.18s;
}

.tc-panel__more:hover {
    color: var(--tc-green-dark);
    gap: 8px;
}

.tc-panel__more svg {
    width: 14px;
    height: 14px;
}

/* ─── NO RESULTS ─────────────────────────────────────────── */
.tc-no-results {
    text-align: center;
    padding: 48px 20px;
    background: var(--tc-white);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    color: var(--tc-muted);
}

.tc-no-results svg {
    width: 40px;
    height: 40px;
    opacity: 0.35;
    display: block;
    margin: 0 auto 12px;
}

.tc-no-results p {
    font-size: 15px;
    margin-bottom: 14px;
}

.tc-no-results button {
    font-size: 13px;
    font-weight: 500;
    color: var(--tc-green);
    background: var(--tc-green-bg);
    border: 1px solid rgba(29, 158, 117, 0.25);
    border-radius: var(--tc-radius);
    padding: 7px 16px;
    cursor: pointer;
    transition: background 0.18s;
}

.tc-no-results button:hover {
    background: #c8eddf;
}

/* ─── RIGHT META SIDEBAR ─────────────────────────────────── */
.tc-meta {
    background: var(--tc-white);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 24px;
}

.tc-meta__block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tc-meta__label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tc-subtle);
}

.tc-meta__value {
    font-size: 32px;
    font-weight: 700;
    color: var(--tc-text);
    line-height: 1;
}

.tc-meta__value--sm {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.35;
}

.tc-meta__unit {
    font-size: 12px;
    color: var(--tc-muted);
}

.tc-meta__reset {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--tc-muted);
    background: var(--tc-bg);
    border: 1px solid var(--tc-border);
    border-radius: var(--tc-radius);
    padding: 7px 12px;
    cursor: pointer;
    transition: color 0.18s, border-color 0.18s;
    width: 100%;
    justify-content: center;
}

.tc-meta__reset:hover {
    color: var(--tc-green);
    border-color: var(--tc-green);
}

.tc-meta__reset svg {
    width: 14px;
    height: 14px;
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */

/* 1024px: правый мета-блок под контент */
@media (max-width: 1024px) {
    .tc-layout {
        grid-template-columns: var(--tc-sidebar-w) 1fr;
        grid-template-rows: auto auto;
    }

    .tc-meta {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px;
        position: static;
    }

    .tc-meta__value { font-size: 24px; }

    .tc-meta__reset {
        width: auto;
        margin-left: auto;
    }
}

/* 768px: сайдбар горизонтально наверху */
@media (max-width: 768px) {
    .tc-layout {
        grid-template-columns: 1fr;
    }

    .tc-sidebar {
        position: static;
    }

    .tc-sidebar__nav {
        flex-direction: row;
        flex-wrap: wrap;
        padding: 10px;
        gap: 6px;
    }

    .tc-filter-btn {
        width: auto;
        padding: 6px 12px;
        border-radius: 20px;
        border: 1px solid var(--tc-border);
    }

    .tc-filter-btn.is-active {
        border-color: var(--tc-green);
    }

    .tc-filter-btn__count { display: none; }

    .tc-main__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .tc-search__input { width: 100%; }
    .tc-main__search  { width: 100%; }
}

/* 480px: панель аккордеона без отступа под аватар */
@media (max-width: 480px) {
    .tc-acc-panel__inner {
        flex-direction: column;
        padding: 16px;
    }

    .tc-panel__photo { width: 80px; }

    .tc-acc-btn { padding: 12px; }

    .tc-acc-btn__cat { display: none; }

    .tc-banner { padding: 60px 20px; }

    .tc-container { padding: 0 14px; }

    .tc-page { padding: 32px 0 56px; }
}