/* GLOBAL STYLES - NO GRADIENTS, SYSTEM FONTS ONLY */

/* RESET & BASE */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
    background-color: #fafafa;
    color: #0a0a0a;
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
    display: block;
}

table {
    max-width: 100%;
    border-collapse: collapse;
}

/* ANTI-OVERFLOW */
.table-responsive,
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* TYPOGRAPHY */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.2;
    font-weight: 700;
    color: #0a0a0a;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

a {
    color: #dc2626;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

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

/* FOCUS STYLES FOR ACCESSIBILITY */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid #dc2626;
    outline-offset: 2px;
}

/* SELECTION COLOR */
::selection {
    background-color: #dc2626;
    color: #fafafa;
}

/* SCROLLBAR STYLING */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #0a0a0a;
}

::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}

/* RESPONSIVE ANTI-OVERFLOW */
@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    
    .grid,
    [class*='grid'] {
        grid-template-columns: 1fr !important;
    }
    
    /* Ensure text doesn't overflow */
    h1, h2, h3, h4, h5, h6 {
        overflow-wrap: break-word;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Prevent horizontal scroll on tables */
    .table-responsive,
    .table-wrapper {
        display: block;
        width: 100%;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    body {
        font-size: 16px;
    }
}

/* PRINT STYLES */
@media print {
    .site-header,
    .site-footer,
    .newsletter-section,
    .nav-toggle {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    a {
        text-decoration: underline;
        color: black;
    }
    
    .masonry-item,
    .article-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}