/* ==========================================================================
   1. Reset & Core Base Styles
   ========================================================================== */
html {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    -webkit-text-size-adjust: 100%;
}

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

body {
    margin: 0;
    padding: 0;
}

/* Fluid Media - prevents images/videos from breaking layouts */
img, video, canvas, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Typography Scale */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.35rem; }
p { margin-top: 0; margin-bottom: 1.5rem; }

/* ==========================================================================
   2. Layout Structure (Containers & Flex/Grid Helpers)
   ========================================================================== */
/* The main wrapping element that keeps content centered on widescreen desktop */
.container {
    width: 100%;
    max-width: 1140px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 20px;
    padding-left: 20px;
}

/* Modern Multi-Column Layouts via Flexbox & Grid */
.flex-row {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 24px;
}

/* Flexible grid columns that auto-wrap */
.flex-col {
    flex: 1 1 300px; /* Expands, shrinks, and wraps when width hits below 300px */
}

/* Standard Header & Nav layout */
.site-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 20px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-menu a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
}

.nav-menu a:hover {
    color: #000;
}

/* ==========================================================================
   3. Media Queries (Mobile & Tablet Adjustments)
   ========================================================================== */

/* Tablets / Small Screens (Portrait views) */
@media (max-width: 768px) {
    h1 { font-size: 1.85rem; }
    h2 { font-size: 1.5rem; }
    
    /* Convert navigation menu into a stacked vertical list on mobile */
    .nav-container {
        flex-direction: column;
        text-align: center;
    }
    
    .nav-menu {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }
}

/* Mobile Phones (Compact views) */
@media (max-width: 480px) {
    .container {
        padding-right: 15px;
        padding-left: 15px;
    }
    
    h1 { font-size: 1.6rem; }
    
    /* Elements that should stack aggressively on tiny devices */
    .flex-row {
        flex-direction: column;
        gap: 16px;
    }
}
