/* Exhibitions page refinement */

.exhibitions-section {
    padding: var(--page-section-padding-top) var(--page-section-padding-inline) var(--page-section-padding-bottom);
}

.exhibitions-container {
    max-width: 1650px;
}

.exhibitions-heading {
    font-family: var(--page-heading-font);
    font-size: var(--page-heading-size);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.08;
    margin: 0;
    padding: 0 var(--hover-padding) var(--page-heading-margin-bottom) var(--hover-padding);
}

.exhibitions-grid {
    grid-template-columns: 130px 1fr 190px 120px;
    gap: 0 2.25rem;
    width: 100%;
}

.exhibitions-item-wrapper {
    grid-template-columns: 130px 1fr 190px 120px;
    gap: 0 2.25rem;
    align-items: center;
    min-height: 7.7rem;
    border-bottom: 1px solid var(--border-color-light);
    padding: var(--hover-padding);
    box-sizing: border-box;
    width: 100%;
    justify-items: start;
}

.exhibitions-header > .exhibitions-col-link,
.exhibitions-item .exhibitions-col-link {
    display: none !important;
}

.exhibitions-header > div {
    font-family: var(--page-body-font);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-color-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 0;
    height: auto;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.exhibitions-header > .exhibitions-col-date {
    grid-column: 1;
    padding-left: var(--hover-padding);
}

.exhibitions-header > .exhibitions-col-title {
    grid-column: 2;
}

.exhibitions-header > .exhibitions-col-location {
    grid-column: 3;
}

.exhibitions-header > .exhibitions-col-category {
    grid-column: 4;
    padding-right: var(--hover-padding);
}

.exhibitions-year-separator {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    margin: 3rem 0 1.5rem 0;
    position: relative;
}

.exhibitions-year-separator:first-of-type {
    margin-top: 1.5rem;
}

.exhibitions-year-label {
    font-family: var(--page-heading-font);
    font-size: clamp(2.35rem, 4.4vw, 3.65rem);
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.04em;
    line-height: 1.2;
    padding-left: var(--hover-padding);
    transition: color 0.3s ease;
}

.exhibitions-item > div {
    font-family: "Source Sans Pro", sans-serif;
    padding: var(--hover-padding) 0;
    min-height: 5.5rem;
    display: flex;
    align-items: center;
}

.exhibitions-col-date {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-color);
    padding-left: var(--hover-padding);
}

.exhibitions-col-title {
    font-size: 1.16rem;
    line-height: 1.4;
    font-weight: 400;
}

.exhibitions-col-location {
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--text-color-secondary);
}

.exhibitions-col-category {
    font-size: 0.88rem;
    line-height: 1.5;
    font-weight: 500;
    text-align: left;
    padding-right: var(--hover-padding);
}

/* Row hover: gradient + text — see style.css (.exhibitions-item-wrapper::before) */

.exhibitions-image-reveal {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: clamp(230px, 26vw, 420px);
    min-width: 0;
    max-width: 420px;
    max-height: none;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
    opacity: 0;
    visibility: hidden;
    transition: opacity 280ms ease, visibility 280ms ease, transform 280ms ease;
    z-index: 20;
    pointer-events: none;
}

