/* ===== GLOBAL CSS - Mercerie Ajaccio ===== */
/* V5.1 - Loisirs créatifs / Mercerie / Couture */

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #2d3748;
    background-color: #f8f4f0;
    line-height: 1.65;
    overflow-x: hidden;
}

/* === MEDIA ELEMENTS === */
img, video, iframe, embed, object, svg, canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* === ANTI-OVERFLOW === */
*:not(table) {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* === TABLEAUX RESPONSIVE === */
table {
    width: 100%;
    border-collapse: collapse;
    max-width: 100%;
}

.table-responsive,
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
}

/* === CONTAINER === */
.container {
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 24px;
}

/* === TYPOGRAPHIE GLOBALE === */
h1, h2, h3, h4, h5, h6 {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.25;
    color: #1a365d;
}

p {
    line-height: 1.7;
    color: #2d3748;
}

a {
    color: #4c6ef5;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #1a365d;
}

a:focus {
    outline: 2px solid #7f9cf5;
    outline-offset: 2px;
    border-radius: 2px;
}

/* === SECTION HEADERS === */
.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-pre {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fbb6ce;
    margin-bottom: 10px;
    padding: 4px 14px;
    background-color: #fff0f6;
    border-radius: 20px;
    border: 1px solid #fbb6ce;
}

.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1a365d;
    margin-bottom: 16px;
    text-align: center;
}

.section-desc {
    font-size: 1.05rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* === BADGES CATÉGORIES === */
.art-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 3px 10px;
    border-radius: 4px;
    background-color: #eef2ff;
    color: #4c6ef5;
    text-decoration: none;
    transition: background-color 0.2s ease;
    border: 1px solid #c5d2f6;
}

.art-category-badge:hover,
.art-category-badge:focus {
    background-color: #c5d2f6;
    color: #1a365d;
    outline: none;
}

/* === DATE & READING TIME === */
.art-date {
    font-size: 0.82rem;
    color: #718096;
}

.art-reading {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: #718096;
}

/* === SCREEN READER ONLY === */
.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;
}

/* === FOCUS VISIBLE GLOBAL === */
:focus-visible {
    outline: 2px solid #7f9cf5;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ===== RESPONSIVE (auto-repair) ===== */
@media (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .section-header {
        margin-bottom: 36px;
    }

    .section-desc {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 0 16px;
    }

    .section-header {
        margin-bottom: 28px;
    }

    .section-pre {
        font-size: 0.75rem;
        padding: 3px 12px;
    }

    .section-title {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .section-desc {
        font-size: 0.97rem;
        max-width: 100%;
    }

    .art-category-badge {
        font-size: 0.7rem;
        padding: 3px 8px;
    }

    .art-date,
    .art-reading {
        font-size: 0.78rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 12px;
    }

    .section-header {
        margin-bottom: 20px;
    }

    .section-pre {
        font-size: 0.7rem;
        padding: 3px 10px;
        letter-spacing: 0.08em;
    }

    .section-title {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .section-desc {
        font-size: 0.92rem;
        line-height: 1.6;
    }

    .art-category-badge {
        font-size: 0.68rem;
        padding: 2px 7px;
    }

    .art-date,
    .art-reading {
        font-size: 0.75rem;
    }

    h1, h2, h3, h4, h5, h6 {
        line-height: 1.3;
    }

    p {
        line-height: 1.6;
    }

    .table-responsive,
    .table-wrapper {
        margin: 0 -12px;
        padding: 0 12px;
        width: calc(100% + 24px);
    }
}