/* Lab Page: Interactive Accordion Layout */

/* Reusing Base Styles from About Page for consistency */
body.lab-gaf-body {
    background-color: #ffffff;
    color: #000000;
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* --- Layout: 3-Column Grid (From About Page) --- */
.minimal-grid-container {
    display: grid;
    grid-template-columns: 200px 1fr 200px;
    /* Left | Center | Right */
    min-height: 100vh;
    padding: 40px 40px;
    box-sizing: border-box;
    gap: 40px;
    align-items: start;
}

.col-left,
.col-right {
    position: sticky;
    top: 40px;
    z-index: 20;
}

.col-right {
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: right;
}

.minimal-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    font-weight: 700;
    text-decoration: none;
    color: #000000;
    letter-spacing: -0.5px;
}

.minimal-nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.minimal-nav-link {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    text-decoration: none;
    color: #B0B0B0;
    letter-spacing: 0.5px;
    transition: color 0.2s ease;
}

.minimal-nav-link:hover,
.minimal-nav-link.active {
    color: #000000;
}

.minimal-copyright {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
}

.col-center {
    width: 100%;
}

/* --- Page Header --- */
.gaf-page-title-row {
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    justify-content: flex-start;
    padding-bottom: 20px;
    border-bottom: 2px solid #000;
    margin-bottom: 0px;
    margin-top: 0;
}

.gaf-page-title {
    text-align: left;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    font-weight: 400;
    text-transform: uppercase;
    margin-bottom: 5px;
    /* Add space for desc */
}

.gaf-page-desc {
    font-family: 'Space Grotesk', sans-serif;
    /* Use Korean-friendly font */
    font-size: 14px;
    color: #666;
    font-weight: 400;
    margin-top: 0;
    line-height: 1.4;
}

.gaf-page-title span {
    display: block;
    font-weight: 700;
}

/* --- Interactive Accordion List --- */
.lab-archive-list {
    display: flex;
    flex-direction: column;
}

/* List Item Container */
.lab-item {
    border-bottom: 1px solid #000;
    overflow: hidden;
    transition: all 0.7s cubic-bezier(0.25, 1, 0.5, 1);
    /* Slower, smoother easeOut */
    cursor: pointer;
    background: transparent;
}

/* 
    State: Collapsed (Default) 
    Height should be enough for the single line text (approx 80-90px)
*/
.lab-item {
    height: 90px;
    padding: 25px 0;
    box-sizing: border-box;
}

/* 
    State: Active / Hover 
    Height expands to show full content
*/
.lab-item.active {
    height: 500px;
    /* Adjust based on content */
    background: #ffffff;
    /* Optional: Add a slight separation styling if desired */
}


/* Internal Grid Layout */
.lab-item-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* Split View */
    gap: 40px;
    height: 100%;
}

/* Left Side (Text) */
.lab-item-left {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    /* When collapsed, we need to ensure alignment */
}

/* Right Side (Image Container) */
.lab-item-right {
    position: relative;
    height: 100%;
    opacity: 0;
    /* Hidden by default */
    transform: translateX(20px);
    transition: all 0.7s ease;
    /* Match container speed */
}

/* Active State: Show Right Side */
.lab-item.active .lab-item-right {
    opacity: 1;
    transform: translateX(0);
}

/* Meta Data (Tags/Date) */
.lab-meta-top {
    /* Always visible, but layout changes? */
}

/* Tags & Date */
.lab-tags {
    margin-bottom: 20px;
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: opacity 0.5s ease;
}

.lab-item.active .lab-tags {
    opacity: 1;
    height: auto;
    /* Auto height is fine for small text */
    margin-bottom: 20px;
}

.lab-tag {
    display: inline-block;
    background: #f0f0f0;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 500;
    margin-right: 5px;
    border-radius: 2px;
}

.lab-date {
    float: right;
    font-size: 12px;
    font-weight: 500;
}

/* Issue Title (No.XX) */
.lab-issue-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    /* Collapsed Size */
    font-weight: 500;
    /* Medium weight default */
    margin: 0;
    transition: all 0.7s ease;
    white-space: nowrap;
    color: #888;
    /* Inactive: Muted Gray for both parts */
}

.lab-issue-red {
    color: #888;
    /* Inactive: Muted Gray */
    transition: color 0.5s ease;
}

/* Active State: Big Title */
.lab-item.active .lab-issue-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: #999;
    /* Prefix 'LAB' stays subtle gray */
}

.lab-item.active .lab-issue-red {
    color: #000000;
    /* Active number becomes Bold Black */
    /* Optional: Add italic for style */
    font-style: italic;
}

/* Collapsed Title */
.lab-collapsed-title {
    position: absolute;
    right: 0;
    top: 5px;
    /* Align with No.XX */
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 1;
    transition: opacity 0.3s;
    text-align: right;
    width: 60%;
}

.lab-item.active .lab-collapsed-title {
    opacity: 0;
    /* Hide when expanded */
    pointer-events: none;
}

/* Bottom Description Area */
.lab-desc-bottom {
    margin-top: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.7s ease;
}

.lab-item.active .lab-desc-bottom {
    opacity: 1;
    transform: translateY(0);
}

.lab-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
    line-height: 1.3;
}

.lab-read-time {
    font-size: 12px;
    color: #555;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Images: Fixed Height to prevent Zoom Glitch */
.lab-img {
    width: 100%;
    height: 500px !important;
    /* Fixed height matching expanded container */
    object-fit: cover;
    display: block;
    /* 
       By fixing height, we prevent object-fit from recalculating 
       as the container grows from 90->500px.
       The container (li) will mask the overflow.
    */
}

.lab-arrow-btn {
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 50px;
    height: 50px;
    background: #fff;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s;
}

.lab-arrow-btn:hover {
    transform: scale(1.05);
}


/* Responsive */
@media (max-width: 1024px) {
    .minimal-grid-container {
        grid-template-columns: 140px 1fr 140px;
        gap: 20px;
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .minimal-grid-container {
        display: block;
        padding: 20px;
    }

    .col-left,
    .col-right {
        position: static;
        height: auto;
        margin-bottom: 40px;
    }

    .col-right {
        text-align: left;
        margin-top: 60px;
    }

    .lab-item-content {
        grid-template-columns: 1fr;
        /* Stack on mobile */
    }

    .lab-item.active {
        height: auto;
        /* Allow auto growth on mobile */
        min-height: 500px;
    }

    .lab-item-right {
        height: 300px;
        /* Fixed image height on mobile */
        margin-top: 20px;
    }
}

/* --- Masonry Image Gallery --- */
.lab-image-gallery {
    column-count: 3;
    column-gap: 20px;
    margin-bottom: 60px;
}

.lab-image-gallery img {
    width: 100%;
    margin-bottom: 20px;
    display: block;
    break-inside: avoid;
    object-fit: cover;
}

/* Responsive Columns */
@media (max-width: 1024px) {
    .lab-image-gallery {
        column-count: 2;
    }
}

@media (max-width: 768px) {
    .lab-image-gallery {
        column-count: 1;
    }
}