/* GÉNÉRAL */
html {
    scroll-behavior: smooth;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #1f1d86;
    background-color: #fff;
    line-height: 1.6;
}

/* CONTAINER AVEC MARGES ADAPTATIVES */
.container {
    width: 90%;
    max-width: 1024px;
    margin: 0 auto;
}

/* HEADER FIXE 80px */
.main-header {
    height: 80px;
    background: #1f1d86;
    color: #fff;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.25);
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* LOGO & DROPDOWN MENU */
.logo-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    width: 270px; /* Élargi pour accueillir MAGIC-WORLDS */
    padding: 5px;
    border-radius: 8px;
    transition: background 0.3s;
}

.logo-link:hover {
    background: rgba(255, 255, 255, 0.1);
}

.header-logo {
    height: 50px;
    width: auto;
}

.header-text-group {
    display: flex;
    flex-direction: column;
}

.header-title {
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 1.8;
    letter-spacing: 0.05rem;
}

.header-subtitle {
    font-weight: normal;
    font-size: 0.7rem;
    line-height: 1.2;
}

/* Style du Menu Dropdown */
.dropdown-menu {
    display: none;
    position: absolute;
    top: 85px;
    left: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    width: 270px; /* Aligné sur la largeur du logo-link */
    max-width: 90vw;
    border-radius: 5px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    z-index: 2000;
    flex-direction: column;
    border: 1px solid #729e57;
}

.dropdown-menu.active {
    display: flex;
    animation: fadeInDown 0.3s ease-out;
}

.dropdown-menu a {
    padding: 12px 20px;
    text-decoration: none;
    color: #1f1d86;
    font-weight: 500;
    font-size: 0.9rem;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s, color 0.2s;
}

.dropdown-menu a:hover {
    background-color: #f7f6f6;
    color: #2851d6;
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* CTA HEADER */
.cta-header {
    background: #fff;
    color: #1f1d86;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    font-size: 0.95rem;
    white-space: nowrap;
    transition: background 0.3s, transform 0.2s;
}

.cta-header:hover {
    background: #f0f0f0;
    transform: translateY(-1px);
}

.txt-mobile {
    display: none;
}

.txt-desktop {
    display: inline;
}

/* HERO SECTION */
.hero-portrait {
    width: 100%;
    height: 480px; 
    overflow: hidden;
    background-color: #f0f0f0;
}

.hero-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}

/* SECTIONS */
.section {
    padding: 40px 0;
}

.section.light {
    background-color: #f7f6f6;
}

h1 {
    color: #1f1d86;
    margin-bottom: 20px;
    font-size: 1.8rem;
    line-height: 1.4;
}

h2 {
    color: #2851d6;
    margin-bottom: 15px;
    font-size: 1.3rem;
    line-height: 1.3;
}

ul {
    list-style: disc inside;
    margin-bottom: 15px;
}

p {
    margin-bottom: 15px;
}

.split-img img {
    width: 100%;
    max-width: 1024px;
    border-radius: 20px;
    display: block;
    margin: 20px auto 0;
}

/* Gélules cliquables > URL / Pages dédiées */
.service-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0 5px 0;
    margin-left: 0;
}

.tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: #2851d6;
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    letter-spacing: 0.05rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: #1f1d86;
    color: #ffffff;
    cursor: pointer;
}

/* Animation douce au scroll pour les service-tags */
.service-tags .tag {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.25s ease-out, transform 0.5s ease-out, background-color 0.5s ease;
}

.service-tags.is-visible .tag {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .service-tags .tag {
        opacity: 1;
        transform: none;
        transition: none;
    }
}


/* GRILLE DES 4 SECTEURS D'ACTIVITÉ */
.sectors-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 25px 0;
    width: 100%;
}

.sector-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

/* Alignement et comportement du tag */
.sector-card .tag {
    display: inline-block;
    padding: 6px 14px;
    background-color: #1f1d86;
    color: #fff;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.sector-card:hover .tag {
    background-color: #2851d6;
    transform: translateY(-2px);
}

/* Conteneur image au format défini / Aspect-ratio */
.sector-image-wrapper {
    width: 100%;
    aspect-ratio: 1,5;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
    background-color: #f7f6f6;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sector-image {
    width: 100%;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: transform 0.3s ease;
}

/* Effet de survol sobre */
.sector-card:hover .sector-image-wrapper {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}

.sector-card:hover .sector-image {
    transform: scale(1.05);
}

/* RESPONSIVE TABLETTE ET MOBILE */
@media (max-width: 900px) {
    .sectors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .sectors-grid {
        grid-template-columns: 1fr; /* Affiche 1 seule carte par ligne (empilées) */
        gap: 20px; /* Espace vertical agréable entre chaque carte */
    }
    
    .sector-card .tag {
        font-size: 0.9rem;
        padding: 8px 14px;
    }
}

/* FAQ */
.faq-list details {
    background: #fff;
    margin-bottom: 12px;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: bold;
    color: #1f1d86;
    cursor: pointer;
    outline: none;
}

.faq-list summary::before {
    content: '▶';
    font-size: 0.7rem;
    transition: transform 0.3s;
}

.faq-list details[open] summary::before {
    transform: rotate(90deg);
}

.faq-list p {
    margin-top: 10px;
    margin-bottom: 0;
    color: #555;
}

/* FORMULAIRE / Tally.so / CTA Container */
.button-container {
    display: flex;
    justify-content: center;
    width: 100%;
    margin-top: 20px;
}

.cta-tally-modal {
    width: 720px; 
    max-width: 100%;
    background: #1f1d86;
    color: #fff;
    border: none;
    padding: 15px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1rem;
    font-family: inherit;
    transition: background 0.3s, transform 0.2s;
    text-align: center;
}

.cta-tally-modal:hover {
    background: #2851d6;
    transform: translateY(-2px);
}

/* FOOTER */
.footer {
    background: #f7f6f6;
    padding: 30px 0;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* BOUTON RETOUR EN HAUT */
#backToTop {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1100;
    width: 45px;
    height: 45px;
    background-color: #1f1d86;
    color: white;
    text-decoration: none;
    border-radius: 50%;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

#backToTop:hover {
    background-color: #2851d6;
    transform: translateY(-3px);
}

/* RESPONSIVE TABLETTE & IPAD (1024px) */
@media (max-width: 1024px) {
    .container {
        width: 85%;
    }

    .cta-header {
        font-size: 0.85rem;
        padding: 8px 12px;
    }
}

/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
    .container {
        width: 90%;
    }

    .logo-link {
        width: 220px;
        gap: 10px;
    }

    .header-subtitle {
        font-size: 0.65rem;
        display: block;
    }
    
    .header-logo {
        height: 40px;
    }

    .header-title {
        font-size: 0.85rem;
    }

    .dropdown-menu {
        width: 220px;
        top: 70px;
    }

    .cta-header {
        font-size: 0.75rem;
        padding: 6px 10px;
    }

    .txt-desktop {
        display: none;
    }

    .txt-mobile {
        display: inline;
    }

    .hero-portrait {
        height: 320px;
    }
    
    .footer {
        font-size: 0.85rem;
        padding: 20px 0;
    }
}