:root {
    --color-brand: #7c2d12;
    --color-cta: #f5a623;
    --text-dark: #1a1a1a;
    --text-body: #333;
    --text-muted: #777;
    --border: #ddd;
    --bg-light: #f8f6f3;
    --bg-warm: #faf7f4;
    --brand-light: #fdf2ed;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

img, video, iframe, svg, canvas {
    max-width: 100%;
    height: auto;
}

.article-hero {
    position: relative;
    background-image: url('/images/adapter-maison-vieillir-autonomie-hero.jpg');
    background-size: cover;
    background-position: center;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.article-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: rgba(90, 31, 10, 0.84);
}

.article-hero__content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 60px 32px;
}

.article-hero__content h1 {
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1.6;
    color: #fff;
    margin: 0 0 16px 0;
}

.article-hero__subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.6;
    color: #f0e0d8;
    margin: 0 0 28px 0;
}

.btn-cta {
    display: inline-block;
    background-color: var(--color-cta);
    color: #1a1a1a;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    padding: 14px 32px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
}

.btn-cta:hover {
    background-color: #e8951a;
    box-shadow: 0 4px 12px rgba(245, 166, 35, 0.35);
}

.btn-cta:focus {
    outline: 3px solid var(--color-cta);
    outline-offset: 2px;
}

.article-wrapper {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 24px;
}

.article-intro {
    font-size: 1.1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin: 48px 0 40px 0;
    padding-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.article-section {
    margin: 0 0 48px 0;
    padding: 40px 0 0 0;
}

.article-section--alt {
    background-color: var(--bg-light);
    padding: 40px 32px;
    margin-left: -32px;
    margin-right: -32px;
    border-radius: 8px;
}

.article-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--color-brand);
    margin: 0 0 20px 0;
}

.article-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 32px 0 12px 0;
}

.article-section p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0 0 16px 0;
}

.article-section ul {
    margin: 0 0 20px 0;
    padding-left: 24px;
}

.article-section ul li {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin-bottom: 8px;
}

.article-img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 24px 0;
}

.article-img + h3 {
    margin-top: 28px;
}

.phase-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin: 24px 0 0 0;
}

.phase-card {
    background-color: var(--bg-white, #fff);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 28px 24px;
    position: relative;
}

.phase-card__number {
    display: block;
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-brand);
    margin-bottom: 12px;
}

.phase-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0 0 8px 0;
}

.phase-card__timeline {
    font-size: 0.85rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--color-brand);
    margin: 0 0 12px 0;
}

.phase-card__content {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0;
}

.calculator-section {
    background-color: var(--bg-light);
    padding: 40px 32px;
    margin-left: -32px;
    margin-right: -32px;
    border-radius: 8px;
    margin-bottom: 48px;
}

.calculator-section h2 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--color-brand);
    margin: 0 0 12px 0;
}

.calculator-section > p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0 0 24px 0;
}

.calculator-card {
    background-color: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    margin-bottom: 32px;
}

.calculator-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: end;
}

.calc-field {
    display: flex;
    flex-direction: column;
}

.calc-field label {
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.calc-field select,
.calc-field input[type="number"] {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-dark);
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background-color: #fff;
    max-width: 100%;
    width: 100%;
}

.calc-field select:focus,
.calc-field input[type="number"]:focus {
    outline: 2px solid var(--color-brand);
    outline-offset: 1px;
}

.calculator-form .btn-cta {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 8px;
}

.calculator-result {
    margin-top: 24px;
    padding: 20px 24px;
    background-color: var(--brand-light);
    border-radius: 8px;
    min-height: 60px;
}

.calculator-result p {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0 0 8px 0;
}

.calculator-result p:last-child {
    margin-bottom: 0;
}

.calculator-result strong {
    font-weight: 700;
    color: var(--color-brand);
}

.calc-placeholder {
    font-style: italic;
    color: var(--text-muted) !important;
    font-size: 0.95rem !important;
}

.calc-result-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-brand) !important;
    margin-bottom: 12px !important;
}

