/* Wonder page */

.wonder-page {
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
}

.wonder-content {
    width: 100%;
    max-width: 1180px;
}

/* Main page title from KirbyText: # About Wonder Lab */
.wonder-content h1 {
    width: 100%;
    max-width: none;
    margin: 0 0 20px;

    font-size: 56px;
    line-height: 1.02;
    font-weight: 700;
    letter-spacing: -0.045em;
}

/* Section titles: ## Lab Life, ## What We Make, etc. */
.wonder-content h2 {
    width: 100%;
    max-width: none;
    margin: 88px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #ddd;

    font-size: 34px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.035em;
}

/* Subsection titles */
.wonder-content h3 {
    width: 100%;
    max-width: none;
    margin: 48px 0 16px;

    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.wonder-content p {
    width: 100%;
    max-width: none;
    margin: 0 0 22px;

    font-size: 21px;
    line-height: 1.48;
    letter-spacing: -0.015em;
}

.wonder-content ul {
    width: 100%;
    max-width: none;
    margin: 0 0 36px;
    padding-left: 1.3em;
}

.wonder-content li {
    margin-bottom: 10px;

    font-size: 20px;
    line-height: 1.45;
    letter-spacing: -0.015em;
}

.wonder-content a {
    color: inherit;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.wonder-content a:hover {
    color: #666;
}

/* 첫 번째 h2는 h1 다음에 바로 오므로 위 여백을 조금 줄임 */
.wonder-content h1 + p + p + h2,
.wonder-content h1 + p + h2 {
    margin-top: 72px;
}

/* Research Areas */
.wonder-research-section {
    width: 100%;
    max-width: 1180px;
}

.wonder-research-section h2 {
    width: 100%;
    max-width: none;
    margin: 88px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #ddd;

    font-size: 34px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.wonder-research-intro {
    width: 100%;
    max-width: 1180px;
    margin: 0 0 36px;
}

.wonder-research-intro p {
    width: 100%;
    max-width: none;
    margin: 0;

    font-size: 21px;
    line-height: 1.48;
    letter-spacing: -0.015em;
}

.wonder-research-grid {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

/* Desktop: text area + image group */
.wonder-research-row {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
    column-gap: 22px;
    align-items: start;
}

.wonder-research-text h3 {
    margin: 0 0 10px;

    font-size: 24px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.wonder-research-text ul {
    max-width: none;
    margin: 0;
    padding-left: 0.8em;
}

.wonder-research-text li {
    margin-bottom: 5px;

    font-size: 20px;
    line-height: 1.45;
    letter-spacing: -0.015em;
}

/* Desktop: 3 images in one row */
.wonder-research-row-images {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    column-gap: 10px;
    row-gap: 0;
}

.wonder-research-image {
    margin: 0;
    padding: 0;

    aspect-ratio: 5 / 3.8;
    overflow: hidden;
}

.wonder-research-image img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;
}

/* Lab Life images */
.wonder-lab-life-section {
    width: 100%;
    max-width: 1180px;
}

.wonder-lab-life-text {
    width: 100%;
    max-width: 1180px;
    margin: 0 0 32px;
}

.wonder-lab-life-text p:last-child {
    margin-bottom: 0;
}

.wonder-lab-life-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;

    width: 100%;
    max-width: 1180px;
    margin-top: 32px;
}

.wonder-lab-life-image {
    margin: 0;
    padding: 0;

    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.wonder-lab-life-image img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;
}

/* What We Make images */
.wonder-what-we-make-section {
    width: 100%;
    max-width: 1180px;
}

/* What We Make title row with YouTube icon */
.wonder-what-we-make-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;

    width: 100%;
    max-width: none;
    margin: 88px 0 10px;
    padding-top: 16px;
    border-top: 1px solid #ddd;
}

.wonder-what-we-make-header h2 {
    width: auto;
    max-width: none;
    min-width: 0;

    margin: 0;
    padding-top: 0;
    border-top: 0;

    font-size: 34px;
    line-height: 1.12;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.wonder-youtube-link,
.wonder-content .wonder-youtube-link {
    position: relative;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;
    flex: 0 0 28px;

    border-radius: 15%;
    background-color: #02cafc;
    color: #fff;

    text-decoration: none;
    /*overflow: hidden;*/

    -webkit-tap-highlight-color: transparent;
}

.wonder-youtube-link svg,
.wonder-content .wonder-youtube-link svg {
    display: block;
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.wonder-youtube-link svg rect {
    fill: currentColor;
}

.wonder-youtube-link svg path {
    fill: #02cafc;
}

.wonder-youtube-link:visited,
.wonder-youtube-link:focus,
.wonder-content .wonder-youtube-link:visited,
.wonder-content .wonder-youtube-link:focus {
    background-color: #02cafc;
    color: #fff;
    outline: none;
}

.wonder-youtube-link:active,
.wonder-content .wonder-youtube-link:active {
    background-color: #e8e8e8;
    color: #fff;
}

@media (hover: hover) and (pointer: fine) {
    .wonder-youtube-link:hover,
    .wonder-content .wonder-youtube-link:hover {
        background-color: #e8e8e8;
        color: #fff;
    }

    .wonder-youtube-link::after {
        content: attr(data-tooltip);

        position: absolute;
        left: 50%;
        bottom: calc(100% + 8px);
        z-index: 20;

        padding: 5px 8px;
        border-radius: 4px;

        background-color: #111;
        color: #fff;

        font-size: 12px;
        line-height: 1;
        font-weight: 400;
        white-space: nowrap;

        opacity: 0;
        visibility: hidden;
        transform: translateX(-50%) translateY(3px);
        transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;

        pointer-events: none;
    }

    .wonder-youtube-link:hover::after,
    .wonder-youtube-link:focus-visible::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }
}

.wonder-what-we-make-text {
    width: 100%;
    max-width: 1180px;
    margin: 0 0 32px;
}

.wonder-what-we-make-text p:last-child {
    margin-bottom: 0;
}

.wonder-what-we-make-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;

    width: 100%;
    max-width: 1180px;
    margin-top: 32px;
}

.wonder-what-we-make-image {
    margin: 0;
    padding: 0;

    aspect-ratio: 4 / 3;
    overflow: hidden;
}

.wonder-what-we-make-image img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;
}

/* What We Make project links */
.wonder-what-we-make-link {
    display: block;
    width: 100%;
    height: 100%;

    color: inherit;
    text-decoration: none;
}

.wonder-content .wonder-what-we-make-link {
    text-decoration: none;
}

.wonder-what-we-make-link img {
    display: block;
    width: 100%;
    height: 100%;

    object-fit: cover;
    transition: opacity 0.2s ease;
}

.wonder-what-we-make-link:hover img {
    opacity: 0.85;
}

/* Joining Wonder Lab title icon */
.wonder-content h2.wonder-joining-title {
    display: flex;
    align-items: center;
}

.wonder-joining-title-icon {
    display: inline-block;
    width: 1.2em;
    height: 1.2em;
    object-fit: contain;
    flex: 0 0 auto;
    margin-left: auto;
}

/* Responsive */
@media screen and (max-width: 960px) {
    .wonder-page {
        max-width: none;
    }

    .wonder-content {
        max-width: none;
    }

    .wonder-content h1 {
        font-size: 46px;
        margin-bottom: 44px;
    }

    .wonder-content h2,
    .wonder-research-section h2 {
        font-size: 30px;
        margin-top: 72px;
    }

    .wonder-what-we-make-header {
        grid-template-columns: minmax(0, 1fr) auto;
        margin-top: 72px;
    }

    .wonder-what-we-make-header h2 {
        width: auto;
        margin: 0;
        padding-top: 0;
        border-top: 0;

        font-size: 30px;
    }

    .wonder-youtube-link,
    .wonder-content .wonder-youtube-link {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .wonder-youtube-link svg,
    .wonder-content .wonder-youtube-link svg {
        width: 19px;
        height: 19px;
    }

    .wonder-content h3 {
        font-size: 23px;
    }

    .wonder-content p,
    .wonder-research-intro p {
        font-size: 20px;
    }

    .wonder-content li,
    .wonder-research-text li {
        font-size: 19px;
    }

    .wonder-research-intro {
        margin-bottom: 44px;
    }

    .wonder-research-row {
        display: block;
    }

    .wonder-research-row-images {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        column-gap: 0;
        row-gap: 0;

        margin-top: 24px;
    }

    .wonder-research-text h3 {
        font-size: 23px;
    }

    .wonder-lab-life-grid,
    .wonder-what-we-make-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

@media screen and (max-width: 640px) {
    .wonder-content h1 {
        font-size: 36px;
        line-height: 1.08;
        margin-bottom: 10px;
    }

    .wonder-content h2,
    .wonder-research-section h2 {
        font-size: 28px;
        margin-top: 64px;
    }

    .wonder-what-we-make-header {
        grid-template-columns: minmax(0, 1fr) auto;
        margin-top: 64px;
    }

    .wonder-what-we-make-header h2 {
        width: auto;
        margin: 0;
        padding-top: 0;
        border-top: 0;

        font-size: 28px;
    }

    .wonder-youtube-link,
    .wonder-content .wonder-youtube-link {
        width: 24px;
        height: 24px;
        flex-basis: 24px;
    }

    .wonder-youtube-link svg,
    .wonder-content .wonder-youtube-link svg {
        width: 19px;
        height: 19px;
    }

    .wonder-content h3,
    .wonder-research-text h3 {
        font-size: 22px;
    }

    .wonder-content p,
    .wonder-research-intro p {
        font-size: 18px;
        line-height: 1.5;
    }

    .wonder-content li,
    .wonder-research-text li {
        font-size: 18px;
    }

    .wonder-research-grid {
        gap: 44px;
    }

    .wonder-research-row-images {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .wonder-lab-life-grid,
    .wonder-what-we-make-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media screen and (max-width: 960px) and (orientation: landscape) {
    .wonder-content h1 {
        font-size: 36px;
        line-height: 1.08;
        margin-bottom: 8px;
    }

    .wonder-content > p:first-of-type {
        margin-top: 0;
    }
}