/* Gallery v2 (2026-10-12): hosted gallery detail page.
 * New class names (gv2-*) so none of the legacy gd-* layers in gallery-detail.php
 * apply. The photo viewer (gd-lightbox) is unchanged in this phase.
 * Colors come from the Admin theme tokens (--text, --accent, ...). */

.gv2 {
    --gv2-text: var(--text, #F4F1EA);
    --gv2-muted: var(--text-muted, #A8A39A);
    --gv2-accent: var(--accent, #D9A42E);
    --gv2-accent-text: var(--accent-text, #E2B13C);
    --gv2-on-accent: var(--on-accent, #17120A);
    --gv2-panel: var(--surface, #121215);
    --gv2-card: var(--card-bg, #141417);
    --gv2-line: var(--card-border, rgba(255,255,255,0.08));
    --gv2-cta-line: var(--cta-border, rgba(255,255,255,0.18));
    --gv2-display: var(--font-display, 'Bricolage Grotesque', var(--font-body, system-ui), sans-serif);
    max-width: 1240px;
    margin: 24px auto 48px;
    padding: 24px 24px 40px;
    box-sizing: border-box;
    border-radius: 24px;
    background: color-mix(in srgb, var(--gv2-panel) 94%, transparent);
    color: var(--gv2-text);
    font-family: var(--font-body, 'DM Sans', system-ui, sans-serif);
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.gv2 *, .gv2 *::before, .gv2 *::after { box-sizing: border-box; }
.gv2 [hidden] { display: none !important; }

/* Breadcrumb */
.gv2-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 14px; color: var(--gv2-muted); }
.gv2-crumbs a { color: var(--gv2-muted); text-decoration: none; }
.gv2-crumbs a:hover { color: var(--gv2-text); text-decoration: underline; }
.gv2-crumbs [aria-current] { color: var(--gv2-text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }

/* Header: info beside cover photo (text never sits on the photo) */
.gv2-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 40px; align-items: center; }
.gv2-head--nocover { grid-template-columns: minmax(0, 1fr); }
.gv2-head__info { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.gv2-badges { display: flex; flex-wrap: wrap; gap: 8px; }
.gv2-badge { padding: 5px 10px; border-radius: 999px; background: rgba(255,255,255,0.06); border: 1px solid var(--gv2-line); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--gv2-muted); }
.gv2-title { margin: 0; font-family: var(--gv2-display); font-weight: 800; font-size: clamp(2rem, 4.2vw, 3.25rem); line-height: 1.04; letter-spacing: -0.02em; color: var(--gv2-text); overflow-wrap: anywhere; }
.gv2-meta { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; font-size: 16px; color: var(--gv2-muted); }
.gv2-meta__item { display: inline-flex; align-items: center; gap: 8px; }
.gv2-meta__item svg { width: 17px; height: 17px; flex: 0 0 17px; color: var(--gv2-accent-text); }
.gv2-desc { margin: 0; font-size: 15px; line-height: 1.6; color: var(--gv2-muted); max-width: 60ch; }
.gv2-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }
.gv2-cover { margin: 0; border-radius: 18px; overflow: hidden; aspect-ratio: 3 / 2; background: var(--gv2-card); border: 1px solid var(--gv2-line); }
.gv2-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Buttons */
.gv2-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid transparent; font: 600 15px/1 var(--font-body, 'DM Sans', system-ui, sans-serif); text-decoration: none; cursor: pointer; white-space: nowrap; }
.gv2-btn svg { width: 18px; height: 18px; flex: 0 0 18px; }
.gv2-btn--gold { background: var(--gv2-accent); color: var(--gv2-on-accent); font-weight: 700; }
.gv2-btn--gold:hover { filter: brightness(1.08); }
.gv2-btn--gold:disabled { opacity: .55; cursor: progress; }
.gv2-btn--ghost { background: transparent; color: var(--gv2-text); border-color: var(--gv2-cta-line); }
.gv2-btn--ghost:hover { background: rgba(255,255,255,0.06); }
.gv2-btn--sm { min-height: 44px; padding: 0 16px; font-size: 14px; }
.gv2-btn:focus-visible, .gv2-link:focus-visible, .gv2-sort__btn:focus-visible, .gv2-tile__open:focus-visible, .gv2-like:focus-visible, .gv2-buy:focus-visible, .gv2-ml__item:focus-visible { outline: 2px solid var(--gv2-accent-text); outline-offset: 2px; }
.gv2-link { background: none; border: 0; padding: 8px 0; color: var(--gv2-accent-text); font: 600 14px var(--font-body, 'DM Sans', system-ui, sans-serif); cursor: pointer; }
.gv2-link:hover { text-decoration: underline; }

/* "From the event" strip (only for galleries linked to a calendar event) */
.gv2-event { display: flex; align-items: center; gap: 18px; padding: 14px 18px 14px 14px; border-radius: 16px; background: var(--gv2-card); border: 1px solid var(--gv2-line); }
.gv2-event__date { flex: 0 0 auto; width: 54px; height: 60px; border-radius: 10px; background: rgba(255,255,255,0.05); border: 1px solid var(--gv2-line); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.gv2-event__date small { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gv2-accent-text); }
.gv2-event__date b { font-family: var(--gv2-display); font-size: 22px; line-height: 1; }
.gv2-event__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gv2-event__label { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--gv2-muted); }
.gv2-event__line { font-size: 16px; font-weight: 600; }

/* Section headings */
.gv2-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.gv2-h2 { margin: 0; font-family: var(--gv2-display); font-weight: 700; font-size: 24px; color: var(--gv2-text); }
.gv2-h2__count { font-family: var(--font-body, 'DM Sans', system-ui, sans-serif); font-size: 16px; font-weight: 500; color: var(--gv2-muted); }

/* Most liked row */
.gv2-ml { display: flex; flex-direction: column; gap: 14px; }
.gv2-ml__row { display: flex; gap: 12px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; scroll-snap-type: x proximity; }
.gv2-ml__item { position: relative; flex: 0 0 150px; height: 225px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--gv2-card); cursor: pointer; scroll-snap-align: start; }
.gv2-ml__item img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.gv2-ml__item:hover img { transform: scale(1.04); }
.gv2-ml__badge { position: absolute; left: 8px; bottom: 8px; height: 28px; padding: 0 10px; border-radius: 14px; background: rgba(10,10,14,0.72); display: flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: #FF6B81; }
.gv2-ml__badge svg { width: 13px; height: 13px; }

/* Toolbar + sort toggle */
.gv2-photos { display: flex; flex-direction: column; gap: 16px; container-type: inline-size; }
.gv2-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 14px; border-top: 1px solid var(--gv2-line); flex-wrap: wrap; }
.gv2-sort { display: flex; padding: 4px; gap: 4px; border-radius: 12px; background: var(--gv2-card); border: 1px solid var(--gv2-line); }
.gv2-sort__btn { min-height: 38px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; color: var(--gv2-muted); font: 600 14px var(--font-body, 'DM Sans', system-ui, sans-serif); cursor: pointer; }
.gv2-sort__btn[aria-pressed="true"] { background: rgba(255,255,255,0.10); color: var(--gv2-text); }

/* Photo grid: justified rows (Phase 3c). Every tile keeps its photo's real shape
   (--r = width / height, set by gallery-detail.js when the thumbnail loads) and each
   row ends flush with the right edge, so there are no holes and no cropping. Order is
   kept. gallery-detail.js sizes the tiles (gv2-grid--js); --gv2-rowh is the tallest a
   row may be. The flex rules below are only the no-JS fallback. */
.gv2-grid { --gv2-cols: 5; --gv2-gap: 10px; --gv2-rowh: 280px; display: flex; flex-wrap: wrap; gap: var(--gv2-gap); }
.gv2-grid::after { content: ''; flex: 999999 1 0px; height: 0; }
.gv2-tile { --r: 0.6667; position: relative; border-radius: 12px; overflow: hidden; background: var(--gv2-card);
    flex: var(--r) 1 calc(var(--r) * var(--gv2-rowh) * 0.85); min-width: 0; aspect-ratio: var(--r); }
.gv2-grid--js::after { display: none; }
.gv2-grid--js .gv2-tile { flex: 0 0 auto; aspect-ratio: auto; }
.gv2-tile__open { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.gv2-tile__open img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; display: block; transition: transform .3s, opacity .3s; }
.gv2-tile__open img.loading { opacity: 0; }
.gv2-tile:hover .gv2-tile__open img { transform: scale(1.03); }
.gv2-tile--new { animation: gv2-in .35s ease both; }
@keyframes gv2-in { from { opacity: 0; } to { opacity: 1; } }
.gv2-like, .gv2-buy { position: absolute; right: 8px; z-index: 1; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; border: 0; background: rgba(10,10,14,0.62); color: #FFFFFF; display: flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; text-decoration: none; font: 600 13px var(--font-body, 'DM Sans', system-ui, sans-serif); }
.gv2-like { top: 8px; }
.gv2-buy { bottom: 8px; padding: 0; width: 40px; }
.gv2-like svg, .gv2-buy svg { width: 17px; height: 17px; flex: 0 0 17px; }
.gv2-like.liked { color: #FF6B81; }
.gv2-like.animate svg { animation: gv2-pop .25s ease; }
@keyframes gv2-pop { 50% { transform: scale(1.3); } }
.gv2-like:hover, .gv2-buy:hover { background: rgba(10,10,14,0.82); }
.gv2-tile--hidden::after { content: 'Hidden'; position: absolute; left: 8px; bottom: 8px; padding: 4px 8px; border-radius: 6px; background: rgba(179,38,30,0.9); color: #fff; font-size: 12px; font-weight: 700; pointer-events: none; }
.gv2-tile--hidden .gv2-tile__open img { opacity: .4; }

/* Load more + progress */
.gv2-more { display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 16px; }
.gv2-more__text { font-size: 14px; color: var(--gv2-muted); }
.gv2-more__bar { width: 240px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.08); overflow: hidden; }
.gv2-more__bar span { display: block; height: 100%; width: 0; background: var(--gv2-accent); transition: width .3s; }
.gv2-more__end { font-size: 14px; color: var(--gv2-muted); }

@media (max-width: 1100px) {
    .gv2-grid { --gv2-cols: 4; --gv2-rowh: 260px; }
}
@media (max-width: 860px) {
    .gv2-head { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .gv2-cover { order: -1; }
    .gv2-grid { --gv2-cols: 3; --gv2-rowh: 240px; }
}
@media (max-width: 600px) {
    .gv2 { margin: 8px 8px 32px; padding: 12px 12px 28px; border-radius: 16px; gap: 22px; }
    .gv2-crumbs a:first-child::before { content: '\2039\00a0'; }
    .gv2-title { font-size: 32px; }
    .gv2-meta { font-size: 15px; gap: 6px 14px; }
    .gv2-actions { flex-wrap: nowrap; }
    .gv2-actions .gv2-btn { padding: 0 16px; }
    .gv2-actions .gv2-btn--gold { flex: 1 1 auto; }
    .gv2-btn--share { flex: 0 0 48px; width: 48px; padding: 0; }
    .gv2-btn--share .gv2-btn__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .gv2-event { display: grid; grid-template-columns: auto minmax(0, 1fr); padding: 10px 12px 12px 10px; gap: 10px 12px; }
    .gv2-event .gv2-btn { grid-column: 1 / -1; }
    .gv2-event__line { font-size: 14px; }
    .gv2-event .gv2-btn { flex: 1 1 100%; }
    .gv2-ml__item { flex-basis: 112px; height: 168px; }
    .gv2-h2 { font-size: 20px; }
    .gv2-grid { --gv2-cols: 2; --gv2-gap: 6px; --gv2-rowh: 215px; }
    .gv2-like, .gv2-buy { min-width: 38px; height: 38px; border-radius: 19px; right: 5px; padding: 0 8px; }
    .gv2-like { top: 5px; }
    .gv2-buy { bottom: 5px; width: 38px; padding: 0; }
    .gv2-tile--sm .gv2-buy { display: none; }
    .gv2-more .gv2-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .gv2-tile__open img, .gv2-ml__item img, .gv2-tile--new, .gv2-like.animate svg { transition: none; animation: none; }
}

/* ---- Photo viewer (Phase 2) ---- */
.gv2-viewer { position: fixed; inset: 0; z-index: 2147482000; display: none; background: #050506; color: #F4F1EA; font-family: var(--font-body, 'DM Sans', system-ui, sans-serif); }
.gv2-viewer.active { display: flex; }
.gv2-viewer__backdrop { position: absolute; inset: 0; }
.gv2-viewer__main { position: relative; flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; height: 100%; height: 100dvh; box-sizing: border-box; padding-top: var(--gv2-safe-top, 0px); padding-bottom: var(--gv2-safe-bottom, 0px); }
.gv2-viewer__bar { flex: 0 0 auto; height: 64px; padding: 0 16px 0 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.gv2-viewer__where { display: flex; align-items: baseline; gap: 14px; min-width: 0; }
.gv2-viewer__count { font-size: 15px; color: #77736C; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gv2-viewer__count b { color: #F4F1EA; font-weight: 700; }
.gv2-viewer__title { font-size: 15px; color: #A8A39A; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv2-viewer__tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.gv2-vbtn { min-width: 44px; height: 44px; padding: 0; border-radius: 22px; border: 0; background: transparent; color: #E8E4DC; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px var(--font-body, 'DM Sans', system-ui, sans-serif); cursor: pointer; }
.gv2-vbtn svg { width: 20px; height: 20px; flex: 0 0 20px; }
.gv2-vbtn:hover { background: rgba(255,255,255,0.08); }
.gv2-vbtn--solid, .gv2-vbtn--pill { background: #1C1C21; }
.gv2-vbtn--pill { padding: 0 16px 0 14px; }
.gv2-vbtn--pill svg { width: 16px; height: 16px; flex-basis: 16px; }
.gv2-vbtn--admin { padding: 0 14px; border: 1px solid #34343B; font-size: 13px; }
.gv2-vbtn--danger { color: #F08A84; border-color: #5A2F31; }
.gv2-vbtn--admin.is-hidden { color: #8FE3D7; }
.gv2-vbtn[hidden] { display: none; }
.gv2-icon-pause { display: none; }
.gv2-playing .gv2-icon-play { display: none; }
.gv2-playing .gv2-icon-pause { display: block; }
.gv2-viewer__progress { flex: 0 0 auto; height: 3px; margin: 0 24px; border-radius: 2px; background: transparent; overflow: hidden; }
.gv2-playing .gv2-viewer__progress { background: #1C1C21; }
.gv2-viewer__progress span { display: block; height: 100%; width: 0; background: var(--accent-text, #E2B13C); }
.gv2-viewer__stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; gap: 16px; padding: 12px 20px; }
.gv2-viewer__imgwrap { flex: 1 1 auto; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.gv2-viewer__imgwrap img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; display: block; user-select: none; -webkit-user-drag: none; }
.gd-lb-swipe-transition { transition: transform .2s ease, opacity .2s ease; }
.gv2-viewer__arrow { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 50%; border: 1px solid #2A2A31; background: rgba(28,28,33,0.85); color: #F4F1EA; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.gv2-viewer__arrow svg { width: 22px; height: 22px; }
.gv2-viewer__arrow:hover { background: #26262C; }
.gv2-viewer__arrow[style*="none"] { display: flex !important; visibility: hidden; }
.gv2-viewer__foot { flex: 0 0 auto; padding: 12px 24px 20px; display: flex; align-items: center; justify-content: center; gap: 24px; }
.gv2-viewer__strip { display: none !important; }
.gv2-viewer__strip { display: flex; gap: 6px; min-width: 0; overflow: hidden; }
.gv2-strip__item { flex: 0 0 56px; width: 56px; height: 56px; padding: 0; border-radius: 8px; border: 2px solid transparent; overflow: hidden; background: #141417; opacity: .55; cursor: pointer; }
.gv2-strip__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gv2-strip__item:hover { opacity: .85; }
.gv2-strip__item.is-current { opacity: 1; border-color: var(--accent-text, #E2B13C); }
.gv2-viewer__actions { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; }
.gv2-vact { height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid #34343B; background: transparent; color: #F4F1EA; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px var(--font-body, 'DM Sans', system-ui, sans-serif); text-decoration: none; cursor: pointer; white-space: nowrap; }
.gv2-vact svg { width: 18px; height: 18px; flex: 0 0 18px; }
.gv2-vact:hover { background: rgba(255,255,255,0.06); }
.gv2-vact--like.liked { color: #FF6B81; border-color: #4A2730; background: #241318; }
.gv2-vact--like.animate svg { animation: gv2-pop .25s ease; }
.gv2-vact--buy { background: var(--accent, #D9A42E); color: var(--on-accent, #17120A); border-color: transparent; font-weight: 700; }
.gv2-vact--buy:hover { background: var(--accent, #D9A42E); filter: brightness(1.08); }
.gv2-vbtn:focus-visible, .gv2-vact:focus-visible, .gv2-viewer__arrow:focus-visible, .gv2-strip__item:focus-visible { outline: 2px solid var(--accent-text, #E2B13C); outline-offset: 2px; }
.gv2-toast { position: absolute; left: 50%; bottom: 96px; transform: translateX(-50%); padding: 10px 16px; border-radius: 10px; background: #26262C; color: #F4F1EA; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px); overflow-wrap: anywhere; }
.gv2-toast.is-on { opacity: 1; }
body.gd-lightbox-open { overflow: hidden; }

@media (max-width: 600px) {
    .gv2-viewer__bar { height: 56px; padding: 0 8px 0 16px; }
    .gv2-viewer__title, .gv2-vbtn__label, .gv2-vbtn--admin { display: none; }
    .gv2-vbtn--pill { padding: 0; width: 44px; }
    .gv2-viewer__progress { margin: 0 16px; }
    .gv2-viewer__stage { padding: 8px 0; gap: 0; }
    .gv2-viewer .gv2-viewer__arrow, .gv2-viewer .gv2-viewer__arrow[style*="none"] { display: none !important; }
    .gv2-viewer__imgwrap img { border-radius: 0; }
    .gv2-viewer__strip { display: none; }
    .gv2-viewer__foot { padding: 10px 16px 24px; }
    .gv2-viewer__actions { width: 100%; }
    .gv2-vact { height: 52px; border-radius: 14px; }
    #gv2-share-photo { width: 52px; padding: 0; }
    #gv2-share-photo .gv2-vact__label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
    .gv2-vact--buy { flex: 1 1 auto; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .gd-lb-swipe-transition { transition: none; }
}

/* ---- Sponsor bar (Phase 3a). --gv2-sponsor is the sponsor's brand color. ---- */
.gv2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gv2-sponsor { --gv2-sponsor: #2BB3A3; display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; padding: 14px 14px 14px 18px; border-radius: 16px;
    background: color-mix(in srgb, var(--gv2-sponsor) 12%, #0B0B0E); border: 1px solid color-mix(in srgb, var(--gv2-sponsor) 38%, transparent); }
.gv2-sponsor__tag { flex: 0 0 auto; padding: 4px 8px; border-radius: 6px; background: color-mix(in srgb, var(--gv2-sponsor) 28%, #0B0B0E); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: color-mix(in srgb, var(--gv2-sponsor) 55%, #FFFFFF); }
.gv2-sponsor__label { font-size: 15px; color: color-mix(in srgb, var(--gv2-sponsor) 25%, #E8E4DC); }
.gv2-sponsor__brand { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.gv2-sponsor__logo { height: 36px; width: auto; max-width: 140px; object-fit: contain; display: block; }
.gv2-sponsor__mono { width: 34px; height: 34px; border-radius: 50%; background: var(--gv2-sponsor); color: #0B0B0E; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px; }
.gv2-sponsor__name { font-family: var(--gv2-display); font-weight: 800; font-size: 20px; color: var(--gv2-text); }
.gv2-sponsor__msg { font-size: 14px; color: var(--gv2-muted); }
.gv2-sponsor__visit { margin-left: auto; min-height: 44px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--gv2-sponsor); color: color-mix(in srgb, var(--gv2-sponsor) 55%, #FFFFFF); font-size: 14px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; white-space: nowrap; }
.gv2-sponsor__visit svg { width: 15px; height: 15px; }
.gv2-sponsor__visit:hover { background: color-mix(in srgb, var(--gv2-sponsor) 18%, transparent); }
.gv2-sponsor__visit:focus-visible { outline: 2px solid var(--gv2-sponsor); outline-offset: 2px; }
@media (max-width: 600px) {
    .gv2-sponsor { padding: 12px; gap: 10px 12px; }
    .gv2-sponsor__label { flex: 1 1 auto; font-size: 13px; }
    .gv2-sponsor__brand { flex: 1 1 100%; }
    .gv2-sponsor__visit { flex: 1 1 100%; margin-left: 0; justify-content: center; }
}

/* ---- Sponsored slideshow (Phase 3b): side panel (desktop), banner (phone), opening card, break card ---- */
.gv2-viewer--sponsored { --gv2-sponsor: #2BB3A3; }
.gv2-sp-panel, .gv2-sp-banner { display: none; }
.gv2-sp-tag { display: inline-block; padding: 4px 9px; border-radius: 6px; background: color-mix(in srgb, var(--gv2-sponsor, #2BB3A3) 28%, #0B0B0E); font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--gv2-sponsor, #2BB3A3) 55%, #FFFFFF); }
.gv2-sp-mono { flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; background: var(--gv2-sponsor); color: #061417; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 28px; }
.gv2-sp-mono--lg { width: 120px; height: 120px; font-size: 52px; }
.gv2-sp-visit { min-height: 48px; padding: 0 22px; border-radius: 12px; border: 1px solid var(--gv2-sponsor); color: color-mix(in srgb, var(--gv2-sponsor) 55%, #FFFFFF); font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.gv2-sp-visit svg { width: 16px; height: 16px; }
.gv2-sp-visit:hover { background: color-mix(in srgb, var(--gv2-sponsor) 18%, transparent); }
.gv2-sp-visit:focus-visible, .gv2-sp-banner:focus-visible, .gv2-sp-panel__artlink:focus-visible { outline: 2px solid var(--gv2-sponsor); outline-offset: 2px; }

/* Desktop: a 360px panel on the left that stays up for the whole slideshow. */
@media (min-width: 901px) {
    .gv2-ss-mode .gv2-sp-panel { position: relative; flex: 0 0 360px; width: 360px; height: 100%; height: 100dvh; box-sizing: border-box; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: calc(40px + var(--gv2-safe-top, 0px)) 32px calc(40px + var(--gv2-safe-bottom, 0px)); text-align: center; overflow: hidden;
        background-color: color-mix(in srgb, var(--gv2-sponsor) 10%, #050506);
        background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--gv2-sponsor) 12%, transparent) 0px, color-mix(in srgb, var(--gv2-sponsor) 12%, transparent) 2px, transparent 2px, transparent 28px);
        border-right: 1px solid color-mix(in srgb, var(--gv2-sponsor) 30%, #050506); }
    .gv2-ss-mode .gv2-sp-panel--art { padding: var(--gv2-safe-top, 0px) 0 var(--gv2-safe-bottom, 0px); gap: 0; background-image: none; }
}
.gv2-sp-panel__label { margin: 0; font-size: 15px; color: color-mix(in srgb, var(--gv2-sponsor) 25%, #E8E4DC); }
.gv2-sp-panel__logo { max-width: 220px; max-height: 140px; width: auto; height: auto; object-fit: contain; display: block; }
.gv2-sp-panel__name { font-family: var(--gv2-display, 'Bricolage Grotesque', sans-serif); font-weight: 800; font-size: 40px; line-height: 1.02; color: #F7F4EE; overflow-wrap: anywhere; }
.gv2-sp-panel__msg { padding: 6px 10px; border-radius: 6px; background: rgba(0,0,0,0.5); font-size: 14px; color: color-mix(in srgb, var(--gv2-sponsor) 25%, #E8E4DC); }
.gv2-sp-panel__qr { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: rgba(0,0,0,0.35); border: 1px solid color-mix(in srgb, var(--gv2-sponsor) 30%, #050506); }
.gv2-sp-qr { flex: 0 0 auto; width: 84px; height: 84px; border-radius: 8px; background: #FFFFFF; display: block; overflow: hidden; }
.gv2-sp-qr svg { width: 100%; height: 100%; display: block; }
.gv2-sp-qr:empty { display: none; }
.gv2-sp-qr:empty + .gv2-sp-panel__qrtext, .gv2-sp-panel__qr:has(.gv2-sp-qr:empty) { display: none; }
.gv2-sp-panel__qrtext { font-size: 14px; font-weight: 600; text-align: left; color: #E8E4DC; line-height: 1.35; }
.gv2-sp-panel__artlink { display: block; width: 100%; height: 100%; }
.gv2-sp-panel__art { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Phone and tablet: a large banner across the top of the slideshow. */
@media (max-width: 900px) {
    .gv2-ss-mode .gv2-sp-banner { flex: 0 0 auto; height: 122px; box-sizing: border-box; display: flex; align-items: center; gap: 14px; padding: 0 16px; text-decoration: none; color: #F4F1EA;
        background-color: color-mix(in srgb, var(--gv2-sponsor) 10%, #050506);
        background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--gv2-sponsor) 12%, transparent) 0px, color-mix(in srgb, var(--gv2-sponsor) 12%, transparent) 2px, transparent 2px, transparent 22px);
        border-bottom: 1px solid color-mix(in srgb, var(--gv2-sponsor) 30%, #050506); }
    .gv2-ss-mode .gv2-sp-banner--art { padding: 0; justify-content: center; background-image: none; }
}
@media (max-width: 380px), (max-height: 640px) {
    .gv2-ss-mode .gv2-sp-banner { height: 96px; }
}
.gv2-sp-banner .gv2-sp-mono { width: 64px; height: 64px; }
.gv2-sp-banner__logo { flex: 0 0 auto; max-width: 96px; max-height: 72px; width: auto; height: auto; object-fit: contain; display: block; }
.gv2-sp-banner__art { height: 100%; width: 100%; max-width: 640px; object-fit: cover; display: block; }
.gv2-sp-banner__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.gv2-sp-banner__label { font-size: 10px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: color-mix(in srgb, var(--gv2-sponsor) 55%, #FFFFFF); }
.gv2-sp-banner__name { font-family: var(--gv2-display, 'Bricolage Grotesque', sans-serif); font-weight: 800; font-size: 24px; line-height: 1.05; color: #F7F4EE; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv2-sp-banner__msg { font-size: 12px; color: color-mix(in srgb, var(--gv2-sponsor) 25%, #E8E4DC); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gv2-sp-banner__go { flex: 0 0 18px; width: 18px; height: 18px; color: color-mix(in srgb, var(--gv2-sponsor) 55%, #FFFFFF); }

/* Full-viewer overlays: opening sponsor card and slideshow break card. */
.gv2-ovl { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; box-sizing: border-box; padding: var(--gv2-safe-top, 0px) 0 var(--gv2-safe-bottom, 0px); background: #050506; color: #F4F1EA; }
.gv2-ovl[hidden] { display: none; }
.gv2-ovl__top { flex: 0 0 auto; height: 64px; padding: 0 16px 0 24px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.gv2-ovl__spacer { flex: 1 1 auto; }
.gv2-ovl__count { font-variant-numeric: tabular-nums; color: #A8A39A; }
.gv2-ovl__bar { flex: 0 0 auto; height: 3px; background: #1C1C21; }
.gv2-ovl__bar span { display: block; height: 100%; width: 0; background: var(--gv2-sponsor, var(--accent-text, #E2B13C)); }
.gv2-vbtn:disabled { opacity: .6; cursor: default; }
.gv2-vbtn:disabled:hover { background: #1C1C21; }

.gv2-sp-intro { background-color: color-mix(in srgb, var(--gv2-sponsor) 10%, #050506);
    background-image: repeating-linear-gradient(135deg, color-mix(in srgb, var(--gv2-sponsor) 12%, transparent) 0px, color-mix(in srgb, var(--gv2-sponsor) 12%, transparent) 2px, transparent 2px, transparent 28px); }
.gv2-sp-intro__card { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 24px; text-align: center; }
.gv2-sp-intro__label { margin: 0; font-size: 17px; color: color-mix(in srgb, var(--gv2-sponsor) 25%, #E8E4DC); }
.gv2-sp-intro__logo { max-width: min(320px, 70vw); max-height: 180px; width: auto; height: auto; object-fit: contain; display: block; }
.gv2-sp-intro__name { font-family: var(--gv2-display, 'Bricolage Grotesque', sans-serif); font-weight: 800; font-size: clamp(36px, 7vw, 64px); line-height: 1.02; color: #F7F4EE; overflow-wrap: anywhere; }
.gv2-sp-intro__msg { padding: 6px 12px; border-radius: 6px; background: rgba(0,0,0,0.5); font-size: 15px; color: color-mix(in srgb, var(--gv2-sponsor) 25%, #E8E4DC); }

.gv2-break__tag { --gv2-sponsor: #77736C; }
.gv2-break__stage { flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px 24px; }
.gv2-break__link { display: flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%; height: 100%; }
.gv2-break__media { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; border-radius: 6px; }
.gv2-break__stage video.gv2-break__media { width: 100%; height: 100%; }
.gv2-break__frame { width: min(100%, 970px); height: 100%; border: 0; background: transparent; }
.gv2-break__cta { position: absolute; right: 24px; bottom: 72px; min-height: 44px; padding: 0 18px; border-radius: 12px; background: var(--accent, #D9A42E); color: var(--on-accent, #17120A); font-weight: 700; display: inline-flex; align-items: center; text-decoration: none; }
.gv2-break__foot { flex: 0 0 auto; min-height: 20px; padding: 10px 24px 18px; display: flex; align-items: center; gap: 12px; font-size: 14px; color: #A8A39A; }
.gv2-break__sponsor strong { color: #F4F1EA; }
.gv2-break__sponsor a { color: color-mix(in srgb, var(--gv2-sponsor) 55%, #FFFFFF); }
@media (max-width: 600px) {
    .gv2-ovl__top { height: 56px; padding: 0 8px 0 16px; }
    .gv2-break__stage { padding: 8px 0; }
    .gv2-break__media { border-radius: 0; }
    .gv2-break__foot { padding: 10px 16px 24px; }
    .gv2-break__cta { right: 16px; bottom: 76px; }
    .gv2-ovl .gv2-vbtn--pill { width: auto; padding: 0 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .gv2-ovl__bar span { transition: none !important; }
}
.gv2-ovl:focus { outline: none; }

/* ---- Viewer swipe (Phase 3e): the previous/next photo waits just off-screen beside
   the current one and moves with it under the finger. ---- */
.gv2-viewer__stage { overflow: hidden; touch-action: none; }
.gv2-viewer__imgwrap { position: relative; will-change: transform; }
.gv2-viewer__arrow { position: relative; z-index: 2; }
.gv2-ghost { position: absolute; top: 0; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.gv2-ghost[hidden] { display: none; }
.gv2-dragging-down .gv2-viewer__bar,
.gv2-dragging-down .gv2-viewer__progress,
.gv2-dragging-down .gv2-viewer__foot,
.gv2-dragging-down .gv2-viewer__arrow,
.gv2-dragging-down .gv2-sp-banner,
.gv2-dragging-down .gv2-sp-panel { opacity: 0; transition: opacity .15s; }

/* ---- Phones (Phase 3g): two square thumbnails per row, like SmugMug. Tablets and
   desktop keep the justified rows. gallery-detail.js stops sizing tiles at this width. ---- */
@media (max-width: 600px) {
    .gv2-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
    .gv2-grid::after { display: none; }
    .gv2-grid .gv2-tile { flex: none; width: auto; height: auto; aspect-ratio: 1 / 1; border-radius: 8px; }
    .gv2-tile__open img { object-position: 50% 35%; }
    .gv2-like, .gv2-buy { min-width: 38px; height: 38px; border-radius: 19px; right: 6px; }
    .gv2-like { top: 6px; padding: 0 9px; }
    .gv2-buy { bottom: 6px; width: 38px; padding: 0; }
    .gv2-tile--sm .gv2-buy { display: flex; }
}

/* ---- Phones (Phase 3h): no bag on thumbnails (buying is in the viewer) and a quiet
   heart. Not liked = white outline, no background, no number. Tapping it (gallery-detail.js
   adds .gv2-like--burst for ~1.5 s): pink heart, dark pill, the count rolls up. Then it
   settles to the filled heart on a dark circle. ---- */
@media (max-width: 600px) {
    .gv2-tile .gv2-buy { display: none; }
    .gv2-tile .gv2-like { top: 4px; right: 4px; height: 40px; min-width: 40px; padding: 0; gap: 0; border-radius: 20px; background: transparent; color: #FFFFFF; font-size: 15px; font-weight: 700; transition: background-color .25s ease, padding .25s ease, gap .25s ease; }
    .gv2-tile .gv2-like:hover { background: transparent; }
    .gv2-tile .gv2-like svg { width: 21px; height: 21px; flex: 0 0 21px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.75)); }
    .gv2-tile .gv2-like .gv2-like__count { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; color: #FFFFFF; font-variant-numeric: tabular-nums; transition: max-width .25s ease, opacity .2s ease; }
    .gv2-tile .gv2-like.liked,
    .gv2-tile .gv2-like.liked:hover { background: rgba(10,10,14,0.66); color: #FF6B81; }
    .gv2-tile .gv2-like.liked svg { filter: none; }
    .gv2-tile .gv2-like.gv2-like--burst { padding: 0 13px 0 11px; gap: 6px; }
    .gv2-tile .gv2-like.gv2-like--burst .gv2-like__count { max-width: 4em; opacity: 1; }
}
@media (max-width: 600px) and (prefers-reduced-motion: reduce) {
    .gv2-tile .gv2-like, .gv2-tile .gv2-like .gv2-like__count { transition: none; }
}

/* ---- Photo viewer heart (Phase 3i): on the photo's top-right corner, same behaviour as
   the phone thumbnails. gallery-detail.js places it (inline top/right) from the photo's
   size and adds .gv2-like--burst for ~1.5 s after a like. ---- */
.gv2-viewer .gv2-photo-like { position: absolute; z-index: 3; top: 10px; right: 10px; height: 48px; min-width: 48px; padding: 0; gap: 0; border: 0; border-radius: 24px; background: transparent; color: #FFFFFF; font: 700 16px var(--font-body, 'DM Sans', system-ui, sans-serif); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background-color .25s ease, padding .25s ease, gap .25s ease; }
.gv2-viewer .gv2-photo-like:hover { background: rgba(10,10,14,0.35); }
.gv2-viewer .gv2-photo-like svg { width: 26px; height: 26px; flex: 0 0 26px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.8)); }
.gv2-viewer .gv2-photo-like .gv2-like__count { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; color: #FFFFFF; font-variant-numeric: tabular-nums; transition: max-width .25s ease, opacity .2s ease; }
.gv2-viewer .gv2-photo-like.liked,
.gv2-viewer .gv2-photo-like.liked:hover { background: rgba(10,10,14,0.66); color: #FF6B81; }
.gv2-viewer .gv2-photo-like.liked svg { filter: none; }
.gv2-viewer .gv2-photo-like.gv2-like--burst { padding: 0 16px 0 13px; gap: 8px; }
.gv2-viewer .gv2-photo-like.gv2-like--burst .gv2-like__count { max-width: 4em; opacity: 1; }
.gv2-viewer .gv2-photo-like:focus-visible { outline: 2px solid var(--accent-text, #E2B13C); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .gv2-viewer .gv2-photo-like, .gv2-viewer .gv2-photo-like .gv2-like__count { transition: none; }
}

/* ---- Desktop and tablet (Phase 3j): thumbnail hearts behave like the phone ones (outline
   at rest; a like shows the dark pill and rolling count for ~1.5 s, then just the heart on
   a dark circle). The buy button stays on these larger thumbnails. ---- */
@media (min-width: 601px) {
    .gv2-tile .gv2-like { top: 8px; right: 8px; height: 40px; min-width: 40px; padding: 0; gap: 0; border-radius: 20px; background: transparent; color: #FFFFFF; font-size: 15px; font-weight: 700; transition: background-color .25s ease, padding .25s ease, gap .25s ease; }
    .gv2-tile .gv2-like:hover { background: transparent; }
    .gv2-tile .gv2-like:hover svg { transform: scale(1.1); }
    .gv2-tile .gv2-like svg { transition: transform .15s ease; }
    .gv2-tile .gv2-like svg { width: 21px; height: 21px; flex: 0 0 21px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.75)); }
    .gv2-tile .gv2-like .gv2-like__count { display: inline-block; max-width: 0; opacity: 0; overflow: hidden; white-space: nowrap; color: #FFFFFF; font-variant-numeric: tabular-nums; transition: max-width .25s ease, opacity .2s ease; }
    .gv2-tile .gv2-like.liked,
    .gv2-tile .gv2-like.liked:hover { background: rgba(10,10,14,0.66); color: #FF6B81; }
    .gv2-tile .gv2-like.liked svg { filter: none; }
    .gv2-tile .gv2-like.gv2-like--burst { padding: 0 13px 0 11px; gap: 6px; }
    .gv2-tile .gv2-like.gv2-like--burst .gv2-like__count { max-width: 4em; opacity: 1; }

    /* Photo viewer on desktop: once liked, the count stays next to the heart. */
    .gv2-viewer .gv2-photo-like:hover { background: transparent; }
    .gv2-viewer .gv2-photo-like:hover svg { transform: scale(1.1); }
    .gv2-viewer .gv2-photo-like svg { transition: transform .15s ease; }
    .gv2-viewer .gv2-photo-like.liked { padding: 0 16px 0 13px; gap: 8px; }
    .gv2-viewer .gv2-photo-like.liked .gv2-like__count { max-width: 4em; opacity: 1; }
}
@media (min-width: 601px) and (prefers-reduced-motion: reduce) {
    .gv2-tile .gv2-like, .gv2-tile .gv2-like .gv2-like__count { transition: none; }
}

/* ---- Most liked row (Phase 3j): just a small pink heart on each photo. No number and no
   background; a soft shadow keeps it visible on bright photos. ---- */
.gv2-ml__badge { left: 8px; bottom: 8px; height: auto; padding: 0; border-radius: 0; background: transparent; gap: 0; color: #FF6B81; }
.gv2-ml__badge svg { width: 18px; height: 18px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.8)); }

/* Phase 3k: phones get a slightly smaller viewer heart than desktop. */
@media (max-width: 600px) {
    .gv2-viewer .gv2-photo-like { height: 40px; min-width: 40px; border-radius: 20px; font-size: 14px; }
    .gv2-viewer .gv2-photo-like svg { width: 22px; height: 22px; flex: 0 0 22px; }
    .gv2-viewer .gv2-photo-like.gv2-like--burst { padding: 0 13px 0 11px; gap: 6px; }
}

/* Phase 3l: phone thumbnail hearts use the same 18px heart as the Most liked row.
   The circle behind a liked heart shrinks to match; an invisible ring keeps the
   tap area at 40px so it is still easy to hit. */
@media (max-width: 600px) {
    .gv2-tile .gv2-like { top: 6px; right: 6px; height: 32px; min-width: 32px; border-radius: 16px; font-size: 13px; }
    .gv2-tile .gv2-like::after { content: ''; position: absolute; inset: -4px; border-radius: 20px; }
    .gv2-tile .gv2-like svg { width: 18px; height: 18px; flex: 0 0 18px; }
    .gv2-tile .gv2-like.gv2-like--burst { padding: 0 10px 0 8px; gap: 5px; }
}