.calc-result-line {
    font-size: 1rem;
    margin-bottom: 6px;
}

.calc-result-highlight {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-dark) !important;
    margin-top: 12px !important;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 0 8px 0;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table caption {
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--text-muted);
    text-align: left;
    padding-bottom: 12px;
    caption-side: top;
}

.data-table thead th {
    font-size: 0.85rem;
    font-weight: 700;
    line-height: 1.6;
    color: #fff;
    background-color: var(--color-brand);
    padding: 12px 16px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.data-table thead th:first-child {
    border-radius: 6px 0 0 0;
}

.data-table thead th:last-child {
    border-radius: 0 6px 0 0;
}

.data-table tbody td {
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
}

.data-table tbody tr:nth-child(even) {
    background-color: var(--bg-light);
}

.data-table tbody tr:hover {
    background-color: var(--brand-light);
}

.faq-item {
    margin: 0 0 28px 0;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-dark);
    margin: 0 0 10px 0;
}

.faq-answer {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-body);
    margin: 0;
}

@media (max-width: 768px) {
    .article-hero {
        min-height: 320px;
    }

    .article-hero__content {
        padding: 40px 20px;
    }

    .article-hero__content h1 {
        font-size: 1.6rem;
    }

    .article-hero__subtitle {
        font-size: 1rem;
    }

    .article-wrapper {
        padding: 0 16px;
    }

    .article-intro {
        font-size: 1rem;
        margin: 32px 0 28px 0;
        padding-bottom: 24px;
    }

    .article-section {
        margin-bottom: 36px;
        padding-top: 28px;
    }

    .article-section--alt {
        padding: 28px 20px;
        margin-left: -20px;
        margin-right: -20px;
        border-radius: 6px;
    }

    .article-section h2 {
        font-size: 1.35rem;
    }

    .article-section h3 {
        font-size: 1.1rem;
        margin-top: 24px;
    }

    .phase-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .calculator-section {
        padding: 28px 20px;
        margin-left: -20px;
        margin-right: -20px;
    }

    .calculator-card {
        padding: 20px;
    }

    .calculator-form {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .data-table {
        font-size: 0.85rem;
    }

    .data-table thead th {
        padding: 10px 12px;
        font-size: 0.8rem;
    }

    .data-table tbody td {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .faq-question {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .article-hero {
        min-height: 260px;
    }

    .article-hero__content {
        padding: 32px 16px;
    }

    .article-hero__content h1 {
        font-size: 1.35rem;
    }

    .btn-cta {
        padding: 12px 24px;
        font-size: 0.9rem;
        width: 100%;
        text-align: center;
    }

    .article-wrapper {
        padding: 0 12px;
    }

    .article-section--alt {
        padding: 20px 16px;
        margin-left: -16px;
        margin-right: -16px;
    }

    .calculator-section {
        padding: 20px 16px;
        margin-left: -16px;
        margin-right: -16px;
    }

    .calculator-card {
        padding: 16px;
    }

    .phase-card {
        padding: 20px 16px;
    }

    .phase-card__number {
        font-size: 2rem;
    }
}

/* ===== TYPOGRAPHY SPACING FIX (APS_ARTICLE_TYPO_REQUIRED_v2) ===== */
/* Defensive guard against universal * { margin: 0 } reset in global.css. */
/* body-scoped via :where() so specificity stays at 0,0,0,1 — beats * but
   loses to any component rule like .tip-box p / .faq-item p. */
body :where(p)              { margin-bottom: 1.1rem; }
body :where(h2)             { margin-top: 2.5rem; margin-bottom: 1rem; }
body :where(h3)             { margin-top: 1.75rem; margin-bottom: 0.75rem; }
body :where(h4)             { margin-top: 1.25rem; margin-bottom: 0.5rem; }
body :where(ul, ol)         { margin-bottom: 1.1rem; padding-left: 1.5rem; }
body :where(li)             { margin-bottom: 0.4rem; }
body :where(blockquote)     { margin: 1.5rem 0; }
