/* Guest-facing photo gallery. Tokens follow the gallery design handoff; the invitation keeps app.css. */

.gallery-page {
    /* Palette lives in tokens.css, shared with the admin; only gallery-specific metrics are local. */
    --sticky-height: 68px;
    --gutter: 48px;
    font-family: var(--body-font);
    font-weight: 200;
    color: var(--ink);
    background: var(--page-bg);
    min-height: 100vh;
}

/* The invitation centres a narrow card in a flex body; the gallery is a full-bleed page. */
body:has(.gallery-page) {
    display: block;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    background: #f2f5f5;
}

/* :where() keeps this reset at zero specificity for the element, so the rules below still win. */
.gallery-page :where(button) {
    font-family: inherit;
    font-weight: inherit;
    background: none;
    border: 0;
    padding: 0;
    color: inherit;
    cursor: pointer;
}

.gallery-page :focus-visible {
    outline: 2px solid var(--teal);
    outline-offset: 2px;
}

/* ------------------------------------------------------------------ hero */

.gallery-hero {
    position: relative;
    height: 520px;
    overflow: hidden;
}

    .gallery-hero img.gallery-hero-photo {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.gallery-hero-scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(3,58,59,.45) 0%, rgba(3,58,59,.05) 38%, rgba(3,58,59,.62) 100%);
}

.gallery-hero-bar {
    position: absolute;
    top: 22px;
    left: var(--gutter);
    right: var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.gallery-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

    .gallery-brand img {
        height: 30px;
        filter: brightness(0) invert(1);
    }

.gallery-brand-name {
    font-family: 'Sirivennela', sans-serif;
    font-size: 20px;
    color: #fff;
}

.gallery-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gallery-lang {
    display: flex;
    gap: 6px;
}

    .gallery-lang button {
        font-size: 13px;
        color: rgba(255,255,255,.7);
        padding: 5px 10px;
        border-radius: 999px;
    }

        .gallery-lang button.active {
            color: #fff;
            background: rgba(255,255,255,.22);
            padding: 5px 12px;
        }

.gallery-signout {
    font-size: 14px;
    color: #fff;
}

.gallery-hero-title {
    position: absolute;
    left: var(--gutter);
    bottom: 44px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.gallery-eyebrow {
    font-size: 12px;
    letter-spacing: 2.4px;
    text-transform: uppercase;
    color: rgba(255,255,255,.8);
}

.gallery-title {
    font-family: 'Sirivennela', sans-serif;
    font-size: 66px;
    line-height: 1;
    color: #fff;
    margin: 0;
    font-weight: normal;
}

.gallery-subline {
    font-size: 16px;
    color: rgba(255,255,255,.85);
}

/* ------------------------------------------------- collapsed hero bar */

.gallery-stickybar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--sticky-height);
    z-index: 40;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}

html.gallery-stuck .gallery-stickybar {
    opacity: 1;
    pointer-events: auto;
}

.gallery-stickybar img.gallery-stickybar-photo {
    position: absolute;
    left: 0;
    top: -180px;
    width: 100%;
    height: 420px;
    object-fit: cover;
    filter: blur(2px);
}

.gallery-stickybar-scrim {
    position: absolute;
    inset: 0;
    background: rgba(3,58,59,.72);
}

.gallery-stickybar-content {
    position: absolute;
    inset: 0;
    padding: 0 var(--gutter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

    .gallery-stickybar-content .gallery-brand img {
        height: 22px;
    }

.gallery-stickybar-title {
    font-family: 'Sirivennela', sans-serif;
    font-size: 19px;
    color: #fff;
}

.gallery-stickybar-divider {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,.3);
}

.gallery-stickybar-meta {
    font-size: 13px;
    color: rgba(255,255,255,.75);
}

.gallery-lang-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: rgba(255,255,255,.85);
}

    .gallery-lang-compact button {
        font-size: 13px;
        color: rgba(255,255,255,.85);
    }

        .gallery-lang-compact button.active {
            color: #fff;
            border-bottom: 1px solid #fff;
        }

.gallery-stickybar .gallery-signout {
    font-size: 13px;
}

/* --------------------------------------------------------------- toolbar */

.gallery-toolbar {
    position: sticky;
    top: var(--sticky-height);
    z-index: 30;
    background: var(--surface);
    border-bottom: 1px solid var(--hairline);
    padding: 0 var(--gutter);
}

