/* Feuille de style du site sur les filtres UV */

body {
    font-family: "Segoe UI", Arial, Helvetica, sans-serif;
    line-height: 1.7;
    color: #3a3a3a;
    background-color: #fff8ef;
    margin: 0;
    padding: 0;
}

/* En-tête */
header {
    background: linear-gradient(135deg, #ffb347 0%, #ff8c42 100%);
    color: white;
    text-align: center;
    padding: 50px 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    margin: 0 0 12px 0;
    font-size: 34px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

header p {
    margin: 0;
    font-style: italic;
    font-size: 17px;
    opacity: 0.95;
}

/* Menu de navigation */
nav {
    background-color: #e76f51;
    text-align: center;
    padding: 14px;
    position: sticky;
    top: 0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

nav a {
    color: white;
    text-decoration: none;
    margin: 0 14px;
    font-weight: bold;
    font-size: 15px;
    transition: opacity 0.2s;
}

nav a:hover {
    opacity: 0.75;
}

/* Contenu principal */
main {
    max-width: 820px;
    margin: 30px auto;
    padding: 0 20px;
}

section {
    background-color: white;
    padding: 28px 32px;
    margin-bottom: 26px;
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
}

h2 {
    color: #e76f51;
    margin-top: 0;
    padding-bottom: 8px;
    border-bottom: 3px solid #ffd9a0;
}

h3 {
    color: #3d405b;
    margin-top: 24px;
}

p, li {
    font-size: 16px;
}

ul, ol {
    padding-left: 22px;
}

li {
    margin-bottom: 6px;
}

strong {
    color: #d65a3a;
}

/* Tableaux */
/* Le conteneur permet au tableau de défiler horizontalement s'il est trop large */
.table-wrap {
    margin: 18px 0;
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /* barre de défilement toujours visible (Firefox) */
    scrollbar-width: thin;
    scrollbar-color: #ff8c42 #fff0dc;
    padding-bottom: 2px;
}

/* barre de défilement toujours visible et colorée (Chrome, Safari, Edge) */
.table-wrap::-webkit-scrollbar {
    height: 10px;
    -webkit-appearance: none;
}

.table-wrap::-webkit-scrollbar-track {
    background: #fff0dc;
    border-radius: 6px;
}

.table-wrap::-webkit-scrollbar-thumb {
    background: #ff8c42;
    border-radius: 6px;
    border: 2px solid #fff0dc;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* largeur minimale : en dessous, le conteneur affiche une barre de défilement */
    min-width: 460px;
}

th, td {
    border: 1px solid #f0e2d0;
    padding: 12px;
    text-align: center;
}

th {
    background: linear-gradient(135deg, #ffb347 0%, #ff8c42 100%);
    color: white;
    font-size: 15px;
}

td {
    height: 22px;
}

tbody tr:nth-child(even) {
    background-color: #fff8ef;
}

tbody tr:hover {
    background-color: #fff0dc;
}

/* Barre du spectre UV */
.uv-bar {
    display: flex;
    height: 50px;
    margin: 22px 0 8px;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(44, 18, 128, 0.3);
    /* dégradé du violet UV profond vers la lumière visible */
    background: linear-gradient(90deg, #2c1280 0%, #3a1f9c 30%, #5a33e0 70%, #7b5cf0 100%);
    /* animation : la barre se déroule de gauche à droite */
    transform-origin: left;
    animation: uv-grow 0.9s ease-out;
}

@keyframes uv-grow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

.uv-zone {
    display: flex;
    align-items: center;
    color: white;
    font-weight: bold;
    font-size: 13px;
    letter-spacing: 1px;
    padding: 0 12px;
}

.uv-zone-b { width: 30%; border-right: 1px dashed rgba(255, 255, 255, 0.4); }
.uv-zone-a { width: 40%; border-right: 1px dashed rgba(255, 255, 255, 0.4); }
.uv-zone-light { font-size: 12px; font-weight: normal; opacity: 0.9; }

.uv-scale {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: #777;
}

/* Formules chimiques */
.structures {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    justify-content: center;
    margin: 18px 0;
}

.structures figure {
    flex: 1 1 200px;
    max-width: 240px;
    margin: 0;
    background-color: #fff8ef;
    border: 1px solid #f0e2d0;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.structures img {
    width: 100%;
    height: auto;
    background-color: white;
    border-radius: 6px;
}

.structures figcaption {
    margin-top: 10px;
    font-weight: bold;
    color: #3d405b;
    font-size: 14px;
}

/* Pied de page */
footer {
    background-color: #3d405b;
    color: white;
    text-align: center;
    padding: 22px;
    margin-top: 30px;
    font-size: 14px;
}

/* Pour les téléphones */
@media (max-width: 600px) {
    header {
        padding: 35px 16px;
    }

    header h1 {
        font-size: 24px;
    }

    header p {
        font-size: 15px;
    }

    main {
        margin: 18px auto;
        padding: 0 12px;
    }

    section {
        padding: 20px 18px;
    }

    p, li {
        font-size: 15px;
    }

    th, td {
        padding: 8px;
        font-size: 14px;
    }
}
