/* Research-backed Experience popups for the main SPA */

.experience-card[data-experience-category] {
    cursor: pointer;
    position: relative;
}

.experience-card[data-experience-category]::after {
    content: 'Explore';
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--primary-color);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .12);
}

/* Keep the owner's original collage on the second Experience tile. */
#experience .experience-grid .experience-card:nth-child(2) > img {
    content: url('images/venue.png');
}

.experience-card[data-experience-category]:focus-visible {
    outline: 3px solid var(--accent-color);
    outline-offset: 4px;
}

.experience-modal-open {
    overflow: hidden;
}

.experience-modal {
    position: fixed;
    inset: 0;
    z-index: 5200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(8, 12, 18, .84);
    backdrop-filter: blur(4px);
}

.experience-modal.active {
    display: flex;
}

.experience-dialog {
    width: min(1180px, 100%);
    max-height: min(900px, calc(100vh - 48px));
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .42);
}

.experience-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 22px 26px 16px;
    border-bottom: 1px solid #e8e8e8;
}

.experience-modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 28px;
    line-height: 1.15;
}

.experience-modal-header p {
    max-width: 820px;
    margin: 6px 0 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.45;
}

.experience-modal-close {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #f1f1f1;
    color: #222;
    cursor: pointer;
    font-size: 30px;
    line-height: 1;
}

.experience-modal-close:hover,
.experience-modal-close:focus-visible {
    background: #e5e5e5;
}

.experience-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 26px;
    border-bottom: 1px solid #ececec;
    scrollbar-width: thin;
}

.experience-tab {
    flex: 0 0 auto;
    padding: 9px 14px;
    border: 1px solid #d9d9d9;
    border-radius: 999px;
    background: #fff;
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
}

.experience-tab[aria-selected='true'] {
    border-color: var(--primary-color);
    background: var(--primary-color);
    color: #fff;
}

.experience-modal-body {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(320px, .9fr);
    overflow: hidden;
}

.experience-viewer {
    min-width: 0;
    overflow-y: auto;
    padding: 22px 24px 24px;
    background: #f5f6f5;
}

.experience-stage {
    position: relative;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
}

/* With only one photo both arrows are hidden. Without this rule the image
   becomes the first auto-placed grid item and collapses into the 48px arrow
   column. Span the viewer instead. */
.experience-prev[hidden] + .experience-image-shell {
    grid-column: 1 / -1;
}

.experience-image-shell {
    position: relative;
    min-height: 440px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: #111;
}

.experience-image-shell img {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 590px;
    object-fit: contain;
}

.experience-image-loading,
.experience-image-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px;
    color: #ddd;
    text-align: center;
}

.experience-image-loading[hidden],
.experience-image-error[hidden],
.experience-arrow[hidden],
.experience-credit[hidden] {
    display: none !important;
}

.experience-arrow {
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #222;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    cursor: pointer;
}

.experience-photo-line {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    margin: 12px 58px 0;
    color: #626262;
    font-size: 13px;
}

.experience-photo-meta {
    min-width: 0;
    text-align: right;
}

.experience-credit {
    display: block;
    margin-top: 4px;
    font-size: 11px;
}

.experience-credit a,
.experience-sources a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 700;
}

.experience-credit a:hover,
.experience-sources a:hover {
    text-decoration: underline;
}

.experience-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin: 16px 58px 0;
    padding-bottom: 4px;
}

.experience-thumb {
    flex: 0 0 82px;
    height: 62px;
    padding: 0;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: #ddd;
    cursor: pointer;
}

.experience-thumb.active {
    border-color: var(--accent-color);
}

.experience-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.experience-details {
    min-width: 0;
    overflow-y: auto;
    padding: 28px;
    border-left: 1px solid #ececec;
    background: #fff;
}

.experience-details h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 26px;
    line-height: 1.18;
}

.experience-details p,
.experience-details li {
    font-size: 15px;
    line-height: 1.58;
}

.experience-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin: 15px 0 18px;
}

.experience-facts span {
    padding: 6px 9px;
    border-radius: 999px;
    background: #f0f2f2;
    color: #384047;
    font-size: 12px;
    font-weight: 700;
}

.experience-highlights {
    margin: 18px 0;
    padding-left: 20px;
}

.experience-highlights li + li {
    margin-top: 7px;
}

.experience-sources {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid #ececec;
    color: #666;
    font-size: 12px;
    line-height: 1.5;
}

.experience-sources strong {
    color: var(--text-main);
}

@media (max-width: 820px) {
    .experience-modal {
        padding: 0;
    }

    .experience-dialog {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }

    .experience-modal-header {
        padding: 15px 16px 12px;
    }

    .experience-modal-header h2 {
        font-size: 22px;
    }

    .experience-tabs {
        padding: 10px 14px;
    }

    .experience-modal-body {
        display: block;
        overflow-y: auto;
    }

    .experience-viewer,
    .experience-details {
        overflow: visible;
    }

    .experience-viewer {
        padding: 14px 12px 18px;
    }

    .experience-stage {
        grid-template-columns: 1fr;
    }

    .experience-image-shell {
        min-height: 290px;
    }

    .experience-image-shell img {
        max-height: 56vh;
    }

    .experience-arrow {
        position: absolute;
        z-index: 3;
        top: 50%;
        transform: translateY(-50%);
        width: 38px;
        height: 38px;
        background: rgba(255, 255, 255, .92);
    }

    .experience-prev { left: 8px; }
    .experience-next { right: 8px; }

    .experience-photo-line,
    .experience-thumbnails {
        margin-left: 2px;
        margin-right: 2px;
    }

    .experience-photo-line {
        display: block;
    }

    .experience-photo-meta {
        margin-top: 4px;
        text-align: left;
    }

    .experience-details {
        padding: 20px 16px 32px;
        border-top: 1px solid #e7e7e7;
        border-left: 0;
    }

    .experience-details h3 {
        font-size: 23px;
    }
}

@media (max-width: 480px) {
    .experience-card[data-experience-category]::after {
        top: 10px;
        right: 10px;
        padding: 6px 9px;
        font-size: 10px;
    }

    .experience-image-shell {
        min-height: 245px;
    }
}
