/* Page /calcul-frais-kilometriques-2026 */

.km-page .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.km-page {
    padding: 2.5rem 0 3rem;
}

.km-page .container {
    max-width: 900px;
}

.km-head h1 {
    font-size: 2rem;
    line-height: 1.2;
    margin-bottom: 0.75rem;
}

.km-updated {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.km-lede {
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.km-answer {
    background: var(--primary-bg);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1rem 1.25rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

/* ---- Calculateur ---- */
.km-calc {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.km-calc h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.km-calc-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.km-trajets-wrap {
    overflow-x: auto;
    margin-bottom: 0.75rem;
}

.km-trajets {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

/* position:relative indispensable : sans bloc conteneur positionné, le .sr-only
   en position:absolute se cale sur le viewport, échappe au scroll horizontal du
   wrapper et élargit toute la page sur mobile. */
.km-trajets th {
    position: relative;
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.4rem 0.5rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.km-trajets td {
    padding: 0.3rem 0.25rem;
    vertical-align: middle;
}

.km-trajets input {
    width: 100%;
    min-width: 90px;
    padding: 0.45rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    color: var(--text);
    background: var(--bg-white);
}

.km-trajets input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

.km-row-del {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
}

.km-row-del:hover {
    color: var(--error);
    background: var(--error-bg);
}

.km-result {
    margin-top: 1.25rem;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
}

.km-result-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.km-result-main span {
    color: var(--text-light);
    font-size: 0.9375rem;
}

.km-result-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-dark);
    font-variant-numeric: tabular-nums;
}

.km-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
    margin-bottom: 0.75rem;
}

.km-result-meta strong {
    color: var(--text);
}

.km-formule {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
    word-break: break-word;
}

.km-warn {
    margin-top: 0.75rem;
    background: var(--warning-bg);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: #78350f;
}

.km-cta-zone {
    margin-top: 1.25rem;
    text-align: center;
}

.km-cta-zone .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.km-cta-note {
    margin-top: 0.6rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ---- Contenu éditorial ---- */
.km-body h2 {
    font-size: 1.5rem;
    margin: 2.25rem 0 0.75rem;
    line-height: 1.3;
}

.km-body h3 {
    font-size: 1.125rem;
    margin: 1.5rem 0 0.5rem;
}

.km-body p,
.km-body li {
    line-height: 1.7;
    color: var(--text-light);
}

.km-body p {
    margin-bottom: 1rem;
}

.km-body ul,
.km-body ol {
    margin: 0 0 1rem 1.25rem;
}

.km-body li {
    margin-bottom: 0.4rem;
}

.km-body a {
    color: var(--primary-dark);
    text-decoration: underline;
}

.km-table-wrap {
    overflow-x: auto;
    margin-bottom: 1.25rem;
}

.km-bareme {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
    background: var(--bg-white);
}

.km-bareme caption {
    caption-side: top;
    text-align: left;
    font-weight: 600;
    color: var(--text);
    padding-bottom: 0.5rem;
    font-size: 0.9375rem;
}

.km-bareme th,
.km-bareme td {
    border: 1px solid var(--border);
    padding: 0.55rem 0.75rem;
    text-align: left;
    white-space: nowrap;
}

.km-bareme thead th {
    background: var(--bg);
    font-size: 0.8125rem;
    color: var(--text);
}

.km-bareme tbody th {
    font-weight: 600;
    background: var(--bg);
}

.km-bareme td {
    font-variant-numeric: tabular-nums;
    color: var(--text-light);
}

.km-example {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
}

.km-example h3 {
    margin-top: 0;
}

.km-example p:last-child {
    margin-bottom: 0;
}

.km-calcul-line {
    font-family: var(--font-mono);
    font-size: 0.8125rem;
    background: var(--bg);
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
    margin: 0.75rem 0;
    color: var(--text);
    line-height: 1.7;
}

.km-sources {
    margin-top: 2.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.km-sources ul {
    margin: 0.5rem 0 0 1.25rem;
}

.km-sources li {
    margin-bottom: 0.3rem;
}

.km-sources a {
    color: var(--text-light);
}

@media (max-width: 720px) {
    .km-head h1 {
        font-size: 1.5rem;
    }

    .km-calc-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .km-calc {
        padding: 1rem;
    }

    .km-result-amount {
        font-size: 1.625rem;
    }

    .km-trajets input {
        min-width: 80px;
    }
}
