/**
 * Block: bloc_timelines_01
 * Description: Timeline section with intro and repeating timeline cards
 * Version: 3.0.0
 * Phase: DYNAMIC (ACF-powered, aligned with maquette /histoire)
 *
 * Figma Source: https://www.figma.com/design/I6wtq12NH17BottRCSlGff?node-id=9048:22893
 *
 * REC19-SURF-TIMELINE-001 — single-rail timeline layout.
 * The render already exposes an intro column on the left and timeline cards on
 * the right. Recipe captures for Surf, Trolili and Restaurant all expect a
 * single vertical rail with cards stacked on the right, not an alternating
 * left/right zig-zag layout.
 *
 * Color Palette:
 * - Text dark: #232425
 * - Brand green: #16A34A
 * - Light green (line/border): #BBF7D0
 * - Dark green (year text): #2e4713
 * - Background section: #F3F4F6
 * - Background cards: #FFFFFF
 */

/* ========================================
   BASE SECTION
   ======================================== */
.bloc-timelines-01 {
    width: 100%;
    box-sizing: border-box;
    padding: 80px var(--section-padding-x, 64px);
    background-color: #F3F4F6;
    font-family: inherit;
}

.bloc-timelines-01__container {
    max-width: var(--section-max-width, 1312px);
    margin: 0 auto;
    padding: 64px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 48px;
    align-items: flex-start;
    background-color: #FFFFFF;
    border-radius: 24px;
}

/* ========================================
   INTRO (LEFT COLUMN)
   Maquette: intro on the left, timeline on the right (side by side)
   ======================================== */
.bloc-timelines-01__intro {
    flex: 0 0 320px;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    position: sticky;
    top: 80px;
}

.bloc-timelines-01__intro--wrapped {
    padding: var(--bloc-timelines-01-intro-wrapper-padding, 24px);
}

.bloc-timelines-01__intro--fullwidth {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
    width: auto;
    position: sticky;
    top: 80px;
}

.bloc-timelines-01__timeline-wrapper {
    flex: 1 1 0;
    min-width: 0;
}

.bloc-timelines-01__tagline {
    font-size: 16px;
    font-weight: 700;
    color: inherit;
    line-height: 1.5;
    margin: 0 0 16px;
}

.bloc-timelines-01__headline {
    font-size: 48px;
    font-weight: 500;
    line-height: 1;
    color: inherit;
    margin: 0 0 16px;
}

.bloc-timelines-01__description {
    font-size: 18px;
    font-weight: 400;
    line-height: 1.5;
    color: inherit;
    margin: 0 0 32px;
}

/* CTA Button — pill style */
.bloc-timelines-01 .btn {
    border-radius: 9999px;
}

.bloc-timelines-01--square-button .btn,
.bloc-timelines-01--square-button .bloc-timelines-01__button {
    border-radius: 0;
}

.bloc-timelines-01__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    height: 48px;
    font-size: 20px;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 9999px;
}

.bloc-timelines-01__button--outline {
    color: inherit;
    background-color: transparent;
    border: 1px solid currentColor;
}

.bloc-timelines-01__button--outline:hover {
    opacity: 0.8;
}

/* ========================================
   TIMELINE LAYOUT — single rail + cards on the right
   ======================================== */
.bloc-timelines-01__timeline-wrapper {
    display: block;
    width: 100%;
    position: relative;
}

/* ========================================
   TIMELINE VISUAL COLUMN (from PHP)
   Hidden in CSS — dot/connector alignment is driven from each card so the
   vertical rail always tracks the actual card stack, regardless of content
   height.
   ======================================== */
.bloc-timelines-01__timeline-line {
    display: none;
}

.bloc-timelines-01__intro--fullwidth + .bloc-timelines-01__timeline-wrapper {
    flex: 1 1 0;
    min-width: 0;
}

.bloc-timelines-01__timeline-rows {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.bloc-timelines-01__timeline-rows::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 36px;
    width: 1px;
    background-color: #BBF7D0;
    z-index: 0;
}

.bloc-timelines-01__timeline-row {
    position: relative;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 32px;
    align-items: start;
}

.bloc-timelines-01__timeline-marker {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: 0;
    z-index: 1;
}

.bloc-timelines-01__timeline-marker--hidden {
    visibility: hidden;
}

.bloc-timelines-01__timeline-dot {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: inherit;
    background-color: transparent;
}

.bloc-timelines-01__timeline-dot--number {
    min-width: 52px;
    min-height: 24px;
    padding: 4px 8px 0;
}

