/*
 * SGIS responsive type system
 *
 * The scale follows tested public-service typography patterns: readable body
 * copy at every viewport, a limited number of roles, relative units for zoom,
 * generous leading, and restrained display sizes that reflow cleanly.
 */

:root {
    --type-caption: clamp(.875rem, .83rem + .18vw, .9375rem);
    --type-small: clamp(.9375rem, .89rem + .2vw, 1rem);
    --type-ui: clamp(1rem, .95rem + .2vw, 1.0625rem);
    --type-body: clamp(1.0625rem, 1.01rem + .25vw, 1.1875rem);
    --type-lead: clamp(1.1875rem, 1.1rem + .4vw, 1.375rem);
    --type-card-title: clamp(1.375rem, 1.22rem + .65vw, 1.75rem);
    --type-h3: clamp(1.5rem, 1.28rem + .9vw, 1.95rem);
    --type-h2: clamp(2rem, 1.6rem + 2vw, 3.5rem);
    --type-h1: clamp(2.75rem, 2rem + 3vw, 4.75rem);
    --measure-reading: 72ch;
}

html { text-size-adjust: 100%; }
body { font-size: var(--type-body); line-height: 1.6; }

/* Reading copy */
main p,
main li,
main dd,
main address,
main td,
main blockquote {
    font-size: var(--type-body) !important;
    line-height: 1.6 !important;
}

.lead-copy,
.hero__lead,
.page-hero__lead,
.decision-hero .page-hero__lead,
.error-hero__lead,
.stem-hero__lead,
.programme-campaign__lead,
.section-heading--split > p,
.intro-statement__grid > p:last-child,
.two-column > div:last-child,
.promise__grid > p,
.pathway-band__copy > p:not(.eyebrow),
.support-story__copy > p:not(.eyebrow) {
    font-size: var(--type-lead) !important;
    line-height: 1.55 !important;
}

/* Display hierarchy */
main h1 {
    font-size: var(--type-h1) !important;
    line-height: .98 !important;
    letter-spacing: -.04em !important;
}

main h2 {
    font-size: var(--type-h2) !important;
    line-height: 1.04 !important;
    letter-spacing: -.035em !important;
}

main h3 {
    font-size: var(--type-h3) !important;
    line-height: 1.12 !important;
    letter-spacing: -.02em !important;
}

main h4 {
    font-size: var(--type-card-title) !important;
    line-height: 1.18 !important;
}

/* Dense catalogue and reader controls use interface type, not display type. */
.book-card h2 {
    font-size: var(--type-card-title) !important;
    line-height: 1.15 !important;
    letter-spacing: -.015em !important;
}

.book-card__body > p {
    font-size: var(--type-small) !important;
    line-height: 1.55 !important;
}

.book-card__body > .book-card__guidance {
    font-size: var(--type-caption) !important;
    line-height: 1.55 !important;
}

.reader-book-title h1 {
    font-size: var(--type-ui) !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
}

.reader-source p {
    font-size: var(--type-caption) !important;
    line-height: 1.55 !important;
}

/* Component titles that belong below the section-heading level */
.hero-route-card > strong,
.quick-routes strong,
.decision-links strong,
.feature-card h3,
.statement-card h2,
.support-grid h3,
.pathway-panel h2,
.programme-cards h2,
.contact-grid h2,
.programme-tile h2,
.programme-method h2,
.book-card h2,
.library-start strong,
.library-principles__list b,
.programme-comparison tbody th,
.programme-workday li strong,
.error-explainer > strong,
.error-matches strong,
.error-route-index nav strong,
.error-safety strong,
.reader-status strong {
    font-size: var(--type-card-title) !important;
    line-height: 1.15 !important;
    letter-spacing: -.02em !important;
}

.stem-origin-strip strong {
    font-size: var(--type-card-title) !important;
    line-height: 1.15 !important;
}

/* Navigation, controls, and actionable copy */
.primary-nav,
.button,
.button--small,
.text-link,
button,
input,
select,
textarea,
main label,
.faq-list summary,
.reader-contents button,
.reader-paging button {
    font-size: var(--type-ui) !important;
    line-height: 1.35 !important;
}

.stem-wayfinder a,
.stem-wayfinder strong {
    font-size: var(--type-small) !important;
    line-height: 1.35 !important;
}

