/* Timeline CSS */

@layer lukuro.modules {

.brxe-lukuro-timeline-wrapper {
    position: relative;
    padding: 40px 0;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    counter-reset: timeline-counter;
}

/* Central Line */
.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: color-mix(in srgb, var(--at-primary-d-2, #076e82) 20%, transparent);
    transform: translateX(-50%);
    border-radius: 4px;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to bottom, black calc(100% - 150px), transparent 100%);
    mask-image: linear-gradient(to bottom, black calc(100% - 150px), transparent 100%);
}

/* Progress Line */
.timeline-line-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background-color: var(--at-primary);
    transition: height 0.1s linear;
    z-index: 1;
}

/* Item Wrapper */
.brxe-lukuro-timeline-item {
    position: relative;
    width: 50%;
    padding-bottom: var(--at-space--m, 20px);
    box-sizing: border-box;
    counter-increment: timeline-counter;
    transition: opacity 0.3s ease;
}

/* =========================================
   Layout: Center (Alternating)
   ========================================= */

/* Use specific selector for Center or Default */
.brxe-lukuro-timeline-wrapper.timeline-layout-center .brxe-lukuro-timeline-item:nth-child(even),
.brxe-lukuro-timeline-wrapper:not([class*="timeline-layout-"]) .brxe-lukuro-timeline-item:nth-child(even) {
    left: 0;
    padding-right: 40px;
    text-align: right;
}

.brxe-lukuro-timeline-wrapper.timeline-layout-center .brxe-lukuro-timeline-item:nth-child(odd),
.brxe-lukuro-timeline-wrapper:not([class*="timeline-layout-"]) .brxe-lukuro-timeline-item:nth-child(odd) {
    left: 50%;
    padding-left: 40px;
    text-align: left;
}

/* Dot Position - Center */
.brxe-lukuro-timeline-wrapper.timeline-layout-center .brxe-lukuro-timeline-item:nth-child(even) .timeline-item-dot,
.brxe-lukuro-timeline-wrapper:not([class*="timeline-layout-"]) .brxe-lukuro-timeline-item:nth-child(even) .timeline-item-dot {
    right: -20px;
    left: auto;
}

.brxe-lukuro-timeline-wrapper.timeline-layout-center .brxe-lukuro-timeline-item:nth-child(odd) .timeline-item-dot,
.brxe-lukuro-timeline-wrapper:not([class*="timeline-layout-"]) .brxe-lukuro-timeline-item:nth-child(odd) .timeline-item-dot {
    left: -20px;
    right: auto;
}

