/* --- VARIABLES & RESET --- */
:root {
    --primary: #0f172a;
    /* Bleu marine profond */
    --secondary: #334155;
    /* Gris ardoise */
    --accent: #ca8a04;
    /* Or/Soin pour la confiance */
    --light: #f8fafc;
    /* Fond très clair */
    --white: #ffffff;
    --text-body: #475569;
    --transition: all 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    color: var(--text-body);
    background-color: var(--light);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* --- UTILITAIRES D'ANIMATION --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: var(--transition);
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- HEADER --- */
/* --- HEADER --- */
.main-header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 1rem 5%;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background-color: var(--accent);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
}

.logo-text {
    line-height: 1;
}

.logo-meta {
    color: var(--white);
}

.logo-compta {
    color: var(--accent);
}

.logo-dot {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-grow: 1;
    justify-content: center;
}

.nav-links a {
    font-weight: 500;
    color: var(--white);
    position: relative;
    font-size: 0.95rem;
    transition: font-weight 0.3s ease;
    cursor: pointer;
}

.nav-links a:hover {
    font-weight: 700;
}

/* Animation Soulignement conservée */
.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.4s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- MODIFICATION : LE LIEN CONTACT N'A PLUS LA CLASSE CTA-BTN ---
           Il est maintenant un lien standard comme les autres --- */

/* Bouton CTA (Optionnel si besoin ailleurs, retiré du menu contact) */
.cta-btn {
    background-color: var(--accent);
    color: var(--white) !important;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    transition: var(--transition);
    font-weight: 600;
    border: none;
}

.cta-btn:hover {
    background-color: var(--white);
    color: var(--primary) !important;
    transform: translateY(-2px);
}

.cta-btn::after {
    display: none !important;
}

/* --- TÉLÉPHONE HEADER --- */
.nav-contact {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--white);
    font-weight: 600;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    transition: var(--transition);
}

.nav-contact svg {
    width: 20px;
    height: 20px;
    fill: var(--accent);
}

.nav-contact:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

.nav-contact:hover svg {
    fill: var(--white);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 2px;
    background-color: var(--white);
    transition: 0.3s;
}

/* --- HERO CAROUSEL --- */
.hero-carousel {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background-color: var(--primary);
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 1;
}

.hero-slide.active {
    opacity: 1;
    z-index: 2;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transform: scale(1.1);
    transition: transform 6s ease;
}

.hero-slide.active img {
    transform: scale(1);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(15, 23, 42, 0.7), rgba(15, 23, 42, 0.4));
    z-index: 2;
}

.hero-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    width: 90%;
    max-width: 900px;
    color: var(--white);
}

.hero-content h1,
.hero-content p {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

/* Animation des boutons (wrapper) */
.hero-content .hero-buttons {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.hero-slide.active .hero-content h1 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.3s;
}

.hero-slide.active .hero-content p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.6s;
}

.hero-slide.active .hero-content .hero-buttons {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.9s;
}

.hero-content h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    line-height: 1.1;
    margin-bottom: 1.5rem;
    font-weight: 800;
}

.hero-content p {
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    color: #e2e8f0;
}

/* Wrapper pour les deux boutons */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Bouton principal */
.hero-btn {
    display: inline-block;
    background-color: var(--accent);
    color: var(--white);
    padding: 1rem 2rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    border: 2px solid var(--accent);
    transition: var(--transition);
}

.hero-btn:hover {
    background-color: transparent;
    color: var(--white);
}

/* Bouton secondaire (Contact) */
.hero-btn.secondary {
    background-color: transparent;
    color: var(--white);
    border: 2px solid var(--white);
}

.hero-btn.secondary:hover {
    background-color: var(--white);
    color: var(--primary);
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
}

.carousel-control:hover {
    background: var(--accent);
    border-color: var(--accent);
}

.control-prev {
    left: 30px;
}

.control-next {
    right: 30px;
}

.hero-dots {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    z-index: 10;
}

