/* ================================================================
   HERMES GLOBAL LAYOUT // V1 // 2026-10-02

   Purpose
   - Product pages use the available desktop canvas instead of a narrow
     legacy portal measure.
   - Individual components may still constrain their own readable text,
     but the global shell no longer constrains whole pages.
   - PAGE CONTEXT has been removed from the product shell.
   - Community keeps its purpose-built three-column workspace.
   - Welcome / First Contact and Hermes AI remain intentional exceptions.
   ================================================================ */

:root {
    --hermes-content-max: 1800px;
    --hermes-page-x: clamp(18px, 2.15vw, 44px);
    --hermes-page-y: clamp(18px, 2.4vh, 34px);
    --portal-measure: 100%;
}

/* One wide product canvas.  The box includes its own padding. */
.portal-content,
.amp-content {
    width: min(var(--hermes-content-max), 100%) !important;
    max-width: none !important;
    margin-inline: auto !important;
    padding-inline: var(--hermes-page-x) !important;
}

/* A route owns the whole product canvas.  Old per-route max-widths
   (1180 / 1320 etc.) no longer decide the width of an entire page. */
.portal-heading,
#portalContent.portal-grid,
.portal-foot {
    width: 100% !important;
    max-width: none !important;
}

/* Account used an ID-specific legacy cap, so explicitly retire it. */
#portalContent.profile-summary,
#portalContent.profile-editing,
#portalContent.ui-settings-active,
#portalContent.support-active,
#portalContent.server-status-active,
#portalContent.player-presence-active,
#portalContent.public-profile-active,
#portalContent.direct-messages-active,
#portalContent.stats-active,
#portalContent.journey-active,
#portalContent.quests-active,
#portalContent.crossroads-active {
    width: 100% !important;
    max-width: none !important;
}

/* The former 190px portal heading was another inherited space tax. */
.portal-heading {
    min-height: 0 !important;
    padding: 14px 0 18px !important;
    margin: 0 0 18px !important;
}

.portal-heading h1 {
    margin-top: 10px !important;
}

/* PAGE CONTEXT is not progressive disclosure anymore; it is gone.
   This rule also protects against stale cached HTML during rollout. */
.portal-context {
    display: none !important;
}

/* The old portal measure was also reintroduced inside a 1500px media
   query.  Keep the shell wide at every desktop/tablet breakpoint. */
@media (max-width: 1500px) {
    :root {
        --portal-measure: 100%;
        --hermes-content-max: 100%;
    }

    .portal-heading,
    #portalContent.portal-grid,
    .portal-foot {
        width: 100% !important;
        max-width: none !important;
    }
}

@media (max-width: 980px) {
    :root {
        --hermes-page-x: 18px;
        --hermes-page-y: 18px;
    }

    .portal-content,
    .amp-content {
        padding: 18px var(--hermes-page-x) 44px !important;
    }

    .portal-heading {
        padding-top: 8px !important;
    }
}

@media (max-width: 620px) {
    :root {
        --hermes-page-x: 12px;
    }

    .portal-content,
    .amp-content {
        padding-left: var(--hermes-page-x) !important;
        padding-right: var(--hermes-page-x) !important;
    }
}