html.gallery-stuck .gallery-toolbar {
    background: rgba(255,255,255,.97);
    box-shadow: 0 6px 18px rgba(0,0,0,.05);
}

.gallery-toolbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    height: 64px;
    transition: height 180ms ease;
}

html.gallery-stuck .gallery-toolbar-inner {
    height: 60px;
}

.gallery-tabs {
    display: flex;
    align-items: center;
    gap: 22px;
}

.gallery-tablist {
    display: flex;
    align-items: center;
}

.gallery-tab {
    font-size: 15px;
    color: var(--muted);
    padding: 20px;
    border-bottom: 2px solid transparent;
    transition: color 180ms ease, border-color 180ms ease, padding 180ms ease;
}

html.gallery-stuck .gallery-tab {
    padding: 18px 16px;
}

.gallery-tab:hover:not(:disabled) {
    color: var(--teal-dark);
}

.gallery-tab.active {
    color: var(--teal);
    border-bottom-color: var(--teal);
}

.gallery-tab:disabled {
    color: #c3cccc;
    cursor: not-allowed;
}

.gallery-count {
    font-size: 13px;
    color: var(--muted);
}

.gallery-filters {
    display: flex;
    align-items: center;
    gap: 18px;
}

.gallery-filter-trigger {
    font-size: 14px;
    color: var(--ink);
    white-space: nowrap;
}

    .gallery-filter-trigger:hover:not(:disabled),
    .gallery-filter-trigger.open {
        color: var(--teal);
    }

    /* Same grey as a disabled tab, so "nothing to filter by" reads the same wherever it appears. */
    .gallery-filter-trigger:disabled {
        color: #c3cccc;
        cursor: not-allowed;
    }

.gallery-filter-divider {
    width: 1px;
    height: 20px;
    background: var(--hairline);
}

.gallery-select-btn {
    font-size: 14px;
    color: var(--teal);
    border: 1px solid var(--teal);
    border-radius: 999px;
    padding: 9px 18px;
    white-space: nowrap;
}

    .gallery-select-btn:hover {
        background: var(--mint-tint);
    }

/* ------------------------------------------------------- applied filters */

.gallery-applied {
    position: sticky;
    top: calc(var(--sticky-height) + 60px);
    z-index: 20;
    background: var(--surface);
    padding: 16px var(--gutter);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: 1px solid #f4f7f7;
}

.gallery-applied-label {
    font-size: 12px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--muted-light);
}

.gallery-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--teal);
    background: var(--mint-tint);
    border-radius: 999px;
    padding: 6px 14px;
}

.gallery-chip-clear {
    font-size: 13px;
    color: var(--muted);
    text-decoration: underline;
}

/* -------------------------------------------------------------- popovers */

.gallery-popover-backdrop {
    position: fixed;
    inset: 0;
    z-index: 45;
}

.gallery-popover {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 46;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    box-shadow: 0 16px 44px rgba(0,0,0,.16);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    cursor: default;
}

.gallery-filter-anchor {
    position: relative;
}

.gallery-popover--wide {
    width: 300px;
}

.gallery-popover--rating {
    width: 230px;
}

.gallery-popover--sort {
    width: 250px;
}

.gallery-popover-eyebrow {
    font-size: 12px;
    letter-spacing: 1.3px;
    text-transform: uppercase;
    color: var(--muted);
}

.gallery-search {
    font-size: 14px;
    color: var(--ink);
    border: 1px solid var(--border-light);
    border-radius: 999px;
    padding: 9px 14px;
    font-family: inherit;
    font-weight: inherit;
    width: 100%;
}

    .gallery-search::placeholder {
        color: var(--muted-light);
    }

    .gallery-search:focus {
        outline: none;
        border-color: var(--teal);
    }

.gallery-option-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 260px;
    overflow-y: auto;
}

.gallery-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 6px;
    border-radius: 8px;
    width: 100%;
    text-align: left;
}

    .gallery-option:hover {
        background: var(--mint-tint-2);
    }

    .gallery-option.selected {
        background: var(--mint-tint-2);
    }

.gallery-checkbox {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1px solid var(--border);
    display: grid;
    place-items: center;
    font-size: 11px;
    flex: 0 0 18px;
}

    .gallery-checkbox .gallery-icon {
        visibility: hidden;
    }

    .gallery-checkbox.checked .gallery-icon {
        visibility: visible;
    }

    .gallery-checkbox.checked {
        background: var(--teal);
        border-color: var(--teal);
        color: #fff;
    }