.exhibitions-item-wrapper:has(.exhibitions-link):hover .exhibitions-image-reveal,
.exhibitions-item-wrapper:has(.exhibitions-link):focus-within .exhibitions-image-reveal,
.exhibitions-item-wrapper:has(.exhibitions-image-reveal img[data-image-src]:not([data-image-src=""])):hover .exhibitions-image-reveal,
.exhibitions-item-wrapper:has(.exhibitions-image-reveal img[data-image-src]:not([data-image-src=""])):focus-within .exhibitions-image-reveal {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.exhibitions-image-reveal img {
    width: 100%;
    height: auto;
    object-fit: cover;
    max-height: none;
}

@media (max-width: 1000px) {
    .exhibitions-grid,
    .exhibitions-item-wrapper {
        grid-template-columns: 112px 1fr 160px 100px;
        gap: 0 1.1rem;
    }

    .exhibitions-col-title {
        font-size: 1.02rem;
    }

    .exhibitions-col-location,
    .exhibitions-col-category {
        font-size: 0.82rem;
    }
}

@media (max-width: 800px) {
    .exhibitions-section .exhibitions-container {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .exhibitions-heading {
        display: block;
        width: 100%;
        text-align: left;
        padding-bottom: var(--page-heading-margin-bottom);
    }

    .exhibitions-grid {
        display: block;
        width: 100%;
    }

    .exhibitions-year-separator {
        margin: 2rem 0 1rem 0;
    }

    .exhibitions-year-separator:first-of-type {
        margin-top: 1.25rem;
        padding-top: 0.35rem;
    }

    .exhibitions-year-label {
        font-size: 1.5rem;
        line-height: 1.2;
        padding-left: var(--hover-padding);
    }

    .exhibitions-header {
        display: none;
    }

    .exhibitions-item-wrapper {
        display: block;
        margin-bottom: 0;
        padding: 0.4rem var(--hover-padding) 0.85rem;
        min-height: 0;
        position: relative;
        border-bottom: 1px solid var(--border-color-light);
    }

    .exhibitions-item {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.12rem;
        align-content: start;
        position: relative;
        width: 100%;
    }

    .exhibitions-item > div {
        min-height: 0 !important;
        display: block !important;
        align-items: unset !important;
        padding: 0.1rem 0 !important;
    }

    .exhibitions-col-date,
    .exhibitions-col-title,
    .exhibitions-col-location,
    .exhibitions-col-category {
        grid-column: auto;
        display: block !important;
    }

    .exhibitions-col-title {
        line-height: 1.32;
        font-size: 1.05rem;
    }

    .exhibitions-col-location,
    .exhibitions-col-category {
        line-height: 1.4;
        font-size: 0.88rem;
    }

    /*
     * Same interaction as desktop: floating preview, absolute in row — no layout shift.
     * Hover / focus-within / .exhibitions-mobile-reveal-open (tap on touch) reveal image.
     */
    .exhibitions-image-reveal {
        position: absolute !important;
        top: 50% !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) scale(0.96) !important;
        width: min(88vw, 400px) !important;
        max-width: 400px !important;
        margin: 0 !important;
        padding: 0 !important;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 20px 45px rgba(0, 0, 0, 0.28);
        z-index: 20;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 280ms ease, visibility 280ms ease, transform 280ms ease;
    }

    body.dark-mode .exhibitions-item-wrapper .exhibitions-image-reveal {
        box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5);
    }

    .exhibitions-image-reveal img {
        position: static !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        max-height: min(55vh, 420px) !important;
        object-fit: cover !important;
        object-position: center;
        display: block;
    }

    .exhibitions-image-reveal img[data-image-src=""],
    .exhibitions-image-reveal img:not([data-image-src]),
    .exhibitions-image-reveal img[src=""],
    .exhibitions-image-reveal:has(img[src=""]) {
        display: none !important;
    }

    .exhibitions-item-wrapper:has(.exhibitions-image-reveal img[data-image-src]:not([data-image-src=""])):hover .exhibitions-image-reveal,
    .exhibitions-item-wrapper:has(.exhibitions-image-reveal img[data-image-src]:not([data-image-src=""])):focus-within .exhibitions-image-reveal,
    .exhibitions-item-wrapper.exhibitions-mobile-reveal-open:has(.exhibitions-image-reveal img[data-image-src]:not([data-image-src=""])) .exhibitions-image-reveal {
        opacity: 1 !important;
        visibility: visible !important;
        transform: translate(-50%, -50%) scale(1) !important;
    }

    /* Touch: avoid iOS stuck :hover — image only when toggled open or focus-within */
    @media (hover: none) {
        .exhibitions-item-wrapper:has(.exhibitions-image-reveal img[data-image-src]:not([data-image-src=""])):hover:not(
                .exhibitions-mobile-reveal-open
            )
            .exhibitions-image-reveal {
            opacity: 0 !important;
            visibility: hidden !important;
            transform: translate(-50%, -50%) scale(0.96) !important;
        }

        .exhibitions-item-wrapper--has-mobile-image {
            cursor: pointer;
            touch-action: manipulation;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .exhibitions-image-reveal {
            transition-duration: 0.01ms;
        }
    }

    .exhibitions-image-reveal:not(:has(img[data-image-src]:not([data-image-src=""]))) {
        display: none !important;
    }
}

/* ─── Publications page — title & venue scale matches events grid (.exhibitions-col-title) ─── */
@media (max-width: 1000px) {
    .publications-list-structured .publications-title {
        font-size: 1.02rem;
    }

    .publications-list-structured .publications-venue {
        font-size: 0.82rem;
    }
}

@media (max-width: 800px) {
    .publications-list-structured .publications-title {
        font-size: 1.05rem;
        line-height: 1.32;
    }

    .publications-list-structured .publications-venue {
        font-size: 0.88rem;
        line-height: 1.4;
    }
}
