/*
Theme Name: Ascenseur Devis
Theme URI: https://example.com
Description: Theme WordPress pour devis ascenseur de maison. Formulaire devis, SEO-first, mobile-first, WCAG 2.1 AA.
Version: 1.0.0
Author: Dev
Text Domain: ascenseur-devis
Requires at least: 6.0
Requires PHP: 8.0
*/

/* ==========================================================================
   1. CSS Variables — Architecte Mineral
   ========================================================================== */
:root {
    --stone: #2D2A26;
    --stone-light: #4A4640;
    --bronze: #8B6F47;
    --bronze-hover: #6B5535;
    --bronze-light: #F5F0E8;
    --cream: #FAF9F7;
    --sand: #F0EDE8;
    --sage: #3D7A5F;
    --sage-hover: #2D5E48;
    --clay: #B54A32;
    --border: #E8E4DE;
    --border-dark: #D4CFC7;
    --white: #FFFFFF;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 8px;
    --shadow-xs: 0 1px 2px rgba(45,42,38,0.04);
    --shadow-sm: 0 1px 3px rgba(45,42,38,0.05), 0 2px 8px rgba(45,42,38,0.03);
    --shadow-md: 0 4px 6px rgba(45,42,38,0.05), 0 6px 16px rgba(45,42,38,0.04);
    --shadow-lg: 0 8px 16px rgba(45,42,38,0.07), 0 12px 28px rgba(45,42,38,0.05);
    --accent-glow: 0 4px 14px rgba(139,111,71,0.25);
    --max-width: 1100px;
    --narrow-width: 800px;
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; scroll-behavior: smooth; }
body {
    font-family: var(--font-stack);
    color: var(--stone-light);
    line-height: 1.7;
    font-size: 1rem;
    background: var(--cream);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}
img, video, iframe, embed, object { max-width: 100%; height: auto; display: block; }
table { max-width: 100%; }
a { color: var(--bronze); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--bronze-hover); }
a:focus-visible { outline: 3px solid var(--bronze); outline-offset: 2px; }
ul, ol { list-style-position: inside; }

/* ==========================================================================
   3. Layout
   ========================================================================== */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; width: 100%; }
.section { padding: 5rem 0; }
.section-dark { background: var(--stone); color: var(--white); }
.section-alt { background: var(--sand); }
.section-title {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--stone);
    margin-bottom: 15px;
}
.section-dark .section-title { color: var(--white); }
.section-subtitle {
    color: var(--stone-light);
    font-size: 1.1rem;
    margin-bottom: 40px;
    max-width: 700px;
}
.text-center { text-align: center; }
.text-center .section-subtitle { margin-left: auto; margin-right: auto; }

/* ==========================================================================
   4. Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--stone);
    line-height: 1.2;
}
h1 { font-size: 2.75rem; }
h2 { font-size: 2rem; margin-bottom: 15px; }
h3 { font-size: 1.35rem; margin-bottom: 10px; }
p { margin-bottom: 1rem; }

/* ==========================================================================
   5. Buttons
   ========================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.4;
    transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
}
.btn:focus-visible { outline: 3px solid var(--bronze); outline-offset: 2px; }
.btn-primary { background: var(--sage); color: var(--white); }
.btn-primary:hover {
    background: var(--sage-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(61,122,95,0.3);
}
.btn-accent { background: var(--sage); color: var(--white); }
.btn-accent:hover {
    background: var(--sage-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(61,122,95,0.3);
}
.btn-outline {
    background: transparent;
    color: var(--bronze);
    border: 2px solid var(--bronze);
}
.btn-outline:hover {
    background: var(--bronze);
    color: var(--white);
    transform: translateY(-2px);
}
.btn-phone { background: var(--sage); color: var(--white); }
.btn-phone:hover {
    background: var(--sage-hover);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.btn-secondary { background: var(--stone); color: var(--white); }
.btn-secondary:hover {
    background: var(--stone-light);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ==========================================================================
   6. Cards
   ========================================================================== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}
.card-icon { width: 48px; height: 48px; margin-bottom: 16px; color: var(--bronze); }
.card h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; color: var(--stone); }
.card p { color: var(--stone-light); font-size: 0.95rem; line-height: 1.6; }
.card-price { font-size: 1.4rem; font-weight: 800; color: var(--bronze); margin-top: 12px; }

/* ==========================================================================
   7. Trust Bar
   ========================================================================== */
.trust-bar { background: var(--stone); padding: 28px 0; }
.trust-bar .container { display: flex; justify-content: space-between; align-items: center; }
.trust-bar-item {
    text-align: center;
    color: var(--white);
    padding: 0 20px;
    border-right: 1px solid rgba(255,255,255,0.12);
    flex: 1;
}
.trust-bar-item:last-child { border-right: none; }
.trust-bar-number {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--bronze);
    display: block;
    line-height: 1.2;
}
.trust-bar-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 4px; }

