/* Layout Styles - Grid, flexbox, and page structure */

/* ========================================
   BODY & HTML
   ======================================== */

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--color-text);
    background-color: var(--color-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* ========================================
   CONTAINER
   ======================================== */

.container {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--container-padding);
    padding-right: var(--container-padding);
}

.container-narrow {
    max-width: var(--max-width-narrow);
}


/* ========================================
   SKIP LINK (Accessibility)
   ======================================== */

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
    background: var(--color-text);
    color: var(--color-background);
    padding: var(--spacing-sm) var(--spacing-md);
    text-decoration: none;
    z-index: var(--z-index-toast);
}

.skip-link:focus {
    position: fixed;
    left: var(--spacing-md);
    top: var(--spacing-md);
    width: auto;
    height: auto;
    overflow: visible;
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-lg);
}


/* ========================================
   HEADER
   ======================================== */

header {
    background-color: var(--color-background);
    padding: var(--spacing-lg) 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: var(--z-index-sticky);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-normal);
    color: var(--color-text);
    margin: 0;
    text-decoration: none;
    line-height: var(--line-height-logo);
}

header .logo:hover {
    color: var(--color-text);
}

header .logo .highlight {
    font-weight: var(--font-weight-extrabold);
    text-transform: uppercase;
}


/* ========================================
   NAVIGATION
   ======================================== */

nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    margin-bottom: 0;
}

nav a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    transition: color var(--transition-fast);
    position: relative;
}

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

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

nav a[aria-current="page"] {
    font-weight: var(--font-weight-bold);
}


/* ========================================
   MAIN CONTENT
   ======================================== */

main {
    min-height: 60vh;
    padding: var(--spacing-2xl) 0;
    margin-top: var(--spacing-3xl);
    /* Account for fixed header */
    background-color: var(--color-background-alt);
}

section {
    margin-bottom: var(--spacing-3xl);
}

section:last-child {
    margin-bottom: 0;
}


/* ========================================
   FOOTER
   ======================================== */

footer {
    padding: var(--spacing-xl) 0;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
}

footer nav {
    margin-bottom: 0;
}

footer nav ul {
    list-style: none;
    display: flex;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    padding: 0;
    margin: 0;
}

footer nav a {
    text-decoration: none;
    font-size: var(--font-size-sm);
    transition: color var(--transition-fast);
}

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

footer p {
    text-align: right;
    font-size: var(--font-size-sm);
    margin: 0;
}


/* ========================================
   TYPOGRAPHY
   ======================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-family-heading);
    font-weight: var(--font-weight-bold);
    line-height: var(--line-height-tight);
    margin-bottom: var(--spacing-md);
    color: var(--color-text);
}

h2 {
    font-size: var(--font-size-3xl);
    margin-bottom: var(--spacing-lg);
}

h3 {
    font-size: var(--font-size-xl);
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

h4 {
    font-size: var(--font-size-lg);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
}

p {
    margin-bottom: var(--spacing-md);
}

p:last-child {
    margin-bottom: 0;
}

a {
    color: var(--color-link);
    transition: color var(--transition-fast);
}

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

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

strong {
    font-weight: var(--font-weight-semibold);
}

small {
    font-size: var(--font-size-sm);
}

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


/* ========================================
   LISTS
   ======================================== */

ul,
ol {
    margin-bottom: var(--spacing-md);
    padding-left: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-xs);
}


/* ========================================
   UTILITIES
   ======================================== */

.text-center {
    text-align: center;
}

.text-light {
    color: var(--color-text-light);
}

.mt-0 {
    margin-top: 0;
}

.mt-sm {
    margin-top: var(--spacing-sm);
}

.mt-md {
    margin-top: var(--spacing-md);
}

.mt-lg {
    margin-top: var(--spacing-lg);
}

.mt-xl {
    margin-top: var(--spacing-xl);
}

.mb-0 {
    margin-bottom: 0;
}

.mb-sm {
    margin-bottom: var(--spacing-sm);
}

.mb-md {
    margin-bottom: var(--spacing-md);
}

.mb-lg {
    margin-bottom: var(--spacing-lg);
}

.mb-xl {
    margin-bottom: var(--spacing-xl);
}