/* ==========================================================================
   Previous Conferences Gallery
   --------------------------------------------------------------------------
   Ported from stemnetwork.com/previous-conferences-gallery, which is the
   reference the user gave. Layout, spacing and behaviour are kept as they are
   there; only the accent colours follow this conference's palette so the page
   does not read as pasted in from another site.

   Two rules carried over from that page, both hard-won — do not "simplify"
   them into fixed frames:

   * Group photographs are never cut sideways. Each card carries --ga, the
     larger of 21:9 and the picture's own ratio, so a wider photograph gets a
     wider, shorter frame instead of losing the people at both ends.
   * The event grid is justified, not cropped. Each tile carries --a (w/h) and
     flexes on it, so a portrait photograph stays portrait.
   ========================================================================== */

/* Narrower than the site's 1360px .container: the cards and the justified
   grid read better at the reference page's width, and the group photographs
   are not stretched across the whole screen. Compound selector so it wins over
   .container regardless of stylesheet order. */
.container.pcg-wrap {
    max-width: 1140px;
}

.pcg-wrap {
    padding: 40px 0 70px;
}

.pcg-rule {
    width: 70px;
    height: 3px;
    background: var(--primary-crimson);
    margin: 0 auto 45px;
}

/* ---- index: one card per completed conference ---------------------------- */

.pcg-card {
    border: 1px solid var(--light-gray);
    border-radius: 10px;
    overflow: hidden;
    background: var(--white);
    margin-bottom: 45px;
    transition: box-shadow 0.3s ease;
}

.pcg-card:hover {
    box-shadow: 0 14px 40px rgba(var(--primary-rgb), 0.13);
}

.pcg-card__group {
    position: relative;
    display: block;
    aspect-ratio: var(--ga, 2.333);
    background: var(--off-white);
    overflow: hidden;
}

.pcg-card__group img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.pcg-card:hover .pcg-card__group img {
    transform: scale(1.03);
}

.pcg-card__body {
    padding: 22px 24px 24px;
}

.pcg-card__body h2 {
    font-size: 23px;
    font-weight: 600;
    line-height: 1.35;
    margin: 0 0 12px;
    color: var(--dark-gray);
}

.pcg-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 28px;
    margin-bottom: 14px;
}

.pcg-meta div {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    color: var(--text-gray);
}

.pcg-meta svg {
    width: 16px;
    height: 16px;
    flex: none;
    color: var(--primary-crimson);
}

.pcg-covers {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 22px;
}

.pcg-covers span {
    font-size: 12.5px;
    color: var(--text-gray);
    background: var(--off-white);
    border: 1px solid var(--light-gray);
    border-radius: 30px;
    padding: 4px 12px;
}

.pcg-striplabel {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--mid-gray, #9b8189);
    margin-bottom: 10px;
}

/* flex: 1 1 0 per tile, not a fixed six-column grid — one event's strip has
   five faces because that set has only five distinct speakers. */
.pcg-strip {
    display: flex;
    gap: 10px;
    margin-bottom: 22px;
}

.pcg-strip a {
    display: block;
    flex: 1 1 0;
    min-width: 0;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    overflow: hidden;
    background: var(--off-white);
}

.pcg-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* biased upward so heads survive the 4:3 crop */
    object-position: center 28%;
    display: block;
    transition: transform 0.45s ease;
}

.pcg-strip a:hover img {
    transform: scale(1.08);
}

.pcg-viewall {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 11px 22px;
    border: 1px solid var(--primary-crimson);
    border-radius: 5px;
    background: var(--primary-crimson);
    color: var(--white);
    font-size: 16px;
    text-decoration: none;
    transition: background-color 0.3s, color 0.3s;
}

.pcg-viewall:hover {
    background: var(--white);
    color: var(--primary-crimson);
}

/* ---- single event: the full grid ----------------------------------------- */

.pcg-back {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 15px;
    color: var(--text-gray);
    text-decoration: none;
    margin-bottom: 22px;
}

.pcg-back:hover {
    color: var(--primary-crimson);
}

.pcg-hero {
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    cursor: pointer;
    display: block;
    aspect-ratio: var(--ga, 2.333);
    border-radius: 10px;
    overflow: hidden;
    background: var(--off-white);
    margin-bottom: 30px;
}

.pcg-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pcg-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    --row: 250px;
}

.pcg-grid button {
    padding: 0;
    border: 0;
    background: var(--off-white);
    border-radius: 7px;
    overflow: hidden;
    cursor: pointer;
    display: block;
    height: var(--row);
    flex: var(--a, 1.5) 1 calc(var(--a, 1.5) * var(--row));
    /* stops a short last row from blowing its photographs up */
    max-width: calc(var(--a, 1.5) * var(--row) * 1.35);
}

.pcg-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.45s ease;
}

.pcg-grid button:hover img {
    transform: scale(1.07);
}

/* ---- lightbox ------------------------------------------------------------ */

.pcg-lb {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcg-lb img {
    max-width: 92vw;
    max-height: 84vh;
    object-fit: contain;
    border-radius: 4px;
}

.pcg-lb__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background-color 0.25s;
}

.pcg-lb__btn:hover {
    background: var(--primary-crimson);
}

.pcg-lb__prev {
    left: 18px;
}

.pcg-lb__next {
    right: 18px;
}

.pcg-lb__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.13);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.pcg-lb__close:hover {
    background: var(--primary-crimson);
}

.pcg-lb__count {
    position: absolute;
    bottom: 22px;
    left: 0;
    right: 0;
    text-align: center;
    color: #bbb;
    font-size: 14px;
}

@media (max-width: 991px) {
    .pcg-grid {
        --row: 190px;
    }

    .pcg-strip {
        flex-wrap: wrap;
    }

    .pcg-strip a {
        flex: 1 1 calc(33.333% - 7px);
    }

    .pcg-card__group,
    .pcg-hero {
        aspect-ratio: min(var(--ga, 2.333), 16 / 9);
    }
}

@media (max-width: 575px) {
    .pcg-card__body {
        padding: 18px 16px 20px;
    }

    .pcg-card__body h2 {
        font-size: 19px;
    }

    .pcg-grid {
        --row: 140px;
        gap: 8px;
    }

    .pcg-card__group,
    .pcg-hero {
        aspect-ratio: min(var(--ga, 2.333), 4 / 3);
    }

    .pcg-lb__btn {
        width: 40px;
        height: 40px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .pcg-card__group img,
    .pcg-strip img,
    .pcg-grid img {
        transition: none;
    }

    .pcg-card:hover .pcg-card__group img,
    .pcg-strip a:hover img,
    .pcg-grid button:hover img {
        transform: none;
    }
}

/* ---- the event page's heading -------------------------------------------- */

/* Above 1100px .sessions-hero__heading is `white-space: nowrap`, which suits
   the two-word headings the other subpages carry. A conference title is far
   longer and simply ran off the right edge, so here it wraps — and at a size
   that lands a long title on two lines rather than four. Two classes deep, so
   it beats the media query without needing one of its own. */
.previous-gallery-event .sessions-hero__heading {
    white-space: normal;
    font-size: clamp(1.35rem, 2.4vw, 2rem);
    /* keeps the two lines close to even instead of leaving one word alone */
    text-wrap: balance;
    max-width: 46ch;
    margin-left: auto;
    margin-right: auto;
}

@media (max-width: 767px) {
    .previous-gallery-event .sessions-hero__heading {
        max-width: none;
    }
}
