/*
 * "Академия раҳбарияти" sahifasi (`views/proacademy/heads.php`).
 *
 * FAQAT shu sahifa uchun — `HeadsPageAsset` orqali ulanadi.
 * Tuzilma, karta (`ip-box`) va o'ng ustun umumiy `inner-page.css` da;
 * bu yerda faqat rahbar kartalari va "Батафсил" oynasi.
 * Barcha klasslar `hp-` prefiksli: sayt shablonidagi (`gorom`)
 * umumiy qoidalar bilan to'qnashmasligi uchun.
 */

.hp {
    --hp-primary: #0b44b8;
    --hp-primary-600: #1554d1;
    --hp-primary-50: #eaf1ff;
    --hp-ink: #0f1b3d;
    --hp-text: #4b5565;
    --hp-muted: #6b7385;
    --hp-line: #e6ebf3;
    --hp-bg: #f4f7fc;
    --hp-radius: 10px;
    --hp-shadow: 0 6px 24px rgba(15, 27, 61, 0.06);

    color: var(--hp-text);
}

/* `:where()` — aniqlik 0: komponentlarning o'z margin/padding'lari ustun turadi */
:where(.hp) h1,
:where(.hp) h2,
:where(.hp) h3,
:where(.hp) p {
    margin: 0;
}

:where(.hp) ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.hp svg {
    flex: 0 0 auto;
}

/* ============================================================
   Ro'yxat
   ============================================================ */

.hp-list,
.hp-card__head {
    min-width: 0;
}

.hp-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============================================================
   Rahbar kartasi
   ============================================================ */

.hp-card {
    display: grid;
    grid-template-columns: 152px minmax(0, 1fr);
    gap: 22px;
    padding: 14px 18px 14px 14px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.hp-card:hover {
    box-shadow: 0 12px 32px rgba(15, 27, 61, 0.1);
}

.hp-card__photo {
    overflow: hidden;
    height: 146px;
    border-radius: 6px;
    background-color: #e9eef6;
}

.hp-card__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.hp-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding-top: 4px;
}

.hp-card__name {
    color: var(--hp-ink);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
}

.hp-card__position {
    margin-top: 4px;
    color: var(--hp-primary);
    font-size: var(--fs-md);
    font-weight: 600;
}

.hp-card__bio {
    display: -webkit-box;
    overflow: hidden;
    max-width: 520px;
    margin-top: 10px;
    color: var(--hp-text);
    font-size: var(--fs-content);
    line-height: var(--lh-content);
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.hp-card__foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-top: auto;
    padding-top: 12px;
}

.hp-contacts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 26px;
    font-size: var(--fs-sidebar);
}

.hp-contacts li {
    display: flex;
    align-items: center;
    gap: 9px;
    color: var(--hp-text);
    line-height: var(--lh-sidebar);
}

.hp-contacts svg {
    color: var(--hp-primary-600);
}

.hp-contacts a {
    color: inherit;
}

.hp-contacts a:hover {
    color: var(--hp-primary);
}

.hp-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    border: 0;
    border-radius: 7px;
    background-color: var(--hp-primary-50);
    color: var(--hp-primary);
    font-size: var(--fs-body);
    font-weight: 600;
    line-height: var(--lh-card);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hp-more:hover,
.hp-more:focus-visible {
    background-color: var(--hp-primary);
    color: #fff;
}

.hp-empty {
    padding: 48px 24px;
    color: var(--hp-muted);
    text-align: center;
}

@media (max-width: 575.98px) {
    .hp-card {
        grid-template-columns: 96px minmax(0, 1fr);
        gap: 14px;
        padding: 12px;
    }

    .hp-card__photo {
        height: 112px;
    }

    .hp-card__name {
        font-size: var(--fs-sidebar-title);
    }

    .hp-card__position {
        font-size: var(--fs-sidebar);
    }

    .hp-card__bio {
        display: none;
    }

    .hp-card__foot {
        grid-column: 1 / -1;
    }

    .hp-contacts {
        flex-direction: column;
    }

    .hp-more {
        width: 100%;
        justify-content: center;
    }
}

