/*
 * GRCForge shared viewport + typography contract.
 * Loaded after the legacy theme layer. Keeps icon glyphs and authored
 * print/export documents intact while normalizing the screen interface.
 */
:root {
    --grc-layout-gutter: clamp(16px, 2.2vw, 36px);
    --grc-body-size: 16px;
    --grc-ui-font: "Open Sans", sans-serif;
    --font-primary: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media screen {
body.grc-site {
    font-family: var(--grc-ui-font) !important;
    font-size: var(--grc-body-size) !important;
    line-height: 1.55;
}

/* Replace the old centered 7xl/1440px shells with viewport-fit page shells. */
body.grc-site .grc-page-container,
body.grc-site > main,
body.grc-site main > .container,
body.grc-site nav > .container,
body.grc-site footer > .container,
body.grc-site nav > div.mx-auto,
body.grc-site footer > div.mx-auto {
    box-sizing: border-box;
    width: calc(100% - var(--grc-layout-gutter) * 2) !important;
    max-width: none !important;
    margin-inline: auto !important;
}
body.grc-site > main {
    padding-inline: 0 !important;
}

/* Remove the 1440px cap used by the shared layout token without affecting
   nested content measures such as prose or form controls. */
body.grc-site {
    --page-max-width: 100%;
    --page-gutter: var(--grc-layout-gutter);
}
body.grc-site .grc-page-container {
    width: calc(100% - var(--grc-layout-gutter) * 2) !important;
}

/* Body/UI copy uses one readable size across legacy utility classes and
   component-local rules. Heading hierarchy and large data values remain intact. */
body.grc-site :where(
    p, a, button, input, select, textarea, label, li, td, th, summary, dt, dd,
    span, strong, em, small, div, legend, output
):not(.health-value, .overview-metric__value, .overview-mini-metrics strong,
    .overview-chevron, .fa, .fas, .far, .fab, .fal, .fad,
    [class*="fa-"], .material-icons, .material-symbols-outlined) {
    font-family: var(--grc-ui-font) !important;
    font-size: var(--grc-body-size) !important;
}

/* Keep one family site-wide while retaining meaningful heading size hierarchy. */
body.grc-site :is(h1, h2, h3, h4, h5, h6, .font-heading) {
    font-family: var(--grc-ui-font) !important;
}
body.grc-site h1 { font-size: clamp(1.75rem, 2.5vw, 2.25rem) !important; line-height: 1.2; }
body.grc-site h2 { font-size: 1.5rem !important; line-height: 1.3; }
body.grc-site h3 { font-size: 1.25rem !important; line-height: 1.35; }
body.grc-site :is(h4, h5, h6) { font-size: 1.125rem !important; line-height: 1.4; }
body.grc-site :is(h1, h2, h3, h4, h5, h6) :is(span, a, strong, em) {
    font-size: inherit !important;
}

/* Educational reading uses one shared Inter scale; operational GRC stays denser. */
body.grc-site:is(.help-site, .learning-academy-site) {
    --grc-ui-font: var(--font-primary);
}
body.grc-site:is(.help-site, .learning-academy-site) h1 {
    font-size: 2.125rem !important;
    font-weight: 600;
    letter-spacing: -0.025em;
}
body.grc-site:is(.help-site, .learning-academy-site) h2 {
    font-size: 1.5rem !important;
    font-weight: 600;
    letter-spacing: -0.015em;
}
body.grc-site:is(.help-site, .learning-academy-site) h3 {
    font-size: 1.125rem !important;
    font-weight: 600;
}
body.grc-site.learning-academy-site :is(.text-xs, .text-sm) {
    font-size: 0.875rem !important;
}
body.grc-site.help-site .help-article-heading .help-meta {
    font-size: 0.875rem !important;
    line-height: 1.5;
    color: var(--text-secondary, #61726b);
}
body.grc-site.help-site .help-article-body {
    font-size: 1rem;
    line-height: 1.7;
}
body.grc-site.help-site .help-article-body h2 {
    margin: 32px 0 12px;
}
body.grc-site.help-site .help-article-body h3 {
    margin: 24px 0 10px;
}
body.grc-site.help-site .help-article-body p {
    margin: 0 0 16px;
}
body.grc-site.help-site .help-article-body li {
    font-size: 1rem !important;
    line-height: 1.7;
}
body.grc-site.help-site .help-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.8rem 1rem;
    color: var(--text-secondary, #61726b);
    font-size: 0.875rem !important;
    line-height: 1.5;
}
body.grc-site.help-site .help-disclaimer > span:not(.help-disclaimer__icon) {
    font-size: 0.875rem !important;
}
body.grc-site.help-site .help-disclaimer__icon {
    display: inline-flex;
    flex: 0 0 1.2rem;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    margin-top: 0.08rem;
    border: 1px solid #9aaca2;
    border-radius: 50%;
    color: #61726b;
    font-size: 0.75rem !important;
    font-weight: 700;
}

@media (max-width: 640px) {
    body.grc-site:is(.help-site, .learning-academy-site) h1 {
        font-size: 1.875rem !important;
    }
    body.grc-site:is(.help-site, .learning-academy-site) h2 {
        font-size: 1.375rem !important;
    }
}

body.grc-site :is(code, pre) {
    font-family: "JetBrains Mono", ui-monospace, monospace !important;
}

/* Controls stay legible and never become narrower than their available track. */
body.grc-site :is(input, select, textarea, button) {
    min-width: 0;
    line-height: 1.4;
}
body.grc-site :is(input, select, textarea) {
    font-size: var(--grc-body-size) !important;
}
body.grc-site .health-scroll,
body.grc-site .overflow-x-auto,
body.grc-site .table-scroll {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
}
body.grc-site table {
    max-width: 100%;
}

@media (max-width: 767px) {
    :root { --grc-layout-gutter: 16px; }
    body.grc-site main.container,
    body.grc-site main > .container,
    body.grc-site .grc-page-container {
        width: calc(100% - 32px) !important;
    }
    body.grc-site :is(nav, footer) {
        min-width: 0;
    }
    body.grc-site :is(input, select, textarea, button) {
        max-width: 100%;
    }
}

}