.gallery-option-label {
    font-size: 14px;
    color: var(--ink);
    flex: 1;
}

.gallery-option-count {
    font-size: 13px;
    color: var(--muted);
}

.gallery-popover-footer {
    display: flex;
    gap: 10px;
    padding-top: 6px;
    border-top: 1px solid #f0f4f4;
}

.gallery-btn-ghost,
.gallery-btn-solid {
    flex: 1;
    text-align: center;
    font-size: 14px;
    border-radius: 999px;
    padding: 10px;
}

.gallery-btn-ghost {
    color: var(--muted);
    border: 1px solid var(--border);
}

    .gallery-btn-ghost:hover {
        color: var(--ink);
    }

.gallery-btn-solid {
    color: #fff;
    background: var(--teal);
}

    .gallery-btn-solid:hover {
        background: var(--teal-dark);
    }

.gallery-star-row {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 26px;
    color: var(--star-gold);
    line-height: 1;
}

    .gallery-star-row button {
        color: inherit;
        line-height: 1;
    }

    .gallery-star-row .empty {
        color: var(--border);
    }

.gallery-helper {
    font-size: 13px;
    color: var(--muted);
}

.gallery-inline-check {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink);
}

.gallery-phase-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.gallery-phase-chip {
    font-size: 13px;
    color: var(--ink);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
}

    .gallery-phase-chip.selected {
        color: #fff;
        background: var(--teal);
        border-color: var(--teal);
    }

    .gallery-phase-chip:disabled {
        color: var(--muted-light);
        border-color: var(--hairline);
        cursor: not-allowed;
    }

/* The wrapper is what carries the tooltip, so it must not swallow the chip's own layout. */
.gallery-phase-chip-wrap {
    display: inline-flex;
}

    .gallery-phase-chip-wrap .gallery-phase-chip {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px 8px;
    }

/* The phase name stays whole; if the pair runs out of room the badge drops beneath it, which reads
   better than a celebration broken across two lines. */
.gallery-phase-chip-name {
    white-space: nowrap;
}

/* A coming-soon chip is unpickable, so its name is muted - the badge is what has to stay readable. */
.gallery-phase-soon {
    font-size: 10px;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: var(--teal);
    background: var(--mint-tint);
    border-radius: 999px;
    padding: 2px 8px;
    white-space: nowrap;
}

.gallery-tab-wrap {
    display: inline-flex;
}

.gallery-radio-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 14px;
    color: var(--ink);
}

    .gallery-radio-list button {
        display: flex;
        justify-content: space-between;
        gap: 10px;
        padding: 8px 6px;
        border-radius: 8px;
        width: 100%;
        text-align: left;
    }

        .gallery-radio-list button:hover {
            background: var(--mint-tint-2);
        }

        .gallery-radio-list button.selected {
            background: var(--mint-tint-2);
            color: var(--teal);
        }

/* ------------------------------------------------------------------ grid */

.gallery-grid-wrap {
    padding: 36px var(--gutter) 48px;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* The handoff's fixed 200px row was measured at 1440, where it happens to be about 3:2. It does not
   scale: at 2560 the same row letterboxes every photo to 3:1. Shape the tiles instead, which is what
   the timeline groups already did - and why grouping looked right when the plain grid did not. */
    .gallery-grid > .gallery-tile,
    .gallery-grid > .gallery-placeholder {
        aspect-ratio: 3 / 2;
    }

.gallery-tile {
    position: relative;
    border-radius: 9px;
    overflow: hidden;
    display: block;
    width: 100%;
    padding: 0;
    background: var(--hairline);
}

.gallery-tile--feature {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-pick-badge {
    position: absolute;
    left: 16px;
    top: 16px;
    font-size: 11px;
    letter-spacing: 1.4px;
    background: var(--teal);
    color: #fff;
    border-radius: 999px;
    padding: 4px 12px;
}

.gallery-heart {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: var(--teal);
    display: grid;
    place-items: center;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
    z-index: 2;
}

    .gallery-heart.on {
        background: var(--teal);
        color: #fff;
        box-shadow: 0 2px 8px rgba(0,0,0,.25);
    }

.gallery-tile--feature .gallery-heart {
    right: 14px;
    top: 14px;
    width: 34px;
    height: 34px;
    font-size: 16px;
}

.gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,.5));
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    font-size: 12px;
    color: rgba(255,255,255,.85);
}

