/*
 * GMOS Commercial Step 5 refinements.
 * Loaded after the core commercial design system on GMOS-managed pages only.
 */

/* Reduce excessive theme whitespace above managed application surfaces. */
body.gmos-managed-surface main,
body.gmos-managed-surface .wp-site-blocks main,
body.gmos-managed-surface .site-main {
    padding-top: clamp(12px, 2vw, 28px) !important;
}
body.gmos-managed-surface .entry-header {
    margin-bottom: 12px !important;
}
body.gmos-managed-surface .entry-title {
    margin-bottom: 0 !important;
}

/*
 * Keep the application header in one fixed shell on every GMOS-managed page.
 * Individual workspaces may use different content widths, but the page title
 * and portal toolbar should never jump horizontally between destinations.
 *
 * Reserve the vertical scrollbar gutter so moving between short and long
 * workspaces does not nudge the visual center by a few pixels.
 */
html {
    scrollbar-gutter: stable;
}
body.gmos-managed-surface .entry-header,
body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child {
    position: relative;
    left: 50%;
    width: min(1440px, calc(100vw - 48px));
    max-width: none;
    box-sizing: border-box;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: translateX(-50%);
}
body.gmos-managed-surface .entry-header {
    padding: 10px 0 8px !important;
    text-align: center;
}
body.gmos-managed-surface .entry-title {
    margin: 0 !important;
    font-size: clamp(2.35rem, 4vw, 3.5rem) !important;
    line-height: 1.08 !important;
    letter-spacing: -.025em;
    color: #172238;
}
body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child {
    min-height: 64px;
    margin-top: 0 !important;
    margin-bottom: 18px !important;
    padding: 7px 10px;
    border-radius: 13px;
    box-shadow: 0 5px 18px rgba(23,53,120,.07);
}
body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child .geer-vsus-portal-toolbar-link {
    min-height: 46px;
    padding: .65rem .95rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
}
body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child .geer-vsus-portal-toolbar-link.is-home {
    background: transparent;
}
body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child .geer-vsus-portal-toolbar-link.is-current {
    border-color: #dce6f3;
    background: #eef4ff;
    box-shadow: inset 0 0 0 1px rgba(23,53,120,.02);
}
body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child .geer-vsus-portal-toolbar-link.is-logout {
    color: #8a2424 !important;
}