.bloc-timelines-01__timeline-dot--dot {
    width: 20px;
    height: 20px;
    min-height: 20px;
    border-radius: 50%;
    background-color: #16A34A;
    border: 4px solid #BBF7D0;
    margin-top: 32px;
    box-shadow: 0 0 0 3px #FFFFFF;
}

.bloc-timelines-01__timeline-dot span {
    display: inline-block;
    line-height: 1;
}

.bloc-timelines-01__timeline-row > .bloc-timelines-01__card {
    min-width: 0;
}

/* ========================================
   CARDS — stacked on the right of a single vertical rail
   ======================================== */
.bloc-timelines-01__cards {
    display: flex;
    flex-direction: column;
    gap: 32px;
    padding-left: 72px;
    min-width: 0;
    position: relative;
}

/* Vertical rail */
.bloc-timelines-01__cards::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 24px;
    width: 2px;
    background-color: #BBF7D0;
    transform: none;
    z-index: 0;
}

.bloc-timelines-01__intro--fullwidth + .bloc-timelines-01__timeline-wrapper .bloc-timelines-01__cards {
    padding-left: 0;
}

.bloc-timelines-01__intro--fullwidth + .bloc-timelines-01__timeline-wrapper .bloc-timelines-01__cards::before {
    content: none;
}

/* ========================================
   TIMELINE CARD — alternating placement
   ======================================== */
.bloc-timelines-01__card {
    display: flex;
    flex-direction: row;
    border: 1px solid #E6E7E7;
    border-radius: 16px;
    background-color: #FFFFFF;
    overflow: hidden;
    position: relative;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

/* Media position variants — override card flex-direction */
.bloc-timelines-01__card--media-bottom {
    flex-direction: column;
}

.bloc-timelines-01__card--media-top {
    flex-direction: column-reverse;
}

.bloc-timelines-01__card--media-bottom .bloc-timelines-01__card-image,
.bloc-timelines-01__card--media-top .bloc-timelines-01__card-image {
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
}

/* Number element wrapper — inherits border/bg from ACF el_number fields */
.bloc-timelines-01__card-number-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.bloc-timelines-01__card-number-wrap--wrapped {
    padding: var(--bloc-timelines-01-number-wrapper-padding, 8px 12px);
}

/* Dot on the timeline for each card — drawn as ::before on the card */
.bloc-timelines-01__card::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #16A34A;
    border: 4px solid #BBF7D0;
    z-index: 2;
    top: 32px;
    left: -58px;
    box-shadow: 0 0 0 3px #FFFFFF;
}

/* Connector line from card to center dot */
.bloc-timelines-01__card::after {
    content: '';
    position: absolute;
    top: 40px;
    height: 3px;
    left: -38px;
    width: 38px;
    background-color: #BBF7D0;
    z-index: 1;
}

.bloc-timelines-01__intro--fullwidth + .bloc-timelines-01__timeline-wrapper .bloc-timelines-01__card::before,
.bloc-timelines-01__intro--fullwidth + .bloc-timelines-01__timeline-wrapper .bloc-timelines-01__card::after {
    content: none;
    display: none;
}

.bloc-timelines-01__card--indicator-hidden::before,
.bloc-timelines-01__card--indicator-hidden::after {
    content: none;
    display: none;
}

/* ========================================
   CARD CONTENT — text side
   ======================================== */
.bloc-timelines-01__card-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 32px 28px;
    justify-content: center;
}

/* Card Year / Step number — large and prominent (#106 fix) */
.bloc-timelines-01__card-year {
    font-family: var(--usine-font-family-heading, 'Bricolage Grotesque', sans-serif);
    font-size: 32px;
    font-weight: 700;
    color: inherit;
    line-height: 1;
    letter-spacing: -0.01em;
    margin: 0 0 4px;
}

/* Card Icon */
.bloc-timelines-01__card-icon {
    width: 48px;
    height: 48px;
    color: inherit;
}

.bloc-timelines-01__card-icon svg {
    width: 100%;
    height: 100%;
}

/* Card Number (legacy, used if step number is rendered separately) */
.bloc-timelines-01__card-number {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    color: inherit;
    margin: 0;
}

/* Card Title */
.bloc-timelines-01__card-title {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.3;
    color: inherit;
    margin: 0;
}

/* Card Description */
.bloc-timelines-01__card-description {
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    color: inherit;
    margin: 0;
}

/* Card Details */
.bloc-timelines-01__card-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.bloc-timelines-01__detail-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.bloc-timelines-01__detail-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: inherit;
}

