/* =========================================
   EXHIBITIONS
   ========================================= */


/* =========================================
   GENERAL LAYOUT
   ========================================= */

.exhibition-container {
    width: auto;
    max-width: 1700px;
    margin-left: 5vw;
    margin-right: 5vw;
    margin-bottom: 5vw;
    padding: 0;
    box-sizing: border-box;
}

.exhibition-container * {
    box-sizing: border-box;
}

.exhibition-container [hidden] {
    display: none !important;
}


/* =========================================
   EXHIBITION HEADER AND TITLE
   ========================================= */

.exhibition-container > .exhibition-header {
    display: block;
    position: static;
    top: auto;
    z-index: auto;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 0;
}

.exhibition-container .exhibition-title {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 3rem;
    letter-spacing: 1px;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    text-transform: capitalize;
    color: #454140;
    margin: 0 0 30px;
    padding: 0;
}


/* =========================================
   PHOTOGRAPH GRID
   ========================================= */

.exhibition-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.exhibition-grid-item {
    display: block;
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    overflow: hidden;
    text-align: left;
}

.exhibition-grid-item img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    transition: opacity 0.25s ease;
}

.exhibition-grid-item:hover img {
    opacity: 0.82;
}


/* =========================================
   EXHIBITIONS ARCHIVE — TITLE ON HOVER
   ========================================= */

.exhibition-archive-item {
    position: relative;
    overflow: hidden;
}

.exhibition-archive-item::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.25);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.exhibition-archive-title {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 2;
    width: 90%;
    transform: translate(-50%, -50%);
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.exhibition-archive-item:hover::after,
.exhibition-archive-item:focus-visible::after {
    opacity: 1;
}

.exhibition-archive-item:hover .exhibition-archive-title,
.exhibition-archive-item:focus-visible .exhibition-archive-title {
    opacity: 1;
}


/* =========================================
   INDIVIDUAL PHOTO VIEWER
   ========================================= */

.exhibition-viewer {
    width: 100%;
    margin: 0;
    padding: 0;
}

.exhibition-viewer[hidden] {
    display: none !important;
}

.exhibition-viewer:not([hidden]) {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}


/* =========================================
   BACK BUTTON
   ========================================= */

.exhibition-back {
    display: inline-block;
    flex: 0 0 auto;
    align-self: flex-start;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
    background: transparent;
    font-family: 'Roboto', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: #454140;
    cursor: pointer;
    text-align: left;
}

.exhibition-back:hover {
    opacity: 0.65;
}


/* =========================================
   VIEWER FRAME
   ========================================= */

.exhibition-viewer-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.exhibition-slides {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
}

.exhibition-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
}

.exhibition-slide img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
}


/* =========================================
   VIEWER NAVIGATION
   ========================================= */

.exhibition-prev,
.exhibition-next {
    position: absolute;
    top: 0;
    bottom: 0;
    z-index: 2;
    width: 50%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
}

.exhibition-prev {
    left: 0;
    cursor: w-resize;
}

.exhibition-next {
    right: 0;
    cursor: e-resize;
}

.exhibition-prev::after,
.exhibition-next::after {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: block;
    font-size: 42px;
    font-weight: 300;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

.exhibition-prev::after {
    content: "‹";
    left: 30px;
}

.exhibition-next::after {
    content: "›";
    right: 30px;
}

.exhibition-prev:hover::after,
.exhibition-next:hover::after {
    opacity: 1;
}


/* =========================================
   MOBILE — UP TO 767PX
   ========================================= */

@media (max-width: 767px) {

    .exhibition-container .exhibition-title {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }

    .exhibition-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 6px;
    }

    .exhibition-viewer-frame {
        min-height: 0;
    }

    .exhibition-prev,
    .exhibition-next {
        width: 50%;
        cursor: pointer;
    }

    .exhibition-prev::after,
    .exhibition-next::after {
        font-size: 32px;
        opacity: 0.85;
    }

    .exhibition-prev::after {
        left: 15px;
    }

    .exhibition-next::after {
        right: 15px;
    }

    .exhibition-archive-item::after {
        opacity: 0;
    }

    .exhibition-archive-title {
        display: none;
    }
}


/* =========================================
   TABLET — 768PX TO 1023PX
   ========================================= */

@media (min-width: 768px) and (max-width: 1023px) {

    .exhibition-container .exhibition-title {
        font-size: 1.8rem;
    }

    .exhibition-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }

    .exhibition-archive-title {
        font-size: 1.2rem;
    }
}


/* =========================================
   DESKTOP — 1024PX TO 1099PX
   ========================================= */

