/* ==========================================================================
   1. GLOBAL & BASE LAYOUT CONFIGURATIONS (Forced Center Foundations)
   ========================================================================== */
body {
    margin: 0 !important;
    padding: 0 !important;
    background-color: #ffffff !important;
    
    /* THE ROOT FIX: Teaches the entire page framework to center its contents */
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important; 
    width: 100% !important;
}

/* Fluid responsive modifier rule for global graphics components */
img.responsive {
    width: 100% !important;
    max-width: 100% !important;
    display: block !important;
    height: auto !important;
}

/* Clearfix solution helper for standard text layout floating structures */
.main::after {
    content: "";
    clear: both;
    display: table;
}

/* ==========================================================================
   2. WIDER TOP NAVIGATION BAR AND HOVER ACTIONS WITH DROP SHADOW UNDERLINE
   ========================================================================== */
.topnav-container-row {
    width: 100% !important;
    background-color: #333333 !important;
    clear: both !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
    z-index: 10 !important;
}

.topnav {
    max-width: 1200px !important;
    margin: 0 auto !important;
    background-color: #333333 !important;
    overflow: hidden !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
}

.topnav a {
    float: left !important;
    display: block !important;
    color: #f2f2f2 !important;
    text-align: center !important;
    padding: 14px 16px !important;
    text-decoration: none !important;
    font-size: 17px !important;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out !important;
}

.topnav a:hover {
    background-color: #ff6600 !important;
    color: #ffffff !important;
}

.topnav a.active {
    background-color: #ff6600 !important;
    color: white !important;
}

.topnav .icon {
    display: none !important;
}

/* ==========================================================================
   3. HORIZONTAL TOP CATEGORIES GRID BAR WITH LIFT SHADOWS (REINFORCED DESKTOP)
   ========================================================================== */
.top-grid-override {
    display: block !important;
    width: 100% !important;
    clear: both !important;
    float: none !important;
    box-sizing: border-box !important;
}

/* Hardened layout engine forces side-by-side placement on computer screens */
.top-categories-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Locks 4 equal columns horizontally */
    max-width: 1200px !important;
    margin: 30px auto 30px auto !important;
    padding: 0 20px !important;
    gap: 20px !important;
    box-sizing: border-box !important;
}

.category-block {
    background-color: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 18px !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03) !important;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out !important;
}

.category-block:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04) !important;
    border-color: #cbd5e1 !important;
}

.category-title {
    font-size: 13px !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    color: #444444 !important;
    font-weight: bold !important;
    border-bottom: 2px solid #ff6600 !important;
    padding-bottom: 6px !important;
    margin-bottom: 10px !important;
}

.category-links {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.category-links li {
    margin-bottom: 6px !important;
}

.category-links a {
    color: #0066cc !important;
    text-decoration: none !important;
    font-size: 14px !important;
    display: inline-block !important;
}

.category-links a:hover {
    text-decoration: underline !important;
    color: #004499 !important;
}

.nested-promo {
    background-color: #fff3cd !important;
    border: 1px solid #ffeeba !important;
    border-radius: 4px !important;
    padding: 10px !important;
    margin-top: auto !important;
    text-align: center !important;
}

.nested-promo h5 {
    margin: 0 0 6px 0 !important;
    color: #856404 !important;
    font-size: 13px !important;
}

.promo-btn-sm {
    display: inline-block !important;
    background-color: #ff6600 !important;
    color: #ffffff !important;
    padding: 6px 10px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    border-radius: 3px !important;
    font-size: 12px !important;
}

.promo-btn-sm:hover {
    background-color: #e65c00 !important;
}

/* ==========================================================================
   4. MAIN READING BLOCK LAYOUT FRAMEWORK (Forced Centering Safety Net)
   ========================================================================== */

/* Universal Overrides: Eradicates legacy float rules across ALL common main layout wrappers */
.main, .main-content-row, main, #main, .content, #content {
    float: none !important;
    clear: both !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Base structural layout width restrictions and auto-centering mechanisms */
.main-content-row {
    display: block !important;
    width: 100% !important;
    max-width: 850px !important; /* Ideal reading line length for text layout density */
    margin-left: auto !important; 
    margin-right: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    position: relative !important;
    padding: 0 25px !important;
    box-sizing: border-box !important;
}

/* Individual container text presentation alignment bounds */
.main {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    text-align: left !important;
    box-sizing: border-box !important;
    
    /* Spacious whitespace padding buffers on both sides of your text */
    padding-left: 30px !important; 
    padding-right: 30px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Typography polish for clean spacing */
.main p {
    font-size: 16px !important;
    line-height: 1.65 !important;
    margin-bottom: 20px !important;
}

.main h2 {
    font-size: 28px !important;
    margin-top: 10px !important;
    margin-bottom: 15px !important;
    color: #222222 !important;
}

.main h3 {
    font-size: 22px !important;
    margin-top: 25px !important;
    margin-bottom: 12px !important;
    color: #333333 !important;
}

.back-arrow-btn {
    display: inline-flex !important;
    align-items: center !important;
    color: #0066cc !important;
    text-decoration: none !important;
    font-size: 15px !important;
    font-weight: bold !important;
    margin-left: 0 !important;
    margin-top: 10px !important;
    margin-bottom: 30px !important;
    padding: 5px 0 !important;
    transition: color 0.15s ease-in-out, transform 0.15s ease-in-out !important;
    cursor: pointer !important;
}

/* ==========================================================================
   5. SMARTPHONE RESPONSIVENESS OVERRIDES (< 576px wide)
   ========================================================================== */
@media screen and (max-width: 576px) {
    /* Responsive styling overrides for your original mobile header script code rules */
    .topnav a:not(:first-child) { 
        display: none !important; 
    }
    .topnav a.icon {
        float: right !important;
        display: block !important;
    }
    .topnav.responsive { 
        position: relative !important; 
    }
    .topnav.responsive a.icon {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
    }
    .topnav.responsive a {
        float: none !important;
        display: block !important;
        text-align: left !important;
    }

    /* ONLY stack vertically on narrow smartphone windows (< 576px) */
    .top-categories-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
        margin-top: 15px !important;
        margin-bottom: 25px !important;
    }
    
    /* Safely turn off active animations and hovers on touchscreen phone displays */
    .category-block:hover, .main img:hover {
        transform: none !important;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
        border-color: #e2e8f0 !important;
    }
    
    /* Expand your inline floating reading images to a natural full layout look on phones */
    .main img {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 15px 0 !important;
    }
}