
/* =========================================================
   Life Story
   ========================================================= */


.life-story-display {
    margin-block: 100px;
}

/* 중앙 timeline */

.life-story-timeline {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.life-story-timeline::before {
    content: "";

    position: absolute;

    top: 0;
    bottom: 0;
    left: 50%;

    width: 3px;

    background: #000;

    transform: translateX(-50%);

    z-index: 2;
}


/* year guide */

.life-story-year-guide {
    position: absolute;

    left: 0;
    width: 100%;

    height: 1px;

    background: #d0d0d0;

    pointer-events: none;

    z-index: 1;
}


.life-story-year-guide-label {
    position: absolute;

    right: 10%;

    transform:
        translate(-50%, -50%);

    padding: 0 .4rem;

    background: #fff;

    color: #999;

    font-size: .75rem;
    font-weight: 400;

    line-height: 1;

    white-space: nowrap;

    pointer-events: none;
}

/* =========================================================
   Special Milestone
   ========================================================= */

.life-story-special-milestone {
    position: absolute;

    left: 50%;

    display: flex;
    flex-direction: column;
    align-items: center;

    width: max-content;

    text-align: center;

    transform: translateX(-50%);

    z-index: 4;

    pointer-events: none;
}


/* Title */

.life-story-special-milestone-title {
    font-size: 1.17rem;
    font-weight: 700;
    line-height: 1.2;

    white-space: nowrap;
}


/* Date */

.life-story-special-milestone-date {
    margin-top: .15rem;

    color: var(--blue);

    font-size: .8rem;
    line-height: 1;

    white-space: nowrap;
}


/* ◎ */

.life-story-special-milestone-symbol {
    width: 14px;
    height: 14px;

    box-sizing: border-box;

    border: 3px solid #000;
    border-radius: 50%;

    background: #fff;
}


/* ---------------------------------------------------------
   Birth
   title
   date
   ◎
   --------------------------------------------------------- */

.life-story-special-milestone.special-above {
    transform:
        translate(-50%, -100%);
}

.life-story-special-milestone.special-above
.life-story-special-milestone-symbol {
    margin-top: .4rem;
}


/* ---------------------------------------------------------
   Current
   ◎
   date
   title
   --------------------------------------------------------- */

.life-story-special-milestone.special-below {
    flex-direction: column-reverse;

    transform:
        translate(-50%, 0);
}

.life-story-special-milestone.special-below
.life-story-special-milestone-symbol {
    margin-bottom: .4rem;
}

/* ---------------------------------------------------------
   Milestone
   --------------------------------------------------------- */

.life-story-milestone {
    position: absolute;

    left: 0;
    width: 50%;

    box-sizing: border-box;

    display: flex;
    justify-content: flex-end;
    align-items: center;

    z-index: 3;

    transform: translateY(-0.5rem);
}

.life-story-milestone::after {
    content: "";

    position: absolute;

    right: 0;
    top: 0.5rem;

    width: var(--branch-length, 15px);
    height: 3px;

    background: #000;

    transform: translateY(-50%);
}

.life-story-milestone-title {
    position: relative;

    margin-right:
        calc(var(--branch-length, 10px) + 5px);

    text-align: right;
    white-space: pre-line;

    font-size: 1.17rem;
    font-weight: 700;
    line-height: 1;
}

.life-story-milestone-date {
    display: block;

    margin-top: .15rem;

    font-family: inherit;
    font-size: .8rem;

    color: var(--blue);
}

/* =========================================================
   Photo Group
   ========================================================= */

.life-story-timeline .photo-group {
    position: absolute;

    left: 0;

    z-index: 3;

    pointer-events: none;
}

/* ---------------------------------------------------------
   Photo trigger
   --------------------------------------------------------- */

.photo-trigger {
    position: absolute;

    top: 0;

    transform:
        translateY(-50%);

    z-index: 1;

    display: flex;

    align-items: center;

    gap: .5rem;

    width: fit-content;

    box-sizing: border-box;

    padding: 0;

    border: 0;

    background: transparent;

    font: inherit;

    cursor: pointer;

    pointer-events: none;
}

.photo-trigger,
.photo-content {
    pointer-events: auto;
}


.life-story-timeline
.photo-group.photo-right
.photo-trigger {
    left: calc(
        50% + var(--branch-length)
    );

    flex-direction: row;
}


.life-story-timeline
.photo-group.photo-left
.photo-trigger {
    right: calc(
        50% + var(--branch-length)
    );

    flex-direction: row-reverse;
}


/* ---------------------------------------------------------
   Photo branch
   --------------------------------------------------------- */

.photo-branch {
    position: absolute;

    top: 0;

    width: var(--branch-length, 30px);
    height: 2px;

    background: #000;

    pointer-events: none;

    z-index: 0;
}


.life-story-timeline
.photo-group.photo-right
.photo-branch {
    left: 50%;
}


.life-story-timeline
.photo-group.photo-left
.photo-branch {
    right: 50%;
}


/* ---------------------------------------------------------
   Photo trigger contents
   --------------------------------------------------------- */

.photo-symbol {
    display: block;

    width: .8rem;
    height: .8rem;

    border-radius: 50%;

    background: #000;

    transition:
        transform .2s ease;
}


.photo-symbol-multiple {
    position: relative;

    background: transparent;
}


.photo-symbol-multiple::before,
.photo-symbol-multiple::after {
    content: "";

    position: absolute;

    width: .8rem;
    height: .8rem;

    border: 2px solid #000;

    background: #fff;

    box-sizing: border-box;

    border-radius: 50%;
}


.photo-symbol-multiple::before {
    left: -3px;
}


.photo-symbol-multiple::after {
    left: 3px;

    background: #000;
}


.photo-trigger:hover
.photo-symbol {
    transform: scale(1.2);
}


.photo-trigger:hover
.photo-title {
    color: var(--red);
}


.photo-title {
    display: block;

    max-width: 300px;

    overflow: hidden;

    white-space: nowrap;

    text-overflow: ellipsis;
}


/* ---------------------------------------------------------
   Photo Group open state
   --------------------------------------------------------- */

.life-story-timeline
.photo-group.is-open
.photo-symbol,
.life-story-timeline
.photo-group.is-open
.photo-title {
    color: var(--red);
}


.life-story-timeline
.photo-group.is-open
.photo-symbol,
.life-story-timeline
.photo-group.is-open
.photo-branch {
    background: var(--red);
}


.life-story-timeline
.photo-group.is-open
.photo-title {
    font-weight: 700;
}


@media screen and (max-width: 767px) {

    /* Timeline */

    .life-story-timeline::before {
        left: 50%;
    }

    /* year guide */

    .life-story-year-guide-label {
        font-size: .65rem;
    }

    /* Milestone */

    .life-story-milestone-title {
        font-size: 1rem;
        margin-right: 35px;
        overflow-wrap: break-word;
        word-break: keep-all;
    }

    .life-story-milestone::after {
        width: 30px;
    }

    /* Photo trigger */

    .photo-branch {
        width: 15px;
    }

    .life-story-timeline
    .photo-group.photo-right
    .photo-trigger {
        left: calc(
            50% + 15px
        );

        flex-direction: row;
    }

    .life-story-timeline
    .photo-group.photo-left
    .photo-trigger {
        right: calc(
            50% + 15px
        );

        flex-direction: row-reverse;
    }

    .photo-trigger {
        padding: 0;
    }

    .photo-title {
        max-width: 160px;
    }

}