.gallery-tile--feature .gallery-caption {
    padding: 18px;
    background: linear-gradient(transparent, rgba(0,0,0,.55));
}

.gallery-star {
    color: var(--star-gold);
}

/* Sized from the font-size of whatever holds it, so the existing per-context sizes still apply. */
.gallery-icon {
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: -0.15em;
    flex: 0 0 auto;
}

.gallery-caption-download {
    font-size: 13px;
    color: #fff;
    border: 1px solid rgba(255,255,255,.4);
    border-radius: 999px;
    padding: 5px 12px;
    opacity: 0;
    transition: opacity 180ms ease;
}

.gallery-tile:hover .gallery-caption-download {
    opacity: 1;
}

.gallery-placeholder {
    border-radius: 9px;
    background-image: repeating-linear-gradient(135deg, #dceae9 0 7px, #edf4f3 7px 14px);
}

    .gallery-placeholder:nth-of-type(4n+1) { opacity: .5; }
    .gallery-placeholder:nth-of-type(4n+2) { opacity: .34; }
    .gallery-placeholder:nth-of-type(4n+3) { opacity: .2; }
    .gallery-placeholder:nth-of-type(4n+4) { opacity: .12; }

.gallery-sentinel {
    height: 1px;
}

/* -------------------------------------------------------- selection mode */

.gallery-toolbar--selecting {
    background: var(--mint-tint-2);
}

.gallery-toolbar--selecting .gallery-toolbar-inner {
    height: 60px;
}

.gallery-selecting-label {
    font-size: 15px;
    color: var(--teal);
}

.gallery-link {
    font-size: 14px;
    color: var(--ink);
    text-decoration: underline;
}

    .gallery-link.subtle {
        color: var(--muted);
    }

.gallery-hint {
    font-size: 13px;
    color: var(--muted);
}

.gallery-cancel-btn {
    font-size: 14px;
    color: var(--muted);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 18px;
    background: #fff;
}

.gallery-check {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(255,255,255,.85);
    border: 1px solid rgba(0,0,0,.08);
    box-shadow: 0 2px 8px rgba(0,0,0,.18);
    display: grid;
    place-items: center;
    font-size: 13px;
    z-index: 2;
}

    .gallery-check .gallery-icon {
        visibility: hidden;
    }

    .gallery-tile.selected .gallery-check .gallery-icon {
        visibility: visible;
    }

.gallery-tile.selected .gallery-check {
    background: var(--teal);
    border-color: var(--teal);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

.gallery-tile-ring {
    position: absolute;
    inset: 0;
    border: 3px solid var(--teal);
    border-radius: 9px;
    background: rgba(3,119,121,.16);
    z-index: 1;
}

.gallery-page.is-selecting .gallery-heart {
    width: 26px;
    height: 26px;
    font-size: 13px;
    background: rgba(255,255,255,.85);
}

.gallery-selection-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 28px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--dark-bar);
    border-radius: 999px;
    padding: 12px 14px 12px 26px;
    box-shadow: 0 14px 40px rgba(0,0,0,.28);
}

.gallery-selection-count {
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
}

.gallery-selection-size {
    font-size: 13px;
    color: #9db5b3;
    white-space: nowrap;
}

.gallery-selection-actions {
    display: flex;
    gap: 10px;
}

.gallery-bar-ghost {
    font-size: 14px;
    color: #e7f1f0;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 999px;
    padding: 10px 18px;
    white-space: nowrap;
}

.gallery-bar-primary {
    font-size: 14px;
    color: var(--dark-bar);
    background: var(--mint);
    border-radius: 999px;
    padding: 10px 20px;
    white-space: nowrap;
}

    .gallery-bar-primary:disabled,
    .gallery-bar-ghost:disabled {
        opacity: .6;
        cursor: default;
    }

/* ------------------------------------------------------- timeline groups */

.gallery-groups {
    padding: 40px var(--gutter) 48px;
}

.gallery-group {
    display: grid;
    grid-template-columns: 210px 1fr;
    gap: 36px;
    padding-bottom: 40px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--hairline);
}

    .gallery-group:last-child {
        border-bottom: 0;
        margin-bottom: 0;
    }

