/* ── Reset & Base ── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    touch-action: manipulation;
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* ── Main ── */
main {
    padding: 24px 16px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ── Grid ── */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 16px;
    touch-action: manipulation;
    touch-action: pan-x pan-y;
}

/* ── Cards ── */
.card {
    border-radius: 16px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.15s ease;
    background-color: #fff;
    aspect-ratio: 3 / 4;
    touch-action: manipulation;
    touch-action: pan-x pan-y;
}

.card:hover {
    transform: scale(1.03);
}

.card:focus {
    outline: 3px solid #ff0000;
    outline-offset: 3px;
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    touch-action: manipulation;
    touch-action: pan-x pan-y;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Home button ── */
.home-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: none;
    border: none;
    text-decoration: none;
    margin: 0.8rem 0 0.5rem 0;
    cursor: pointer;
    font-size: 10rem;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

/* ── Footer ── */
footer {
    text-align: center;
    padding: 24px;
    margin-top: 32px;
    border-top: 1px solid #ebebeb;
}

footer a {
    color: #d6d6d6;
    text-decoration: none;
    font-size: 0.9rem;
}

footer a:hover {
    text-decoration: underline;
}

/* ── Legal page ── */
.legal-content h2 {
    font-size: 1.5rem;
    color: #5B5FC7;
    margin-bottom: 16px;
    margin-top: 8px;
}

.legal-content h3 {
    font-size: 1.1rem;
    color: #333;
    margin-top: 24px;
    margin-bottom: 8px;
}

.legal-content p {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #555;
}

/* ── Responsive ── */

/* Tablette (max 1024px) */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    main {
        max-width: 900px;
    }
}

/* Smartphone (max 600px) */
@media (max-width: 600px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    main {
        max-width: 100%;
        padding: 16px 12px;
    }
}