/* General */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background-color: white;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Header */

.header {
    width: 100%;
    margin: 0;
    padding: 30px 1vw;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
}

.header-name {
    justify-self: start;
    font-family: "Geneva", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #222222;
}

.resume-link {
    justify-self: end;
    font-size: 13px;
    color: #555555;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.resume-link:hover {
    opacity: 0.5;
}

.header-name-wrapper {
    position: relative;
    justify-self: start;
}

.name-details {
    position: absolute;
    top: calc(100% + 1vh);
    left: 0;

    display: flex;
    flex-direction: column;
    gap: 2px;

    font-family: "Geneva", sans-serif;
    font-size: 11px;
    line-height: 1.3;
    color: #888888;

    opacity: 0;
    pointer-events: none;
    transition: none;
}

.header-name-wrapper:hover .name-details {
    opacity: 1;
}

/* Main content */

main {
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0 1vw;
}

/* Image gallery */

.gallery {
    display: flex;
    align-items: center;
    width: 100%;
    height: 55vh;
    gap: 0.8vw;
    transform: translateY(9.667vh);
}

/* Individual images */

.gallery-item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 100%;
    overflow: visible;
    transition: flex-grow 0.5s ease;
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hover interaction */

.gallery:hover .gallery-item {
    flex-grow: 0.9167;
}

.gallery .gallery-item:hover {
    flex-grow: 2;
}

/* Make other images translucent when hovering */
.gallery:hover .gallery-item img {
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.gallery .gallery-item:hover img {
    opacity: 1;
}

/* Image labels */

.image-label {
    position: absolute;
    bottom: calc(100% + 2vh);
    left: 0;
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 2px;

    font-family: Arial, sans-serif;
    font-size: 11px;
    line-height: 1.3;
    color: #383838;
    text-align: left;

    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.label-title,
.label-date,
.label-info {
    color: #383838;
}

.gallery-item:hover .image-label {
    opacity: 1;
    transition: opacity 0.2s ease 0.5s;
}

/* Footer */

.footer {
    width: 100%;
    margin: 0;
    padding: 30px 1vw;
    display: flex;
    justify-content: center;
}

.email-link {
    font-size: 13px;
    color: #777777;
    font-style: italic;
    text-decoration: none;
    transition: opacity 0.3s ease;
}

.email-link:hover {
    opacity: 0.5;
}

/* Mobile portrait version */
@media screen and (max-width: 700px) and (orientation: portrait) {
.header {
    padding: 2vh 5vw;
}
    main {
        padding: 0 5vw;
    }

    .gallery {
        height: 45vh;
        gap: 3vw;
        overflow-x: auto;
        overflow-y: visible;
        transform: none;
        align-items: center;
        scroll-snap-type: x mandatory;
    }

    .gallery-item,
    .gallery:hover .gallery-item,
    .gallery .gallery-item:hover {
        flex: 0 0 calc((100% - 3vw) / 2);
        height: 100%;
        scroll-snap-align: start;
    }

    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    /* Hide labels in the overview */
    .image-label {
        display: none;
    }

    /* Single-image view */
    .gallery.is-focused {
        overflow: visible;
        height: 55vh;
    }

    .gallery.is-focused .gallery-item {
        display: none;
    }

    .gallery.is-focused .gallery-item.is-active {
        display: block;
        flex: 0 0 100%;
        height: 100%;
    }

    .gallery.is-focused .gallery-item.is-active img {
        width: 100%;
        height: 100%;
    }

    .gallery.is-focused .gallery-item.is-active .image-label {
        display: flex;
        position: absolute;
        bottom: calc(100% + 2vh);
        left: 0;
        width: 100%;
        opacity: 1;
        font-size: 11px;
        line-height: 1.4;
    }
}