/* ========================================
   RESET
======================================== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}


/* ========================================
   BASE
======================================== */

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 11px;
    line-height: 1.25;
    color: #000;
    background: #fff;
}


/* ========================================
   HEADER
======================================== */

.site-header {
    width: 100%;
    padding: 1rem 1rem 1.7rem 1rem;

    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.site-name {
    white-space: nowrap;
}

.site-nav {
    display: flex;
    gap: 1.7rem;
}

.site-header a {
    color: #000;
    text-decoration: none;
}

.site-header a:hover {
    text-decoration: underline;
}


/* ========================================
   PAGE
======================================== */

.page {
    width: 100%;
    padding: 0 1rem 1rem 1rem;
}


/* ========================================
   GALLERY
======================================== */

.gallery {
    display: grid;

    grid-template-columns: repeat(6, minmax(0, 1fr));

    column-gap: 1.7rem;
    row-gap: 2rem;

    width: 100%;
}


/* ========================================
   PROJECT
======================================== */

.project {
    display: block;
    min-width: 0;

    color: inherit;
    text-decoration: none;

    cursor: pointer;
}


/* ========================================
   PROJECT IMAGE
======================================== */

.project-image {
    width: 100%;
}

.project-image img {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 0;
}


/* ========================================
   CAPTIONS
======================================== */

.caption {
    margin-top: 0.45rem;

    font-size: 11px;
    line-height: 1.2;
}

.number {
    color: rgba(0, 0, 0, 0.4);
}

.english {
    color: rgba(0, 0, 0, 0.48);
}


/* ========================================
   PROJECT OVERLAY
======================================== */

.project-overlay {
    position: fixed;

    inset: 0;

    width: 100%;
    height: 100vh;

    z-index: 1000;

    /*
       White translucent layer over the
       entire home page
    */

    background-color: rgba(255, 255, 255, 0.70);

    /*
       Hidden initially
    */

    opacity: 0;
    visibility: hidden;

    /*
       Soft fade instead of sliding curtain
    */

    transition:
        opacity 0.35s ease,
        visibility 0.35s ease;

    overflow-y: auto;
}


/* ========================================
   OPEN OVERLAY
======================================== */

.project-overlay.open {
    opacity: 1;
    visibility: visible;
}


/* ========================================
   OVERLAY CONTENT
======================================== */

.overlay-content {
    width: 50%;
    min-height: 100vh;

    margin-left: auto;

    padding: 1rem;

    background-color: rgba(255, 255, 255, 0.95);

    /*
       Content fades in slightly after
       the background
    */

    opacity: 0;

    transition:
        opacity 0.35s ease 0.05s;
}

.project-overlay.open .overlay-content {
    opacity: 1;
}


/* ========================================
   OVERLAY HEADER
======================================== */

.overlay-header {
    display: flex;

    justify-content: space-between;
    align-items: flex-start;

    width: 100%;

    padding-bottom: 1.7rem;

    gap: 1rem;
}


/* ========================================
   CLOSE BUTTONS
======================================== */

.close-button {
    border: 0;

    padding: 0;
    margin: 0;

    background: none;

    color: #000;

    font-family: inherit;
    font-size: inherit;
    line-height: inherit;

    cursor: pointer;

    white-space: nowrap;
}

.close-button:hover {
    text-decoration: underline;
}


/* ========================================
   OVERLAY IMAGES
======================================== */

.overlay-images {
    display: flex;

    flex-direction: column;

    gap: 1rem;

    width: 100%;
}

.overlay-images img {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 0;
}


/* ========================================
   PROJECT INFORMATION
======================================== */

.project-information {
    display: grid;

    grid-template-columns: 1fr 1fr;

    column-gap: 1rem;

    margin-top: 3rem;

    margin-bottom: 8rem;
}

.project-details {
    text-align: left;
}

.project-description {
    text-align: left;
}

.project-description p {
    margin: 0 0 1rem 0;
}

.project-description .english {
    color: rgba(0, 0, 0, 0.48);
}


/* ========================================
   OVERLAY FOOTER
======================================== */

.overlay-footer {
    width: 100%;

    padding-bottom: 1rem;
}


/* ========================================
   TABLET / SMALL LAPTOP
======================================== */

@media (max-width: 800px) {

    .site-header {
        padding: 1rem 1rem 1rem 1rem;
    }

    .site-nav {
        gap: 1rem;
    }

    .page {
        padding: 0 1rem 1rem 1rem;
    }

    .gallery {
        grid-template-columns: repeat(3, minmax(0, 1fr));

        column-gap: 1rem;
        row-gap: 1.5rem;
    }


    /* Overlay */

    .overlay-content {
        width: 85%;
    }


    /* Project information */

    .project-information {
        grid-template-columns: 1fr;

        row-gap: 2rem;

        margin-top: 2rem;
    }
}


/* ========================================
   MOBILE
======================================== */

@media (max-width: 500px) {

    .site-header {
        align-items: flex-start;
    }

    .site-nav {
        flex-direction: column;

        gap: 0.2rem;

        text-align: right;
    }

    .gallery {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        column-gap: 1rem;
        row-gap: 1.5rem;
    }


    /* Overlay */

    .overlay-content {
        width: 100%;
    }


    .overlay-header {
        font-size: 11px;
    }
}