/* CalculateHome.com - Universal Blog Theme CSS */

/* ==================================================
   UNIVERSAL BLOG THEME
   Ensures consistent, readable styling across all blog posts
   ================================================== */

/* Typography & Readability */
.article-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e1e8f0 100%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.article-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23ffffff" opacity="0.05"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 3rem 1rem;
    line-height: 1.7;
    color: var(--text-primary);
    background: #ffffff;
}

/* Enhanced text readability */
.article-content p {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #2d3748;
}

.article-content h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 3rem 0 1.5rem 0;
    color: var(--text-primary);
    border-bottom: 3px solid var(--primary-color);
    padding-bottom: 0.5rem;
}

.article-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2.5rem 0 1rem 0;
    color: var(--text-primary);
}

.article-content h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
    color: var(--text-primary);
}

/* Article metadata */
.article-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    justify-content: center;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    border: 1px solid #e2e8f0;
}

/* Category badges */
.article-category {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Category-specific colors */
.category-analysis {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.category-cashflow {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
}

.category-financing {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%) !important;
}

.category-flip {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
}

.category-advanced {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important;
}

.category-beginner {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
}

/* Formula boxes with enhanced readability */
.formula-box {
    color: white;
    padding: 2.5rem;
    border-radius: 16px;
    margin: 3rem 0;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.formula-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
                linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
                linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.1) 75%),
                linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.1) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    pointer-events: none;
}

.formula-box h3 {
    color: white !important;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    position: relative;
    z-index: 1;
}