@media (min-width: 1024px) and (max-width: 1099px) {

    .exhibition-container .exhibition-title {
        font-size: 1.8rem;
    }

    .exhibition-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
    }
}


/* =========================================
   LARGE DESKTOP — 1100PX TO 1699PX
   ========================================= */

@media (min-width: 1100px) and (max-width: 1699px) {

    .exhibition-container .exhibition-title {
        font-size: 1.8rem;
    }
}


/* =========================================
   EXTRA LARGE SCREENS — 1700PX+
   ========================================= */

@media (min-width: 1700px) {

    .exhibition-container .exhibition-title {
        font-size: 2.2rem;
    }
}


/* =========================================
   VIEWER HEIGHT — RESPONSIVE
   ========================================= */

@supports selector(.exhibition-container:has(.exhibition-viewer:not([hidden]))) {

    @media (max-width: 767px) {
        .exhibition-container:has(.exhibition-viewer:not([hidden])) {
            height: 80vh;
            display: flex;
            flex-direction: column;
            margin-bottom: 0;
        }
    }

    @media (min-width: 768px) and (max-width: 1023px) {
        .exhibition-container:has(.exhibition-viewer:not([hidden])) {
            height: 72vh;
            display: flex;
            flex-direction: column;
            margin-bottom: 0;
        }
    }

    @media (min-width: 1024px) and (max-width: 1099px) {
        .exhibition-container:has(.exhibition-viewer:not([hidden])) {
            height: 75vh;
            display: flex;
            flex-direction: column;
            margin-bottom: 0;
        }
    }

    @media (min-width: 1100px) and (max-width: 1699px) {
        .exhibition-container:has(.exhibition-viewer:not([hidden])) {
            height: 85vh;
            display: flex;
            flex-direction: column;
            margin-bottom: 0;
        }
    }

    @media (min-width: 1700px) {
        .exhibition-container:has(.exhibition-viewer:not([hidden])) {
            height: 80vh;
            display: flex;
            flex-direction: column;
            margin-bottom: 0;
        }
    }
}


/* =========================================
   PHOTOGRAPH DIMENSIONS
   ========================================= */

/* Default and mobile */

.exhibition-container .exhibition-viewer .exhibition-slide img {
    display: block !important;
    width: auto !important;
    height: auto !important;
    max-height: 80vh !important;
    max-width: 100% !important;
    object-fit: contain !important;
}


/* 768px */

@media (min-width: 768px) {

    .exhibition-container .exhibition-viewer .exhibition-slide img {
        max-height: 72vh !important;
        max-width: 90vw !important;
    }
}


/* 1024px */

@media (min-width: 1024px) {

    .exhibition-container .exhibition-viewer .exhibition-slide img {
        max-height: 75vh !important;
        max-width: 90vw !important;
    }
}


/* 1100px */

@media (min-width: 1100px) {

    .exhibition-container .exhibition-viewer .exhibition-slide img {
        max-height: 85vh !important;
        max-width: 68vw !important;
    }
}


/* 1700px — REDUCED IMAGE HEIGHT */

@media (min-width: 1700px) {

    .exhibition-container .exhibition-viewer .exhibition-slide img {
        max-height: 64vh !important;
        max-width: 75vw !important;
    }
}


/* =========================================
   VERTICAL POSITION — EXHIBITION CONTENT
   ========================================= */

/* Move content up by 23px below 1100px */

@media (max-width: 1099px) {

    .exhibition-container {
        margin-top: -23px !important;
    }
}


/* Keep original position from 1100px onward */

@media (min-width: 1100px) {

    .exhibition-container {
        margin-top: 0 !important;
    }

    .exhibition-container .exhibition-header {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }
}


/* =========================================
   VIEWER — CENTERING ON THE VIEWPORT
   ========================================= */

@supports selector(.exhibition-container:has(.exhibition-viewer:not([hidden]))) {

    .exhibition-container:has(.exhibition-viewer:not([hidden])) {
        width: 100vw !important;
        max-width: none !important;
        margin-left: calc(50% - 50vw) !important;
        margin-right: calc(50% - 50vw) !important;
    }

    .exhibition-container:has(.exhibition-viewer:not([hidden])) .exhibition-viewer {
        width: 100% !important;
    }

    .exhibition-container:has(.exhibition-viewer:not([hidden])) .exhibition-viewer-frame {
        width: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .exhibition-container:has(.exhibition-viewer:not([hidden])) .exhibition-slides,
    .exhibition-container:has(.exhibition-viewer:not([hidden])) .exhibition-slide {
        width: 100% !important;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}