/* =========================
      RESET & BASE
========================= */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Roboto, Helvetica, sans-serif;
    line-height: 1.6;
    background: linear-gradient(180deg, #2f65b0 0%, #2a78b8 50%, #2f65b0 100%);
    color: #000000;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    --body-width: 820px;
    --body-offset: calc((100% - var(--body-width)) / 2 - 180px);
    --body-right-edge: calc(var(--body-offset) + var(--body-width));
}

/* =========================
     ANIMATIONS GLOBALES
========================= */

@keyframes drop {
    from {
        top: -20%;
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    to {
        top: 110%;
        opacity: 0;
    }
}

@keyframes alert-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes intro-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeUpSearch {
    from {
        opacity: 0;
        transform: translateY(100vh);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes carousel-scroll {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

/* ================================
    DÉCOR - LIGNES DE FOND (MENU)
================================ */

.background-lines {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.background-lines span {
    position: absolute;
    top: 0;
    width: 2px;
    height: 100%;
    background: rgba(255,255,255,0.15);
    overflow: hidden;
}

.background-lines span:nth-child(1) { left: 15%; }
.background-lines span:nth-child(2) { left: 30%; }
.background-lines span:nth-child(3) { left: 50%; }
.background-lines span:nth-child(4) { left: 70%; }
.background-lines span:nth-child(5) { left: 85%; }

/* Gouttes animées */
.background-lines span::after {
    content: "";
    position: absolute;
    top: -20%;
    left: 50%;
    width: 3px;
    height: 14px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: drop 6s linear infinite;
}

.background-lines span:nth-child(1)::after { animation-delay: 0s; }
.background-lines span:nth-child(2)::after { animation-delay: 2s; }
.background-lines span:nth-child(3)::after { animation-delay: 4s; }
.background-lines span:nth-child(4)::after { animation-delay: 1s; }
.background-lines span:nth-child(5)::after { animation-delay: 3s; }

/* =========================
       LAYOUT GÉNÉRAL
========================= */

.site-header,
main.container,
.site-footer {
    position: relative;
    z-index: 10;
}

.container {
    max-width: 1200px;
    margin: auto;
    padding: 1.5rem;
}

/* Carte blanche - Contenu principal */
main.container {
    max-width: 820px;
    margin-top: 2.5rem;
    margin-bottom: 3rem;
    margin-left: calc((100% - 820px) / 2 - 180px);
    padding: 1.8rem 1.8rem 2.2rem 1.8rem;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    color: #000000;
}

/* =========================
         HEADER
========================= */

.site-header {
    position: relative;
    z-index: 1000;
    max-width: 1140px;
    margin-left: calc((100% - 820px) / 2 - 180px);
    margin-top: 2rem;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.3rem 1.5rem;
}

/* Logo */
.logo-link {
    display: inline-block;
}

.logo-link:hover {
    opacity: 0.9;
}

.header-logo img {
    height: 63px;
    width: auto;
    display: block;
    transform: scale(1.5);
    transform-origin: left center;
}

/* Navigation */
.header-nav {
    position: relative;
}

.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu-item {
    position: relative;
}

.menu-title {
    font-weight: bold;
    color: #c41e3a;
    cursor: pointer;
    user-select: none;
}

.menu-title::after {
    content: " ˅";
    font-size: 0.8em;
    margin-left: 0.3rem;
    display: inline-block;
    transition: transform 0.25s ease;
}

.has-submenu:hover .menu-title::after {
    transform: rotate(180deg);
}

/* Sous-menu */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0.8rem 0;
    position: absolute;
    right: 0;
    top: 120%;
    z-index: 2000;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.18);
    min-width: 220px;
    opacity: 0;
    transform: translateY(-10px);
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.has-submenu:hover .submenu {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.submenu::before {
    content: "";
    display: block;
    height: 3px;
    background-color: #c41e3a;
    border-radius: 3px 3px 0 0;
    margin-bottom: 0.4rem;
}

.submenu li a {
    display: block;
    padding: 0.7rem 1.4rem;
    color: #1f2a44;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.submenu li a:hover {
    background-color: #f4f6fb;
}

/* Bouton burger (masqué en desktop) */
.burger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.burger-btn span {
    width: 26px;
    height: 3px;
    background-color: #c41e3a;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* =========================
		 FOOTER
========================= */

.site-footer {
    background: #000;
    text-align: center;
    padding: 1rem;
    margin-top: 3rem;
}

footer {
    color: #ffffff;
    font-size: 0.85rem;
    line-height: 1.6;
}

.site-footer a {
    color: #c41e3a;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* =========================
       TYPOGRAPHIE
========================= */

.site-title {
    margin: 0 0 2rem 0;
    font-size: 1.6rem;
    font-weight: 700;
    color: #1f2a44;
    text-align: left;
}

/* =========================
         ALERTE
========================= */

.alert {
    position: relative;
    padding: 1.2rem 3rem 1.2rem 1.5rem;
    margin-bottom: 2.5rem;
    background-color: #f8e6e6;
    color: #a01a1a;
    border-radius: 6px;
    border-left: 5px solid #c41e3a;
    box-shadow: none;
    animation: alert-slide-in 2s ease-out;
    z-index: 100;
}

.alert h3 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 700;
}

.alert p {
    margin: 0;
    font-size: 0.81rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Bouton fermeture */
.alert-close {
    position: absolute;
    top: 20px;
    right: 14px;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    background-color: #ffffff;
    border: 2px solid #c41e3a;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.alert-close::before,
.alert-close::after {
    content: "";
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: #c41e3a;
    border-radius: 1px;
}

.alert-close::before {
    transform: rotate(45deg);
}

.alert-close::after {
    transform: rotate(-45deg);
}

.alert-close:hover {
    background-color: #c41e3a;
}

.alert-close:hover::before,
.alert-close:hover::after {
    background-color: #ffffff;
}

/* =========================
      INTRO (CADRE BLEU)
========================= */

.intro {
    position: relative;
    padding: 2.6rem 2.2rem;
    margin: 3rem 0 4rem 0;
    text-align: center;
    color: #ffffff;
    background: radial-gradient(circle at center, #6fa3e8 0%, #3f7acb 35%, #245aa8 65%, #163f7a 100%);
    border: 3px solid rgba(196, 30, 58, 0.85);
    border-radius: 6px;
    animation: intro-fade-in 0.8s ease-out;
}

.intro::before,
.intro::after {
    content: "";
    display: block;
    height: 14px;
    margin: 1.8rem 0;
    background: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.85) 1px, transparent 2px, transparent 6px);
}

.intro p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.intro p:last-child {
    margin-bottom: 0;
}

.intro-underline {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
}

/* =========================
        SÉPARATEURS
========================= */

.separator {
    width: 100%;
    height: 2px;
    margin: 4rem 0;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.45), transparent);
}

/* =========================
      BLOC RECHERCHE
========================= */

.search-box {
    position: fixed;
    top: 148px;
    left: calc((100% - 820px) / 2 - 180px + 820px + 20px);
    width: 300px;
    padding: 1.8rem;
    background-color: #fff9f5;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.search-title {
    margin: 0 0 1rem 0;
    font-size: 0.95rem;
    color: #6b6b6b;
}

.search-box input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0;
    font-size: 0.95rem;
    line-height: 1;
    border: none;
    border-radius: 8px;
    background-color: #fbeaea;
    color: #333;
}

.search-box button {
    width: fit-content;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    background-color: #2b2d56;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

.search-box button:hover {
    background-color: #1f2147;
}

/* ===========================
    BOUTON RETOUR EN HAUT
=========================== */

#backToTop {
    position: fixed;
    left: calc((100% - 820px) / 2 - 180px + 820px + 40px);
    bottom: 110px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background-color: #ff4d6d;
    color: transparent;
    font-size: 0;
    border: none;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1000;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='19' x2='12' y2='5'/%3E%3Cpolyline points='5 12 12 5 19 12'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 22px 22px;
}

#backToTop::after {
    content: none;
}

#backToTop:hover {
    background-color: #ff2f57;
    transform: translateY(-4px);
}

/* ============================
    RÉCEMMENT EN VEDETTE
============================= */

@keyframes featured-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.featured-characters {
    margin-bottom: 3rem;
    animation: featured-fade-in 0.6s ease-out;
}

.featured-characters h4 {
    text-align: left;
    margin-bottom: 1.5rem;
    font-size: 1.35rem;
    font-weight: 700;
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.2rem;
    align-items: start;
}

.featured-grid a {
    display: block;
    text-align: center;
    color: inherit;
    text-decoration: none;
}

.featured-grid img {
    width: 100%;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    display: block;
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.featured-grid a:hover img {
    transform: scale(1.05);
}

.featured-grid span {
    display: block;
    margin-top: 0.7rem;
    font-size: 0.78rem;
    line-height: 1.35;
    color: #8a8a8a;
    font-style: italic;
}

/* ============================
    CATÉGORIES (PAGE D'ACCUEIL)
============================= */

.categories {
    margin-bottom: 3rem;
}

.categories h2 {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 2rem;
    font-size: 2.2rem;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    position: relative;
    z-index: 1;
}

.category-grid img {
    width: 100%;
    border-radius: 6px;
    transition: transform 0.3s;
}

.category-grid img:hover {
    transform: scale(1.05);
}

/* =========================
        CARROUSEL
========================= */

.carousel {
    overflow: hidden;
    width: 100%;
}

.carousel-track {
    display: flex;
    width: max-content;
    animation: carousel-scroll 40s linear infinite;
}

.carousel-track img {
    width: 220px;
    margin-right: 1.5rem;
    border-radius: 6px;
    flex-shrink: 0;
}

/* =========================
     PAGE HÉROS/ÉQUIPES
========================= */

.heroes-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.hero-item {
    text-align: center;
    opacity: 0;
    transform: translate(0, 0);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.hero-item a {
    display: block;
}

.hero-item img {
    width: 100%;
    display: block;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

.hero-name {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    font-weight: 400;
    color: #8a8a8a;
    text-align: center;
    line-height: 1.3;
    font-style: italic;
}

/* Animations d'apparition */
.hero-item.from-left { transform: translateX(-40px); }
.hero-item.from-right { transform: translateX(40px); }
.hero-item.from-top { transform: translateY(-40px); }
.hero-item.from-bottom { transform: translateY(40px); }

.hero-item.is-visible {
    opacity: 1;
    transform: translate(0, 0);
}

/* Page équipes */
.teams-list {
    grid-template-columns: repeat(4, 1fr);
}

/* =========================
      IMAGE DE PAGE HÉROS
========================= */

.page-hero-image {
    width: 100%;
    margin-bottom: 1.5rem;
    overflow: hidden;
    border-radius: 8px;
}

.page-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s ease;
}

.page-hero-image:hover img {
    transform: scale(1.08);
}

/* =========================
      FICHE PERSONNAGE
========================= */

.page-layout {
    display: block;
}

.page-content {
    display: block;
}

.character-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.character-intro h2 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: #1f2a44;
}

.version-item:not(:last-child) {
    border-bottom: 1px solid #e4e6eb;
}

.character-versions img {
    width: 100%;
    border-radius: 6px;
}

.character-infos ul {
    list-style: none;
    padding: 0;
}

.character-infos li {
    margin-bottom: 0.6rem;
    font-size: 0.9rem;
}

.character-intro img,
.character-gallery img,
.character-versions img,
.character-page main img,
.character-origins img,
.character-costume img {
    display: block;
    width: 100%;
    height: auto;
}

/* =========================
    RÉSULTATS DE RECHERCHE
========================= */

.search-results-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
}

.search-result-item {
    padding: 0.9rem 0;
    border-bottom: 1px solid #e4e6eb;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item a {
    color: #1f2a44;
    text-decoration: none;
    font-size: 1.05rem;
}

.search-result-item a:hover {
    text-decoration: underline;
}

.search-result-types {
    display: flex;
    gap: 0.5rem;
}

.search-result-type {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
}

.type-héros { background: #2a89ac; }
.type-ennemi { background: #b62828; }
.type-anti-héros { background: #e26514; }
.type-catégorie { background: #95aaa9; }
.type-menu { background: #142846; }
.type-équipe { background: #349145; }
.type-pierre { background: #7b3fb6; }

/* =========================
    RESPONSIVE - TABLETTE
========================= */

@media (max-width: 1024px) {
    /* Header */
    .header-inner {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .header-nav {
        position: relative;
    }

    .site-header {
        width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Carte blanche */
    main.container {
        max-width: 90%;
        margin-left: auto;
        margin-right: auto;
    }

    /* Search-box */
    .search-box {
        position: static;
        width: 100%;
        max-width: 100%;
        margin: 2.5rem 0 2rem;
        padding: 1.6rem;
        background-color: #e8edf7;
        border: 1px solid rgba(47, 101, 176, 0.25);
        border-radius: 12px;
        box-shadow: 0 8px 22px rgba(47, 101, 176, 0.18);
        animation: none;
    }

    .search-box input {
        background-color: #ffffff;
    }

    /* Burger visible */
    .burger-btn {
        display: flex;
    }

    /* Texte "Menu" masqué */
    .menu-title {
        display: none;
    }

    /* Sous-menu fermé par défaut */
    .submenu {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
    }

    /* Ouverture au clic */
    .menu-item.open .submenu {
        display: block;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Désactive les hover */
    .category-grid img,
    .category-grid article,
    .category-grid a {
        transform: none !important;
        transition: none !important;
    }

    .category-grid img:hover,
    .category-grid img:active,
    .category-grid img:focus,
    .category-grid article:hover,
    .category-grid article:active {
        transform: none !important;
    }

    /* Bouton retour en haut */
    #backToTop {
        left: auto;
        right: 30px;
    }

    /* Masquage alerte */
    #translation-alert,
    .alert {
        display: none !important;
    }

    /* Grille héros */
    .heroes-list {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================
     RESPONSIVE - MOBILE
========================= */

@media (max-width: 768px) {
    /* Alerte totalement masquée */
    #translation-alert,
    .alert {
        display: none !important;
    }

    /* Désactivation gouttes */
    .background-lines {
        display: none;
    }

    /* Layout mobile */
    main.container {
        padding: 1.4rem 1.2rem;
    }

    .carousel-track img {
        width: 150px;
    }

    .search-box {
        padding: 1.4rem;
    }

    .site-header {
        width: 90%;
        margin-top: 1rem;
        margin-left: auto;
        margin-right: auto;
    }

    .header-inner {
        padding: 0.4rem 1rem;
    }

    .header-logo img {
        transform: scale(1.2);
    }

    /* Catégories - Mode mobile */
    .category-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.6rem;
        padding: 0 0.5rem;
    }

    .category-grid article {
        width: 100%;
        padding: 0.4rem;
    }

    .category-grid img {
        width: 100%;
        aspect-ratio: 3 / 5;
        object-fit: cover;
        border-radius: 6px;
    }

    .category-grid h3 {
        font-size: 1rem;
        margin-top: 0.5rem;
    }

    .category-grid article:nth-child(3) {
        grid-column: 1 / 2;
    }

    /* Bouton retour en haut - masqué */
    #backToTop {
        display: none !important;
    }

    /* Grille héros */
    .heroes-list {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Fiche personnage */
    .character-intro {
        grid-template-columns: 1fr;
    }
}

/* =========================
    RESPONSIVE - AUTRES BREAKPOINTS
========================= */

@media (max-width: 600px) {
    .teams-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .heroes-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop - Animations */
@media (min-width: 1025px) {
    #backToTop {
        position: fixed;
        bottom: 125px;
        left: calc(var(--body-right-edge) + 60px);
    }

    .search-box {
        animation: fadeUpSearch 1.2s ease-out forwards;
    }
}
/* =========================
   PAGES INDEX (HÉROS / ENNEMIS)
========================= */

.index-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2a44;
    margin-bottom: 0.8rem;
}

.index-separator {
    width: 100%;
    height: 1px;
    background: rgba(0,0,0,0.15);
    margin-bottom: 1.5rem;
}

.index-layout {
    display: grid;
    grid-template-columns: 160px 1fr 160px;
    gap: 2rem;
    align-items: start;
}

.index-images-left,
.index-images-right {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.index-img-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
}

.index-img-slot img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.index-img-slot img.active {
    opacity: 1;
}

.index-center {
    min-width: 0;
}

.index-letter-group {
    margin-bottom: 0;
    text-align: center;
    padding-top: 1.8rem;
}

.index-group-separator {
    width: 140px;
    height: 1px;
    background-color: #cccccc;
    margin: 1.8rem auto 0 auto;
}

.index-letter {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1f2a44;
    margin-bottom: 1rem;
    display: block;
}

.index-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    align-items: center;
}

.index-list li a {
    color: #c41e3a;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s ease;
    display: inline-block;
}

.index-list li a:hover {
    color: #8a0f26;
    text-decoration: underline;
}

@media (max-width: 1024px) {
    .index-layout {
        grid-template-columns: 120px 1fr 120px;
        gap: 1.2rem;
    }
	
    .featured-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .index-layout {
        grid-template-columns: 1fr;
    }
    .index-images-left,
    .index-images-right {
        display: none;
    }

    .featured-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.4rem;
    }

    .featured-grid span {
        font-size: 0.8rem;
    }
}

/* =========================
   PIERRES D'INFINITÉ – GRILLE 3 COLONNES
========================= */

.infinity-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.infinity-list .hero-item:last-child {
    grid-column: 2;
}

@media (max-width: 600px) {
    .infinity-list {
        grid-template-columns: repeat(2, 1fr);
    }
    .infinity-list .hero-item:last-child {
        grid-column: 1 / -1;
    }
}

/* =========================================
   PIERRES D'INFINITÉ — EGO MOBILE
========================================= */

@media (max-width: 768px) {

    .infinity-list .hero-item:last-child {
        grid-column: 2;
    }

}

/* =========================
   PAGE CONTACT
========================= */

.contact-section {
    margin-bottom: 2rem;
}

/* Mise en page — suggestion de nouvelle page */

#character-suggestion label {
    display: block;
}

#character-suggestion input,
#character-suggestion select {
    display: block;
    width: 275px;
}

/* =========================================
   MENU — RÉCEMMENT EN VEDETTE
   TABLETTE / MOBILE
========================================= */

@media (max-width: 1024px) {

    /*
     * Réorganisation du contenu :
     * Catégories avant Récemment en vedette.
     */
    main.container:has(.featured-grid) {
    display: flex;
    flex-direction: column;
}

    main.container:has(.featured-grid) > *:nth-child(1) {
        order: 1;
    }

    main.container:has(.featured-grid) > *:nth-child(2) {
        order: 2;
    }

    main.container:has(.featured-grid) > *:nth-child(3) {
        order: 3;
    }

    /* Séparateur après l'introduction */
    main.container:has(.featured-grid) > *:nth-child(4) {
        order: 4;
    }

    /* Catégories */
    main.container:has(.featured-grid) > *:nth-child(7) {
        order: 5;
    }

    /* Séparateur après les catégories */
    main.container:has(.featured-grid) > *:nth-child(8) {
        order: 6;
    }

    /* Récemment en vedette */
    main.container:has(.featured-grid) > *:nth-child(5) {
        order: 7;
    }

    /* Séparateur après les vedettes */
    main.container:has(.featured-grid) > *:nth-child(6) {
        order: 8;
    }

    /* Carousel */
    main.container:has(.featured-grid) > *:nth-child(9) {
        order: 9;
    }

    /* Séparateur après le carousel */
    main.container:has(.featured-grid) > *:nth-child(10) {
        order: 10;
    }

    /* Lien "toutes les pages" */
    main.container:has(.featured-grid) > *:nth-child(11) {
        order: 11;
    }

    /*
     * 3 images par ligne.
     */
    .featured-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /*
     * On retire uniquement la 7e vignette
     * sur tablette et mobile.
     */
    .featured-grid a:nth-child(7) {
        display: none;
    }
	
	    /* Images équilibrées sans déformation */
    .featured-grid a {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .featured-grid img {
        width: auto;
        height: 180px;
        max-width: 100%;
        aspect-ratio: auto;
        object-fit: contain;
    }
}

/* =========================================
   BOUTON LISTE COMPLÈTE
   TABLETTE / MOBILE
========================================= */

@media (max-width: 1024px) {

    .category-page {
        display: flex;
        flex-direction: column;
    }

    /* Page Héros */
    .page-content.category-page > .site-title {
        order: 1;
    }

    .page-content.category-page > .index-btn-wrapper {
        order: 2;
        margin: 0 0 2rem 0;
    }

    .page-content.category-page > .heroes-list {
        order: 3;
    }

    /* Page Super-Vilains */
    main.container.category-page > .site-title {
        order: 1;
    }

    main.container.category-page > .index-btn-wrapper {
        order: 2;
        margin: 0 0 2rem 0;
    }

    main.container.category-page > .heroes-list {
        order: 3;
    }
}