/**
 * Base Styles
 * Global typography and element defaults
 *
 * @package MG
 */

/* ========================================
   Document & Body
   ======================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;

    /* Offset for fixed header */
    padding-top: var(--mg-header-offset-mobile, 80px);

    font-family: var(--mg-font-sans);
    font-size: var(--mg-text-base);
    font-weight: var(--mg-font-weight-regular);
    line-height: var(--mg-leading-normal);
    color: var(--mg-color-text);
    background-color: var(--mg-color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

@media (min-width: 768px) {
    body {
        padding-top: var(--mg-header-offset-desktop, 130px);
    }
}

/* ========================================
   Typography
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: var(--mg-font-weight-bold);
    line-height: var(--mg-leading-tight);
    color: var(--mg-color-text);
}

h1 {
    font-size: var(--mg-text-4xl);
}

h2 {
    font-size: var(--mg-text-3xl);
}

h3 {
    font-size: var(--mg-text-2xl);
}

h4 {
    font-size: var(--mg-text-xl);
}

h5 {
    font-size: var(--mg-text-lg);
}

h6 {
    font-size: var(--mg-text-base);
}

p {
    margin: 0 0 1em;
}

/* ========================================
   Links
   ======================================== */

a {
    color: var(--mg-color-link);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--mg-color-link-hover);
}

a:focus {
    outline: none;
}

a:focus-visible {
    outline: 2px solid var(--mg-color-focus);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ========================================
   Lists
   ======================================== */

ul,
ol {
    margin: 0;
    padding: 0;
}

/* ========================================
   Images
   ======================================== */

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   Buttons
   ======================================== */

button {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    cursor: pointer;
}

button:focus {
    outline: none;
}

button:focus-visible {
    outline: 2px solid var(--mg-color-focus);
    outline-offset: 2px;
}

/* ========================================
   Focus Visible (Global)
   ======================================== */

:focus {
    outline: none;
}

:focus-visible {
    outline: 2px solid var(--mg-color-focus);
    outline-offset: 2px;
}