/* ==========================================================================
   8. Stats Grid
   ========================================================================== */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 30px 0;
}
.stat-card {
    background: var(--stone);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    color: var(--white);
}
.stat-number { font-size: 2em; font-weight: 800; color: var(--bronze); line-height: 1.2; }
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.6); margin-top: 6px; }

/* ==========================================================================
   9. Tables
   ========================================================================== */
.table-wrapper { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 25px 0; }
.responsive-table {
    width: 100%;
    border-collapse: collapse;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}
.responsive-table thead tr { background: var(--stone); color: var(--white); }
.responsive-table th {
    padding: 14px 18px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.responsive-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--border);
    color: var(--stone-light);
    font-size: 0.95rem;
}
.responsive-table tbody tr:nth-child(even) { background: var(--sand); }
.responsive-table tbody tr:hover { background: var(--bronze-light); }
.responsive-table .price,
.responsive-table td strong { color: var(--bronze); font-weight: 700; }

/* ==========================================================================
   10. Forms
   ========================================================================== */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--stone);
    font-size: 0.95rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 100%;
    background: var(--white);
    color: var(--stone);
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--bronze);
    outline: none;
    box-shadow: 0 0 0 3px rgba(139,111,71,0.15);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error { border-color: var(--clay); }
.form-group textarea { resize: vertical; min-height: 110px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--border-dark); }
.form-trust-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
    font-size: 0.85rem;
    color: var(--stone-light);
}
.form-trust-bar svg { width: 18px; height: 18px; flex-shrink: 0; }

/* ==========================================================================
   11. Alert Boxes
   ========================================================================== */
.highlight-box {
    background: var(--bronze-light);
    border-left: 5px solid var(--bronze);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 22px 28px;
    margin: 30px 0;
    color: var(--stone-light);
}
.highlight-box strong { color: var(--bronze-hover); }
.info-box {
    background: #ecfdf5;
    border-left: 5px solid var(--sage);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 22px 28px;
    margin: 30px 0;
    color: var(--stone-light);
}
.info-box strong { color: var(--sage); }
.danger-box {
    background: #fef2f2;
    border-left: 5px solid var(--clay);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 22px 28px;
    margin: 30px 0;
    color: var(--stone-light);
}
.danger-box strong { color: var(--clay); }

/* ==========================================================================
   12. Process Timeline
   ========================================================================== */
.timeline { position: relative; padding-left: 48px; }
.timeline::before {
    content: '';
    position: absolute;
    left: 18px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}
.timeline-step { position: relative; margin-bottom: 36px; }
.timeline-step:last-child { margin-bottom: 0; }
.timeline-step-number {
    position: absolute;
    left: -48px;
    top: 0;
    width: 38px;
    height: 38px;
    background: var(--bronze);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.95rem;
    z-index: 1;
}
.timeline-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--stone);
    margin-bottom: 6px;
}
.timeline-step-desc { color: var(--stone-light); font-size: 0.95rem; line-height: 1.6; }

/* ==========================================================================
   13. Certifications
   ========================================================================== */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}
.cert-card {
    background: var(--stone);
    border-radius: var(--radius-lg);
    padding: 24px;
    color: var(--white);
    border-top: 3px solid var(--bronze);
    text-align: center;
}
.cert-card-icon { width: 48px; height: 48px; margin: 0 auto 14px; color: var(--bronze); }
.cert-card h4 { font-size: 1rem; font-weight: 700; color: var(--white); margin-bottom: 6px; }
.cert-card p { font-size: 0.88rem; color: rgba(255,255,255,0.6); }

/* ==========================================================================
   14. Devis Section
   ========================================================================== */
.devis-section { background: var(--sand); padding: 5rem 0; }
.devis-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    max-width: 720px;
    margin: 0 auto;
}
.devis-box h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--stone);
}
.devis-box .devis-sub { color: var(--stone-light); margin-bottom: 30px; }
.devis-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.devis-success {
    background: #ecfdf5;
    color: var(--sage);
    padding: 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    display: none;
}
.devis-error {
    background: #fef2f2;
    color: var(--clay);
    padding: 18px;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-align: center;
    display: none;
}

/* ==========================================================================
   15. Hero
   ========================================================================== */
.hero {
    background: var(--cream);
    color: var(--stone);
    padding: 100px 0 80px;
    position: relative;
}
.hero h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--stone);
}
.hero p {
    font-size: 1.15rem;
    max-width: 650px;
    margin-bottom: 30px;
    line-height: 1.7;
    color: var(--stone-light);
}
.hero-buttons { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-badge {
    display: inline-block;
    background: var(--bronze-light);
    color: var(--bronze);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ==========================================================================
   16. Blog
   ========================================================================== */
.blog-container {
    max-width: var(--narrow-width);
    margin: 0 auto;
    padding: 5rem 20px;
}
.blog-post h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 15px;
    color: var(--stone);
}
.blog-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--stone-light);
    font-size: 0.9rem;
    margin-bottom: 30px;
}
.blog-content h2 { font-size: 1.6rem; font-weight: 800; margin: 40px 0 15px; color: var(--stone); }
.blog-content h3 { font-size: 1.3rem; font-weight: 700; margin: 30px 0 12px; color: var(--stone); }
.blog-content p { margin-bottom: 18px; color: var(--stone-light); line-height: 1.8; }
.blog-content ul,
.blog-content ol { margin: 15px 0 15px 25px; color: var(--stone-light); }
.blog-content li { margin-bottom: 8px; line-height: 1.6; }