/* Portal Home: make the dashboard read as one application workspace. */
body.gmos-surface-portal_home .entry-content {
    width: min(1360px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}
body.gmos-surface-portal_home .entry-content > * {
    max-width: none;
}
body.gmos-surface-portal_home :where(.geer-vsus-dashboard-card,.gmos-portal-shell) {
    width: 100%;
}
body.gmos-surface-portal_home :where(.geer-vsus-dashboard-grid,.gmos-dashboard-grid,.geer-vsus-admin-grid,.gmos-admin-grid) {
    width: 100%;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    align-items: stretch;
}
body.gmos-surface-portal_home :where(.geer-vsus-stat,.gmos-stat,.gmos-dashboard-stat) {
    height: 100%;
}

/* Directory: keep the application shell and directory workspace on the same rail. */
body.gmos-surface-directory .entry-content {
    width: min(1440px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}
body.gmos-surface-directory .entry-content > * {
    max-width: none;
}
body.gmos-surface-directory .entry-content > .geer-vsus-dashboard-card:first-of-type,
body.gmos-surface-directory .entry-content > .geer-vsus-directory:first-of-type,
body.gmos-surface-directory .entry-content > .geer-vsus-directory-wrap:first-of-type {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}

/* Profile: use the same application rail as the other volunteer pages. */
body.gmos-surface-profile .entry-content {
    width: min(1440px, calc(100% - 48px));
    margin-left: auto;
    margin-right: auto;
}
body.gmos-surface-profile .entry-content > * {
    max-width: none;
}
body.gmos-surface-profile .geer-vp-profile-center {
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box;
}
body.gmos-surface-profile :where(.geer-vsus-profile-hero,.gmos-profile-hero,.geer-vsus-heritage-hero) {
    padding: clamp(22px, 3vw, 34px) !important;
}
body.gmos-surface-profile :where(.geer-vsus-profile-card,.gmos-profile-card,.geer-vsus-story-card) {
    padding: clamp(14px, 1.6vw, 19px) !important;
}
body.gmos-surface-profile :where(.geer-vsus-profile-card,.gmos-profile-card,.geer-vsus-story-card) + :where(.geer-vsus-profile-card,.gmos-profile-card,.geer-vsus-story-card) {
    margin-top: 14px;
}
body.gmos-surface-profile :where(.geer-vsus-profile-grid,.gmos-profile-grid,.geer-vsus-story-grid) {
    gap: 14px !important;
}
body.gmos-surface-profile :where(.geer-vsus-profile-card,.gmos-profile-card,.geer-vsus-story-card) :where(h2,h3,p) {
    margin-top: 0;
}

/* Schedule: give the month view enough horizontal room to be genuinely readable. */
body.gmos-surface-schedule .entry-content {
    width: min(1480px, calc(100% - 24px));
    margin-left: auto;
    margin-right: auto;
}
body.gmos-surface-schedule .entry-content > * {
    max-width: none;
}
body.gmos-surface-schedule :where(.gmos-native-schedule,.gmos-schedule-wrap,.gmos-calendar-wrap) {
    width: 100% !important;
    max-width: none !important;
}
body.gmos-surface-schedule :where(.gmos-calendar-grid,.gmos-schedule-grid,.gmos-month-grid) {
    grid-template-columns: repeat(5, minmax(170px, 1fr)) !important;
    width: 100%;
    overflow-x: auto;
    padding-bottom: 8px;
}
body.gmos-surface-schedule :where(.gmos-day,.gmos-calendar-day,.gmos-schedule-day) {
    min-width: 170px !important;
    padding: 14px !important;
}
body.gmos-surface-schedule :where(.gmos-shift-card,.gmos-calendar-shift,.gmos-schedule-shift) {
    line-height: 1.35;
}
body.gmos-surface-schedule :where(.gmos-shift-card,.gmos-calendar-shift,.gmos-schedule-shift) :where(p,span,div) {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: normal;
}

@media (max-width: 1100px) {
    body.gmos-surface-schedule :where(.gmos-calendar-grid,.gmos-schedule-grid,.gmos-month-grid) {
        grid-template-columns: repeat(5, 180px) !important;
        justify-content: start;
    }
}

@media (max-width: 760px) {
    body.gmos-managed-surface .entry-header {
        width: calc(100% - 16px);
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
    body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child {
        width: 100%;
        max-width: 100%;
    }
    body.gmos-managed-surface .entry-header {
        padding: 8px 0 6px !important;
        margin-bottom: 8px !important;
    }
    body.gmos-managed-surface .entry-title {
        font-size: clamp(2rem, 10vw, 2.65rem) !important;
    }
    body.gmos-managed-surface .entry-content > .geer-vsus-portal-toolbar:first-child {
        margin-bottom: 12px !important;
    }
    body.gmos-managed-surface main,
    body.gmos-managed-surface .wp-site-blocks main,
    body.gmos-managed-surface .site-main {
        padding-top: 8px !important;
    }
    body.gmos-surface-portal_home .entry-content,
    body.gmos-surface-directory .entry-content,
    body.gmos-surface-profile .entry-content,
    body.gmos-surface-schedule .entry-content {
        width: calc(100% - 16px);
    }
    body.gmos-surface-schedule :where(.gmos-calendar-grid,.gmos-schedule-grid,.gmos-month-grid) {
        grid-template-columns: repeat(5, 230px) !important;
    }
}

/* Commercial portal shell: keep GMOS-managed pages application-focused. */
body.gmos-managed-surface .wp-site-blocks > header.wp-block-template-part,
body.gmos-managed-surface .wp-site-blocks > footer.wp-block-template-part {
    display: none !important;
}
body.gmos-managed-surface .wp-site-blocks {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}
body.gmos-managed-surface main,
body.gmos-managed-surface .wp-block-post-content {
    margin-top: 0 !important;
}

/* Portal Home: make the volunteer landing page immediately actionable. */
body.gmos-surface-portal_home .gmos-volunteer-home-actions {
    position: relative;
    z-index: 2;
    margin: 0 22px 22px;
    padding: 18px;
    border: 1px solid #dce6ed;
    border-radius: 14px;
    background: #f8fbfd;
    box-shadow: 0 5px 16px rgba(23, 50, 85, .045);
}
body.gmos-surface-portal_home .gmos-volunteer-home-actions__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin: 0 0 12px;
}
body.gmos-surface-portal_home .gmos-volunteer-home-actions__head > span {
    color: #607487;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
body.gmos-surface-portal_home .gmos-volunteer-home-actions__head > strong {
    color: #173568;
    font-size: 18px;
    line-height: 1.25;
}
body.gmos-surface-portal_home .gmos-volunteer-home-actions__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action {
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 11px;
    min-height: 72px;
    padding: 12px 13px;
    border: 1px solid #d8e3ea;
    border-left: 4px solid #2f7f97;
    border-radius: 12px;
    background: #fff;
    color: #173568 !important;
    text-decoration: none !important;
    box-shadow: 0 3px 10px rgba(23, 50, 85, .04);
    transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action__icon {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    background: #eaf4f8;
    font-size: 20px;
    line-height: 1;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action__copy {
    display: block;
    min-width: 0;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action__copy > strong,
body.gmos-surface-portal_home .gmos-volunteer-home-action__copy > small {
    display: block;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action__copy > strong {
    color: #173568;
    font-size: 14px;
    line-height: 1.2;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action__copy > small {
    margin-top: 3px;
    color: #6c7c8b;
    font-size: 11px;
    line-height: 1.35;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action > b {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #edf5f8;
    color: #27708a;
    font-size: 15px;
}
body.gmos-surface-portal_home .gmos-volunteer-home-action:hover,
body.gmos-surface-portal_home .gmos-volunteer-home-action:focus-visible {
    transform: translateY(-1px);
    border-color: #afcad6;
    box-shadow: 0 7px 16px rgba(23, 50, 85, .09);
    outline: none;
}
@media (max-width: 760px) {
    body.gmos-surface-portal_home .gmos-volunteer-home-actions {
        margin: 0 14px 16px;
        padding: 14px;
    }
    body.gmos-surface-portal_home .gmos-volunteer-home-actions__head {
        display: block;
    }
    body.gmos-surface-portal_home .gmos-volunteer-home-actions__head > strong {
        display: block;
        margin-top: 4px;
        font-size: 16px;
    }
    body.gmos-surface-portal_home .gmos-volunteer-home-actions__grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.gmos-surface-portal_home .gmos-volunteer-home-action {
        transition: none;
    }
    body.gmos-surface-portal_home .gmos-volunteer-home-action:hover,
    body.gmos-surface-portal_home .gmos-volunteer-home-action:focus-visible {
        transform: none;
    }
}

/* Portal Home: let the greeting breathe even when the user carries many roles. */
body.gmos-surface-portal_home .geer-vsus-welcome-header-row {
    grid-template-columns: minmax(280px, 1fr) auto !important;
    align-items: start !important;
}
body.gmos-surface-portal_home .geer-vsus-welcome-main {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
}
body.gmos-surface-portal_home .geer-vsus-welcome-date {
    grid-column: 2;
    grid-row: 1;
}
body.gmos-surface-portal_home .geer-vsus-welcome-role {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: flex-start;
    padding: 0 24px 20px 84px;
}
body.gmos-surface-portal_home .geer-vsus-welcome-role .gmos-identity-badges {
    justify-content: flex-start;
}
body.gmos-surface-portal_home .geer-vsus-welcome-copy > strong {
    overflow-wrap: normal;
    word-break: normal;
}
@media (max-width: 760px) {
    body.gmos-surface-portal_home .geer-vsus-welcome-header-row {
        grid-template-columns: 1fr !important;
    }
    body.gmos-surface-portal_home .geer-vsus-welcome-date,
    body.gmos-surface-portal_home .geer-vsus-welcome-role {
        grid-column: 1;
        grid-row: auto;
    }
    body.gmos-surface-portal_home .geer-vsus-welcome-role {
        padding: 0 18px 14px 18px;
    }
}

