@import url("https://fonts.googleapis.com/css2?family=Inter:opsz,wght@14..32,100..700&display=swap");

body {
    margin: 0;
    font-family:
        Inter,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
    line-height: 1.5;
    color: #222;
    background: #faf9f6;
}

.chart-container {
    width: min(100% - 2rem, 70rem);
    margin-inline: auto;
    padding-block: 1.5rem;
}

.chart-header {
    text-align: center;
}

.chart-header h1 {
    margin: 0 0 0.5rem;
    font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem);
    font-weight: 700;
    line-height: 1.2;
}

.chart-header p {
    margin: 0 0 1.5rem;
    color: #555;
}

.chart-wrapper {
    position: relative;
    margin: 0;
}

.main-map {
    position: relative;
    height: 600px;
}

.canary-inset {
    position: absolute;
    left: 1rem;
    bottom: 1rem;

    width: 230px;
    padding: 0.5rem;

    background: white;
    border: 1px solid #ddd;
}

.canary-inset span {
    display: block;
    margin-bottom: 0.25rem;

    font-size: 0.8rem;
    font-weight: 600;
    text-align: left;
}

.canary-map {
    position: relative;
    height: 130px;
}

.city-insets {
    position: absolute;
    right: 1rem;
    bottom: 1rem;

    display: flex;
    gap: 0.5rem;
}

.city-inset {
    width: 100px;
    padding: 0.4rem;

    background: white;
    border: 1px solid #ddd;
}

.city-inset span {
    display: block;
    margin-bottom: 0.25rem;

    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
}

.city-map {
    position: relative;
    height: 80px;
}

@media (max-width: 768px) {
    .chart-wrapper {
        width: min(100% - 1.5rem, 600px);
    }

    .main-map {
        height: 400px;
    }

    /* Les encarts quittent leur position flottante */
    .canary-inset,
    .city-insets {
        position: static;
    }

    /* Canaries sur une ligne entière */
    .canary-inset {
        width: 100%;
        margin-top: 1rem;
        box-sizing: border-box;
    }

    .canary-map {
        height: 160px;
    }

    /* Ceuta et Melilla sur deux colonnes */
    .city-insets {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;

        margin-top: 0.75rem;
    }

    .city-inset {
        width: auto;
        box-sizing: border-box;
    }

    .city-map {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .chart-wrapper {
        width: min(100% - 1rem, 480px);
    }

    .main-map {
        height: 340px;
    }

    .canary-map {
        height: 130px;
    }

    .city-map {
        height: 100px;
    }

    .city-insets {
        grid-template-columns: 1fr;
    }
}
