/* My profile page. Builds on page-shell.css; everything is scoped under .mp-page. */

.mp-page {
    background: #f7f4f1;
}

/* ---------- Hero ---------- */

.mp-hero__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    /* The site header floats over the top of the page. */
    padding: 176px 0 92px;
}

.ss-page .mp-hero__title {
    font-size: clamp(28px, 4vw, 44px);
    overflow-wrap: anywhere;
}

.mp-hero__meta,
.mp-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mp-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: 999px;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .03em;
}

.mp-chip--gold {
    border-color: #f2b632;
    background: rgba(242, 182, 50, .16);
    color: #ffd978;
}

.mp-btn--outline {
    border-color: rgba(255, 255, 255, .7);
    color: #fff;
}

.mp-btn--outline:hover,
.mp-btn--outline:focus {
    background: #fff;
    color: var(--ss-brand);
}

.ss-btn.mp-btn--sm {
    padding: 9px 18px;
    font-size: 12px;
}

/* ---------- Layout ---------- */

.ss-page .mp-body {
    padding: 0 0 72px;
}

.mp-layout {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr) 310px;
    align-items: start;
    gap: 24px;
    /* The cards overlap the bottom of the hero. */
    margin-top: -56px;
    position: relative;
}

.mp-side,
.mp-main,
.mp-aside {
    display: grid;
    gap: 24px;
    min-width: 0;
}

.mp-card {
    padding: 24px;
    border: 1px solid var(--ss-line);
    border-radius: var(--ss-radius);
    background: #fff;
    box-shadow: var(--ss-shadow);
    min-width: 0;
}

.ss-page .mp-card__title {
    margin: 0 0 6px;
    text-align: left;
    color: var(--ss-ink);
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
}

.mp-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.mp-card__head .ss-btn {
    flex-shrink: 0;
}

.ss-page .mp-card p {
    font-size: 14px;
    line-height: 1.6;
}

/* ---------- Photo card ---------- */

.mp-me {
    text-align: center;
}

.mp-me__form {
    margin: 0;
}

.mp-me__photo {
    position: relative;
    width: 148px;
    height: 148px;
    margin: 0 auto 16px;
}

.mp-me__img {
    width: 100%;
    height: 100%;
    border: 5px solid #fff;
    border-radius: 50%;
    object-fit: cover;
    background: #efe8e2;
    box-shadow: 0 6px 20px rgba(34, 32, 31, .18);
}

.mp-me__pick {
    position: absolute;
    right: 2px;
    bottom: 2px;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    margin: 0;
    border: 3px solid #fff;
    border-radius: 50%;
    background: var(--ss-brand);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: background-color .2s ease;
}

.mp-me__pick:hover,
.mp-me__pick:focus-within {
    background: var(--ss-brand-dark);
}

.mp-me__file {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
}

.ss-page .mp-me__name {
    margin: 0 0 2px;
    text-align: center;
    color: var(--ss-ink);
    font-size: 20px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.ss-page .mp-me__code {
    text-align: center;
    color: var(--ss-brand);
    font-weight: 600;
    letter-spacing: .04em;
}

.ss-page .mp-card .mp-me__hint {
    margin-top: 8px;
    text-align: center;
    font-size: 13px;
}

.mp-me__save {
    margin-top: 14px;
}

.mp-me__save[hidden] {
    display: none;
}

/* ---------- Account menu ---------- */

.mp-nav {
    display: grid;
    padding: 10px;
}

.mp-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 10px;
    color: var(--ss-ink);
    font-size: 14px;
    font-weight: 600;
    transition: background-color .2s ease, color .2s ease;
}

.mp-nav a .fa {
    width: 18px;
    color: var(--ss-brand);
    text-align: center;
}

.mp-nav a:hover,
.mp-nav a:focus {
    background: var(--ss-cream);
    color: var(--ss-brand);
    text-decoration: none;
}

/* ---------- Completion ---------- */