.bloc-timelines-01__detail-text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: inherit;
}

/* CTA Link */
.bloc-timelines-01__cta-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #3C0314;
    text-decoration: none;
    width: fit-content;
    transition: color 0.2s ease;
}

.bloc-timelines-01__cta-link:hover {
    color: #2a020e;
}

.bloc-timelines-01__cta-arrow {
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
}

.bloc-timelines-01__cta-link:hover .bloc-timelines-01__cta-arrow {
    transform: translateX(4px);
}

/* ========================================
   CARD IMAGE — side of card, controlled size
   Aspect ratio 4:3 to avoid tall vertical images (#99 fix)
   ======================================== */
.bloc-timelines-01__card-image {
    width: 280px;
    min-width: 280px;
    flex-shrink: 0;
    aspect-ratio: 4 / 3;
    background-color: #E6E7E7;
    overflow: hidden;
}

.bloc-timelines-01__card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ========================================
   DARK SINGLE-RAIL VARIANT
   Same geometry as the default single-rail layout, but with transparent cards
   and light indicators for dark backgrounds.
   ======================================== */
.bloc-timelines-01--single-rail .bloc-timelines-01__container {
    background-color: transparent;
    border-radius: 0;
    padding: 0;
}

.bloc-timelines-01--single-rail .bloc-timelines-01__cards::before {
    width: 2px;
    background-color: rgba(255, 255, 255, 0.25);
}

.bloc-timelines-01--single-rail .bloc-timelines-01__timeline-rows::before {
    background-color: rgba(255, 255, 255, 0.25);
}

.bloc-timelines-01--single-rail .bloc-timelines-01__card {
    background-color: transparent;
    border-color: transparent;
    border-radius: 0;
    box-shadow: none;
}

.bloc-timelines-01--single-rail .bloc-timelines-01__timeline-dot--dot {
    background-color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px #512a37;
}

.bloc-timelines-01--single-rail .bloc-timelines-01__card::before {
    background-color: #ffffff;
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 0 0 3px #512a37;
}

.bloc-timelines-01--single-rail .bloc-timelines-01__card::after {
    background-color: rgba(255, 255, 255, 0.25);
}

.bloc-timelines-01--single-rail .bloc-timelines-01__card-year {
    color: #ffffff;
}

.bloc-timelines-01--single-rail .bloc-timelines-01__card-title {
    color: #ffffff;
}

.bloc-timelines-01--single-rail .bloc-timelines-01__card-description {
    color: rgba(255, 255, 255, 0.75);
}

.bloc-timelines-01--single-rail .bloc-timelines-01__detail-text {
    color: rgba(255, 255, 255, 0.75);
}

.bloc-timelines-01--single-rail .bloc-timelines-01__cta-link {
    color: #ffffff;
}

/* Single-rail cards are full-width, image can be wider */
.bloc-timelines-01--single-rail .bloc-timelines-01__card-image {
    width: 280px;
    min-width: 280px;
}

.bloc-timelines-01__image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.bloc-timelines-01__image-placeholder svg {
    width: 80px;
    height: 80px;
    opacity: 0.5;
}

/* ========================================
   RESPONSIVE - Large Tablet (< 1200px)
   Keep 2-column layout but reduce spacing
   ======================================== */
