/* programmatic.css — shared styles for generated cluster pages
   (/pricing/, /documents/, /creator/, /all-tools/), built by
   scripts/build_pages.py. Calculator classes mirror margincalc/style.css so the
   embedded mini-calculators look like the real tools. Loaded with
   ?v=STYLE_VERSION from scripts/build_tools.py. */

.prog-page {
    max-width: 1000px;
    margin: 32px auto 48px;
    padding: 0 20px;
    color: var(--text-main, #0f172a);
}

/* Breadcrumb */
.prog-breadcrumb {
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 20px;
}
.prog-breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.prog-breadcrumb li + li::before { content: "›"; margin-right: 6px; color: #94a3b8; }
.prog-breadcrumb a { color: var(--primary, #2563eb); text-decoration: none; }
.prog-breadcrumb a:hover { text-decoration: underline; }

/* Header */
.prog-header { margin-bottom: 28px; }
.prog-header h1 {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin: 0 0 12px;
}
.prog-header .prog-lede {
    font-size: 1.1rem;
    color: var(--text-muted, #64748b);
    line-height: 1.65;
    max-width: 760px;
    margin: 0;
}
.prog-answer {
    display: inline-block;
    margin: 14px 0 0;
    padding: 10px 16px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    font-weight: 700;
    color: #1d4ed8;
    font-size: 1.05rem;
}

/* Calculator card (mirrors margincalc/style.css) */
.calculator-card {
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.05);
    margin-bottom: 32px;
}
.calculator-card h2 { font-size: 1.25rem; margin: 0 0 18px; }
.calc-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 28px; }
.inputs-section { display: flex; flex-direction: column; gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 14px; font-weight: 600; color: var(--text-main, #0f172a); }
.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
    font-family: inherit;
    color: var(--text-main, #0f172a);
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.form-control:focus { border-color: var(--primary, #2563eb); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }
.results-section { display: flex; flex-direction: column; gap: 14px; }
.result-card {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 16px;
}
.primary-result { background: var(--primary, #2563eb); border-color: var(--primary, #2563eb); color: #fff; }
.primary-result .result-label { color: rgba(255,255,255,0.85); }
.primary-result .result-value { color: #fff; font-size: 1.9rem; }
.results-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-label { font-size: 13px; font-weight: 600; color: var(--text-muted, #64748b); margin-bottom: 4px; }
.result-value { font-size: 1.25rem; font-weight: 700; color: var(--text-main, #0f172a); }
.calc-hint { font-size: 0.85rem; color: var(--text-muted, #64748b); margin-top: 12px; }

/* Sections and prose */
.prog-section { margin: 0 0 32px; line-height: 1.7; }
.prog-section h2 { font-size: 1.5rem; font-weight: 700; margin: 0 0 12px; }
.prog-section h3 { font-size: 1.15rem; font-weight: 600; margin: 20px 0 8px; }
.prog-section p { margin: 0 0 12px; color: #334155; }
.prog-section ul, .prog-section ol { margin: 0 0 12px 1.4rem; padding: 0; color: #334155; }
.prog-section li { margin-bottom: 6px; }
.prog-formula {
    background: #f8fafc;
    border-left: 4px solid var(--primary, #2563eb);
    border-radius: 8px;
    padding: 14px 18px;
    margin: 12px 0 16px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.95rem;
    color: #0f172a;
    overflow-x: auto;
}
.prog-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px 0;
    color: #78350f;
}
.prog-disclosure {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 14px 18px;
    margin: 16px 0 28px;
    font-size: 0.95rem;
    color: #334155;
}
.prog-disclosure strong { color: #0f172a; }

/* Tables */
.table-responsive { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 12px 0 20px; }
.prog-table {
    border-collapse: collapse;
    width: 100%;
    min-width: 420px;
    font-size: 0.95rem;
    background: #fff;
}
.prog-table th, .prog-table td {
    border: 1px solid #e2e8f0;
    padding: 9px 12px;
    text-align: right;
    white-space: nowrap;
}
.prog-table th { background: #f1f5f9; color: #0f172a; font-weight: 600; text-align: right; }
.prog-table th:first-child, .prog-table td:first-child { text-align: left; }
.prog-table tbody tr:nth-child(even) { background: #f8fafc; }
.prog-table tr.is-current { background: #eff6ff !important; font-weight: 700; }
.prog-table a { color: var(--primary, #2563eb); text-decoration: none; }
.prog-table a:hover { text-decoration: underline; }
.prog-table-wide { min-width: 560px; }

/* Hub cards and lists */
.prog-hub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    margin: 12px 0 28px;
}
.prog-card {
    display: block;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px 18px;
    text-decoration: none;
    color: #0f172a;
    transition: transform 0.15s, box-shadow 0.15s;
}
.prog-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -8px rgba(0,0,0,0.15); }
.prog-card strong { display: block; margin-bottom: 4px; color: var(--primary, #2563eb); }
.prog-card span { font-size: 0.9rem; color: #64748b; }
.prog-linklist { columns: 2; column-gap: 32px; margin: 0 0 20px; padding: 0 0 0 1.2rem; }
.prog-linklist li { margin-bottom: 6px; break-inside: avoid; }
.prog-linklist a { color: var(--primary, #2563eb); text-decoration: none; }
.prog-linklist a:hover { text-decoration: underline; }

/* Prev / next */
.prog-prevnext {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin: 8px 0 36px;
    font-size: 0.95rem;
}
.prog-prevnext a {
    color: var(--primary, #2563eb);
    text-decoration: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 12px;
    background: #fff;
}
.prog-prevnext a:hover { border-color: var(--primary, #2563eb); }

/* FAQ block reuses .tool-faq-section from style.css; make sure it aligns */
.prog-page .tool-faq-section, .prog-page .related-tools-section { padding-left: 0; padding-right: 0; }

@media (max-width: 768px) {
    .prog-header h1 { font-size: 1.6rem; }
    .calc-grid { grid-template-columns: 1fr; }
    .results-grid { grid-template-columns: 1fr 1fr; }
    .prog-linklist { columns: 1; }
    .calculator-card { padding: 18px; }
}