.mp-progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(160px, 240px) auto;
    align-items: center;
    gap: 20px;
}

.mp-progress__meter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mp-progress__meter strong {
    min-width: 44px;
    color: var(--ss-brand);
    font-size: 16px;
}

.mp-bar {
    flex: 1;
    height: 10px;
    border-radius: 999px;
    background: #efe8e2;
    overflow: hidden;
}

.mp-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--ss-brand-dark), #f0703a);
}

/* ---------- At a glance ---------- */

.mp-facts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px 20px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.mp-facts li {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--ss-ink);
    font-size: 14px;
}

.mp-facts li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.mp-facts .fa {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--ss-cream);
    color: var(--ss-brand);
}

/* ---------- Gallery ---------- */

.mp-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.mp-gallery__item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 10px;
    overflow: hidden;
    background: #efe8e2;
}

.mp-gallery__view {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.mp-gallery__view img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

.mp-gallery__view:hover img,
.mp-gallery__view:focus img {
    transform: scale(1.06);
}

.mp-gallery__delete {
    position: absolute;
    top: 8px;
    right: 8px;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(27, 20, 19, .72);
    color: #fff;
    cursor: pointer;
    transition: background-color .2s ease;
}

.mp-gallery__delete:hover,
.mp-gallery__delete:focus {
    background: var(--ss-brand);
}

.mp-empty {
    padding: 28px 16px;
    border: 2px dashed var(--ss-line);
    border-radius: 10px;
    text-align: center;
    color: var(--ss-muted);
}

.mp-empty .fa {
    margin-bottom: 8px;
    font-size: 32px;
    color: #d9cdc4;
}

.ss-page .mp-empty p {
    text-align: center;
}

/* ---------- Details ---------- */

.mp-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    padding: 5px;
    border-radius: 999px;
    background: #f3eeea;
}

.mp-tabs__btn {
    flex: 1;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ss-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.mp-tabs__btn.is-active {
    background: var(--ss-brand);
    color: #fff;
}

.mp-panel[hidden] {
    display: none;
}

.ss-page .mp-panel__title {
    margin: 22px 0 6px;
    text-align: left;
    color: var(--ss-brand);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.mp-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 32px;
    margin: 0;
}

.mp-details > div {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--ss-line);
    font-size: 14px;
}

.mp-details dt {
    flex-shrink: 0;
    color: var(--ss-muted);
    font-weight: 400;
}

.mp-details dd {
    margin: 0;
    min-width: 0;
    text-align: right;
    color: var(--ss-ink);
    font-weight: 600;
    overflow-wrap: anywhere;
}

.mp-details dd.is-empty {
    color: #b3aaa4;
    font-weight: 400;
}

.ss-page .mp-about {
    white-space: pre-line;
}

/* ---------- Right column ---------- */

.mp-search {
    display: flex;
    margin: 10px 0 0;
    border: 1px solid var(--ss-line);
    border-radius: 999px;
    overflow: hidden;
    background: #fff;
}

.mp-search:focus-within {
    border-color: var(--ss-brand);
}

.mp-search input {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    border: 0;
    background: none;
    color: var(--ss-ink);
    font-size: 14px;
    outline: none;
}

.mp-search button {
    flex-shrink: 0;
    width: 46px;
    border: 0;
    background: var(--ss-brand);
    color: #fff;
    cursor: pointer;
}

.mp-search button:hover,
.mp-search button:focus {
    background: var(--ss-brand-dark);
}

.mp-people,
.mp-stories {
    display: grid;
    gap: 14px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}

.mp-people a {
    display: flex;
    align-items: center;
    gap: 14px;
    color: inherit;
}

.mp-people a:hover,
.mp-people a:focus {
    text-decoration: none;
}

.mp-people__photo {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    overflow: hidden;
    background: #efe8e2;
}

.mp-people__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-people__text {
    display: grid;
    min-width: 0;
    font-size: 13px;
    color: var(--ss-muted);
}

