/* ============================================================
   KOUBA BTP — Page Nos réalisations
   ============================================================ */

/* Timeline verticale */
.projects-timeline {
    position: relative;
    padding: var(--sp-7) 0;
}
.projects-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, transparent, var(--border-strong) 10%, var(--border-strong) 90%, transparent);
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: var(--sp-5);
    align-items: center;
    margin-bottom: var(--sp-8);
}
.timeline-item:nth-child(even) .timeline-content { grid-column: 3; }
.timeline-item:nth-child(even) .timeline-visual  { grid-column: 1; grid-row: 1; }

.timeline-content {
    grid-column: 1;
    padding: var(--sp-6);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    transition: all var(--t-normal);
}
.timeline-content:hover {
    transform: translateY(-4px);
    border-color: var(--kouba-orange);
    box-shadow: var(--shadow-lg);
}

.timeline-year {
    display: inline-block;
    padding: 6px 14px;
    background: rgba(245,124,31,0.15);
    color: var(--kouba-orange);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: var(--sp-4);
}
.timeline-content h3 {
    font-size: var(--fs-lg);
    margin-bottom: var(--sp-3);
    line-height: 1.3;
}
.timeline-content p {
    font-size: var(--fs-sm);
    line-height: 1.7;
    margin-bottom: var(--sp-4);
}
.timeline-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    padding-top: var(--sp-4);
    border-top: 1px solid var(--border-color);
    margin-bottom: var(--sp-4);
    font-size: var(--fs-xs);
    color: var(--text-muted);
}
.timeline-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}
.timeline-meta-item svg { color: var(--kouba-orange); flex-shrink: 0; }

.timeline-actions {
    display: flex;
    gap: var(--sp-3);
    flex-wrap: wrap;
}

/* Pastille centrale */
.timeline-dot {
    grid-column: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.timeline-dot::before {
    content: '';
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--kouba-orange);
    border: 4px solid var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(245,124,31,0.2);
    z-index: 1;
}
.timeline-item.is-ongoing .timeline-dot::before {
    background: var(--kouba-green);
    box-shadow: 0 0 0 4px rgba(60,180,74,0.25);
    animation: dot-pulse 2s infinite;
}
@keyframes dot-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(60,180,74,0.25); }
    50%      { box-shadow: 0 0 0 12px rgba(60,180,74,0.05); }
}

/* Image projet */
.timeline-visual {
    grid-column: 3;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow-md);
}
.timeline-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow);
}
.timeline-visual:hover img { transform: scale(1.06); }

.status-badge {
    position: absolute;
    top: var(--sp-3);
    left: var(--sp-3);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    backdrop-filter: blur(8px);
}
.status-badge.ongoing {
    background: rgba(60,180,74,0.9);
    color: #FFFFFF;
}
.status-badge.delivered {
    background: rgba(17,17,17,0.75);
    color: #FFFFFF;
}

/* ---------- MODALE GALERIE ---------- */
.gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--sp-5);
    opacity: 0;
    transition: opacity var(--t-normal);
}
.gallery-modal.is-open {
    display: flex;
    opacity: 1;
}

.gallery-inner {
    position: relative;
    width: 100%;
    max-width: 1100px;
    height: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--sp-3) 0;
    color: #FFFFFF;
}
.gallery-title {
    font-family: var(--font-heading);
    font-size: var(--fs-md);
    font-weight: 600;
}
.gallery-counter {
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.6);
}
.gallery-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all var(--t-fast);
}
.gallery-close:hover { background: var(--kouba-orange); }

.gallery-main {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: var(--radius-md);
    background: #000;
}
.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform var(--t-normal);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    backdrop-filter: blur(8px);
    transition: all var(--t-fast);
    z-index: 2;
}
.gallery-nav:hover { background: var(--kouba-orange); }
.gallery-prev { left: var(--sp-3); }
.gallery-next { right: var(--sp-3); }

.gallery-caption {
    padding: var(--sp-3) 0;
    text-align: center;
    font-size: var(--fs-sm);
    color: rgba(255,255,255,0.75);
}

.gallery-thumbs {
    display: flex;
    gap: var(--sp-2);
    padding: var(--sp-3) 0;
    overflow-x: auto;
    scrollbar-width: thin;
}
.gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    opacity: 0.5;
    transition: all var(--t-fast);
}
.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-thumb.is-active {
    border-color: var(--kouba-orange);
    opacity: 1;
}
.gallery-thumb:hover { opacity: 0.85; }

/* ---------- RESPONSIVE PROJECTS ---------- */
@media (max-width: 900px) {
    .projects-timeline::before { left: 20px; }

    .timeline-item,
    .timeline-item:nth-child(even) {
        grid-template-columns: 40px 1fr;
        gap: var(--sp-4);
    }
    .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        grid-column: 2;
        grid-row: auto;
    }
    .timeline-visual,
    .timeline-item:nth-child(even) .timeline-visual {
        grid-column: 2;
        grid-row: auto;
    }
    .timeline-dot {
        grid-column: 1;
        grid-row: 1 / 3;
        align-self: flex-start;
        padding-top: var(--sp-6);
    }
    .timeline-dot::before { width: 16px; height: 16px; }
}

@media (max-width: 640px) {
    .gallery-main { border-radius: 0; }
    .gallery-nav { width: 42px; height: 42px; }
    .timeline-actions { flex-direction: column; align-items: stretch; }
    .timeline-actions .btn { width: 100%; }
}