/* ============================================================================
   CambridgePortal — Global Styles
   Base resets, typography defaults, and shared utilities for both surfaces.
   ============================================================================ */

@import url('variables.css');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Lexend:wght@300;400;500;600;700&display=swap');

/* ----------------------------------------------------------------------------
   Reset
   ---------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ----------------------------------------------------------------------------
   Document defaults
   ---------------------------------------------------------------------------- */
html {
    font-family: var(--font-body);
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ----------------------------------------------------------------------------
   Headings inherit the heading font but have no opinionated sizing here.
   Surface stylesheets (forms.css, admin.css) set sizes per context.
   ---------------------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: var(--leading-tight);
    font-weight: var(--weight-semibold);
}

/* ----------------------------------------------------------------------------
   Media defaults
   ---------------------------------------------------------------------------- */
img,
picture,
video,
canvas,
svg {
    max-width: 100%;
    display: block;
}

/* ----------------------------------------------------------------------------
   Form elements inherit fonts so the body font applies in inputs.
   ---------------------------------------------------------------------------- */
input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

/* ----------------------------------------------------------------------------
   Links — inherit colour by default, underline only on hover.
   ---------------------------------------------------------------------------- */
a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover,
a:focus {
    text-decoration: underline;
}

/* ----------------------------------------------------------------------------
   Lists default to no bullets in app contexts; restore where needed.
   ---------------------------------------------------------------------------- */
ul,
ol {
    list-style: none;
}

/* ----------------------------------------------------------------------------
   Utility — visually hidden (accessible to screen readers, off-screen visually)
   ---------------------------------------------------------------------------- */
.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ----------------------------------------------------------------------------
   Utility — container
   ---------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--space-6);
    padding-right: var(--space-6);
}

/* ----------------------------------------------------------------------------
   Reduced motion preferences are respected.
   ---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
