/* =========================================
   1. Imports & Reset
   ========================================= */
/* Importing Google Fonts: Montserrat (Headings) and Merriweather (Body) */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:ital,wght@0,300;0,400;0,700;1,400&family=Montserrat:wght@500;600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* =========================================
   2. Variables (:root)
   ========================================= */
:root {
    /* Colors */
    --color-primary: #2c3e50;  /* Slate Blue */
    --color-accent: #e67e22;   /* Safety Orange */
    --color-bg: #fdfdfd;       /* Off-white */
    --color-text-main: #333333;
    --color-text-light: #ecf0f1;
    --color-gray-light: #e0e0e0;
    
    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Merriweather', serif;
    
    /* Spacing & Layout */
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 2rem;
    --container-width: 1200px;
    --header-height: 70px;
}

/* =========================================
   3. Global Styles (Mobile First)
   ========================================= */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-bg);
    color: var(--color-text-main);
    line-height: 1.6;
    font-size: 16px; /* Base size */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
    font-weight: 700;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: var(--spacing-md);
}

a {
    text-decoration: none;
    color: var(--color-primary);
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-accent);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   4. Utility Classes
   ========================================= */

/* Container */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px; /* Ensure >44px height for tap targets */
    border-radius: 4px;
    font-family: var(--font-heading);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background-color: #34495e;
    color: #fff;
}

.btn-secondary {
    background-color: var(--color-accent);
    color: #fff;
}

.btn-secondary:hover {
    background-color: #d35400;
    color: #fff;
}

/* Card Component (Blog Posts/Features) */
.card {
    background: #fff;
    border: 1px solid var(--color-gray-light);
    border-radius: 8px;
    padding: var(--spacing-md);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Ad Slot (Layout Shift Protection) */
.ad-slot {
    background-color: #f0f0f0;
    border: 1px dashed #ccc;
    width: 100%;
    min-height: 250px; /* Pre-allocate space */
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--spacing-lg) 0;
    color: #888;
    font-family: var(--font-heading);
    font-size: 0.9rem;
}

/* =========================================
   5. Media Queries (Responsive)
   ========================================= */

/* Tablet & Desktop */
@media (min-width: 768px) {
    body {
        font-size: 18px; /* Improve readability on larger screens */
    }

    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }

    .container {
        padding: 0 var(--spacing-lg);
    }
/* =========================================
   6. Navigation Styles (Moved from Index)
   ========================================= */
header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--header-height);
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-primary);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-primary);
}

.nav-menu {
    display: flex;
    gap: 20px;
    list-style: none;
}

.nav-menu li a {
    color: var(--color-primary);
    font-weight: 600;
}

/* Mobile Menu Logic */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 4px 4px rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }
}
}