.formula-box .formula {
    font-size: 1.4rem;
    font-weight: 700;
    background: rgba(255,255,255,0.15);
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    border: 2px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* Category-specific formula box colors */
.formula-box.analysis {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.formula-box.cashflow {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.formula-box.financing {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.formula-box.flip {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.formula-box.advanced {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.formula-box.beginner {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

/* Example boxes with high contrast */
.example-box {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem;
    margin: 3rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
}

.example-box::before {
    content: '💡';
    position: absolute;
    top: -10px;
    left: 20px;
    background: #ffffff;
    padding: 0 10px;
    font-size: 1.5rem;
}

.example-box h4 {
    color: var(--primary-color) !important;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.example-box p, .example-box ul, .example-box ol {
    color: #2d3748 !important;
    line-height: 1.7;
}

/* Key takeaway boxes */
.key-takeaway {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-left: 5px solid #10b981;
    padding: 2rem;
    margin: 3rem 0;
    border-radius: 0 16px 16px 0;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
    position: relative;
}

.key-takeaway::before {
    content: '💡';
    position: absolute;
    top: -8px;
    left: 15px;
    background: #10b981;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.key-takeaway strong {
    color: #065f46;
}

.key-takeaway ul li {
    color: #047857;
    margin-bottom: 0.5rem;
}

/* Warning boxes */
.warning-box {
    background: linear-gradient(135deg, #fef3cd 0%, #fef3cd 100%);
    border-left: 5px solid #f59e0b;
    padding: 2rem;
    margin: 3rem 0;
    border-radius: 0 16px 16px 0;
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.15);
    position: relative;
}

.warning-box::before {
    content: '⚠️';
    position: absolute;
    top: -8px;
    left: 15px;
    background: #f59e0b;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.warning-box strong {
    color: #92400e;
}

.warning-box ul li {
    color: #a16207;
    margin-bottom: 0.5rem;
}

/* Professional tables */
.benchmark-table, .expense-table {
    width: 100%;
    border-collapse: collapse;
    margin: 3rem 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.benchmark-table th, .expense-table th {
    background: var(--primary-color);
    color: white;
    padding: 1.5rem;
    text-align: left;
    font-weight: 600;
    font-size: 1.1rem;
}

.benchmark-table td, .expense-table td {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    color: #2d3748;
    font-size: 1rem;
}

.benchmark-table tr:hover, .expense-table tr:hover {
    background: #f8fafc;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.benchmark-table tr:last-child td, .expense-table tr:last-child td {
    border-bottom: none;
}

/* Table of Contents */
.toc {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2.5rem;
    margin: 3rem 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.toc h3 {
    margin-bottom: 1.5rem;
    color: var(--primary-color) !important;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc ul {
    list-style: none;
    padding: 0;
}

.toc li {
    margin: 0.8rem 0;
}

.toc a {
    color: var(--text-primary);
    text-decoration: none;
    padding: 0.8rem 1rem;
    display: block;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
    font-weight: 500;
}

.toc a:hover {
    color: var(--primary-color);
    background: white;
    border-left-color: var(--primary-color);
    transform: translateX(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Lists with better spacing */
.article-content ul, .article-content ol {
    margin-bottom: 2rem;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.8rem;
    color: #2d3748;
    line-height: 1.6;
}

.article-content li strong {
    color: var(--primary-color);
}

/* Enhanced grid layouts */
.optimization-grid, .related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.optimization-card, .related-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.optimization-card::before, .related-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.optimization-card:hover, .related-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    border-color: var(--primary-color);
}

.optimization-card:hover::before, .related-card:hover::before {
    transform: scaleX(1);
}

.optimization-card h4, .related-card h4 {
    color: var(--primary-color) !important;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.optimization-card ul li, .related-card p {
    color: #2d3748 !important;
    line-height: 1.6;
}

/* CTA sections */
.cta-section {
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin: 4rem 0;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(255,255,255,0.1) 25%, transparent 25%),
                linear-gradient(-45deg, rgba(255,255,255,0.1) 25%, transparent 25%);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    pointer-events: none;
}

.cta-section h3 {
    color: white !important;
    margin-bottom: 1.5rem;
    font-size: 2.2rem;
    position: relative;
    z-index: 1;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.95;
    position: relative;
    z-index: 1;
}

.cta-btn {
    background: white;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-block;
    margin-top: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.cta-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

/* Related articles section */
.related-articles {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 4rem 0;
    margin-top: 4rem;
    border-radius: 20px 20px 0 0;
}

.related-articles h3 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.2rem;
    color: var(--text-primary) !important;
}

.related-card small {
    color: var(--text-muted) !important;
    font-size: 0.85rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .article-hero {
        padding: 2.5rem 0;
    }

    .article-hero h1 {
        font-size: 2.2rem !important;
    }

    .article-content {
        padding: 2rem 1rem;
    }

    .article-content h2 {
        font-size: 1.6rem;
    }

    .article-content h3 {
        font-size: 1.3rem;
    }

    .formula-box, .example-box, .key-takeaway, .warning-box {
        padding: 1.5rem;
        margin: 2rem 0;
    }

    .formula-box .formula {
        font-size: 1.1rem;
        padding: 1rem;
    }

    .optimization-grid, .related-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 1rem;
    }

    .toc {
        padding: 1.5rem;
    }

    .benchmark-table th, .expense-table th,
    .benchmark-table td, .expense-table td {
        padding: 1rem;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-hero h1 {
        font-size: 1.8rem !important;
    }

    .article-hero p {
        font-size: 1rem !important;
    }

    .article-content {
        padding: 1.5rem 0.5rem;
    }

    .formula-box, .example-box {
        padding: 1rem;
    }

    .cta-section {
        padding: 2.5rem 1rem;
    }

    .cta-section h3 {
        font-size: 1.6rem !important;
    }
}

/* Accessibility improvements */
.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.article-content a:hover {
    color: var(--primary-dark);
}

.article-content a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles */
@media print {
    .article-hero,
    .related-articles,
    .cta-section,
    .navbar,
    .professional-footer {
        display: none;
    }

    .article-content {
        max-width: none;
        padding: 0;
        color: black;
    }

    .formula-box,
    .example-box,
    .key-takeaway,
    .warning-box {
        border: 2px solid #000;
        background: white !important;
        color: black !important;
    }
}

/* Smooth scrolling for the entire page */
html {
    scroll-behavior: smooth;
}

/* Focus management for better accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 10000;
}

.skip-link:focus {
    top: 6px;
}

/* Enhanced reading experience */
.article-content {
    font-feature-settings: "liga" 1, "kern" 1;
    text-rendering: optimizeLegibility;
}

/* Selection styling */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* =========================
   NEW BLOG POST STYLES (for alignment fixes)
   ========================= */

/* Key Takeaways Box */
.key-takeaways {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border: 2px solid #10b981;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.15);
}

.key-takeaways h3 {
    color: #10b981 !important;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.key-takeaways ul {
    margin: 0;
    padding-left: 1.5rem;
}

.key-takeaways li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Formula Box */
.formula-box {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.formula-box h4 {
    color: var(--primary-color) !important;
    margin-bottom: 1rem;
}

.formula-box p {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0;
}

/* Pro Tip Box */
.pro-tip {
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 20%, #f59e0b 100%);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-left: 4px solid #f59e0b;
}

.pro-tip h4 {
    color: #92400e !important;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pro-tip p {
    color: #451a03 !important;
    margin: 0;
}

/* Factors Grid */
.factors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.factor-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.factor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.factor-card h4 {
    color: var(--primary-color) !important;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.factor-card p {
    color: #4a5568 !important;
    line-height: 1.6;
    margin: 0;
}

/* Strategy Sections */
.strategy-sections {
    display: grid;
    gap: 2rem;
    margin: 2rem 0;
}

.strategy-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2rem;
    border-left: 4px solid var(--primary-color);
}

.strategy-section h3 {
    color: var(--primary-color) !important;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.strategy-section p {
    color: #4a5568 !important;
    margin-bottom: 1rem;
}

.strategy-section ul {
    margin: 0;
    padding-left: 1.5rem;
}

.strategy-section li {
    margin-bottom: 0.5rem;
    color: #2d3748 !important;
}

/* Predictions Grid */
.predictions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.prediction-card {
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid;
}

.prediction-card.positive {
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdf4 100%);
    border-left-color: #10b981;
}

.prediction-card.neutral {
    background: linear-gradient(135deg, #fef3c7 0%, #fef9c3 100%);
    border-left-color: #f59e0b;
}

.prediction-card.negative {
    background: linear-gradient(135deg, #fef2f2 0%, #fef5f5 100%);
    border-left-color: #ef4444;
}

.prediction-card h4 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.prediction-card.positive h4 {
    color: #065f46 !important;
}

.prediction-card.neutral h4 {
    color: #92400e !important;
}

.prediction-card.negative h4 {
    color: #991b1b !important;
}

.prediction-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.prediction-card li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Calculator Grid */
.calculator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.calc-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.calc-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.calc-card h4 {
    color: var(--primary-color) !important;
    margin-bottom: 1rem;
}

.calc-card p {
    color: #4a5568 !important;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.calc-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.calc-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

/* Benefits Grid */
.benefits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.benefit-card h4 {
    color: var(--primary-color) !important;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.benefit-card ul {
    margin: 0;
    padding-left: 1.5rem;
}

.benefit-card li {
    margin-bottom: 0.5rem;
    color: #4a5568 !important;
    line-height: 1.6;
}

/* Data Tables */
.cap-rate-table {
    margin: 2rem 0;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.cap-rate-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.cap-rate-table th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.cap-rate-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.cap-rate-table tr:hover {
    background: #f8fafc;
}

.data-source {
    text-align: center;
    margin-top: 1rem;
    font-style: italic;
    color: #6b7280;
}

/* Action Steps */
.action-steps {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
}

.action-steps h3 {
    color: #1d4ed8 !important;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.action-steps ol {
    margin: 0;
    padding-left: 1.5rem;
}

.action-steps li {
    margin-bottom: 0.5rem;
    color: #1e40af !important;
    line-height: 1.6;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .factors-grid,
    .predictions-grid,
    .calculator-grid,
    .benefits-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .factor-card,
    .prediction-card,
    .calc-card,
    .benefit-card {
        padding: 1rem;
    }

    .cap-rate-table {
        font-size: 0.875rem;
    }

    .cap-rate-table th,
    .cap-rate-table td {
        padding: 0.5rem;
    }
}