/* Metadata is intentionally smaller, but never microcopy. */
.topline,
.topline *,
.eyebrow,
.breadcrumbs,
main small,
main dt,
main figcaption,
main [class*="kicker"],
main [class*="section-label"],
.hero-route-card > span,
.hero__note span,
.hero__proof span,
.hero__proof strong,
.home-proof span,
.home-proof strong,
.home-hero__caption span,
.quick-routes span,
.quick-routes b,
.learning-cycle article > span,
.decision-links span,
.pathway-map span,
.status-grid span,
.evidence-list article > span,
.principle-grid article > span,
.process-grid article > span,
.support-grid article > span,
.statement-card > span,
.pathway-panel > span,
.pathway-steps b,
.programme-list > a > span,
.programme-list > a > b,
.programme-family-note strong,
.notice-band strong,
.programme-cards span,
.admissions-steps > li > span,
.contact-grid article > span,
.library-hero__proof span,
.library-start span,
.library-filter label,
.library-result-count,
.book-cover span,
.book-cover i,
.book-card__meta span,
.book-card__author,
.book-card__actions small,
.programme-tile > div:first-child,
.programme-tile dt,
.programme-tile dd,
.programme-facts > span,
.programme-facts dt,
.programme-facts dd,
.programme-method span,
.session-flow span,
.location-mark span,
.resource-card > span,
.stem-disciplines li > span,
.stem-photo figcaption span,
.stem-preview__status,
.stem-pulse span,
.stem-pulse strong,
.stem-origin-strip span,
.stem-overview__quick-grid span,
.stem-fit-grid span,
.stem-lab__steps article > span,
.stem-project-grid article > span,
.stem-projects__note strong,
.stem-evidence__list span,
.stem-safety__copy strong,
.stem-safety__checks span,
.stem-brief dt,
.programme-campaign__focus span,
.programme-campaign__focus strong,
.programme-campaign__preview > div:first-child,
.programme-campaign__preview dt,
.programme-campaign__preview dd,
.programme-campaign__pulse span,
.programme-campaign__pulse strong,
.programme-campaign__fit span,
.programme-campaign__steps article > span,
.programme-campaign__evidence-list span,
.programme-campaign__safety-grid strong,
.programme-comparison thead th,
.programme-comparison tbody th span,
.programme-comparison tbody td small,
.programme-workday li > span,
.programme-research-note > strong,
.programme-research-note a,
.programme-demand legend,
.programme-demand > p,
.programme-days label,
.error-explainer > span,
.error-path b,
.error-search label,
.error-search small,
.error-matches span,
.error-matches b,
.error-route-index nav span,
.error-safety span,
.reader-book-title > a,
.reader-panel span,
.reader-bottom span,
.reader-source,
.reader-paging output {
    font-size: var(--type-caption) !important;
    line-height: 1.45 !important;
}

/* Secondary copy that still needs comfortable continuous reading. */
.hero__proof span,
.home-proof span,
.quick-routes b,
.pathway-steps span,
.programme-list > a > b,
.stem-disciplines small,
.stem-preview > p,
.stem-origin-strip p,
.stem-cycle-principles span,
.stem-project-grid p,
.stem-projects__note p,
.stem-safety__copy span,
.stem-safety__checks strong,
.stem-brief__heading > p,
.stem-brief dd,
.stem-brief__questions li,
.stem-cta li,
.book-card__author,
.book-card__guidance,
.book-card__actions small,
.library-principles__list p,
.programme-campaign__preview > p,
.programme-campaign__steps p,
.programme-campaign__safety-grid span,
.programme-comparison tbody td,
.programme-comparison tbody td small,
.programme-workday li p,
.programme-research-note > p,
.programme-demand > p,
.error-explainer > p,
.error-explainer .error-honesty,
.error-matches p {
    font-size: var(--type-small) !important;
    line-height: 1.5 !important;
}

.status-grid a,
.stem-disciplines strong,
.stem-preview > strong,
.programme-campaign__preview > strong {
    font-size: var(--type-ui) !important;
    line-height: 1.4 !important;
}

/* Footer and utility navigation */
.footer-grid h2 {
    font-size: var(--type-caption) !important;
    line-height: 1.35 !important;
}

.footer-grid a,
.footer-grid address,
.footer-base {
    font-size: var(--type-small) !important;
    line-height: 1.55 !important;
}

.footer-brand p {
    font-size: var(--type-lead) !important;
    line-height: 1.5 !important;
}

/* Keep long-form paragraphs comfortable on wide displays without constraining cards. */
.legal-copy,
.page-hero__narrow,
.section-heading,
.reader-status {
    max-inline-size: var(--measure-reading);
}

@media (max-width: 760px) {
    :root {
        --type-h1: clamp(2.65rem, 2.25rem + 2vw, 3rem);
        --type-h2: clamp(2rem, 1.75rem + 1.25vw, 2.35rem);
        --type-h3: clamp(1.45rem, 1.3rem + .75vw, 1.7rem);
    }

    main h1,
    main h2,
    main h3 { overflow-wrap: normal; hyphens: none; }

    .reader-tools button { font-size: 0 !important; }
}

@media (max-width: 360px) {
    :root {
        --type-body: 1.0625rem;
        --type-lead: 1.1875rem;
        --type-ui: 1rem;
        --type-h1: 2.5rem;
        --type-h2: 1.9rem;
    }
}
