/**
 * Matheson Leadership Headshots Styles
 */

/* Break out of Divi's constrained row so the inner container owns the width */
.et_pb_row:has(#leadership-headshots) {
    max-width: 100% !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

.et_pb_section:has(#leadership-headshots) {
    padding: 0 !important;
}

#leadership-headshots,
#leadership-headshots * {
    box-sizing: border-box;
}

#leadership-headshots {
    background: #ffffff;
    padding: 0 0 96px;
}

#leadership-headshots .leadership-headshots-container {
    width: 80%;
    max-width: 1208px;
    margin: 0 auto;
}

#leadership-headshots .leadership-headshots-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 54px;
    font-weight: 700;
    line-height: 1.02;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--msc-primary, #25285F);
    margin: 0 0 40px;
    padding: 0;
}

#leadership-headshots .leadership-headshots-heading:has(+ .leadership-headshots-subtext) {
    margin-bottom: 14px;
}

#leadership-headshots .leadership-headshots-subtext {
    /* Client-entered prose: honour the line breaks they type, since the
       field is a plain textarea rendered inside a single paragraph. */
    white-space: pre-line;
    font-family: 'Open Sans', sans-serif;
    font-size: 17px;
    line-height: 1.7;
    color: #4a4a4a;
    max-width: 62ch;
    margin: 0 0 40px;
    padding: 0;
}

#leadership-headshots .leadership-headshots-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 28px 20px;
}

#leadership-headshots .leadership-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
}

#leadership-headshots .leadership-card-trigger {
    position: absolute;
    inset: 0;
    z-index: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

#leadership-headshots .leadership-card-trigger:focus-visible {
    outline: 2px solid #3E6CB8;
    outline-offset: 4px;
}

#leadership-headshots .leadership-card-trigger-label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#leadership-headshots .leadership-card-photo {
    position: relative;
    display: block;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #ececed;
    border-bottom: 3px solid #3E6CB8;
}

#leadership-headshots .leadership-card-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    filter: grayscale(1);
    will-change: transform;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

#leadership-headshots .leadership-card-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 56px;
    font-weight: 700;
    color: #c3c3c9;
    background: #ececed;
}

#leadership-headshots .leadership-card-cue {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 16px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    background: linear-gradient(to top, rgba(28, 31, 78, 0.92), rgba(28, 31, 78, 0));
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

#leadership-headshots .leadership-card:hover .leadership-card-photo img,
#leadership-headshots .leadership-card:focus-within .leadership-card-photo img {
    transform: scale(1.05);
}

#leadership-headshots .leadership-card:hover .leadership-card-cue,
#leadership-headshots .leadership-card:focus-within .leadership-card-cue {
    opacity: 1;
    transform: translateY(0);
}

#leadership-headshots .leadership-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 12px;
    background: #f3f4f9;
}

#leadership-headshots .leadership-card-meta-text {
    min-width: 0;
}

#leadership-headshots .leadership-card-linkedin {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: var(--msc-primary, #25285F);
    transition: color 0.2s ease, transform 0.2s ease;
}

#leadership-headshots .leadership-card-linkedin svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: block;
}

#leadership-headshots .leadership-card-linkedin:hover {
    color: #3E6CB8;
    transform: translateY(-1px);
}

#leadership-headshots .leadership-card-linkedin:focus-visible {
    outline: 2px solid #3E6CB8;
    outline-offset: 2px;
}

#leadership-headshots .leadership-card-name {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.5px;
    color: var(--msc-primary, #25285F);
    margin: 0 0 6px;
    padding: 0;
}

#leadership-headshots .leadership-card-position {
    display: block;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #3E6CB8;
    margin: 0;
    padding: 0;
}

/* Scroll reveal */
#leadership-headshots .reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

#leadership-headshots .reveal-up.is-visible {
    opacity: 1;
    transform: translate(0);
}

/* ---- Bio modal ---- */

.leadership-modal,
.leadership-modal * {
    box-sizing: border-box;
}

