/* Variables CSS avec nouvelles animations */
:root {
    --primary-color: #1a4b8c;
    --secondary-color: #ffc72c;
    --text-dark: #2c3e50;
    --text-light: #6c757d;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(135deg, #1a4b8c 0%, #2a6ec6 100%);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Animations keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px var(--secondary-color);
    }
    50% {
        box-shadow: 0 0 20px var(--secondary-color), 0 0 30px var(--secondary-color);
    }
}

/* Styles avec animations */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: rgba(255, 255, 255, 0.95);
    background-attachment: fixed;
    overflow-x: hidden;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

/* Croix en arrière-plan - VISIBLE EN BLEU */
body::after {
    content: '✟';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 800px;
    color: rgba(26, 75, 140, 0.08) !important;
    z-index: 0;
    pointer-events: none;
    font-weight: 300;
}

/* Pas d'effets de gradient radial */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 0;
    pointer-events: none;
}

/* Conteneur principal */
.main-container {
    position: relative;
    z-index: 1;
    max-width: 85%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Navbar */
nav {
    position: fixed !important;
    top: 0 !important;
    width: 100%;
    z-index: 1200;
}

/* Titre de la page avec animation */
.page-title {
    background: var(--gradient-primary);
    color: var(--white);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 9%;
    margin-bottom: 3%;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: slideDown 0.8s ease-out;
    overflow: hidden;
    z-index: 1;
}

.page-title::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 2s infinite;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 45%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
    animation: scaleIn 1s ease-out 0.5s both;
}

@keyframes shimmer {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* Section image avec animations */
#cathedrale-image {
    position: relative;
    height: 60vh;
    background: linear-gradient(rgba(26, 75, 140, 0.7), rgba(26, 75, 140, 0.7)), 
                url('asset/img/cathedrale-bg.jpg') center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
    border-radius: 15px;
    animation: fadeInUp 1.2s ease-out;
    z-index: 1;
}

.image-container h1 {
    color: var(--white);
    font-size: 3rem;
    text-align: center;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.5);
    animation: fadeInUp 1.5s ease-out 0.3s both;
}

.image-container strong {
    color: var(--secondary-color);
    display: block;
    margin-top: 0.5rem;
    animation: glow 3s infinite;
}

/* Sections avec animations différées */
.history-section {
    background: var(--white);
    border-radius: 15px;
    padding: 3rem;
    margin-bottom: 3rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
    animation: fadeInUp 0.8s ease-out forwards;
    z-index: 1;
}

.history-section:nth-child(odd) {
    animation: fadeInLeft 0.8s ease-out forwards;
}

.history-section:nth-child(even) {
    animation: fadeInRight 0.8s ease-out forwards;
}

.history-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 0;
    background: var(--gradient-primary);
    transition: height 0.6s ease;
}

.history-section:hover::before {
    height: 100%;
}

/* Titres avec animation */
.section-title h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 1rem;
    animation: scaleIn 0.8s ease-out 0.5s both;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--secondary-color);
    border-radius: 2px;
    animation: expandWidth 1s ease-out 1s forwards;
}

@keyframes expandWidth {
    to {
        width: 80px;
    }
}

/* Articles avec animations */
.history-article {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
    transition: var(--transition);
    opacity: 0;
    transform: translateX(-30px);
    animation: fadeInLeft 0.8s ease-out forwards;
    position: relative;
    z-index: 1;
}

.history-article:nth-child(even) {
    transform: translateX(30px);
    animation: fadeInRight 0.8s ease-out forwards;
}

.history-article:hover h3,
.history-article:hover p {
    color: var(--text-dark);
}

.history-article h3 {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.3s forwards;
}

.history-article h3::before {
    content: '📜';
    margin-right: 0.5rem;
    font-size: 1.2rem;
    animation: float 3s ease-in-out infinite;
}

.history-article p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 1rem;
    text-align: justify;
    color: var(--text-dark);
    opacity: 0;
    animation: fadeInUp 0.8s ease-out 0.6s forwards;
}

/* Séparateurs animés */
.separator, .sp2 {
    text-align: center;
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 1.2rem;
    margin: 3rem 0;
    position: relative;
    letter-spacing: 3px;
    opacity: 0;
    animation: scaleIn 0.8s ease-out forwards, glow 2s infinite 1s;
    z-index: 1;
}