/* Arrow - Center */
.brxe-lukuro-timeline-wrapper.timeline-layout-center .brxe-lukuro-timeline-item:nth-child(even) .timeline-item-content::before,
.brxe-lukuro-timeline-wrapper:not([class*="timeline-layout-"]) .brxe-lukuro-timeline-item:nth-child(even) .timeline-item-content::before {
    right: -10px;
    left: auto;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent var(--lukuro-color-surface, #fff);
}

.brxe-lukuro-timeline-wrapper.timeline-layout-center .brxe-lukuro-timeline-item:nth-child(odd) .timeline-item-content::before,
.brxe-lukuro-timeline-wrapper:not([class*="timeline-layout-"]) .brxe-lukuro-timeline-item:nth-child(odd) .timeline-item-content::before {
    left: -10px;
    right: auto;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--lukuro-color-surface, #fff) transparent transparent;
}


/* =========================================
   Layout: Left
   ========================================= */

.brxe-lukuro-timeline-wrapper.timeline-layout-left .timeline-line {
    left: 20px;
    transform: none;
}

/* Important to override Center styles if specificity is tricky */
.brxe-lukuro-timeline-wrapper.timeline-layout-left .brxe-lukuro-timeline-item {
    width: 100%;
    left: 0;
    padding-left: 60px; 
    padding-right: 0;
    text-align: left;
}

.brxe-lukuro-timeline-wrapper.timeline-layout-left .brxe-lukuro-timeline-item .timeline-item-dot {
    left: 0;
    right: auto;
}

.brxe-lukuro-timeline-wrapper.timeline-layout-left .brxe-lukuro-timeline-item .timeline-item-content::before {
    left: -10px;
    right: auto;
    border-width: 10px 10px 10px 0;
    border-color: transparent var(--lukuro-color-surface, #fff) transparent transparent;
}


/* =========================================
   Components
   ========================================= */

/* Dot */
.timeline-item-dot {
    position: absolute; /* Crucial */
    top: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--lukuro-color-surface, #fff);
    border: 2px solid var(--lukuro-color-border-control, #767676);
    color: var(--lukuro-color-text-muted, #666);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    z-index: 2;
    /* Pierscien wycina kropke z osi czasu, wiec jedzie kolorem TLA STRONY, nie powierzchni. */
    box-shadow: 0 0 0 5px var(--lukuro-color-page, #fff);
    transition: all 0.3s ease;
}

.brxe-lukuro-timeline-item.active .timeline-item-dot {
    background-color: var(--at-primary);
    border-color: var(--at-primary);
    color: var(--lukuro-color-on-primary, #fff);
    transform: scale(1.1);
}

.timeline-item-dot .number:empty::before {
    content: counter(timeline-counter);
}

/* Content */
.timeline-item-content {
    background-color: var(--lukuro-color-surface, #fff);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--at-shadow--m, 0 10px 30px rgba(0,0,0,0.05));
    text-align: left;
    position: relative;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: var(--at-grid--1-2, 1fr 1fr);
    align-items: center;
    gap: 30px;
}

.brxe-lukuro-timeline-item.active .timeline-item-content {
    box-shadow: var(--at-shadow--m, 0 15px 40px rgba(0,0,0,0.1));
    transform: translateY(-2px);
}

.timeline-item-content::before {
    content: '';
    position: absolute;
    top: 15px;
    width: 0;
    height: 0;
    border-style: solid;
}

/* Image */
.timeline-image {
    border-radius: var(--at-radius-full, 50%);
    overflow: hidden;
    aspect-ratio: 1;
    height: 200px;
    width: 200px;
    margin-right: auto;
}

.timeline-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Typography */
.timeline-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--lukuro-color-text, #222);
}

.timeline-description {
    font-size: 0.95rem;
    color: var(--lukuro-color-text-muted, #666);
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 767px) {
    .brxe-lukuro-timeline-wrapper .timeline-line {
        left: 20px;
        transform: none;
    }

    .brxe-lukuro-timeline-wrapper .brxe-lukuro-timeline-item {
        width: 100%;
        padding-left: 60px;
        padding-right: 0;
    }

    /* Reset Arrow to Left for all */
    .brxe-lukuro-timeline-wrapper .brxe-lukuro-timeline-item .timeline-item-content::before {
        border-width: 10px 10px 10px 0;
        border-color: transparent var(--lukuro-color-surface, #fff) transparent transparent;
    }

    /* Reset pozycji na mobile bez `!important` ([FW-CSS-001] W2): potrojona klasa wrappera daje
       specyficznosc rowna regulom desktopowym (`:not([class*="timeline-layout-"]) ... :nth-child()`
       0,4,0 / 0,5,0 / 0,5,1), a ten blok stoi po nich - wygrywa kolejnoscia w tej samej warstwie.
       Podniesione sa WYLACZNIE deklaracje, ktore mialy `!important`; padding i obramowanie strzalki
       wyzej przegrywaja z desktopem tak samo jak przed W2 (znany blad, BACKLOG FW-CSS-001).
       Nie skracaj selektorow. */
    .brxe-lukuro-timeline-wrapper.brxe-lukuro-timeline-wrapper.brxe-lukuro-timeline-wrapper .brxe-lukuro-timeline-item {
        left: 0;
        text-align: left;
    }

    /* Reset Dot to Left for all */
    .brxe-lukuro-timeline-wrapper.brxe-lukuro-timeline-wrapper.brxe-lukuro-timeline-wrapper .brxe-lukuro-timeline-item .timeline-item-dot {
        left: 0;
        right: auto;
    }

    .brxe-lukuro-timeline-wrapper.brxe-lukuro-timeline-wrapper.brxe-lukuro-timeline-wrapper .brxe-lukuro-timeline-item .timeline-item-content::before {
        left: -10px;
        right: auto;
    }

    .timeline-item-content {
        grid-template-columns: 1fr;
    }
}

} /* @layer lukuro.modules */
