/*
Theme Name: Divi Child Theme
Description: 
Version: 1.0.0
Author: 
Author URI: constellationcreative.com
Theme URI: 
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Template: Divi
*/

/* ========== Custom CSS from Generator ========== */

/* Task 2: staff title under the name in the Portfolio grid */
.et_pb_portfolio_item .staff-title {
    margin: 4px 0 0;
    font-family: inherit;
    font-style: normal;
    font-size: 1.2em;
    line-height: 1.3;
    opacity: 0.8;
}

/* Task 3: staff bio/image modal
   ------------------------------------------------------------------ */
:root {
    --staff-modal-accent: #0e5a6b;   /* name colour */
    --staff-modal-radius: 14px;
}

body.staff-modal-open {
    overflow: hidden;
    width: 100%;
}

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

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

.staff-modal__media[hidden],
.staff-modal__role[hidden] {
    display: none;
}

.staff-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
}

.staff-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: row-reverse;   /* image on the right */
    width: 100%;
    max-width: 960px;
    max-height: min(88vh, 620px);
    background: #fff;
    border-radius: var(--staff-modal-radius);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.staff-modal__close {
    position: absolute;
    top: 10px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.staff-modal__media {
    flex: 0 0 42%;
    min-height: 260px;
}

.staff-modal__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.staff-modal__content {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 32px;
    min-width: 0;
}

.staff-modal__name {
    margin: 0;
    color: var(--staff-modal-accent);
}

.staff-modal__role {
    margin: 4px 0 16px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--staff-modal-accent);
}

.staff-modal__bio {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-right: 8px;
    line-height: 1.6;
}

@media (max-width: 700px) {
    .staff-modal {
        padding: 12px;
        align-items: flex-start;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .staff-modal__dialog {
        flex-direction: column;
        max-height: none;
        margin: max(16px, env(safe-area-inset-top, 0px)) auto max(16px, env(safe-area-inset-bottom, 0px));
    }

    .staff-modal__bio {
        overflow-y: visible;
    }

    .staff-modal__media {
        flex: 0 0 auto;
        height: 220px;
        min-height: 0;
    }

    .staff-modal__content {
        padding: 24px 20px;
        min-height: 0;
    }
}

/* Task 4: [staff_zoom_list] Virtual Appointment Links grid
   ------------------------------------------------------------------ */
.staff-zoom-list {
    --staff-zoom-photo: 140px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 40px 24px;
}

.staff-zoom {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: inherit;
    text-decoration: none;
}

.staff-zoom__media {
    width: var(--staff-zoom-photo);
    aspect-ratio: 1;
    margin-bottom: 14px;
    border-radius: 50%;
    overflow: hidden;
    background: #e6eef0;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.staff-zoom__photo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
}

.staff-zoom__name {
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.3;
    color: var(--staff-modal-accent);
}

.staff-zoom__title {
    margin-top: 2px;
    line-height: 1.3;
    opacity: 0.8;
}

.staff-zoom__link {
    margin-top: 6px;
    font-size: 0.9em;
    color: var(--staff-modal-accent);
    text-decoration: underline;
    word-break: break-all;
}

.staff-zoom:hover .staff-zoom__media,
.staff-zoom:focus-visible .staff-zoom__media {
    transform: scale(1.04);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

.staff-zoom:focus-visible {
    outline: 2px solid var(--staff-modal-accent);
    outline-offset: 6px;
    border-radius: 8px;
}

/* Task 5: Virtual Appointment Links page (Portfolio modules with the
   "staff-grid--zoom" class). Photo/name are not clickable; see custom.js.
   ------------------------------------------------------------------ */
.staff-grid--zoom .et_pb_portfolio_item a:not(p a) {
    cursor: default;
}

.staff-grid--zoom .et_pb_portfolio_item .et_overlay {
    display: none;
}

.staff-grid--zoom .et_pb_portfolio_item,
.staff-grid--zoom .et_pb_portfolio_item .et_pb_module_header {
    text-align: center;
}

/* Divi pads every <p> but the last; the title is no longer last once the Zoom link follows it. */
.staff-grid--zoom .et_pb_portfolio_item .staff-title {
    padding-bottom: 0;
}

.staff-grid--zoom .staff-zoom-link {
    margin-top: 4px;
    padding-bottom: 0;
    font-size: 1.1em;
    font-weight: 600;
    word-break: break-all;
}

.staff-grid--zoom .staff-zoom-link a {
    text-decoration: none;
}