/* Séparateur sp2 - position spécifique avant le carrousel */
.sp2 {
    margin: 2rem auto 5rem;
    max-width: 90%;
    padding: 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 2px;
}

.separator::before,
.separator::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    animation: expandLine 1s ease-out 0.5s forwards;
}

.separator::before {
    left: calc(50% - 150px);
}

.separator::after {
    right: calc(50% - 150px);
}

@keyframes expandLine {
    to {
        width: 100px;
    }
}

/* Animation d'entrée en scroll */
@media (prefers-reduced-motion: no-preference) {
    .history-section {
        animation-delay: var(--animation-delay, 0s);
    }
    
    .history-section:nth-child(2) { --animation-delay: 0.2s; }
    .history-section:nth-child(3) { --animation-delay: 0.4s; }
    .history-section:nth-child(4) { --animation-delay: 0.6s; }
}

/* Responsive avec animations maintenues */
@media (max-width: 1199px) {
    .history-section {
        max-width: 92%;
        padding: 2.5rem;
    }

    #cathedrale-image {
        max-width: 92%;
    }
}

@media (max-width: 991px) {
    .page-title {
        margin-top: 8rem;
        font-size: 2.2rem;
    }

    .history-section {
        max-width: 93%;
        padding: 2.2rem;
    }

    #cathedrale-image {
        max-width: 93%;
        height: 50vh;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .history-article h3 {
        font-size: 1.4rem;
    }

    .history-article p {
        font-size: 1.05rem;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.8rem;
        margin-top: 7rem;
        padding: 1.5rem 1rem;
        animation-duration: 1s;
    }

    .image-container h1 {
        font-size: 2rem;
        animation-delay: 0.5s;
    }

    .main-container {
        max-width: 95%;
        padding: 1rem;
    }

    .history-section {
        padding: 2rem 1.5rem;
        max-width: 95%;
        animation: fadeInUp 1s ease-out forwards;
    }

    #cathedrale-image {
        max-width: 95%;
        height: 45vh;
    }

    .section-title h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .history-article {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .history-article h3 {
        font-size: 1.3rem;
    }

    .history-article p {
        font-size: 1rem;
        line-height: 1.7;
    }

    .separator {
        font-size: 1.1rem;
        margin: 2.5rem 0;
    }
}

@media (max-width: 576px) {
    .page-title {
        margin-top: 6rem;
        font-size: 1.5rem;
        padding: 1.2rem 0.8rem;
    }

    .main-container {
        max-width: 98%;
        padding: 0.5rem;
    }

    .history-section {
        max-width: 98%;
        padding: 1.5rem 1rem;
    }

    #cathedrale-image {
        max-width: 98%;
        height: 40vh;
    }

    .image-container h1 {
        font-size: 1.6rem;
    }

    .section-title h2 {
        font-size: 1.6rem;
        margin-bottom: 1.2rem;
    }

    .history-article {
        padding: 1.2rem 1rem;
        margin-bottom: 1.5rem;
    }

    .history-article h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }

    .history-article h3::before {
        font-size: 1rem;
        margin-right: 0.3rem;
    }

    .history-article p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 0.8rem;
    }

    .separator {
        font-size: 1rem;
        margin: 2rem 0;
        letter-spacing: 2px;
    }

    .sp2 {
        margin: 1.5rem auto 4rem;
        padding: 0.4rem 0;
        max-width: 95%;
        font-size: 0.85rem;
    }
}

@media (max-width: 375px) {
    .page-title {
        margin-top: 5.5rem;
        font-size: 1.3rem;
        padding: 1rem 0.5rem;
    }

    .main-container {
        padding: 0.3rem;
    }

    .history-section {
        padding: 1.2rem 0.8rem;
    }

    #cathedrale-image {
        height: 35vh;
    }

    .image-container h1 {
        font-size: 1.4rem;
    }

    .section-title h2 {
        font-size: 1.4rem;
    }

    .history-article {
        padding: 1rem 0.8rem;
    }

    .history-article h3 {
        font-size: 1.1rem;
    }

    .history-article p {
        font-size: 0.9rem;
        text-align: left;
    }

    .separator {
        font-size: 0.95rem;
        margin: 1.5rem 0;
    }

    .sp2 {
        margin: 1rem auto 3.5rem;
        padding: 0.3rem 0;
        max-width: 98%;
        font-size: 0.8rem;
    }
}

/* Désactiver les animations pour ceux qui préfèrent */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