.gallery-group-head {
    position: sticky;
    top: calc(var(--sticky-height) + 24px);
    align-self: start;
}

.gallery-group-name {
    font-family: 'Sirivennela', sans-serif;
    font-size: 30px;
    line-height: 1.15;
    color: var(--teal);
}

.gallery-group-count {
    font-size: 13px;
    color: var(--muted);
    margin-top: 6px;
}

.gallery-group-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

    .gallery-group-grid .gallery-tile {
        aspect-ratio: 3 / 2;
    }

/* -------------------------------------------------------------- lightbox */

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: var(--lightbox-bg);
}

    .gallery-lightbox img.gallery-lightbox-photo {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

/* The two gradients every control is read against. Below the controls, above the photo, and
   deliberately click-through so the frame itself still takes the click. */
.gallery-lightbox-scrim {
    position: absolute;
    left: 0;
    right: 0;
    pointer-events: none;
}

.gallery-lightbox-scrim--top {
    top: 0;
    height: 130px;
    background: var(--lightbox-scrim-top);
}

.gallery-lightbox-scrim--bottom {
    bottom: 0;
    height: 220px;
    background: var(--lightbox-scrim-bottom);
}

/* A gradient alone still loses against a near-white sky; the shadow is what closes that gap. */
.gallery-lightbox-counter,
.gallery-lightbox-controls,
.gallery-lightbox-bottom {
    text-shadow: var(--lightbox-scrim-shadow);
}

.gallery-lightbox-counter {
    position: absolute;
    top: 22px;
    left: 26px;
    font-size: 13px;
    color: rgba(255,255,255,.8);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.gallery-lightbox-controls {
    position: absolute;
    top: 22px;
    right: 28px;
    display: flex;
    align-items: center;
    gap: 26px;
}

/* Text and icon only. The 44px minimum keeps the tap target the size the pill used to give it. */
.gallery-lightbox-action {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 2px;
    color: #fff;
    font-size: 15px;
    white-space: nowrap;
}

    /* Teal fails against a dark photo, so the active heart borrows the star gold instead. */
    .gallery-lightbox-action.on .gallery-icon {
        color: var(--star-gold);
    }

.gallery-lightbox-close .gallery-icon {
    font-size: 20px;
}

.gallery-lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,.45);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 19px;
}

    .gallery-lightbox-nav.prev { left: 28px; }
    .gallery-lightbox-nav.next { right: 28px; }

    .gallery-lightbox-nav:disabled {
        opacity: .3;
        cursor: default;
    }

/* Nothing here has a background any more, so focus needs a ring of its own. */
.gallery-lightbox :focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Credits left, rating right, both resting on the same baseline. */
.gallery-lightbox-bottom {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 26px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.gallery-lightbox-credits {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 9px;
    min-width: 0;
    max-width: 640px;
}

.gallery-credit-technical {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 14px;
    color: rgba(255,255,255,.72);
}

.gallery-credit-separator {
    color: rgba(255,255,255,.35);
}

/* One line, never two: names past the visible count are dropped and the counter speaks for them. */
.gallery-credit-people {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
}

.gallery-credit-label {
    color: rgba(255,255,255,.55);
}

.gallery-credit-label--short {
    display: none;
}

.gallery-credit-names {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

    .gallery-credit-names .gallery-credit-name:nth-child(n+4) {
        display: none;
    }

.gallery-credit-name {
    color: #fff;
    font-size: inherit;
    border-bottom: 1px solid rgba(255,255,255,.35);
    padding-bottom: 1px;
    transition: border-color .15s ease;
}

    .gallery-credit-name:hover {
        border-bottom-color: #fff;
    }

    .gallery-credit-name.is-static {
        border-bottom-color: transparent;
    }

.gallery-tag-counter {
    display: none;
    font-size: 13px;
    color: #fff;
    background: rgba(255,255,255,.16);
    border-radius: 999px;
    padding: 3px 10px;
    text-shadow: none;
}

    .gallery-tag-counter.has-overflow {
        display: block;
    }

    .gallery-tag-counter.open {
        background: #fff;
        color: #0f1415;
    }

.gallery-tag-counter-short {
    display: none;
}

.gallery-tag-backdrop {
    position: fixed;
    inset: 0;
}

/* Opaque and above the scrim: a panel of names is unreadable through a gradient. */
.gallery-tag-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 14px);
    z-index: 1;
    padding: 18px 22px;
    border-radius: 12px;
    background: var(--lightbox-panel-bg);
    border: 1px solid rgba(255,255,255,.1);
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: max-content;
    max-width: 560px;
    max-height: 320px;
    overflow-y: auto;
    text-shadow: none;
    animation: gallery-tag-panel-in .15s ease;
}

