/* ==========================================
   CALC-PAGE.CSS — Shared styles for all
   programmatic SEO pages (comparisons, etc.)
   ========================================== */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f7f8fa;
    color: #2c3e50;
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================
   LAYOUT
   ========================================== */

.calc-page {
    flex: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 2.5rem 2rem 3rem;
    width: 100%;
}

/* ==========================================
   BREADCRUMB
   ========================================== */

.calc-breadcrumb {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 1rem;
}

.calc-breadcrumb a { color: #6b7280; text-decoration: none; }
.calc-breadcrumb a:hover { color: #2c5f41; }

/* ==========================================
   PAGE TITLE
   ========================================== */

.calc-page-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    text-align: center;
    margin-bottom: 1.5rem;
}

/* ==========================================
   TEASER ANSWER
   ========================================== */

.calc-teaser {
    text-align: center;
    font-size: 1.1rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
}

/* ==========================================
   CALCULATOR CARD
   ========================================== */

.calc-card {
    background: white;
    border: 2px solid #2c5f41;
    border-top: 5px solid #2c5f41;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.calc-card-title {
    font-size: 1rem;
    color: #2c5f41;
    font-weight: 700;
    margin-bottom: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.calc-input-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.fraction-input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fraction-input-group label {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.fraction-input-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fraction-input-box input {
    width: 70px;
    height: 46px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c3e50;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s;
}

.fraction-input-box input:focus {
    border-color: #2c5f41;
}

.fraction-line {
    width: 70px;
    height: 3px;
    background: #2c5f41;
    margin: 4px 0;
    border-radius: 2px;
}

.vs-label {
    font-size: 1.4rem;
    font-weight: 700;
    color: #2c5f41;
}

.compare-btn {
    background: #2c5f41;
    color: white;
    border: none;
    padding: 0.85rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.compare-btn:hover { background: #1e4530; }

.calc-error {
    color: #e74c3c;
    font-weight: 600;
    text-align: center;
    margin-top: 0.5rem;
    display: none;
}

/* ==========================================
   ANSWER REVEAL (inside card)
   ========================================== */

.calc-answer-reveal {
    display: none;
}

.calc-answer-reveal.show {
    display: block;
}

.calc-result {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
}

.calc-result .answer-symbol {
    color: #27ae60;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0.3rem;
}

/* ==========================================
   VISUAL BARS
   ========================================== */

.calc-bars {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 420px;
    margin: 0 auto;
}

.calc-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.calc-bar-label {
    width: 80px;
    font-weight: 700;
    font-size: 1.1rem;
    text-align: right;
    color: #2c5f41;
    flex-shrink: 0;
}

.calc-bar-track {
    flex: 1;
    height: 40px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.calc-bar-fill {
    height: 100%;
    background-color: #2c5f41;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.calc-bar-value {
    width: 60px;
    font-size: 0.9rem;
    color: #666;
}

/* ==========================================
   SECTION HEADINGS
   ========================================== */

.calc-section {
    margin-bottom: 2.5rem;
}

.calc-section h2 {
    font-size: 1.4rem;
    color: #2c5f41;
    margin-bottom: 1rem;
    font-weight: 700;
}

.calc-section p {
    margin-bottom: 0.8rem;
    font-size: 1.05rem;
    line-height: 1.8;
}

/* ==========================================
   STEPS — white cards with green border
   ========================================== */

.calc-steps {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}

.calc-steps li {
    background: white;
    padding: 0.8rem 1rem;
    margin-bottom: 0.6rem;
    border-radius: 6px;
    border-left: 3px solid #27ae60;
    font-size: 1.05rem;
    line-height: 1.7;
}

.step-number {
    font-weight: bold;
    color: #27ae60;
    margin-right: 0.4rem;
}

.math-block {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    text-align: center;
    padding: 0.8rem 0;
    color: #2c3e50;
}

/* ==========================================
   FACTS — warm amber
   ========================================== */

.calc-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin: 1rem 0 1.5rem;
}

.calc-fact {
    background: #fff3e0;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    border-left: 4px solid #ff9800;
}

.calc-fact .fact-label {
    color: #f57c00;
    font-size: 0.85rem;
    font-weight: 600;
    display: block;
    margin-bottom: 0.3rem;
}

.calc-fact .fact-value {
    font-weight: 700;
    color: #2c3e50;
    font-size: 1.15rem;
}

/* ==========================================
   CTA CARD
   ========================================== */

.calc-cta-card {
    background: #e8f5e9;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.calc-cta-card h3 {
    font-size: 1.1rem;
    color: #2c5f41;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.calc-cta-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #2c5f41;
    text-decoration: none;
    font-size: 1.05rem;
    font-weight: 600;
    padding: 0.5rem 0;
}

.calc-cta-link:hover { text-decoration: underline; }
.calc-cta-link .cta-icon { font-size: 1.3rem; flex-shrink: 0; }
.calc-cta-link .cta-arrow { margin-left: auto; color: #27ae60; font-weight: 700; font-size: 1.2rem; }

/* ==========================================
   LINKS — related comparisons
   ========================================== */

.calc-links {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e2e8f0;
}

.calc-links h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 1rem;
    font-weight: 600;
}

.calc-related {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    margin-top: 1rem;
    list-style: none;
}

.calc-related li a { color: #2c5f41; text-decoration: none; font-size: 0.95rem; }
.calc-related li a:hover { text-decoration: underline; }

/* ==========================================
   MATHJAX SIZING
   ========================================== */

.calc-page .MathJax { font-size: 1.4em !important; }
.calc-result .MathJax { font-size: 1.7em !important; }
.calc-bar-label .MathJax { font-size: 1.5em !important; }
.math-block .MathJax { font-size: 1.6em !important; }
.calc-fact .fact-label .MathJax { font-size: 1.5em !important; }
.calc-faq .MathJax { font-size: 1.35em !important; }

/* ==========================================
   FAQ
   ========================================== */

.calc-faq .faq-item { margin-bottom: 1.2rem; }
.calc-faq .faq-question { font-size: 1.1rem; font-weight: 600; color: #2c5f41; margin-bottom: 0.3rem; }
.calc-faq .faq-answer { font-size: 1.05rem; line-height: 1.8; color: #2c3e50; }

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 600px) {
    .calc-page { padding: 1.5rem 1.2rem 2rem; }
    .calc-page-title { font-size: 1.4rem; }
    .calc-result { font-size: 1.1rem; }
    .calc-input-row { gap: 1rem; }
    .fraction-input-box input { width: 60px; height: 40px; font-size: 1.2rem; }
    .fraction-line { width: 60px; }
    .calc-bar-label { width: 60px; font-size: 1rem; }
    .calc-bar-value { width: 50px; font-size: 0.85rem; }
    .calc-facts { grid-template-columns: 1fr 1fr; }
    .calc-section h2 { font-size: 1.2rem; }
}