.hero-dot {
    width: 12px;
    height: 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

.hero-dot.active {
    background: var(--accent);
    transform: scale(1.3);
}

/* --- SECTIONS GÉNÉRALES --- */
section {
    padding: 6rem 5%;
    max-width: 1200px;
    margin: 0 auto;
    scroll-margin-top: 100px;
}

.section-title {
    text-align: center;
    margin-bottom: 2rem;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.section-title .divider {
    width: 60px;
    height: 4px;
    background-color: var(--accent);
    margin: 0 auto;
    border-radius: 2px;
}

/* --- À PROPOS --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-img {
    width: 100%;
    height: 400px;
    background-color: #ddd;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.about-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.about-img:hover img {
    transform: scale(1.05);
}

.about-text p {
    text-align: justify;
}

.about-text ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1.5rem;
    list-style: none;
}

.about-text ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent);
    font-weight: 800;
    font-size: 1.2rem;
}

/* --- SERVICES --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    border-top: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
}

.icon-box {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: var(--accent);
}

.service-card h3 {
    margin-bottom: 1rem;
    color: var(--primary);
}

/* --- PUBLICATIONS --- */
.pub-bg {
    background-color: var(--white);
    width: 100%;
    max-width: 100%;
}

.pub-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 6rem 5%;
    scroll-margin-top: 100px;
}

.pub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

@media (min-width: 992px) {
    .pub-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.pub-card {
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.pub-card:hover {
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

.pub-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.pub-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}



.pub-card:hover .pub-img {
    transform: scale(1.05);
}

.pub-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--white);
    z-index: 1;
}

.pub-date {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: block;
}

.pub-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary);
    font-size: 1.2rem;
}

.read-more {
    display: inline-block;
    margin-top: 1rem;
    font-weight: 600;
    color: var(--primary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
    align-self: flex-start;
}

/* Compact Arrow Navigation */
.pub-arrow-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.arrow-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--white);
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.arrow-btn:hover:not(.disabled) {
    background: var(--primary);
    color: var(--white);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.arrow-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    border-color: #cbd5e1;
    color: #94a3b8;
}

.arrow-btn svg {
    transition: transform 0.3s ease;
}

.arrow-btn.prev-arrow:hover:not(.disabled) svg {
    transform: translateX(-2px);
}

.arrow-btn.next-arrow:hover:not(.disabled) svg {
    transform: translateX(2px);
}

@media (max-width: 768px) {
    .section-title {
        padding-top: 60px;
        /* Make room for absolutely positioned arrows */
    }

    .pub-arrow-nav {
        top: 10px !important;
        left: 10px !important;
        right: auto !important;
    }
}

/* --- CONTACT --- */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    background-color: var(--primary);
    border-radius: 20px;
    overflow: hidden;
    color: var(--white);
    padding: 3rem;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

