/**
 * Humbrella Design System - Base Styles
 * Version: 1.0
 * 
 * Reset, typography, and global element styles.
 * Requires: variables.css
 */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

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

/* Gradient background body - text defaults to light */
body.bg-gradient {
    background: var(--gradient-brand);
    color: var(--color-text-light);
}

/* =========================================
   TYPOGRAPHY - HEADINGS
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

h1 {
    font-size: var(--text-5xl);
    letter-spacing: var(--tracking-tight);
}

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

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

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

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

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

/* Heading color variants */
.heading-gold { color: var(--color-gold); }
.heading-teal { color: var(--color-primary); }
.heading-magenta { color: var(--color-magenta); }
.heading-light { color: var(--color-text-light); }

/* =========================================
   TYPOGRAPHY - BODY TEXT
   ========================================= */
p {
    margin-bottom: var(--space-4);
    line-height: var(--leading-relaxed);
}

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

.lead {
    font-size: var(--text-xl);
    line-height: var(--leading-relaxed);
    color: var(--color-text-muted);
}

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

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

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

em, i {
    font-style: italic;
}

/* =========================================
   LINKS
   ========================================= */
a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--color-primary-dark);
    text-decoration: underline;
}

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

/* Link variants */
.link-gold {
    color: var(--color-gold);
}

.link-gold:hover {
    color: var(--color-gold-dark);
}

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

.link-light:hover {
    color: var(--color-gold);
}

/* =========================================
   LISTS
   ========================================= */
ul, ol {
    margin-bottom: var(--space-4);
    padding-left: var(--space-6);
}

li {
    margin-bottom: var(--space-2);
    line-height: var(--leading-relaxed);
}

/* Unstyled list */
.list-none {
    list-style: none;
    padding-left: 0;
}

.list-none li {
    margin-bottom: 0;
}

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

img {
    border-style: none;
}

figure {
    margin: var(--space-6) 0;
}

figcaption {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
    text-align: center;
}

/* =========================================
   FORMS - BASE
   ========================================= */
input, button, textarea, select {
    font-family: inherit;
    font-size: 100%;
    line-height: inherit;
}

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

input:focus, textarea:focus, select:focus {
    outline: none;
}

/* Placeholder styling */
::placeholder {
    color: var(--color-text-muted);
    opacity: 0.7;
}

/* =========================================
   TABLES
   ========================================= */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: var(--space-6);
}

th, td {
    padding: var(--space-3) var(--space-4);
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

th {
    font-weight: var(--font-semibold);
    background-color: var(--color-cream);
}

/* =========================================
   HORIZONTAL RULE
   ========================================= */
hr {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: var(--space-8) 0;
}

/* =========================================
   BLOCKQUOTE
   ========================================= */
blockquote {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-style: italic;
    color: var(--color-text-muted);
    padding: var(--space-6);
    margin: var(--space-6) 0;
    border-left: var(--border-width-4) solid var(--color-primary);
    background: var(--color-cream);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

blockquote cite {
    display: block;
    font-size: var(--text-sm);
    font-style: normal;
    margin-top: var(--space-4);
    color: var(--color-primary);
}

/* =========================================
   CODE
   ========================================= */
code {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.9em;
    background: var(--color-cream);
    padding: 0.2em 0.4em;
    border-radius: var(--radius-sm);
}

pre {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: var(--color-cream);
    padding: var(--space-4);
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin-bottom: var(--space-6);
}

pre code {
    background: none;
    padding: 0;
}

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

/* =========================================
   FOCUS VISIBLE (Accessibility)
   ========================================= */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

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

/* =========================================
   PRINT STYLES
   ========================================= */
@media print {
    body {
        background: white;
        color: black;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .no-print {
        display: none !important;
    }
}
