/* user/themes/regard-sur/css/agence-history.css */

/* Variables CSS Regard Sur */
:root {
    --primary-bg: #1c1c1c;
    --accent-orange: #EE7900;
    --text-white: #f9f9f9;
    --orange-light: rgba(238, 121, 0, 0.1);
    --orange-border: rgba(238, 121, 0, 0.3);
}

/* Section Notre Histoire */
.history-section {
    margin: 80px 0;
    position: relative;
}

/* Header de section unifié */
.history-section .section-header {
    text-align: center;
    margin-bottom: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.history-section .section-title {
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 1.5rem;
    position: relative;
}

.history-section .section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--accent-orange), transparent);
    border-radius: 2px;
}

.history-section .section-description {
    margin-top: 1.5rem;
}

.history-section .section-description p {
    color: rgba(249, 249, 249, 0.8);
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0;
}

/* État aperçu avec toggle */
.timeline-preview {
    position: relative;
    margin-bottom: 60px;
}

/* Masque de fondu au-dessus du bouton toggle */
.timeline-preview::after {
    content: '';
    position: absolute;
    bottom: -80px; /* Couvre la zone du bouton */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 600px;
    height: 120px;
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(28, 28, 28, 0.3) 30%,
        rgba(28, 28, 28, 0.6) 60%,
        rgba(28, 28, 28, 0.8) 100%
    );
    pointer-events: none;
    z-index: 8;
    transition: opacity 0.4s ease;
}

/* Masque disparaît après déploiement */
.timeline-preview.expanded::after {
    opacity: 0;
}

.timeline-preview .timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* Item demi (tronqué) */
.timeline-item-half {
    position: relative;
}

.timeline-content-truncated {
    position: relative;
    overflow: hidden;
	isolation: isolate;
}

.timeline-content-truncated .timeline-description {
    max-height: 3em;
    overflow: hidden;
}

/* Gradient mask noir sur l'item 2 tronqué */
.gradient-mask {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 300px; /* Couvre l'item */
    background: linear-gradient(to bottom, 
        transparent 0%,
        rgba(28, 28, 28, 0) 0%,
        rgba(28, 28, 28, 0.5) 20%,
        rgba(28, 28, 28, 0.85) 40%,
        rgba(28, 28, 28, 0.95) 60%,
        rgba(28, 28, 28, 1) 100%
    );
    pointer-events: none;
    z-index: 15; /* Au-dessus du contenu, sous le bouton (z-index: 10 devient 20 pour le bouton) */
    border-radius: 0 0 20px 20px;
}

.timeline-item-half .timeline-content {
    overflow: hidden; /* Empêche tout débordement visuel */
}

.timeline-item-half.deployed .gradient-mask {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

.timeline-item-half.deployed .timeline-content-truncated {
    overflow: visible !important;
}

.timeline-item-half.deployed .timeline-description {
    max-height: none !important;
}

/* Bouton toggle centré en bas */
.timeline-toggle-btn {
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: auto; 
    min-width: 200px; 
    height: 60px;
    padding: 0 30px; 
    background: var(--orange-light);
    border: 2px solid var(--accent-orange);
    border-radius: 30px; 
    color: var(--accent-orange);
    font-size: 1rem; 
    font-weight: 600; 
    cursor: pointer;
    transition: all 0.4s ease;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px; 
    animation: togglePulse 2s infinite ease-in-out;
    backdrop-filter: blur(5px);
    white-space: nowrap; 
}

.timeline-toggle-btn .btn-text {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
    transition: transform 0.3s ease;
}

.timeline-toggle-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.timeline-toggle-btn:hover {
    background: var(--accent-orange);
    color: white;
    transform: translateX(-50%) translateY(-5px);
    box-shadow: 0 10px 25px rgba(238, 121, 0, 0.4);
}

.timeline-toggle-btn:hover .btn-text {
    transform: translateX(-2px);
}

.timeline-toggle-btn:hover i {
    transform: translateY(3px);
}

.timeline-toggle-btn:active {
    transform: translateX(-50%) translateY(-2px);
}


/* État caché du bouton après clic */
.timeline-toggle-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) scale(0.8);
}

/* Timeline restante (cachée au départ) */
.timeline-remaining {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
    margin-top: 40px;
}

.timeline-remaining .timeline-line {
    top: -500px; /* Remonte pour se connecter à la ligne du preview */
}

.timeline-remaining.active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.timeline-remaining .timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

@keyframes zoomPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Timeline Container - Style vertical */
.timeline-container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
}

/* Ligne centrale progressive */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--accent-orange) 20%, 
        var(--accent-orange) 80%, 
        transparent 100%
    );
    transform: translateX(-50%);
    border-radius: 2px;
	/* z-index: 5; */ /* Au-dessus du fade-overlay */
}

