/* Template CSS
   - Keep this file lean; rely on components/style.css for base typography, buttons, cards, etc.
   - Favor spacing consistency over pixel-perfect values; adjust sparingly per calculator.
*/

/* Match your existing template style + add explicit warn slot + results separator */
.calc-page .card {
    margin-top: 16px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: static;
    width: auto;
    height: auto;
    padding: 8px 12px;
    background: #111827;
    color: #f9fafb;
    border-radius: 8px;
}

.lede {
    color: #374151;
    font-size: 1.05rem;
    margin: 6px 0 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr; /* Default: single column */
    gap: 12px; /* Align spacing with existing calculators (bmi/mortgage) */
}

/* Use only when two inputs are tightly related (e.g., $ and %) */
.pair-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

/* Optional: force full-width rows when mixing with pair-grid */
.span-2 {
    grid-column: 1 / -1;
}

.field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}

.field input {
    width: 100%;
    margin-bottom: 1px; /* Keep warn tight to the input */
}

/*
  Validation vs hint:
  - warn: red, should appear directly under input.
  - hint: neutral, reserves space to avoid layout shift.
*/
.warn {
    color: #b91c1c;
    font-size: 0.9rem;
    margin-top: 1px;
    margin-bottom: 1px;
    min-height: 0; /* avoid extra gap when empty */
}

.hint {
    color: #6b7280;
    font-size: 0.85rem;
    margin-top: 4px; /* Match mortgage spacing */
    min-height: 0;
}

/* Actions row */
.actions {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.small {
    font-size: 0.9rem;
    color: #6b7280;
}

/* Optional panel */
.panel {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.check {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    cursor: pointer;
}

/*
  Results table:
  Default desktop behavior is "hug content" so label/value stay close
  without hard-coding max-width. On smaller screens, stretch to 1fr/auto.
*/
.results-table {
    display: grid;
    grid-template-columns: max-content max-content;
    justify-content: start;
    gap: 8px 14px;
    align-items: baseline;
}

@media (max-width: 900px) {
    .results-table {
        grid-template-columns: 1fr auto;
        justify-content: stretch;
    }
}

.results-table .k {
    color: #6b7280;
    font-size: 0.95rem;
}

.results-table .v {
    font-weight: 700;
    font-size: 1.05rem;
    text-align: left;
}

@media (max-width: 900px) {
    .results-table .v {
        text-align: right;
    }
}

.results-table .v.strong {
    font-weight: 900;
}

.rt-row {
    display: contents;
}

.rt-sep {
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(0, 0, 0, 0.08);
    margin: 6px 0;
}

.warnblock {
    margin-top: 10px;
    color: #7f1d1d;
}

.text-block h2,
.text-block h3 {
    margin-top: 0;
}

.text-block ul {
    padding-left: 20px;
    margin: 8px 0;
}

/* UX/design principles (keep in mind)
   - Mobile-first: grid collapses cleanly; tap targets remain large; avoid horizontal scrolling.
   - Information hierarchy: headings, lede, and results use consistent type scale.
   - Feedback: warn + hint reserve space to reduce layout shift.
   - Brevity: short labels and hints; avoid verbose placeholders.
   - Performance: share assets from /components to minimize payload.
*/