.mp-people__text strong {
    color: var(--ss-ink);
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mp-people__text em {
    color: var(--ss-brand);
    font-style: normal;
    font-weight: 600;
}

.mp-stories li {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    aspect-ratio: 16 / 10;
    background: #efe8e2;
}

.mp-stories img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mp-stories span {
    position: absolute;
    inset: auto 0 0;
    padding: 26px 12px 10px;
    background: linear-gradient(transparent, rgba(27, 20, 19, .82));
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.mp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--ss-brand);
    font-size: 14px;
    font-weight: 600;
}

.mp-link:hover,
.mp-link:focus {
    color: var(--ss-brand-dark);
    text-decoration: none;
}

/* ---------- Upload dialog ---------- */

/* The dialog sits outside .ss-page, so the colours its buttons are drawn with are repeated here. */
.mp-modal {
    --ss-brand: #d02323;
    --ss-brand-dark: #a81818;
    --ss-ink: #22201f;
    --ss-muted: #6f6a67;
    --ss-line: #ece7e2;
    --ss-cream: #fff7ef;
}

.mp-modal .modal-content {
    width: 100%;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: #22201f;
}

.mp-modal .modal-header,
.mp-modal .modal-footer {
    border: 0;
    padding: 18px 22px;
}

.mp-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mp-modal .modal-title {
    margin: 0;
    color: #22201f;
    font-size: 18px;
    font-weight: 600;
}

.mp-modal .close {
    margin: 0;
    font-size: 28px;
    line-height: 1;
}

.mp-modal .modal-body {
    padding: 0 22px;
}

.mp-modal .modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.mp-drop {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 28px 16px;
    border: 2px dashed #e0d6ce;
    border-radius: 12px;
    background: #fff7ef;
    color: #6f6a67;
    font-size: 13px;
    font-weight: 400;
    text-align: center;
    cursor: pointer;
}

.mp-drop .fa {
    font-size: 34px;
    color: #d02323;
}

.mp-drop strong {
    color: #22201f;
    font-size: 15px;
}

.mp-drop input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.mp-previews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.mp-previews img {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 8px;
    object-fit: cover;
}

/* ---------- Photo viewer ---------- */

.mp-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(20, 14, 13, .92);
    cursor: zoom-out;
}

.mp-lightbox[hidden] {
    display: none;
}

.mp-lightbox img {
    max-width: 100%;
    max-height: calc(100vh - 40px);
    border-radius: 8px;
}

.mp-lightbox__close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
}

/* ---------- Narrower screens ---------- */

@media (max-width: 1280px) {
    .mp-layout {
        grid-template-columns: 270px minmax(0, 1fr);
    }

    /* The right column drops below and spreads across the page. */
    .mp-aside {
        grid-column: 1 / -1;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        align-items: start;
    }

    .mp-stories {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 1100px) {
    .mp-progress {
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;
    }

    .mp-progress__meter {
        width: 100%;
    }
}

@media (max-width: 860px) {
    .mp-hero__inner {
        padding: 150px 0 80px;
    }

    .mp-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .mp-side,
    .mp-main,
    .mp-aside {
        gap: 18px;
    }

    .mp-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .mp-card {
        padding: 18px;
    }

    .mp-nav {
        padding: 8px;
    }

    .mp-nav a {
        padding: 11px 10px;
        gap: 9px;
        font-size: 13px;
    }

    .mp-card__head {
        flex-direction: column;
    }

    .mp-details {
        grid-template-columns: minmax(0, 1fr);
    }

    .mp-tabs__btn {
        padding: 9px 8px;
        font-size: 13px;
    }

    .mp-hero__actions .ss-btn {
        padding: 10px 18px;
        font-size: 12px;
    }

    .mp-modal .modal-dialog {
        margin: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mp-gallery__view img,
    .mp-nav a,
    .mp-tabs__btn {
        transition: none;
    }
}