@keyframes gallery-tag-panel-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-tag-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.gallery-tag-panel-eyebrow {
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
}

.gallery-tag-panel-close {
    font-size: 16px;
    color: rgba(255,255,255,.65);
    display: grid;
    place-items: center;
}

.gallery-tag-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px 16px;
}

    .gallery-tag-panel-grid .gallery-credit-name {
        font-size: 14px;
        justify-self: start;
    }

.gallery-tag-panel-hint {
    font-size: 13px;
    color: rgba(255,255,255,.5);
}

.gallery-lightbox-rating {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.gallery-rating-own {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.gallery-rating-eyebrow {
    font-size: 11px;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: rgba(255,255,255,.7);
}

/* The button reset carries font-family but not font-size, so each star is sized explicitly. */
.gallery-lightbox .gallery-star-row,
.gallery-lightbox .gallery-star-row button {
    gap: 0;
    font-size: 26px;
    letter-spacing: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,.55);
}

    .gallery-lightbox .gallery-star-row .empty {
        color: rgba(255,255,255,.45);
    }

.gallery-rating-average-eyebrow {
    display: none;
}

.gallery-rating-average-line {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: rgba(255,255,255,.78);
}

.gallery-rating-average-value {
    color: rgba(255,255,255,.78);
}

.gallery-rating-average-count-short {
    display: none;
}

/* ----------------------------------------------------------- empty state */

.gallery-empty {
    padding: 80px var(--gutter);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    text-align: center;
}

.gallery-empty-text {
    font-size: 16px;
    color: var(--muted);
}

.gallery-empty-action {
    flex: 0 0 auto;
    padding: 10px 22px;
}


/* ------------------------------------------------------------ responsive
   Two independent switches:
   - the chrome swaps to the mobile pattern at 1099px, where the desktop
     toolbar runs out of room for six filter triggers next to the tabs;
   - the layout follows the grid breakpoints from the handoff.            */

.gallery-mobile-chips,
.gallery-mobile-actions,
.gallery-mobile-selectbar,
.gallery-mobile-downloadbar,
.gallery-sheet-backdrop,
.gallery-sheet {
    display: none;
}

@media (max-width: 1279px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1099px) {
    .gallery-page {
        --sticky-height: 0px;
        --gutter: 24px;
    }

    .gallery-stickybar,
    .gallery-toolbar,
    .gallery-selection-bar {
        display: none;
    }

    .gallery-applied {
        position: static;
    }

    .gallery-grid-wrap,
    .gallery-groups {
        padding-bottom: 120px;
    }

    .gallery-mobile-chips {
        display: flex;
        gap: 8px;
        padding: 12px var(--gutter);
        overflow-x: auto;
        border-bottom: 1px solid var(--hairline);
        scrollbar-width: none;
    }

        .gallery-mobile-chips::-webkit-scrollbar {
            display: none;
        }

    .gallery-mobile-chip {
        font-size: 13px;
        color: var(--ink);
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 8px 14px;
        white-space: nowrap;
    }

        .gallery-mobile-chip.active {
            color: #fff;
            background: var(--teal);
            border-color: var(--teal);
        }

        .gallery-mobile-chip:disabled {
            color: var(--muted-light);
            border-color: var(--hairline);
        }

    /* Two fixed pills over a fade, both 48px tall for touch. */
    .gallery-mobile-actions {
        display: block;
    }

    .gallery-mobile-fade {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        height: 110px;
        background: linear-gradient(rgba(255,255,255,0), #fff 55%);
        pointer-events: none;
        z-index: 50;
    }

    .gallery-mobile-filter {
        position: fixed;
        right: var(--gutter);
        bottom: 22px;
        z-index: 51;
        display: flex;
        align-items: center;
        gap: 10px;
        height: 48px;
        padding: 0 20px;
        border-radius: 999px;
        background: var(--teal);
        color: #fff;
        font-size: 15px;
        box-shadow: 0 8px 24px rgba(3,119,121,.35);
    }

    .gallery-mobile-select {
        position: fixed;
        left: var(--gutter);
        bottom: 22px;
        z-index: 51;
        display: flex;
        align-items: center;
        gap: 8px;
        height: 48px;
        padding: 0 18px;
        border-radius: 999px;
        background: #fff;
        border: 1px solid var(--border);
        color: var(--ink);
        font-size: 15px;
        box-shadow: 0 8px 24px rgba(0,0,0,.12);
    }

        .gallery-mobile-select .tick {
            color: var(--teal);
        }

    /* Selection mode replaces the pair with a header and a download bar. */
    .gallery-mobile-selectbar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px var(--gutter);
        background: var(--mint-tint-2);
        border-bottom: 1px solid var(--hairline);
        position: sticky;
        top: 0;
        z-index: 40;
    }

    .gallery-mobile-selected {
        font-size: 15px;
        color: var(--teal);
    }

    .gallery-mobile-cancel {
        font-size: 14px;
        color: var(--muted);
    }

    .gallery-mobile-downloadbar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 51;
        padding: 16px var(--gutter) 22px;
        background: rgba(255,255,255,.97);
        border-top: 1px solid var(--hairline);
        display: flex;
        gap: 10px;
        align-items: center;
    }

    .gallery-mobile-fav {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        border-radius: 50%;
        border: 1px solid var(--border);
        color: var(--teal);
        display: grid;
        place-items: center;
        font-size: 17px;
    }

    .gallery-mobile-download {
        flex: 1;
        text-align: center;
        font-size: 15px;
        color: #fff;
        background: var(--teal);
        border-radius: 999px;
        padding: 15px;
    }

        .gallery-mobile-download:disabled {
            opacity: .6;
        }

    /* Bottom sheet */
    .gallery-sheet-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 90;
        background: rgba(18,25,26,.5);
    }

    .gallery-sheet {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        bottom: 0;
        width: min(100%, 520px);
        z-index: 91;
        max-height: 86vh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        padding: 20px;
        display: flex;
        flex-direction: column;
    }

    .gallery-sheet-handle {
        width: 44px;
        height: 4px;
        border-radius: 2px;
        background: var(--border);
        margin: 0 auto 16px;
    }

    .gallery-sheet-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 20px;
    }

    .gallery-sheet-title {
        font-size: 18px;
        color: var(--ink);
    }

    .gallery-sheet-close {
        font-size: 20px;
        color: var(--muted);
    }

    .gallery-sheet-rows {
        display: flex;
        flex-direction: column;
        gap: 20px;
        font-size: 15px;
        color: var(--ink);
        overflow-y: auto;
    }

    .gallery-sheet-row {
        display: flex;
        justify-content: space-between;
        gap: 16px;
        padding-bottom: 14px;
        border-bottom: 1px solid var(--hairline);
        width: 100%;
        text-align: left;
    }

        .gallery-sheet-row:last-child {
            border-bottom: 0;
            padding-bottom: 0;
        }

        .gallery-sheet-row:disabled {
            color: #c3cccc;
            cursor: not-allowed;
        }

            .gallery-sheet-row:disabled .gallery-sheet-value {
                color: inherit;
            }

    .gallery-sheet-value {
        color: var(--muted);
    }

        .gallery-sheet-value.set {
            color: var(--teal);
        }

    .gallery-sheet-footer {
        margin-top: auto;
        padding-top: 20px;
        display: flex;
        gap: 12px;
    }

    .gallery-sheet-reset {
        flex: 1;
        text-align: center;
        font-size: 15px;
        color: var(--muted);
        border: 1px solid var(--border);
        border-radius: 999px;
        padding: 14px;
    }

    .gallery-sheet-apply {
        flex: 2;
        text-align: center;
        font-size: 15px;
        color: #fff;
        background: var(--teal);
        border-radius: 999px;
        padding: 14px;
    }

    /* The sub-sheet reuses the popover bodies, laid out full width. */
    .gallery-subsheet-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
        overflow-y: auto;
    }

        .gallery-subsheet-body .gallery-option-list {
            max-height: none;
        }
}