/* Tor ekranda pastki qism rasm ostidan butun kenglikda davom etadi */
@media (max-width: 575.98px) {
    .hp-card__body {
        display: contents;
    }

    .hp-card__head {
        align-self: center;
    }
}

/* ============================================================
   "Батафсил" oynasi
   ============================================================ */

.hp-modal {
    width: min(1040px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 14px;
    background-color: #fff;
    color: var(--hp-text);
    box-shadow: 0 30px 80px rgba(8, 28, 74, 0.35);
}

/* Sayt shablonidagi `dialog` qoidalari yopiq oynani ham ko'rsatib qo'ymasin */
.hp-modal:not([open]) {
    display: none;
}

.hp-modal[open] {
    position: fixed;
    inset: 0;
    margin: auto;
    animation: hp-pop 0.22s ease-out;
}

.hp-modal::backdrop {
    background-color: rgba(18, 42, 96, 0.45);
    backdrop-filter: blur(3px);
}

@keyframes hp-pop {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.985);
    }
}

@media (prefers-reduced-motion: reduce) {
    .hp-modal[open] {
        animation: none;
    }
}

.hp-modal__inner {
    position: relative;
    display: grid;
    grid-template-columns: 356px minmax(0, 1fr);
    min-height: 560px;
}

.hp-modal__close {
    position: absolute;
    z-index: 3;
    top: 18px;
    right: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background-color: #fff;
    color: var(--hp-ink);
    box-shadow: 0 4px 14px rgba(15, 27, 61, 0.16);
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.hp-modal__close:hover {
    background-color: var(--hp-primary);
    color: #fff;
}

.hp-modal__close:focus-visible {
    outline: 2px solid var(--hp-primary-600);
    outline-offset: 2px;
}

/* ---- Chap panel: akademiya nomi va rasm ---- */

.hp-modal__aside {
    position: relative;
    overflow: hidden;
    padding: 0 22px 26px 26px;
    background: linear-gradient(180deg, #f3f7fd 0%, #e8eff9 100%);
}

/* Qiya ko'k sarlavha tasmasi va uning och ko'k qirrasi */
.hp-modal__aside::before,
.hp-modal__aside::after {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    content: "";
}

.hp-modal__aside::before {
    background: linear-gradient(115deg, #0a2f80 0%, #0e45b3 60%, #1a5fd8 100%);
    clip-path: polygon(0 0, 100% 0, 84% 60%, 0 100%);
}

.hp-modal__aside::after {
    background: linear-gradient(115deg, rgba(59, 130, 246, 0.2) 0%, rgba(59, 130, 246, 0.7) 100%);
    clip-path: polygon(84% 60%, 100% 0, 100% 14%, 89% 64%);
}

.hp-modal__brand {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 26px 30px 0 12px;
    color: #fff;
}

.hp-modal__brand-text {
    font-size: var(--fs-sm);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.hp-modal__brand-text::after {
    display: block;
    width: 40px;
    height: 3px;
    margin-top: 7px;
    border-radius: 2px;
    background-color: #e3b04b;
    content: "";
}

.hp-modal__photo {
    position: relative;
    z-index: 1;
    margin-top: 26px;
    padding: 16px;
    border-radius: 12px;
    background-color: #fff;
    box-shadow: 0 14px 34px rgba(15, 27, 61, 0.13);
}

.hp-modal__photo img {
    display: block;
    width: 100%;
    aspect-ratio: 307 / 375;
    border-radius: 6px;
    background-color: #e9eef6;
    object-fit: cover;
    object-position: top center;
}

/* ---- O'ng panel: ma'lumotlar ---- */

.hp-modal__main {
    position: relative;
    overflow: hidden;
    padding: 34px 34px 38px 30px;
}

/* Fondagi xira akademiya belgisi */
.hp-modal__mark {
    position: absolute;
    top: 34px;
    right: 30px;
    color: var(--hp-primary-600);
    opacity: 0.06;
    pointer-events: none;
}

.hp-modal__badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 16px;
    border-radius: 8px;
    background-color: #e4edfb;
    color: #1f3a6e;
    font-size: var(--fs-body);
    font-weight: 500;
    line-height: var(--lh-card);
}

.hp-modal__name {
    position: relative;
    margin-top: 22px;
    padding-right: 48px;
    color: var(--hp-ink);
    font-size: var(--fs-page-title);
    font-weight: 700;
    line-height: var(--lh-heading);
}

.hp-modal__position {
    position: relative;
    margin-top: 10px;
    color: var(--hp-primary-600);
    font-size: var(--fs-content);
    font-weight: 600;
    line-height: var(--lh-normal);
}

/* Aloqa plitkalari */
/*
 * Plitkalar orasida ajratuvchi chiziq. Qator boshiga o'ralib tushgan plitkaning
 * chap chizig'i konteyner chegarasidan tashqarida qoladi va `overflow: hidden`
 * bilan kesiladi — chiziq faqat plitkalar ORASIDA ko'rinadi.
 */
.hp-tiles {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 16px 0;
    margin-top: 26px;
    margin-left: -16px;
    overflow: hidden;
}

.hp-tile {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-left: -1px;
    padding: 0 16px;
    border-left: 1px solid var(--hp-line);
}

.hp-tile__icon {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: #e4edfb;
    color: var(--hp-primary-600);
}

.hp-tile__text {
    display: flex;
    flex-direction: column;
    padding-top: 3px;
}

.hp-tile__value {
    color: var(--hp-ink);
    font-size: var(--fs-sidebar);
    white-space: nowrap;
    font-weight: var(--fw-semibold);
    line-height: var(--lh-sidebar);
}

.hp-tile--light .hp-tile__value {
    font-weight: 500;
}

.hp-tile__value strong {
    font-weight: 700;
}

.hp-tile__value a {
    color: inherit;
}

.hp-tile__value a:hover {
    color: var(--hp-primary);
}

.hp-tile__label {
    margin-top: 3px;
    color: var(--hp-muted);
    font-size: var(--fs-card);
    line-height: var(--lh-card);
}

/* Biografiya */
.hp-modal__section {
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 30px;
    color: var(--hp-primary-600);
}

.hp-modal__section h3 {
    color: var(--hp-ink);
    font-size: var(--fs-lg);
    font-weight: var(--fw-semibold);
}

.hp-modal__section::after {
    flex: 1 1 auto;
    height: 2px;
    margin-left: 10px;
    background: linear-gradient(90deg, #d9e3f2 0%, rgba(217, 227, 242, 0.2) 100%);
    content: "";
}

.hp-modal__bio {
    position: relative;
    margin-top: 16px;
    color: #3b4458;
}

.hp-modal__bio p + p {
    margin-top: 14px;
}

.hp-modal__bio.is-empty {
    color: var(--hp-muted);
    font-size: var(--fs-content);
}

@media (max-width: 991.98px) {
    .hp-modal__inner {
        grid-template-columns: 300px minmax(0, 1fr);
    }

    .hp-modal__main {
        padding: 30px 28px 32px 24px;
    }

    .hp-modal__name {
        font-size: var(--fs-page-title);
    }

    .hp-modal__position {
        font-size: var(--fs-md);
    }

    .hp-tiles {
        margin-left: 0;
    }

    .hp-tile {
        flex: 1 1 100%;
        margin-left: 0;
        padding: 0;
        border-left: 0;
    }

    .hp-tile__value {
        white-space: normal;
    }
}

@media (max-width: 767.98px) {
    .hp-modal {
        max-height: calc(100vh - 24px);
    }

    .hp-modal__inner {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .hp-modal__aside {
        padding: 0 20px 22px;
    }

    .hp-modal__brand {
        padding-right: 64px;
    }

    .hp-modal__photo {
        max-width: 260px;
        margin: 22px auto 0;
        padding: 12px;
    }

    .hp-modal__main {
        padding: 24px 20px 28px;
    }

    .hp-modal__mark {
        display: none;
    }

    .hp-modal__name {
        margin-top: 16px;
        padding-right: 0;
        font-size: var(--fs-page-title);
    }

    .hp-modal__position {
        font-size: var(--fs-md);
    }

    .hp-modal__close {
        top: 12px;
        right: 12px;
    }
}
