/* HUB Staff View - hub-staff-view.css */

/* -- CSS custom properties (override per site) -------------------------------- */
:root {
    --hub-stv-gap: 1.5rem;
    --hub-stv-photo-size: 120px;
    --hub-stv-photo-height: 200px;
    --hub-stv-profile-gap: 1.5rem;
    --hub-stv-item-gap: 1rem;
    --hub-stv-modal-max-width: 560px;
    --hub-stv-modal-z: 99999;
}

/* -- Wrapper ------------------------------------------------------------------ */
.hub-stv-wrap {
    margin: 0;
    padding: 0;
}

/* -- List layout ------------------------------------------------------------- */
.hub-stv-wrap--list .hub-stv-item,
.hub-stv-wrap--list-linked .hub-stv-item {
    margin-bottom: var(--hub-stv-item-gap);
}

.hub-stv-item__name {
    margin-bottom: 0.15em;
}

.hub-stv-item__role {
    margin-top: 0;
    margin-bottom: 0;
}

/* -- Group headings ---------------------------------------------------------- */
.hub-stv-group {
    margin-bottom: calc( var(--hub-stv-gap) * 1.5 );
}

.hub-stv-group__label {
    margin-bottom: 0.5em;
    padding-bottom: 0.25em;
    border-bottom: 1px solid currentColor;
    opacity: 0.7;
}

.hub-stv-group__items {
    margin-top: var(--hub-stv-item-gap);
}

/* -- Profile card ------------------------------------------------------------ */
.hub-stv-item--profiles {
    display: flex;
    flex-wrap: wrap;
    gap: var(--hub-stv-profile-gap);
    align-items: flex-start;
    margin-bottom: var(--hub-stv-gap);
}

.hub-stv-item--profiles.hub-stv-item--photo-left {
    flex-direction: row;
}

.hub-stv-item--profiles.hub-stv-item--photo-right {
    flex-direction: row-reverse;
}

.hub-stv-item--profiles.hub-stv-item--photo-top {
    flex-direction: column;
}

.hub-stv-item--profiles.hub-stv-item--photo-bottom {
    flex-direction: column-reverse;
}

/* Side-by-side (left/right): constrain photo to --hub-stv-photo-size */
.hub-stv-item--profiles.hub-stv-item--photo-left .hub-stv-item__photo,
.hub-stv-item--profiles.hub-stv-item--photo-right .hub-stv-item__photo {
    flex: 0 0 var(--hub-stv-photo-size);
    max-width: var(--hub-stv-photo-size);
}

/* Top/bottom: photo fills card width, constrained to --hub-stv-photo-height */
.hub-stv-item--profiles.hub-stv-item--photo-top .hub-stv-item__photo,
.hub-stv-item--profiles.hub-stv-item--photo-bottom .hub-stv-item__photo {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    height: var(--hub-stv-photo-height);
    overflow: hidden;
}

.hub-stv-item__photo {
    flex: 0 0 var(--hub-stv-photo-size);
    max-width: var(--hub-stv-photo-size);
}

/* Grid wrap — used when photo_align is top or bottom so cards sit side by side */
.hub-stv-wrap--grid {
    display: grid;
    grid-template-columns: repeat( auto-fill, minmax( var(--hub-stv-card-min-width, 200px), 1fr ) );
    gap: var(--hub-stv-gap);
    align-items: start;
}

/* Items inside a grid wrap should not add their own bottom margin */
.hub-stv-wrap--grid .hub-stv-item--profiles {
    margin-bottom: 0;
}

/* Grid cards: center photo and text */
.hub-stv-wrap--grid .hub-stv-item--profiles,
.hub-stv-group__items.hub-stv-wrap--grid .hub-stv-item--profiles {
    align-items: center;
}

.hub-stv-wrap--grid .hub-stv-item__content,
.hub-stv-group__items.hub-stv-wrap--grid .hub-stv-item__content {
    text-align: center;
    width: 100%;
}

.hub-stv-item__photo img {
    display: block;
    width: 100%;
    height: auto;
}

.hub-stv-item--photo-top .hub-stv-item__photo img,
.hub-stv-item--photo-bottom .hub-stv-item__photo img {
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.hub-stv-item__content {
    flex: 1 1 0;
    min-width: 0;
}

.hub-stv-item__name {
    margin-top: 0;
}

.hub-stv-item__designation {
    display: block;
    margin-bottom: 0.4em;
    font-style: italic;
}

.hub-stv-item__bio {
    margin-top: 0.5em;
}

.hub-stv-item__more {
    display: inline-block;
    margin-top: 0.75em;
}

/* -- Linked list ------------------------------------------------------------- */
.hub-stv-item--list-linked .hub-stv-item__name a {
    text-decoration: underline;
    cursor: pointer;
}

/* -- Photo zoom link --------------------------------------------------------- */
.hub-stv-photo-zoom {
    display: block;
    cursor: zoom-in;
}

/* -- Modal ------------------------------------------------------------------- */
.hub-stv-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: var(--hub-stv-modal-z);
    align-items: center;
    justify-content: center;
}

.hub-stv-modal[aria-hidden="false"] {
    display: flex;
}

.hub-stv-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    cursor: pointer;
}

.hub-stv-modal__box {
    position: relative;
    z-index: 1;
    background: #fff;
    max-width: var(--hub-stv-modal-max-width);
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-start;
}

.hub-stv-modal__close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    color: inherit;
}

.hub-stv-modal__photo {
    flex: 0 0 100px;
}

.hub-stv-modal__photo img {
    display: block;
    width: 100%;
    height: auto;
}

.hub-stv-modal__content {
    flex: 1 1 0;
    min-width: 0;
}

.hub-stv-modal__name {
    margin-top: 0;
    margin-bottom: 0.2em;
}

.hub-stv-modal__role {
    margin-top: 0;
    margin-bottom: 0.25em;
}

.hub-stv-modal__designation {
    display: block;
    font-style: italic;
    margin-bottom: 0.5em;
}

.hub-stv-modal__bio {
    margin-top: 0.5em;
}

/* -- Photo zoom lightbox ----------------------------------------------------- */
.hub-stv-zoom-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: calc( var(--hub-stv-modal-z) + 1 );
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.hub-stv-zoom-overlay.is-open {
    display: flex;
}

.hub-stv-zoom-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    display: block;
}

/* -- Responsive -------------------------------------------------------------- */
@media ( max-width: 600px ) {
    .hub-stv-item--profiles {
        flex-direction: column !important;
    }

    .hub-stv-item__photo {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .hub-stv-modal__box {
        flex-direction: column;
    }

    .hub-stv-modal__photo {
        flex: 0 0 auto;
    }
}