@media (max-width: 1023px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .gallery-tile--feature {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-group {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .gallery-group-head {
        position: static;
    }

    .gallery-group-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .gallery-page {
        --gutter: 16px;
    }

    .gallery-hero {
        height: 210px;
    }

    .gallery-hero-scrim {
        background: linear-gradient(180deg, rgba(3,58,59,.4), rgba(3,58,59,.6));
    }

    .gallery-hero-bar {
        top: 14px;
    }

        .gallery-hero-bar .gallery-brand img {
            height: 22px;
        }

    .gallery-brand-name,
    .gallery-hero .gallery-signout,
    .gallery-subline {
        display: none;
    }

    .gallery-hero .gallery-lang button {
        padding: 4px 6px;
    }

    .gallery-hero-title {
        bottom: 18px;
        gap: 2px;
    }

    .gallery-eyebrow {
        font-size: 11px;
        letter-spacing: 2px;
    }

    .gallery-title {
        font-size: 32px;
        line-height: 1.1;
    }

    .gallery-grid-wrap {
        padding-top: 14px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .gallery-page.is-selecting .gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

        /* Square tiles fit more of the selection on screen at once. */
        .gallery-page.is-selecting .gallery-grid > .gallery-tile {
            aspect-ratio: 1 / 1;
        }

    .gallery-heart {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }

    .gallery-page.is-selecting .gallery-heart {
        display: none;
    }

    .gallery-page.is-selecting .gallery-check {
        left: 8px;
        top: 8px;
    }

    .gallery-page.is-selecting .gallery-caption {
        display: none;
    }

    .gallery-groups {
        padding-top: 14px;
    }

    .gallery-group-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* The bottom block is taller here, so the gradient it sits on grows with it. */
    .gallery-lightbox-scrim--bottom {
        height: 260px;
    }

    /* One block: technical line, people line, a rule, then the two ratings side by side. */
    .gallery-lightbox-bottom {
        left: 16px;
        right: 16px;
        bottom: 16px;
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .gallery-lightbox-credits {
        max-width: none;
        gap: 12px;
    }

    .gallery-credit-technical {
        flex-wrap: wrap;
        gap: 6px 8px;
        font-size: 12px;
        color: rgba(255,255,255,.55);
    }

        /* Date and phase fit one row on their own; should a phase ever be long enough not to, the
           row breaks between its parts rather than inside a date. */
        .gallery-credit-technical > span {
            white-space: nowrap;
        }

    .gallery-credit-camera {
        display: none;
    }

    .gallery-credit-people {
        font-size: 14px;
    }

    .gallery-credit-label--full {
        display: none;
    }

    .gallery-credit-label--short {
        display: inline;
    }

    /* One name only at this width; the counter carries the rest. */
    .gallery-credit-names .gallery-credit-name:nth-child(n+2) {
        display: none;
    }

    .gallery-tag-counter {
        display: none;
    }

        .gallery-tag-counter.has-overflow-mobile {
            display: block;
        }

    .gallery-tag-counter-full {
        display: none;
    }

    .gallery-tag-counter-short {
        display: inline;
    }

    /* A bottom sheet rather than a popover: there is no room to anchor one above the line. */
    .gallery-tag-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        max-width: none;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        border-left: none;
        border-right: none;
        border-bottom: none;
    }

    .gallery-tag-panel-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Own rating and guest average share one row, split left and right. */
    .gallery-lightbox-rating {
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 16px;
        padding-top: 12px;
        border-top: 1px solid rgba(255,255,255,.08);
    }

    .gallery-rating-own {
        align-items: flex-start;
    }

    .gallery-rating-eyebrow {
        font-size: 10px;
    }

    .gallery-lightbox .gallery-star-row {
        font-size: 22px;
        letter-spacing: 3px;
    }

    .gallery-rating-average {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }

    .gallery-rating-average-eyebrow {
        display: block;
    }

    .gallery-rating-average-line {
        font-size: 14px;
    }

    .gallery-rating-average-label,
    .gallery-rating-average-count {
        display: none;
    }

    .gallery-rating-average-count-short {
        display: inline;
    }

    .gallery-lightbox-controls {
        top: 16px;
        right: 16px;
        gap: 14px;
    }

    /* Icons only up here - the labels would crowd the counter. */
    .gallery-lightbox-action {
        min-width: 44px;
        justify-content: center;
    }

    .gallery-lightbox-action-label {
        display: none;
    }

    .gallery-lightbox-counter {
        top: 20px;
        left: 16px;
    }
}

.gallery-lightbox-rating--read-only {
    justify-content: flex-end;
}
