/* =========================================================
   Subportal
   ========================================================= */

.subportal_grid {
    font-family: 'Jeju Gothic', sans-serif;
    width: min(1440px, 95vw);
    margin-block: 4px;

    display: grid;

    grid-template-columns:
        2.2fr
        repeat(10, 1fr)
        2.2fr;

    grid-template-rows:
        repeat(4, 100px);

    gap: var(--gap);
}


/* 카드 배치 */

.life-story {
    grid-column: 2 / span 5;
    grid-row: 1 / span 3;
}

.travel {
    grid-column: 7 / span 5;
    grid-row: 2 / span 3;
}


/* void 배치 */

.vl1 {
    grid-column: 1;
    grid-row: 1 / span 2;
}

.vl2 {
    grid-column: 1;
    grid-row: 3 / span 2;
}

.vr1 {
    grid-column: 12;
    grid-row: 1 / span 2;
}

.vr2 {
    grid-column: 12;
    grid-row: 3 / span 2;
}

.v01 {
    grid-column: 7 / span 2;
    grid-row: 1;
}

.v02 {
    grid-column: 9 / span 3;
    grid-row: 1;
}

.v03 {
    grid-column: 2;
    grid-row: 4;
}

.v04 {
    grid-column: 3 / span 4;
    grid-row: 4;
}


/* hover */

.life-story:hover {
    background: var(--blue);
    color: white;
}

.travel:hover {
    background: var(--yellow);
}


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


.life-story-display {
    margin-top: 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
   ========================================================= */

.photo-group {
    position: absolute;

    left: 0;
    width: 100%;

    box-sizing: border-box;

    z-index: 3;

    pointer-events: none;
}



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

.photo-trigger {
    position: absolute;
    top: 0;

    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;
}

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

    flex-direction: row;
}

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

    flex-direction: row-reverse;
}


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

.photo-branch {
    position: absolute;

    top: .85rem;

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

    background: #000;

    pointer-events: none;

    z-index: 0;
}

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

.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-title {
    display: block;

    max-width: 220px;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

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

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

/* =========================================================
   Photo Viewer
   ========================================================= */

.photo-content {
    position: relative;
    z-index: 2;

    width: auto;
    max-width: calc(100% - 2rem);

    margin-left: auto;
    margin-right: auto;
    margin-top: 2rem;

    height: 0;
    overflow: hidden;

    box-sizing: border-box;

    background: #fff;

    border: 0;

    pointer-events: auto;

    transition:
        height .5s ease;
}

.photo-group.is-open {
    padding-bottom: 3rem;
}

.photo-group.is-open
.photo-content {
    border: 3px solid #000;
}

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

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

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

.photo-inner {
    padding: 1.5rem;
}


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

.photo-viewer {
    width: 100%;

    overflow: hidden;

    padding-bottom: 1.5rem;

    border-bottom: 3px solid #000;
}

.photo-image-container {
    width: 100%;
}

.photo-image {
    display: block;

    width: auto;
    max-width: 100%;
    height: auto;

    margin: 0 auto;

    box-shadow:
        3px 3px 10px rgba(0, 0, 0, .15);
}


/* ---------------------------------------------------------
   Photo navigation
   --------------------------------------------------------- */

.photo-navigation {
    display: flex;

    justify-content: center;
    align-items: center;

    gap: 1rem;

    margin-top: .5rem;
}

.photo-navigation button {
    border: 0;
    background: transparent;

    padding: .2rem .5rem;

    font-size: 1.5rem;
    line-height: 1;

    cursor: pointer;
}

.photo-navigation button:disabled {
    opacity: .25;
    cursor: default;
}

.photo-counter {
    min-width: 3em;

    text-align: center;

    font-size: 1rem;
    color: #000;
}


/* ---------------------------------------------------------
   Photo meta
   --------------------------------------------------------- */

.photo-meta {
    display: flex;

    justify-content: flex-start;
    align-items: center;

    gap: 1rem;

    font-size: 1rem;
    color: #000;
}

.photo-meta-icon {
    margin-right: .25rem;
}

.photo-meta-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    margin-bottom: .5rem;
}

.photo-close {
    border: 0;
    background: none;

    padding: 0;

    font-size: 1.5rem;
    line-height: 1;

    color: #000;

    cursor: pointer;
}

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


/* ---------------------------------------------------------
   Photo description
   --------------------------------------------------------- */

.photo-description {
    margin-top: .75rem;
    margin-bottom: 0;

    padding: .75rem 1rem;

    background: #fafafa;

    border: 1px solid #e6e6e6;
    border-radius: 4px;

    font-size: .85rem;
    line-height: 1.5;
}

.photo-description-title {
    margin-bottom: .3rem;

    font-size: 1.17rem;
    font-weight: 700;
}

.photo-description-text {
    font-size: 1rem;
}


/* =========================================================
   Photo Comments
   ========================================================= */

.photo-comments .comment-list-title {
    margin-top: 1rem;
}

.photo-comments .comment-editor-title {
    margin-top: 1.5rem;
}

.comment-write,
.comment-footer {
    margin: 0;
}


/* =========================================================
   Mobile
   ========================================================= */

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

    .subportal_grid {
        grid-template-columns:
            repeat(10, 1fr);
    }


    /* 카드 배치 */

    .life-story {
        grid-column: 1 / span 5;
        grid-row: 1 / span 3;
    }

    .travel {
        grid-column: 6 / span 5;
        grid-row: 2 / span 3;
    }


    /* void 배치 */

    .vl1,
    .vl2,
    .vr1,
    .vr2 {
        display: none;
    }

    .v01 {
        grid-column: 6 / span 3;
        grid-row: 1;
    }

    .v02 {
        grid-column: 9 / span 2;
        grid-row: 1;
    }

    .v03 {
        grid-column: 1 / span 2;
        grid-row: 4;
    }

    .v04 {
        grid-column: 3 / span 3;
        grid-row: 4;
    }


    /* 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;
    }

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

        flex-direction: row;
    }

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

        flex-direction: row-reverse;
    }

    .photo-trigger {
        padding: 0;
    }

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

    }
}