.site-page {
    --site-frame-width: 100%;
    --site-frame-inset-left: calc(var(--site-frame-width) * 0.0604);
    --site-frame-inset-right: calc(var(--site-frame-width) * 0.0526);
}

.site-shell {
    display: grid;
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
}

.site-frame {
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-width: 0;
    /* Keep short pages together; let longer content grow in normal flow. */
    min-height: 100vh;
    min-height: 100svh;
}

/* Background variants are independent of dense/legal layout tuning.
   focus: compact content mainly on the quiet left side.
   content: broader application surfaces, including distributed cards. */
.site-background--full {
    --review-stage-background-opacity: 1;
}

.site-background--focus {
    --review-stage-background-opacity: 0.8;
}

.site-background--content {
    --review-stage-background-opacity: 0.5;
}

.site-background--content-detail {
    --review-stage-background-opacity: 0.4;
}

.site-background--dense {
    --review-stage-background-opacity: 0.25;
}

.site-shell--dense {
    /* Manual Dense/Legal tuning controls: edit here or on this shell in DevTools.
       Width is capped by available space; content-top adds normal-flow spacing. */
    --site-legal-content-width: 60ch;
    --site-legal-content-top: 0px;
    --site-legal-font-size: 18px;
    --site-legal-font-weight: 400;
}

.site-shell .lobby__background img {
    object-fit: cover;
    object-position: var(--site-background-position, center center);
}

.site-shell .lobby__header,
.site-shell .lobby__main,
.site-page .site-footer__inner {
    width: var(--site-frame-width);
    max-width: 100%;
    margin-inline: auto;
    padding-inline: var(--site-frame-inset-left) var(--site-frame-inset-right);
}

.site-shell .lobby__navigation {
    transform: none;
}

.site-shell .lobby__main {
    overflow-wrap: anywhere;
}

.site-footer {
    flex-shrink: 0;
    color: #1F3524;
    font-family: "Nunito", sans-serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px 16px;
    box-sizing: border-box;
    min-height: 4.5rem;
    padding: 12px 5.26% 12px 6.64%;
}

.site-footer__item {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.site-footer__separator {
    flex-shrink: 0;
}

.site-footer a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    color: inherit;
    text-decoration: none;
    text-underline-offset: 3px;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.site-footer a:focus-visible {
    outline: 2px solid #2C3D29;
    outline-offset: 5px;
}

@media (max-width: 40rem) {
    .site-page {
        --site-frame-inset-left: 24px;
        --site-frame-inset-right: 24px;
    }

    .site-background--focus,
    .site-background--content,
    .site-background--content-detail,
    .site-background--dense {
        --review-stage-background-opacity: 0.25;
    }

    .site-footer__inner {
        justify-content: flex-start;
        padding-right: 24px;
        padding-left: 24px;
    }
}

.lobby .site-header-actions {
    align-items: flex-end;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
}

.lobby .site-primary-navigation {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: inherit;
    min-width: 0;
}

.lobby .site-header-language {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: inherit;
    min-height: 44px;
    white-space: nowrap;
}

.lobby .site-primary-navigation a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    text-underline-offset: 4px;
}

.lobby .site-primary-navigation a:hover {
    text-decoration: underline;
}

.lobby .site-primary-navigation a[aria-current="page"] {
    color: #B3761E;
    font-weight: 600;
    text-decoration: none;
}

.site-logout {
    margin: 2rem 0 0;
}

.site-logout__button {
    min-height: 44px;
    padding: 0 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 16px;
    font-weight: 400;
    cursor: pointer;
    text-underline-offset: 4px;
}

.site-logout__button:hover {
    text-decoration: underline;
}

.site-logout__button:focus-visible {
    outline: 2px solid #2C3D29;
    outline-offset: 5px;
}

.site-shell .site-page-content {
    width: 100%;
    min-width: 0;
    color: #1F3524;
    font-family: "Nunito", sans-serif;
    font-size: 18px;
    line-height: 1.65;
}

.site-shell .site-page-content h1 {
    margin: 0 0 1.5rem;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 600;
    line-height: 1.25;
}

.site-shell .site-page-content h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.25;
}

.site-shell .site-page-content__section {
    margin-block-start: 2rem;
}

.site-skip-link:focus-visible,
.lobby .site-page-content:focus-visible,
.lobby__main[tabindex="-1"]:focus-visible {
    outline: 2px solid #2C3D29;
    outline-offset: 5px;
}

.site-skip-link {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    max-width: calc(100% - 16px);
    box-sizing: border-box;
    padding: 12px 16px;
    background: #FBFAF6;
    color: #1F3524;
    transform: translateY(-200%);
    overflow-wrap: anywhere;
}

.site-skip-link:focus {
    transform: none;
}

@media (max-width: 40rem) {
    .lobby .site-header-actions {
        margin-left: 0;
    }
}

/* Project orientation changes placement, never reading direction or text alignment. */
[data-content-side="right"] .lobby__main {
    align-items: flex-end;
}

.site-shell .site-page-content:not(.w2-topics) {
    max-width: 60ch;
}

[data-content-side="right"] .w2-topic-detail {
    margin-left: auto;
}

@media (max-width: 40rem) {
    .site-shell .lobby__background img {
        object-position: var(--site-background-position-mobile, center center);
    }
}