.info-item {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.contact-form {
    background-color: var(--white);
    padding: 2.5rem;
    border-radius: 10px;
    color: var(--text-body);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 5px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.submit-btn {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.submit-btn:hover {
    background-color: var(--accent);
}

/* --- BOUTON RETOUR EN HAUT --- */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999;
    background-color: var(--accent);
    color: var(--white);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#backToTop:hover {
    background-color: var(--primary);
    border: #ca8a04 solid 1px;
    transform: translateY(-5px);
}

#backToTop svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
}

/* --- FOOTER --- */
footer {
    background-color: #0b1120;
    color: #94a3b8;
    padding: 4rem 5% 1rem;
    text-align: center;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto 3rem;
    text-align: left;
}

@media (min-width: 992px) {
    .footer-content {
        grid-template-columns: 1.5fr 1fr 1.5fr;
    }
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 1.5rem;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a:hover {
    color: var(--accent);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transition: var(--transition);
}

.social-icon-link:hover {
    background: var(--accent);
    color: var(--white);
    transform: translateY(-3px);
}

.social-icon-link svg {
    width: 20px;
    height: 20px;
    fill: #94a3b8;
    transition: fill 0.3s;
}

.social-icon-link:hover svg {
    fill: var(--white);
}

.copyright {
    border-top: 1px solid #1e293b;
    padding-top: 1.5rem;
    font-size: 0.9rem;
}

.footer-col p svg {
    width: 16px;
    /* taille normale */
    height: 16px;
    fill: currentColor;
    vertical-align: middle;
    margin-right: 6px;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 70px;
        left: 0;
        width: 100%;
        background: var(--primary);
        flex-direction: column;
        padding: 2rem;
        text-align: center;
        box-shadow: 0 10px 10px rgba(0, 0, 0, 0.2);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-contact {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .about-grid,
    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-content p {
        font-size: 1.4rem;
    }
}

/* Admin Button */
.admin-btn-fixed {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--primary);
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.admin-btn-fixed:hover {
    transform: translateY(-3px);
    background-color: var(--accent);
}

/* --- PUBLICATION DETAIL PAGE (PREMIUM REDESIGN) --- */
.pub-detail-wrapper {
    background-color: #f8fafc;
    min-height: 100vh;
    padding: 120px 0 100px;
    /* Removed 5% horizontal padding from wrapper */
    display: flex;
    flex-direction: column;
    align-items: center;
}

.pub-detail-max-width {
    width: 90%;
    /* For mobile */
    max-width: 1000px;
    margin: 0 auto;
}

.pub-detail-header-simple {
    margin-bottom: 2rem;
}

.pub-detail-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}



.pub-detail-date-badge {
    color: #94a3b8;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.pub-detail-top-flex {
    display: flex;
    gap: 3rem;
    align-items: start;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .pub-detail-top-flex {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

.pub-detail-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.pub-detail-image-wrapper {
    width: 25%;
    min-width: 250px;
    height: 25vh;
    /* Limit height to 1/4 of the screen */
    margin: 0;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.pub-detail-main-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensure image covers the area without distortion */
    display: block;
}

.pub-detail-card {
    background-color: var(--white);
    border-radius: 1rem;
    padding: 3rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 3rem;
}

.pub-detail-card.pdf-content {
    padding: 0;
    border-radius: 0;
    box-shadow: none;
}

.pub-detail-card-content {
    position: relative;
    z-index: 1;
}

.pub-detail-excerpt {
    font-size: clamp(1.1rem, 3vw, 1.35rem);
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 2.5rem;
    line-height: 1.7;
    border-left: 4px solid var(--accent);
    padding-left: 1.5rem;
    font-style: italic;
    letter-spacing: -0.01em;
}

.pub-detail-body-text {
    color: var(--text-body);
    line-height: 1.8;
    font-size: 1.05rem;
}

.pub-detail-body-text>*+* {
    margin-top: 2rem;
}

.pub-detail-cta {
    margin-top: 4rem;
    background-color: var(--primary);
    border-radius: 2rem;
    padding: 3rem;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px -12px rgba(15, 23, 42, 0.3);
}

.pub-detail-cta-decor {
    position: absolute;
    inset: 0;
    opacity: 0.1;
    pointer-events: none;
}

.cta-circle {
    position: absolute;
    border-radius: 50%;
    border: 4px solid var(--white);
}

.cta-circle-1 {
    width: 160px;
    height: 160px;
    top: 40px;
    left: 40px;
}

.cta-circle-2 {
    width: 240px;
    height: 240px;
    bottom: 40px;
    right: 40px;
    border-width: 8px;
    opacity: 0.2;
}

.pub-detail-cta-title {
    font-size: clamp(1.3rem, 4vw, 2rem);
    font-weight: 800;
    margin-bottom: 1.5rem;
    letter-spacing: -0.01em;
}

.pub-detail-cta-text {
    color: #cbd5e1;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 2rem;
    max-width: 40rem;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.pub-detail-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--white);
    color: var(--primary);
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.pub-detail-cta-btn:hover {
    transform: scale(1.05);
    background-color: var(--accent);
    color: var(--white);
}

.pub-detail-back-link {
    color: #64748b;
    font-weight: 700;
    transition: color 0.3s ease;
    display: inline-block;
}

.pub-detail-back-link:hover {
    color: var(--accent);
    transform: translateX(-5px);
}

@media (max-width: 768px) {
    .pub-detail-card {
        padding: 3rem 1.5rem;
        border-radius: 2.5rem;
    }

    .pub-detail-cta {
        padding: 4rem 2rem;
        border-radius: 2.5rem;
    }

    .pub-detail-hero-frame {
        border-radius: 2.5rem;
    }

    .pub-detail-body-text {
        font-size: 1.1rem;
    }
}