@font-face {
font-family: 'Facility';
font-style: normal;
font-weight: bold;
src: url('../FONTS/Facility-Bold-Trial.otf');
}

@font-face {
font-family: 'Facility';
font-style: italic;
font-weight: bold;
src: url('../FONTS/Facility-Bold-Italic-Trial.otf');
}

:root {
    --text-font-size: 0.9rem;
    --text-line-height: calc(0.9 * 1.5);
    --text-letter-spacing: 0.05em;
}

#bg {
    width: 100vw;
    position: fixed;
    z-index: -100;
    opacity: 0;
}

body {
    margin: 0;
    font-family: Facility, sans-serif;
    font-weight: bold;
    font-family: 'Facility', Arial, sans-serif;
    font-size: var(--text-font-size);
    line-height: var(--text-line-height);
    letter-spacing: var(--text-letter-spacing);
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

body.panel-open {
    overflow: hidden;
}

header {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    flex-shrink: 0;
    padding: 1rem;
    box-sizing: border-box;
}

.h1 {
    margin: 0;
    color: black;
}

.main-nav:hover {
    cursor: pointer;
}

.main-nav a {
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:nth-child(1) {
    position: absolute;
    top: 1rem;
    left: 60vw;
}

.main-nav a:nth-child(2) {
    position: absolute;
    top: 1rem;
    left: 80vw;
}

.main-nav a:nth-child(3) {
    position: absolute;
    top: 1rem;
    right: 3rem;
}

.main-nav a:nth-child(4) {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.about-dropdown {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 60vw;
    display: none;
    width: min(32rem, 35vw);
    margin: 0;
    background-color: white;
    line-height: var(--text-line-height);
}

.about-dropdown p {
    margin: 0 0 1rem;
}

.about-dropdown p:last-child {
    margin-bottom: 0;
}

.about-open .about-dropdown {
    display: block;
}

.filter-dropdown {
    position: absolute;
    z-index: 30;
    top: 100%;
    left: 80vw;
    display: none;
    width: max-content;
    margin: 0;
    padding: 0;
    background-color: white;
    list-style: none;
    font-size: var(--text-font-size);
    line-height: var(--text-line-height);
}

.filter-dropdown li {
    padding: 0.1rem 0;
}

.filter-option {
    padding: 0;
    border: 0;
    background: transparent;
    color: black;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.filters-active .filter-option:not([aria-pressed="true"]) {
    color: #999;
}

.square.is-filtered-out {
    display: none;
}

.filter-open .filter-dropdown {
    display: block;
}

.story-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    height: calc(100vw / 15);
    flex-shrink: 0;
}

.story {
    width: calc(100vw / 15);
    height: calc(100vw / 15);
    border-radius: 100px;
    overflow: hidden;

    transition: transform 0.3s ease-in-out;
}

.story:hover {
    transform: scale(1.05);
    transition: transform 0.3s ease-in-out;
    cursor: pointer;
}

.story.is-open:hover {
    transform: none;
}

.story img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.lecture-story {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #00a651;
    color: #000;
    text-align: center;
}

.story-label {
    display: block;
    width: 80%;
    max-width: 80%;
    line-height: 1;
    white-space: nowrap;
}

.story.is-open {
    position: relative;
    z-index: 20;
}

.story.is-open img {
    visibility: hidden;
}

.story.is-open .story-label {
    visibility: hidden;
}

.lecture-story.is-open {
    background: transparent;
}

.story.is-open::before,
.story.is-open::after {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2rem;
    height: 2px;
    background: currentColor;
    content: "";
}

.story.is-open::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.story.is-open::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.story-panel {
    position: fixed;
    z-index: 15;
    top: var(--story-panel-top, 100vh);
    right: 0;
    bottom: 0;
    left: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.25s ease-in-out, top 0.25s ease-in-out;
}

.story-panel.image-description-mode {
    bottom: var(--story-description-height, 0px);
}

.story-panel.image-description-mode .story-panel-content {
    align-items: flex-end;
}

.story-open .story-panel {
    visibility: visible;
    opacity: 1;
}

.story-closing .story-panel {
    visibility: visible;
    opacity: 0;
}

.story-panel-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-content-image,
.story-content-video {
    display: none;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.story-panel.image-mode .story-content-image,
.story-panel.video-mode .story-content-video {
    display: block;
}

.story-content-lecture {
    display: none;
    width: min(100%, 1200px);
    max-width: 100%;
    max-height: calc(100vh - var(--story-panel-top, 100vh));
    height: auto;
    aspect-ratio: 3 / 2;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 1rem;
    overflow: hidden;
    background: #00a651;
    color: #000;
    text-align: center;
    line-height: 1;
}

.story-panel.lecture-mode .story-content-lecture {
    display: flex;
}

.story-image-description {
    position: fixed;
    z-index: 16;
    width: max-content;
    max-width: 50%;
    bottom: 0;
    left: 0;
    display: none;
    box-sizing: border-box;
    padding: 0.5rem 1rem;
    background: #000;
    color: #fff;
    font-size: var(--text-font-size);
    line-height: var(--text-line-height);
}

.story-image-description.is-visible {
    display: block;
}

@media (max-width: 600px) {
    .story-content-lecture {
        width: min(100%, calc(100vh - 8rem));
        aspect-ratio: 2 / 3;
    }
}

.grid-container {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    align-items: flex-start;
    transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.site-content {
    min-height: 0;
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    transition: width 0.72s cubic-bezier(0.22, 1, 0.36, 1);
}


.square {
    display: flex;
    flex-direction: column;
    overflow: visible;
    /* 5 cards per row, but each card is image + caption, not a full square tile */
    flex: 0 0 calc(100% / 5);
    width: calc(100vw / 5);
    height: auto;
    box-sizing: border-box;
    transition: transform 0.3s ease-in-out;
}

.square:hover {
    cursor: pointer;
    transform: scale(1.05);
    transition: transform 0.3s ease-in-out;
}


.square-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    flex-shrink: 0;
}

.square img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: left bottom;
    display: block;
}

.square-caption {
    width: 100%;
    font-weight: 700;
    letter-spacing: var(--text-letter-spacing);
    padding: 0.5rem 2rem 2rem 0rem;
    margin-left: 0;
    min-height: 1.6rem;
    color: #000;
    box-sizing: border-box;
}

.grid-container .square .square-caption {
    padding-left: 0rem;
}

.grid-container .square:nth-child(5n + 1) .square-caption {
    padding-left: 1rem;
}

.detail-panel {
    position: fixed;
    z-index: 10;
    top: 0;
    right: 0;
    width: 60vw;
    height: 100vh;
    box-sizing: border-box;
    padding: 1rem 0;
    background: white;
    transform: translateX(100%);
    transition: transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
    overflow-y: auto;
}

.panel-open .detail-panel {
    transform: translateX(0);
}

.detail-close {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 1;
    width: 1.5rem;
    height: 1.5rem;
    border: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.detail-close::before,
.detail-close::after {
    position: absolute;
    top: 50%;
    left: 0;
    width: 2rem;
    height: 2px;
    background: currentColor;
    content: "";
}

.detail-close::before {
    transform: translateY(-50%) rotate(45deg);
}

.detail-close::after {
    transform: translateY(-50%) rotate(-45deg);
}

.detail-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-image {
    display: block;
    width: 100%;
    height: auto;
}

.detail-copy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 0 2rem;
    line-height: var(--text-line-height);
}

.detail-copy p {
    margin: 0;
}

.detail-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.detail-gallery img {
    display: block;
    width: 100%;
    height: auto;
}

.detail-copy-final {
    padding-bottom: 3rem;
}

.detail-title {
    margin: 0;
    font-size: var(--text-font-size);
    line-height: var(--text-line-height);
    text-align: center;
    padding-bottom: 3rem;
}

.panel-open .site-content {
    width: 40vw;
}

.panel-open .grid-container {
    width: 100%;
}

.panel-open .square {
    flex-basis: calc(100vw / 5);
    width: calc(100vw / 5);
}

.panel-open .square:nth-child(2n + 1) .square-caption {
    padding-left: 1rem;
}


/* 4 squares per row */
@media (max-width: 1400px) {
    .square {
        flex: 0 0 calc(100% / 4);
        width: calc(100vw / 4);
    }

    .grid-container .square:nth-child(4n + 1) .square-caption {
        padding-left: 1rem;
    }

    .panel-open .square {
        flex-basis: calc(100vw / 4);
        width: calc(100vw / 4);
    }

    .panel-open .square .square-caption {
        padding-left: 1rem;
    }

    .panel-open .detail-panel {
        width: 75vw;
    }

    .panel-open .site-content {
        width: 25vw;
    }
}


/* 3 squares per row */
@media (max-width: 1150px) {
    .square {
        flex: 0 0 calc(100% / 3);
        width: calc(100vw / 3);
    }

    .grid-container .square:nth-child(3n + 1) .square-caption {
        padding-left: 1rem;
    }

    .story {
        width: calc(100vw / 9);
        height: calc(100vw / 9);
}

    .story-container {
        height: calc(100vw / 9);
    }

    .panel-open .square {
        flex-basis: calc(100vw / 3);
        width: calc(100vw / 3);
    }

    .panel-open .square .square-caption {
        padding-left: 1rem;
    }

    .panel-open .detail-panel {
        width: 66.6667vw;
    }

    .panel-open .site-content {
        width: 33.3333vw;
    }
}


/* 2 squares per row */
@media (max-width: 900px) {
    .about-dropdown {
        left: 1rem;
        width: calc(100vw - 2rem);
    }

    .square {
        flex: 0 0 calc(100% / 2);
        width: calc(100vw / 2);
    }

    .grid-container .square:nth-child(2n + 1) .square-caption {
        padding-left: 1rem;
    }

    .story {
        width: calc(100vw / 6);
        height: calc(100vw / 6);
}

    .story-container {
        height: calc(100vw / 6);
    }

    .detail-panel {
        width: 50vw;
    }

    .panel-open .site-content {
        width: 50vw;
    }

    .panel-open .square {
        flex-basis: calc(100vw / 2);
        width: calc(100vw / 2);
    }

    .panel-open .square .square-caption {
        padding-left: 1rem;
    }
}