/* ==========================================================================
   17. Archive
   ========================================================================== */
.archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
}
.archive-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.archive-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-dark);
}
.archive-card img { width: 100%; height: 200px; object-fit: cover; }
.archive-card-body { padding: 24px; }
.archive-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.archive-card h3 a { color: var(--stone); }
.archive-card h3 a:hover { color: var(--bronze); }
.archive-card p { color: var(--stone-light); font-size: 0.93rem; }
.archive-card-date { color: var(--stone-light); font-size: 0.82rem; margin-top: 12px; }

/* ==========================================================================
   18. Contact
   ========================================================================== */
.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: start;
}
.contact-info-card {
    background: var(--stone);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: 35px;
}
.contact-info-card h3 { color: var(--white); font-size: 1.3rem; margin-bottom: 20px; }
.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}
.contact-info-item svg { flex-shrink: 0; color: var(--bronze); }
.contact-info-item a { color: var(--border); }
.contact-info-item a:hover { color: var(--white); }

/* ==========================================================================
   19. Footer
   ========================================================================== */
.site-footer {
    background: #1E1B18;
    color: rgba(255,255,255,0.6);
    padding: 4rem 0 0;
    border-top: 3px solid var(--bronze);
}
.footer-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 3rem;
}
.site-footer h4 { color: var(--white); font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: rgba(255,255,255,0.6); font-size: 0.93rem; }
.site-footer a:hover { color: var(--bronze); }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px 0;
    font-size: 0.85rem;
    text-align: center;
    color: rgba(255,255,255,0.5);
}

/* ==========================================================================
   20. Map
   ========================================================================== */
.map-container {
    position: relative;
    padding-bottom: 40%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin: 30px 0;
}
.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==========================================================================
   21. Mobile CTA Bar
   ========================================================================== */
.mobile-cta {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--stone);
    padding: 10px 12px;
    z-index: 999;
    box-shadow: 0 -2px 12px rgba(45,42,38,0.15);
}
.mobile-cta .container { display: flex; gap: 10px; }
.mobile-cta .btn {
    flex: 1;
    justify-content: center;
    padding: 12px 10px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
}

/* ==========================================================================
   22. Responsive
   ========================================================================== */
@media (max-width: 768px) {
    .hero { padding: 60px 0 50px; }
    .hero h1 { font-size: 1.8em; }
    .hero p { font-size: 1rem; }
    .hero-buttons { flex-direction: column; }
    .hero-buttons .btn { width: 100%; justify-content: center; }

    .section { padding: 3rem 0; }
    .section-title { font-size: 1.5rem; }

    .card-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .cert-grid { grid-template-columns: 1fr 1fr; }

    .trust-bar .container { flex-wrap: wrap; }
    .trust-bar-item {
        flex: 0 0 50%;
        border-right: none;
        padding: 10px 0;
    }

    .devis-row { grid-template-columns: 1fr; }
    .devis-box { padding: 24px; }
    .contact-layout { grid-template-columns: 1fr; }
    .archive-grid { grid-template-columns: 1fr; }
    .footer-columns { grid-template-columns: 1fr 1fr; }

    .blog-container { padding: 3rem 20px; }
    .blog-post h1 { font-size: 1.6rem; }

    .responsive-table thead { display: none; }
    .responsive-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
    }
    .responsive-table td {
        display: flex;
        justify-content: space-between;
        padding: 10px 15px;
    }
    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--stone);
        margin-right: 15px;
    }

    .timeline { padding-left: 40px; }
    .timeline-step-number {
        left: -40px;
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }
}

@media (max-width: 640px) {
    .mobile-cta { display: block; }
    .mobile-cta .container { display: flex; }
    body { padding-bottom: 64px; }
}

@media (max-width: 480px) {
    .stat-grid { grid-template-columns: 1fr; }
    .cert-grid { grid-template-columns: 1fr; }
    .trust-bar-item { flex: 0 0 100%; }
    .footer-columns { grid-template-columns: 1fr; }
    body { font-size: 0.938rem; }
}


/* ==========================================================================
   Maillage interne
   ========================================================================== */
.maillage-section {
    border-top: 1px solid var(--border);
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.maillage-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.maillage-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--stone);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.maillage-col ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
}

.maillage-col li {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--stone-light);
}

.maillage-col a {
    color: var(--bronze);
    text-decoration: none;
}

.maillage-col a:hover {
    text-decoration: underline;
    color: var(--bronze-hover);
}

@media (min-width: 768px) {
    .maillage-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2.5rem;
    }
}