@media (max-width: 1200px) {
    .bloc-timelines-01 {
        padding: 64px var(--section-padding-x, 64px);
    }

    .bloc-timelines-01__container {
        padding: 48px;
    }

    .bloc-timelines-01__headline {
        font-size: 40px;
    }

    .bloc-timelines-01__card-image {
        width: 200px;
        min-width: 200px;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__card-image {
        width: 220px;
        min-width: 220px;
    }
}

/* ========================================
   RESPONSIVE - Tablet (< 992px)
   Switch to single-column vertical layout
   ======================================== */
@media (max-width: 992px) {
    /* Revert side-by-side to stacked on tablet */
    .bloc-timelines-01__container {
        flex-direction: column;
    }

    .bloc-timelines-01__intro {
        flex: none;
        max-width: 100%;
        position: static;
    }

    .bloc-timelines-01 {
        padding: 48px var(--section-padding-x, 64px);
    }

    .bloc-timelines-01__container {
        padding: 32px;
        gap: 32px;
        border-radius: 16px;
    }

    .bloc-timelines-01__intro {
        width: 100%;
    }

    /* Single column: remove grid, stack vertically with left rail */
    .bloc-timelines-01__cards {
        display: flex;
        flex-direction: column;
        gap: 24px;
        padding-left: 40px;
    }

    /* Left-aligned vertical line for mobile */
    .bloc-timelines-01__cards::before {
        left: 12px;
        transform: none;
    }

    /* All cards take full width */
    .bloc-timelines-01__card {
        flex-direction: column;
        margin-bottom: 0;
    }

    /* Dots on the left for all cards */
    .bloc-timelines-01__card::before {
        left: -34px;
        right: auto;
    }

    .bloc-timelines-01__card::after {
        left: -14px;
        right: auto;
        width: 14px;
    }

    .bloc-timelines-01__card:nth-child(odd)::before {
        right: auto;
        left: -34px;
    }

    .bloc-timelines-01__card:nth-child(odd)::after {
        right: auto;
        left: -14px;
        width: 14px;
    }

    .bloc-timelines-01__card:nth-child(even)::before {
        left: -34px;
    }

    .bloc-timelines-01__card:nth-child(even)::after {
        left: -14px;
        width: 14px;
    }

    .bloc-timelines-01__card:nth-child(even) {
        flex-direction: column;
    }

    /* Image fills card width on tablet */
    .bloc-timelines-01__card-image {
        width: 100%;
        min-width: 0;
        aspect-ratio: 16 / 9;
    }

    /* Single-rail tablet: cards stack, image full-width */
    .bloc-timelines-01--single-rail .bloc-timelines-01__card,
    .bloc-timelines-01--single-rail .bloc-timelines-01__card:nth-child(odd),
    .bloc-timelines-01--single-rail .bloc-timelines-01__card:nth-child(even) {
        flex-direction: column;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__card-image {
        width: 100%;
        min-width: 0;
        aspect-ratio: 16 / 9;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__cards {
        padding-left: 40px;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__cards::before {
        left: 12px;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__card::before,
    .bloc-timelines-01--single-rail .bloc-timelines-01__card:nth-child(odd)::before,
    .bloc-timelines-01--single-rail .bloc-timelines-01__card:nth-child(even)::before {
        left: -34px;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__card::after,
    .bloc-timelines-01--single-rail .bloc-timelines-01__card:nth-child(odd)::after,
    .bloc-timelines-01--single-rail .bloc-timelines-01__card:nth-child(even)::after {
        left: -14px;
        width: 14px;
    }

    .bloc-timelines-01__timeline-rows {
        gap: 24px;
    }

    .bloc-timelines-01__timeline-rows::before {
        left: 10px;
    }

    .bloc-timelines-01__timeline-row {
        grid-template-columns: 32px minmax(0, 1fr);
        gap: 16px;
    }

    .bloc-timelines-01__timeline-marker {
        justify-content: flex-start;
    }

    .bloc-timelines-01__timeline-dot--number {
        min-width: 0;
        padding: 0;
    }

    .bloc-timelines-01__timeline-dot--dot {
        margin-top: 24px;
        box-shadow: 0 0 0 2px #FFFFFF;
    }

    .bloc-timelines-01--single-rail .bloc-timelines-01__timeline-dot--dot {
        box-shadow: 0 0 0 2px #512a37;
    }
}

/* ========================================
   RESPONSIVE - Mobile (< 768px)
   ======================================== */
@media (max-width: 768px) {
    .bloc-timelines-01 {
        padding: 32px 16px;
    }

    .bloc-timelines-01__container {
        padding: 24px;
        border-radius: 12px;
    }

    .bloc-timelines-01__headline {
        font-size: 32px;
    }

    .bloc-timelines-01__description {
        font-size: 16px;
        margin-bottom: 24px;
    }

    .bloc-timelines-01__card {
        border-radius: 12px;
    }

    .bloc-timelines-01__card-content {
        gap: 10px;
        padding: 20px;
    }

    .bloc-timelines-01__card-year {
        font-size: 24px;
    }

    .bloc-timelines-01__cards {
        padding-left: 32px;
    }
}

/* ========================================
   RESPONSIVE - Small Mobile (< 480px)
   ======================================== */
@media (max-width: 480px) {
    .bloc-timelines-01__headline {
        font-size: 28px;
    }

    .bloc-timelines-01__card-year {
        font-size: 20px;
    }

    .bloc-timelines-01__cards {
        padding-left: 28px;
    }

    .bloc-timelines-01__card::before {
        width: 16px;
        height: 16px;
        border-width: 3px;
        left: -28px;
    }

    .bloc-timelines-01__card:nth-child(odd)::before {
        left: -28px;
    }

    .bloc-timelines-01__card:nth-child(even)::before {
        left: -28px;
    }
}
