/* ===========================================
    Pregnancy Weight Gain Calculator - Tool Specific Styles
    =========================================== */

/* Box Styling */
.pwg-box {
    max-width: 750px;
    margin: 0 auto;
    padding: 0; 
}

/* Form Container */
.pwg-form {
    padding: 20px; 
    border: 1px solid #C5CAE9; /* Light Indigo/Blue Border */
    border-radius: 8px;
    background-color: #F7F9FC; /* Very Light Grey/Blue Background */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.pwg-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #3949AB; /* Dark Indigo */
    border-bottom: 2px solid #9FA8DA;
    padding-bottom: 5px; 
    margin-top: 5px; 
    margin-bottom: 20px; 
}

/* Unit Toggle Row */
.unit-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 5px 0;
    border-bottom: 1px dashed #9FA8DA;
}
.unit-selector {
    padding: 8px 10px;
    border: 1px solid #3949AB;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 500;
    color: #3949AB;
    background-color: #ffffff;
    cursor: pointer;
}

/* Compact Input Grid */
.pwg-compact-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 15px 2%; /* Vertical and horizontal gap */
}

.pwg-input-group {
    display: flex;
    flex-direction: column;
    flex-basis: 31%; /* Allows three inputs per row on desktop */
    min-width: 120px;
}

/* Specific adjustments for three-column layouts on small screens */
@media (max-width: 650px) {
    .pwg-input-group {
        flex-basis: 48%; /* Two inputs per row on medium screens */
    }
}
@media (max-width: 450px) {
    .pwg-input-group {
        flex-basis: 100%; /* Stack inputs on very small screens */
    }
}


.pwg-input-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.9rem; 
    margin-bottom: 4px;
}

.pwg-input-group input, .pwg-input-group select {
    padding: 8px;
    border: 1px solid #CED4DA;
    border-radius: 4px;
    font-size: 1rem;
    text-align: right;
}

.pwg-input-group select {
    text-align: left;
}


/* Button Styles */
.pwg-calculate-btn {
    display: block;
    width: 100%;
    padding: 14px; 
    margin-top: 25px; 
    background-color: #3949AB; /* Primary Indigo */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.pwg-calculate-btn:hover {
    background-color: #303F9F;
}

/* Results Display */
.pwg-results {
    margin-top: 20px; 
    padding: 20px;
    border: 2px solid #5C6BC0; 
    border-radius: 8px;
    background-color: #E8EAF6; /* Lightest Indigo */
    text-align: center;
}

.pwg-results-title {
    color: #3949AB;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #9FA8DA;
    padding-bottom: 5px;
}

/* Data Grid */
.pwg-data-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 15px; 
    margin-bottom: 10px; 
}

.pwg-data-segment {
    flex-basis: 48%;
    background: #ffffff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #C5CAE9;
}

.pwg-data-segment.full-width {
    flex-basis: 100%;
    margin-top: 10px;
}


.pwg-data-segment .pwg-data-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #495057;
    text-transform: uppercase;
}
.pwg-data-segment .pwg-data-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: #3949AB; 
    margin-top: 5px;
}

.pwg-data-segment .pwg-data-range {
    font-size: 1.6rem;
    font-weight: 700;
    color: #4CAF50; /* Green for key range */
    margin-top: 5px;
}

.pwg-data-segment .pwg-data-subtext {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 8px;
}

/* Recalculate Button */
.pwg-recalculate-btn {
    padding: 8px 15px;
    margin-top: 20px;
    background-color: #7986CB;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Responsive adjustments for results */
@media (max-width: 600px) {
    .pwg-data-segment {
        flex-basis: 100%; /* Stack results on small screens */
    }
}


/* ===========================================
    SEO Content FIXES (The Critical Formatting Overrides)
    =========================================== */

/* Target the h4s within the SEO content to ensure they have vertical clearance */
.seo-content h4 {
    margin-top: 25px !important;
    margin-bottom: 10px !important;
}

/* Ensure MathJax Display blocks are treated as full-width elements */
.seo-content .MathJax_Display, .seo-content [role="presentation"] {
    display: block !important;
    margin-top: 15px !important;
    margin-bottom: 15px !important;
    width: 100% !important;
}

/* Ensure paragraphs surrounding the h4 headings have proper spacing */
.seo-content p {
    margin-bottom: 10px;
}