/* MyPaperHelp v39 — stable desktop menus and shared breadcrumb polish. */

@media (min-width: 1021px) {
    .site-header {
        isolation: isolate;
        overflow: visible !important;
        z-index: 1000 !important;
    }

    .site-header #primary-navigation,
    .site-header .nav-item {
        overflow: visible !important;
    }

    .site-header .nav-panel {
        top: calc(100% - 2px) !important;
        z-index: 1200 !important;
        max-height: calc(100vh - 94px);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        scrollbar-width: thin;
        scrollbar-color: #d7b0c3 transparent;
        pointer-events: auto;
    }

    .site-header .nav-panel::-webkit-scrollbar { width: 7px; }
    .site-header .nav-panel::-webkit-scrollbar-thumb {
        border: 2px solid #fff;
        border-radius: 99px;
        background: #d7b0c3;
    }

    /* `translate` remains intact while the existing entrance animation runs. */
    .site-header .services-panel,
    .site-header .subjects-panel,
    .site-header .knowledge-panel,
    .site-header .countries-panel {
        left: 50% !important;
        right: auto !important;
        width: min(1120px, calc(100vw - 32px));
        translate: -50% 0;
    }

    .site-header .writing-panel {
        right: clamp(22px, 20vw, 390px) !important;
        width: min(360px, calc(100vw - 32px));
        max-height: min(650px, calc(100vh - 94px));
    }

    .site-header .nav-panel::before {
        content: "";
        position: sticky;
        top: 0;
        z-index: 3;
        display: block;
        grid-column: 1 / -1;
        height: 3px;
        margin: -22px -22px 19px;
        background: linear-gradient(90deg, var(--v14-blue, #8b1e5a), var(--v14-lime, #f3c969));
    }

    .site-header .writing-panel::before {
        flex: 0 0 3px;
        width: calc(100% + 32px);
        margin: -16px -16px 13px;
    }

    .site-header .nav-item.menu-expanded > .nav-panel,
    .site-header .nav-item:hover > .nav-panel,
    .site-header .nav-item:focus-within > .nav-panel {
        visibility: visible;
        pointer-events: auto;
    }

    .knowledge-panel__lead {
        position: sticky;
        top: 20px;
        align-self: start;
        min-height: 210px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        border: 1px solid #f1dfcf;
        box-shadow: inset 0 0 0 1px rgba(255,255,255,.7);
    }

    .knowledge-panel__cards > a,
    .services-panel__links > a,
    .subjects-panel__grid > a,
    .countries-panel__grid > a,
    .writing-panel > a {
        border: 1px solid transparent;
        transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
    }

    .knowledge-panel__cards > a:hover,
    .knowledge-panel__cards > a:focus-visible {
        border-color: #f1e7ed;
        background: linear-gradient(135deg, #fff8fa, #fffdf8);
        box-shadow: 0 9px 22px rgba(36,26,34,.07);
        transform: translateY(-2px);
    }
}

/* The service and country templates share this breadcrumb class. */
.mph-v10 main > .country-breadcrumb {
    width: min(1200px, calc(100% - 40px));
    min-height: 48px;
    margin: 18px auto;
    padding: 9px 15px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    border: 1px solid #eadde3;
    border-radius: 14px;
    background: linear-gradient(135deg, #fff 0%, #fff8fa 100%);
    color: #756b72;
    box-shadow: 0 8px 24px rgba(36,26,34,.055);
    font-size: .75rem;
    line-height: 1.4;
}

.mph-v10 main > .country-breadcrumb a {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 4px 8px;
    border-radius: 8px;
    color: #8b1e5a;
    font-weight: 800;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease, transform .2s ease;
}

.mph-v10 main > .country-breadcrumb a:first-child::before {
    content: "⌂";
    margin-right: 6px;
    color: #8b1e5a;
    font-size: .9rem;
}

.mph-v10 main > .country-breadcrumb a:hover,
.mph-v10 main > .country-breadcrumb a:focus-visible {
    background: #fbeaf2;
    color: #68133f;
    transform: translateY(-1px);
}

.mph-v10 main > .country-breadcrumb > span[aria-hidden="true"] {
    width: 18px;
    height: 18px;
    display: inline-grid;
    place-items: center;
    color: transparent;
    font-size: 0;
}

.mph-v10 main > .country-breadcrumb > span[aria-hidden="true"]::before {
    content: "›";
    color: #bd9dac;
    font-size: 1rem;
    line-height: 1;
}

.mph-v10 main > .country-breadcrumb > span:last-child {
    min-width: 0;
    color: #40323d;
    font-weight: 700;
}

@media (max-width: 1020px) {
    .site-header .nav-panel::before { display: none; }
}

@media (max-width: 600px) {
    .mph-v10 main > .country-breadcrumb {
        width: calc(100% - 36px);
        margin: 12px auto;
        padding: 8px 10px;
        border-radius: 11px;
        font-size: .68rem;
    }

    .mph-v10 main > .country-breadcrumb a { padding-inline: 5px; }
    .mph-v10 main > .country-breadcrumb > span:last-child {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header .nav-panel,
    .mph-v10 main > .country-breadcrumb a { transition: none !important; }
}
