/* ============================================================
   Magnific Popup — Essentia Health / Nursing Page
   Matches base style: sofia-pro font, rem units (1rem = 10px),
   color tokens: black #141414, lake #0083AD, snowfall #DAE1E9
   ============================================================ */

/* ── Overlay ── */
.mfp-bg {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1042;
    overflow: hidden;
    position: fixed;
    background: #141414;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mfp-bg.mfp-ready {
    opacity: 0.88;
}

.mfp-bg.mfp-removing {
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

/* ── Wrapper ── */
.mfp-wrap {
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1043;
    position: fixed;
    outline: none !important;
    -webkit-backface-visibility: hidden;
}

/* ── Container ── */
.mfp-container {
    text-align: center;
    position: absolute;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    padding: 2rem 2rem;
    box-sizing: border-box;
}

.mfp-container::before {
    content: '';
    display: inline-block;
    height: 100%;
    vertical-align: middle;
}

.mfp-align-top .mfp-container::before {
    display: none;
}

/* ── Content wrapper ── */
.mfp-content {
    position: relative;
    display: inline-block;
    vertical-align: middle;
    margin: 0 auto;
    text-align: left;
    z-index: 1045;
    max-width: 100%;
}

.mfp-ajax-holder .mfp-content,
.mfp-inline-holder .mfp-content {
    width: 100%;
    cursor: auto;
}

/* ── Preloader ── */
.mfp-preloader {
    color: #DAE1E9;
    position: absolute;
    top: 50%;
    width: auto;
    text-align: center;
    margin-top: -0.8rem;
    left: 8px;
    right: 8px;
    z-index: 1044;
    font-family: "Sofia Pro", sans-serif;
    font-size: 1.4rem;
}

.mfp-preloader a {
    color: #0083AD;
    text-decoration: underline;
}

.mfp-preloader a:hover {
    color: #96DAEA;
}

/* ── Image type ── */
.mfp-figure {
    line-height: 0;
}

.mfp-figure::after {
    content: '';
    position: absolute;
    left: 0;
    top: 4rem;
    bottom: 4rem;
    display: block;
    right: 0;
    width: auto;
    height: auto;
    z-index: -1;
    box-shadow: 0 0 6rem rgba(0, 0, 0, 0.5);
    background: #141414;
}

.mfp-figure small {
    color: #B7C7D3;
    display: block;
    font-size: 1.2rem;
    line-height: 1.6rem;
    font-family: "Sofia Pro", sans-serif;
    margin-top: 1rem;
}

.mfp-figure figure {
    margin: 0;
}

/* ── Image itself ── */
.mfp-image-holder .mfp-content {
    max-width: 100%;
}

img.mfp-img {
    width: auto;
    max-width: 100%;
    height: auto;
    display: block;
    line-height: 0;
    box-sizing: border-box;
    padding: 4rem 0;
    margin: 0 auto;
    border-radius: 1.2rem;
    box-shadow: 0 0 4rem rgba(0, 0, 0, 0.4);
    /* Responsive max height so image never overflows viewport */
    max-height: 90vh;
    object-fit: contain;
}

/* ── Bottom caption bar ── */
.mfp-bottom-bar {
    margin-top: -3.6rem;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    cursor: auto;
}

.mfp-title {
    text-align: left;
    line-height: 1.8rem;
    color: #B7C7D3;
    word-wrap: break-word;
    padding-right: 3.6rem;
    font-family: "Sofia Pro", sans-serif;
    font-size: 1.4rem;
}

/* ── Close button ── */
.mfp-close,
.mfp-arrow {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}

.mfp-close {
    width: 4.4rem;
    height: 4.4rem;
    position: absolute;
    right: 0;
    top: 0;
    text-decoration: none;
    text-align: center;
    opacity: 0.7;
    padding: 0;
    /* ← was: 0 0 1.8rem 1rem  */
    line-height: 1;
    /* ← was: 4.4rem            */
    color: #ffffff;
    font-style: normal;
    font-size: 2.8rem;
    font-family: "Sofia Pro", sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    outline: none;
    z-index: 1046;
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
    border-radius: 50%;
}

.mfp-close:hover,
.mfp-close:focus {
    opacity: 1;
    background-color: rgba(218, 225, 233, 0.15);
}

.mfp-close:active {
    top: 0;
}

/* Position close button relative to the image container */
.mfp-image-holder .mfp-close,
.mfp-iframe-holder .mfp-close {
    right: -0.6rem;
    top: 4rem;
    /* align with image top padding */
}

/* ── Zoom animation (nursing-mfp mainClass) ── */
.nursing-mfp.mfp-zoom-in .mfp-content,
.nursing-mfp.mfp-zoom-in img.mfp-img {
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

.nursing-mfp.mfp-zoom-in.mfp-ready .mfp-content,
.nursing-mfp.mfp-zoom-in.mfp-ready img.mfp-img {
    opacity: 1;
    transform: scale(1);
}

.nursing-mfp.mfp-zoom-in.mfp-removing .mfp-content,
.nursing-mfp.mfp-zoom-in.mfp-removing img.mfp-img {
    opacity: 0;
    transform: scale(0.93);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
}

/* ── Cursor hint on the trigger ── */
.nursing-intro__popup-trigger {
    display: block;
    position: absolute;
    inset: 0;
    cursor: zoom-in;
    border-radius: 1.2rem;
    /* inherit parent overflow hidden */
}

/* ── Zoom icon overlay ── */
.nursing-intro__zoom-icon {
    position: absolute;
    bottom: 1.2rem;
    right: 1.2rem;
    width: 3.6rem;
    height: 3.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(20, 20, 20, 0.6);
    border-radius: 50%;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    pointer-events: none;
}

.nursing-intro__zoom-icon svg {
    width: 1.8rem;
    height: 1.8rem;
    display: block;
}

.nursing-intro__popup-trigger:hover .nursing-intro__zoom-icon,
.nursing-intro__popup-trigger:focus .nursing-intro__zoom-icon {
    opacity: 1;
    transform: scale(1);
}

/* ── Responsive tweaks ── */

/* Mobile: tighter padding so image fills the screen */
@media (max-width: 767px) {
    .mfp-container {
        padding: 1rem;
    }

    img.mfp-img {
        padding: 6rem 0 5rem;
        max-height: 85vh;
    }

    .mfp-image-holder .mfp-close {
        right: 0;
        top: 1rem;
    }
}

/* Tablet+ */
@media (min-width: 768px) {
    img.mfp-img {
        max-height: 88vh;
    }
}

/* Large screens: limit image width so it never looks stretched */
@media (min-width: 1024px) {
    .mfp-image-holder .mfp-content {
        max-width: 90vw;
    }
}

/* ── Prevent body scroll when popup is open ── */
body.mfp-active {
    overflow: hidden;
}