/* Gallery layout. Typography, spacing, controls and colours use the shared styles. */
.gallery-watch [hidden] { display: none; }
.gallery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); scroll-margin-top: var(--space-4); }
.gallery-switcher { display: flex; align-items: center; gap: var(--space-2); }
.gallery-switcher > span { margin-right: var(--space-2); }
.gallery-watch-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: var(--space-8) var(--space-6); }
.gallery-watch-detail.shell { max-width: 1040px; }
.gallery-watch-detail .gallery-watch-layout { grid-template-columns: minmax(0, 1fr); }
.gallery-watch-viewer, .gallery-browser { min-width: 0; }
.gallery-catalogue-region { display: contents; }
.gallery-catalogue-region > .bulk-moderation-panel { grid-column: 1 / -1; }
.watch-media-stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 16 / 9; max-height: min(660px, 65svh); overflow: hidden; border: 1px solid var(--line); border-radius: .625rem; background: #05090e; }
.watch-media-stage > img { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.watch-video { position: absolute; inset: 0; }
.watch-video .youtube-video-stage { height: 100%; aspect-ratio: auto; min-height: 0; border: 0; border-radius: 0; background: transparent; }
.watch-media-stage .watch-expand { position: absolute; bottom: var(--space-3); right: var(--space-3); color: var(--text); background: #080d14bd; border: 1px solid #ffffff30; }
.watch-details { padding-top: var(--space-5); }
.watch-details h2 { margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
.watch-details > p { margin: 0 0 var(--space-2); }
.watch-creator-actions { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.watch-creator-actions > .byline { flex: 1; }
.watch-gallery-actions { display: flex; justify-content: flex-end; flex-shrink: 0; margin-left: auto; }
.watch-creator-actions .content-actions, .watch-gallery-actions .content-actions { margin: 0; padding: 0; border: 0; flex-shrink: 0; }
.watch-creator-actions .project-actions-row, .watch-gallery-actions .project-actions-row { flex-wrap: nowrap; gap: var(--space-2); }
.watch-creator-actions [data-project-share-label], .watch-gallery-actions [data-project-share-label] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.watch-description { margin-block: var(--space-4); padding: var(--space-4) var(--space-5); border: 1px solid var(--line); border-radius: .5rem; background: var(--surface); }
.watch-description p { white-space: pre-line; overflow-wrap: anywhere; margin: 0; }
.watch-gallery-header { display: grid; gap: var(--space-4); margin-bottom: var(--space-8); }
.watch-gallery-header h1 { margin: 0; overflow-wrap: anywhere; }
.watch-gallery-header .watch-description { margin: 0; padding: 0; border: 0; background: transparent; }
.watch-item-details { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-5); }
.watch-item-caption { flex: 1; min-width: 0; }
.watch-item-caption h2 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.watch-items { min-width: 0; margin-top: var(--space-4); }
.watch-items-position { display: block; margin-top: var(--space-2); text-align: left; }
.watch-items-heading { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-2); }
.watch-items-heading h3 { margin: 0; }
.watch-items-body { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--space-2); }
[data-watch-ready] .watch-items-body { grid-template-columns: var(--control-height) minmax(0, 1fr) var(--control-height); }
.watch-item-list { display: flex; gap: var(--space-2); min-width: 0; overflow-x: auto; padding: var(--space-1); scroll-snap-type: x proximity; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--control-border) transparent; }
.watch-item-choice { position: relative; display: block; flex: 0 0 clamp(80px, 10vw, 112px); min-width: 0; aspect-ratio: 4 / 3; margin: 0; padding: 0; border: 2px solid transparent; border-radius: .375rem; background: #05090e; color: var(--text); overflow: hidden; scroll-snap-align: start; }
.watch-item-choice[aria-current="true"] { border-color: var(--cyan); }
.watch-item-choice:focus-visible { outline-offset: -4px; }
.watch-item-choice img { display: block; width: 100%; height: 100%; object-fit: contain; }
.watch-item-choice > span { position: absolute; bottom: var(--space-1); right: var(--space-1); }
.watch-item-choice .icon { width: var(--control-icon-size); height: var(--control-icon-size); }
.gallery-browser { border-left: 1px solid var(--line); padding-left: var(--space-5); }
.browse-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.browse-heading h2 { margin: 0; }
.browse-heading > span { flex-shrink: 0; }
.catalogue-search { margin-bottom: var(--space-4); }
.gallery-choices { display: flex; flex-direction: column; gap: var(--space-2); max-height: min(790px, 82svh); overflow-y: auto; overscroll-behavior-y: contain; padding: var(--space-1); scrollbar-width: thin; scrollbar-color: var(--control-border) transparent; }
.gallery-choice-row { display: flex; flex: 0 0 auto; min-width: 0; align-items: flex-start; }
.gallery-choice-row > .bulk-item-selection { flex: 0 0 auto; }
.gallery-choice { display: grid; flex: 1; min-width: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-3); padding: var(--space-2); overflow: hidden; border: 1px solid transparent; border-radius: .5rem; background: transparent; color: inherit; text-decoration: none; }
.gallery-choice:hover { background: var(--surface); color: inherit; }
.gallery-choice[aria-current="true"] { background: var(--surface); border-color: var(--cyan); }
.gallery-choice-picture { position: relative; display: block; width: 100%; min-width: 0; min-height: 8.5rem; aspect-ratio: 16 / 10; border-radius: .25rem; background: #05090e; }
.gallery-choice-picture img { display: block; width: 100%; height: 100%; object-fit: contain; }
.gallery-choice-picture > .tag { position: absolute; bottom: var(--space-2); right: var(--space-2); background: #080d14e6; color: var(--text); border-color: #ffffff40; }
.gallery-choice-copy { display: flex; flex-direction: column; gap: calc(var(--space-1) + 6px); min-width: 0; min-height: 0; contain: size; overflow: hidden; }
.gallery-choice h3 { display: -webkit-box; flex: 0 0 auto; margin: 0; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.gallery-choice .choice-author { flex: 0 0 auto; }
.gallery-choice .choice-author .byline-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.choice-description-space { flex: 1; min-height: 0; overflow: hidden; }
.gallery-choice .choice-description { display: -webkit-box; margin: 0; -webkit-box-orient: vertical; -webkit-line-clamp: var(--description-lines, 3); overflow: hidden; overflow-wrap: anywhere; }
.watch-image-dialog { --dialog-width: 1440px; }
.watch-image-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.watch-image-dialog > img { display: block; width: 100%; height: min(70svh, 1000px); object-fit: contain; }
.watch-image-dialog > p { margin: var(--space-3) 0 0; }
@media (max-width: 1000px) {
    .gallery-watch-layout { grid-template-columns: minmax(0, 1fr); }
    .gallery-browser { border: 0; padding-left: 0; }
    .gallery-choices { max-height: none; overflow: visible; }
    .gallery-choice { border-color: var(--line); }
}
@media (max-width: 720px) {
    .watch-media-stage { aspect-ratio: 4 / 3; max-height: 56svh; }
    .watch-media-stage.is-video { aspect-ratio: 16 / 9; }
    .gallery-switcher { gap: var(--space-1); }
    .gallery-switcher > span { margin-right: 0; }
    .watch-creator-actions { flex-wrap: wrap; gap: var(--space-2); }
}
@media (max-width: 460px) {
    .gallery-toolbar { flex-wrap: wrap; }
    .gallery-switcher { margin-left: auto; }
}
@media (pointer: coarse) {
    [data-watch-ready] .watch-items-body { grid-template-columns: minmax(0, 1fr); }
    .watch-items-body .watch-item-step { display: none; }
}
@media (forced-colors: active) {
    .watch-item-choice[aria-current="true"], .gallery-choice[aria-current="true"] { outline: 2px solid Highlight; }
}