.leadership-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.leadership-modal[hidden] {
    display: none;
}

.leadership-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(18, 20, 46, 0.72);
    opacity: 0;
    transition: opacity 0.28s ease;
}

.leadership-modal.is-open .leadership-modal-backdrop {
    opacity: 1;
}

.leadership-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    background: #ffffff;
    box-shadow: 0 30px 80px rgba(18, 20, 46, 0.4);
    opacity: 0;
    transform: translateY(12px) scale(0.99);
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.leadership-modal.is-open .leadership-modal-dialog {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.leadership-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #1c1f4e;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.leadership-modal-close:hover {
    background: #9CC3E8;
    color: #1c1f4e;
}

.leadership-modal-close:focus-visible {
    outline: 2px solid #9CC3E8;
    outline-offset: 2px;
}

.leadership-modal-banner {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 32px 40px;
    background: linear-gradient(135deg, #1c1f4e 0%, var(--msc-primary, #25285F) 100%);
}

.leadership-modal-photo {
    flex: 0 0 132px;
    width: 132px;
    height: 160px;
    overflow: hidden;
    background: #2b2f6b;
}

.leadership-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    filter: grayscale(1);
}

.leadership-modal-photo-placeholder {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 44px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
}

.leadership-modal-banner-text {
    padding-bottom: 4px;
}

.leadership-modal-name {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: 0.3px;
    color: #ffffff;
    margin: 0 0 6px;
    padding: 0;
}

.leadership-modal-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #9CC3E8;
    margin: 0 0 14px;
    padding: 0;
}

.leadership-modal-linkedin {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s ease, gap 0.2s ease;
}

.leadership-modal-linkedin:hover {
    color: #9CC3E8;
    gap: 12px;
}

.leadership-modal-body {
    padding: 32px 40px 40px;
}

.leadership-modal-bio p {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #4a4a4a;
    margin: 0 0 18px;
    padding: 0;
}

.leadership-modal-bio p:last-child {
    margin-bottom: 0;
}

.leadership-modal-pending {
    font-family: 'Open Sans', sans-serif;
    font-size: 16px;
    line-height: 1.75;
    color: #8a8a8a;
    font-style: italic;
    margin: 0;
}

.leadership-modal-lists {
    margin-top: 28px;
    padding-top: 28px;
    border-top: 1px solid #e2e2e6;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 40px;
}

.leadership-modal-lists:has(.leadership-modal-list:only-child) {
    grid-template-columns: 1fr;
}

.leadership-modal-list-heading {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--msc-primary, #25285F);
    margin: 0 0 12px;
    padding: 0;
}

.leadership-modal-list ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.leadership-modal-list li {
    position: relative;
    font-family: 'Open Sans', sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #4a4a4a;
    margin: 0 0 10px;
    padding: 0 0 0 18px;
}

.leadership-modal-list li:last-child {
    margin-bottom: 0;
}

.leadership-modal-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 9px;
    width: 7px;
    height: 7px;
    background: #3E6CB8;
}

body.leadership-modal-open {
    overflow: hidden;
}

/* ---- Responsive ---- */

@media (max-width: 980px) {
    #leadership-headshots {
        padding: 0 0 72px;
    }

    #leadership-headshots .leadership-headshots-container {
        width: 90%;
    }

    #leadership-headshots .leadership-headshots-heading {
        font-size: 44px;
    }

    #leadership-headshots .leadership-headshots-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 28px 20px;
    }
}

@media (max-width: 640px) {
    .leadership-modal {
        padding: 0;
    }

    .leadership-modal-dialog {
        max-width: none;
        max-height: 100vh;
        height: 100%;
    }

    .leadership-modal-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 18px;
        padding: 28px 24px;
    }

    .leadership-modal-body {
        padding: 24px 24px 32px;
    }

    .leadership-modal-lists {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    #leadership-headshots .leadership-headshots-container {
        width: 92%;
    }

    #leadership-headshots .leadership-headshots-heading {
        font-size: 36px;
    }

    #leadership-headshots .leadership-headshots-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}
