/* ============================================
   OrthoAlign Rehab — Base Styles
   Modern CSS Reset + Global Defaults
   ============================================ */

/* ----------------------------------------
   CSS RESET (Modern)
   ---------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    font-size: 100%;
    line-height: var(--leading-normal);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    font-weight: var(--weight-regular);
    line-height: var(--leading-relaxed);
    color: var(--color-gray-800);
    background-color: var(--color-white);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ----------------------------------------
   ELEMENTS
   ---------------------------------------- */
img,
picture,
video,
canvas,
svg {
    display: block;
    max-width: 100%;
    height: auto;
}

input,
button,
textarea,
select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

a {
    color: var(--color-blue);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-blue-dark);
}

ul,
ol {
    list-style: none;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--weight-bold);
    line-height: var(--leading-tight);
    letter-spacing: var(--tracking-tight);
    color: var(--color-navy);
    text-wrap: balance;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
    max-width: 70ch;
    text-wrap: pretty;
}

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

blockquote {
    border-left: 3px solid var(--color-blue);
    padding-left: var(--space-4);
    font-style: italic;
    color: var(--color-gray-600);
}

hr {
    border: none;
    border-top: 1px solid var(--color-gray-200);
    margin: var(--space-8) 0;
}

/* Focus Styles (Accessibility) */
:focus-visible {
    outline: 3px solid var(--color-blue);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

/* Skip to Content (Accessibility) */
.skip-link {
    position: absolute;
    top: -100%;
    left: var(--space-4);
    padding: var(--space-3) var(--space-6);
    background: var(--color-navy);
    color: var(--color-white);
    font-weight: var(--weight-semibold);
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: var(--z-tooltip);
    transition: top var(--transition-base);
}

.skip-link:focus {
    top: 0;
    color: var(--color-white);
}

/* ----------------------------------------
   LAYOUT UTILITIES
   ---------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--container-px);
}

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

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

.section {
    padding-block: var(--section-py);
    padding-inline: var(--section-px);
    position: relative;
}

.section--gray {
    background-color: var(--color-gray-50);
}

.section--cyan {
    background-color: var(--color-cyan-light);
}

.section--navy {
    background: var(--gradient-cta);
    color: var(--color-white);
}

.section--navy h2,
.section--navy h3,
.section--navy h4 {
    color: var(--color-white);
}

.section--navy p {
    color: rgba(255, 255, 255, 0.85);
}

/* ----------------------------------------
   FLEXBOX UTILITIES
   ---------------------------------------- */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

/* ----------------------------------------
   GRID UTILITIES
   ---------------------------------------- */
.grid { display: grid; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ----------------------------------------
   TEXT UTILITIES
   ---------------------------------------- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-navy { color: var(--color-navy); }
.text-blue { color: var(--color-blue); }
.text-gray { color: var(--color-gray-500); }
.text-white { color: var(--color-white); }
.text-success { color: var(--color-success); }
.font-medium { font-weight: var(--weight-medium); }
.font-semibold { font-weight: var(--weight-semibold); }
.font-bold { font-weight: var(--weight-bold); }

/* ----------------------------------------
   SPACING UTILITIES
   ---------------------------------------- */
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mx-auto { margin-inline: auto; }

/* ----------------------------------------
   VISIBILITY
   ---------------------------------------- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden { display: none !important; }

/* ----------------------------------------
   SELECTION
   ---------------------------------------- */
::selection {
    background-color: var(--color-blue);
    color: var(--color-white);
}

/* ----------------------------------------
   SCROLLBAR (Webkit)
   ---------------------------------------- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--color-gray-300);
    border-radius: var(--radius-pill);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-gray-400);
}
