/* ===========================================
    Pregnancy Calculator - Tool Specific Styles
    =========================================== */

/* Box Styling */
.pc-box {
    max-width: 700px;
    margin: 0 auto;
    padding: 0; 
}

/* Form Container */
.pc-form {
    padding: 20px; 
    border: 1px solid #FFCDD2; /* Light Red/Pink Border */
    border-radius: 8px;
    background-color: #F8F8FF; /* Off-White/Lavender Background */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.pc-section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #E91E63; /* Pink */
    border-bottom: 2px solid #F48FB1;
    padding-bottom: 5px; 
    margin-top: 5px; 
    margin-bottom: 20px; 
}

/* Input Method Toggle */
.input-method-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px 30px; /* Space between labels */
    margin-bottom: 25px;
    padding: 5px 0;
}
.input-method-row > label {
    font-weight: 500;
    color: #495057;
    flex-basis: 100%; /* forces the title to a new line on mobile */
}

.radio-group input[type="radio"] {
    margin-right: 8px;
    accent-color: #E91E63;
}

/* Date Input */
.pc-input-group {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
}
.pc-input-group label {
    font-weight: 500;
    color: #495057;
    font-size: 0.95rem; 
    margin-bottom: 6px;
}
.pc-input-group input[type="date"] {
    padding: 10px;
    border: 1px solid #F48FB1;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    max-width: 300px; /* Keeps the input field from spanning full width */
}

/* Button Styles */
.pc-calculate-btn {
    display: block;
    width: 100%;
    padding: 14px; 
    margin-top: 25px; 
    background-color: #E91E63; /* Primary Pink */
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}
.pc-calculate-btn:hover {
    background-color: #C2185B;
}

/* Results Display */
.pc-results {
    margin-top: 20px; 
    padding: 20px;
    border: 2px solid #F06292; 
    border-radius: 8px;
    background-color: #FFFDE7; /* Light Yellow/Cream */
    text-align: center;
}
.pc-results-title {
    color: #E91E63;
    font-size: 1.5rem;
    margin-bottom: 15px;
    border-bottom: 2px solid #F48FB1;
    padding-bottom: 5px;
}

/* Compact Data Grid */
.pc-data-grid {
    display: flex;
    flex-wrap: wrap; 
    justify-content: space-between;
    gap: 15px 2%; 
    margin-bottom: 10px; 
}
.pc-data-segment.total-result {
    flex-basis: 49%; /* Two segments per row */
    background: #ffffff;
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    border: 1px solid #FFCDD2;
}

.pc-data-segment .pc-data-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6C7A89;
    text-transform: uppercase;
}
.pc-data-segment .pc-data-value {
    font-size: 1.6rem;
    font-weight: 800;
    color: #E91E63; 
    margin-top: 5px;
}
.pc-data-segment .pc-data-subtext {
    font-size: 0.8rem;
    color: #90A4AE;
    margin-top: 5px;
}

/* Gestational Age Section */
.pc-data-segment.detailed-results {
    flex-basis: 100%;
    text-align: center;
    margin-top: 15px;
    background-color: #F8F8FF;
    border: 1px solid #FFCDD2;
    padding: 15px;
}
.pc-detail-title {
    font-size: 1.1rem;
    color: #E91E63;
    border-bottom: 1px dashed #F48FB1;
    padding-bottom: 5px;
    margin-top: 0;
    margin-bottom: 10px;
}
.age-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4CAF50; /* Green for key result */
}

.pc-recalculate-btn {
    padding: 8px 15px;
    margin-top: 20px;
    background-color: #F06292;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .pc-data-segment.total-result {
        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 following the h4 headings have proper bottom spacing */
.seo-content p {
    margin-bottom: 10px;
}