/* Timeline Item */
.timeline-item {
    position: relative;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) .timeline-content {
    margin-left: auto;
    margin-right: calc(50% + 3rem);
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: calc(50% + 3rem);
    margin-right: auto;
    text-align: left;
}

/* Point central avec icône */
.timeline-point {
    position: absolute;
    left: 50%;
    top: 2rem;
    width: 24px;
    height: 24px;
    background: var(--accent-orange);
    border: 4px solid var(--primary-bg);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 15;
    transition: all 0.3s ease;
}

.timeline-icon {
    position: absolute;
    left: 50%;
    top: 1.8rem;
    width: 32px;
    height: 32px;
    background: var(--accent-orange);
    border: 3px solid var(--primary-bg);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 14px;
    box-shadow: 0 0 0 4px var(--orange-border);
}

.timeline-item.visible .timeline-icon {
    animation: iconPulse 2s infinite ease-in-out;
}

@keyframes iconPulse {
    0% { box-shadow: 0 0 0 4px var(--orange-border); }
    50% { box-shadow: 0 0 0 12px rgba(238, 121, 0, 0.2); }
    100% { box-shadow: 0 0 0 4px var(--orange-border); }
}

/* Contenu des cards */
.timeline-content {
    background: rgba(249, 249, 249, 0.05);
    /* border: 1px solid var(--orange-border); */
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    position: relative;
    max-width: 400px;
}

.timeline-content:hover {
    border-color: var(--accent-orange);
    box-shadow: 0 25px 50px rgba(238, 121, 0, 0.15);
    transform: translateY(-8px);
    background: rgba(249, 249, 249, 0.08);
}

/* Flèches pointant vers le centre */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 2.2rem;
    width: 0;
    height: 0;
    border: 15px solid transparent;
}

.timeline-bg-icon {
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-size: 10rem;
    color: var(--accent-orange);
    opacity: 0.07;
    pointer-events: none;
    z-index: 0;
    line-height: 1;
    transition: opacity 0.4s ease;
    user-select: none;
}

/* Icône à droite pour les blocs côté droit (odd) */
.timeline-item:nth-child(odd) .timeline-bg-icon {
    bottom: 8px;
    left: 12px;
    right: auto;
}

/* Icône à gauche pour les blocs côté gauche (even) */
.timeline-item:nth-child(even) .timeline-bg-icon {
    bottom: 8px;
    left: 12px;
    left: auto;
}

.timeline-item:nth-child(odd) .timeline-content::before {
    right: -30px;
    border-left-color: var(--orange-border);
}

.timeline-item:nth-child(even) .timeline-content::before {
    left: -30px;
    border-right-color: var(--orange-border);
}

.timeline-year {
    color: var(--accent-orange);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.timeline-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-white);
    line-height: 1.3;
}

.timeline-description {
    opacity: 0.9;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.timeline-item:nth-child(odd) .timeline-tags {
    justify-content: flex-end;
}

.timeline-tag {
    background: var(--orange-light);
    color: var(--accent-orange);
    padding: 6px 12px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid var(--orange-border);
    transition: all 0.3s ease;
}

.timeline-tag:hover {
    background: var(--accent-orange);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .history-section .section-title {
        font-size: 2.2rem;
    }

    .history-section .section-description p {
        font-size: 1rem;
    }

    .timeline-miniature {
        padding: 30px 20px;
        margin-bottom: 30px;
    }

    .mini-timeline-vertical {
        height: 100px;
    }

    .timeline-line {
        left: 2.5rem;
    }

    .timeline-point,
    .timeline-icon {
        left: 2.5rem;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 3rem;
        margin-right: 1rem;
        text-align: left;
        max-width: none;
    }

    .timeline-item:nth-child(odd) .timeline-bg-icon,
    .timeline-item:nth-child(even) .timeline-bg-icon {
        right: 12px;
        left: auto;
    }

    .timeline-content::before {
        display: none;
    }

    .timeline-item:nth-child(odd) .timeline-tags {
        justify-content: flex-start;
    }
	
	.timeline-toggle-btn {
        min-width: 180px;
        padding: 0 20px;
        font-size: 0.9rem;
    }
    
    .timeline-toggle-btn .btn-text {
        font-size: 0.9rem;
    }
    
    .timeline-toggle-btn i {
        font-size: 1rem;
    }
}

/* Accessibilité */
@media (prefers-reduced-motion: reduce) {
    .timeline-miniature,
    .timeline-item,
    .timeline-content {
        transition: none;
    }

    .mini-point,
    .timeline-icon {
        animation: none;
    }

    .zoom-icon {
        animation: none;
    }
}

/* Mode sombre amélioré */
@media (prefers-color-scheme: dark) {
    .timeline-content {
        background: rgba(249, 249, 249, 0.03);
    }
    
    .timeline-content:hover {
        background: rgba(249, 249, 249, 0.06);
    }
}