/* ==========================================================================
   Photo galleries: viewer (hero, toolbar, layouts, lightbox, share)
   Photos are never framed: no borders, mattes or padding around images.
   ========================================================================== */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Save-image deterrents: no drag, no iOS long-press callout, no selection. */
.gx img, .gx-lb img, .gx-card img { -webkit-user-drag: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.gx-img, .gx-lb-img, .gx-ss-img { pointer-events: none; }

/* ---------- Hero (cover) ---------- */
.gx-hero { position: relative; min-height: min(78vh, 720px); display: flex; align-items: flex-end; color: #F6F2E8; background: #0B0B0B; overflow: hidden; isolation: isolate; }
.gx-hero--empty { min-height: 420px; background: radial-gradient(120% 90% at 20% 0%, #2A2415 0%, #0B0B0B 60%); }
.gx-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transform: scale(1.04); animation: gx-hero-in 1.6s var(--ease) both; }
@keyframes gx-hero-in { from { transform: scale(1.12); opacity: 0; } to { transform: scale(1.04); opacity: 1; } }
.gx-hero-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.05) 35%, rgba(0,0,0,.72) 100%); }
.gx-hero-inner { padding-top: 96px; padding-bottom: clamp(36px, 6vw, 72px); }
.gx-back { display: inline-flex; align-items: center; gap: .45rem; font-size: .88rem; color: rgba(246,242,232,.8); margin-bottom: 1.2rem; }
.gx-back .icon { width: 16px; height: 16px; transform: rotate(180deg); }
.gx-back:hover { color: #fff; }
.gx-status-note { display: inline-flex; align-items: center; gap: .5rem; font-size: .82rem; padding: .35rem .8rem; border-radius: 999px; background: rgba(0,0,0,.45); backdrop-filter: blur(8px); margin: 0 0 1rem; }
.gx-hero-meta { margin: 0 0 .7rem; }
.gx-title { font-size: clamp(2.4rem, 7vw, 5.6rem); color: #fff; max-width: 16ch; text-wrap: balance; }
.gx-desc { max-width: 60ch; margin: 1rem 0 0; color: rgba(246,242,232,.85); font-size: clamp(1rem, 1.4vw, 1.15rem); }
.gx-desc:empty { display: none; }
.gx-hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.8rem; }

/* ---------- Toolbar (sticky) ---------- */
.gx-bar { position: sticky; top: var(--header-h); z-index: 40; background: var(--header-bg); backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px); border-bottom: 1px solid var(--line); scroll-margin-top: var(--header-h); }
.gx-bar-inner { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.gx-bar-title { font-family: var(--font-display); font-weight: 750; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 26ch; margin-right: auto; }
.gx-modes { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.gx-mode { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .8rem; border-radius: 999px; font-size: .82rem; font-weight: 600; color: var(--muted); transition: background .25s var(--ease), color .25s; }
.gx-mode .icon { width: 17px; height: 17px; }
.gx-mode:hover { color: var(--text); }
.gx-mode[aria-selected="true"] { background: var(--text); color: var(--bg); }
.gx-tools { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gx-range { display: inline-flex; align-items: center; gap: .4rem; color: var(--muted); }
.gx-range .icon { width: 16px; height: 16px; }
.gx-range input { width: 86px; accent-color: var(--gold-deep); }
.gx-chip { display: inline-flex; align-items: center; gap: .4rem; height: 34px; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--line-strong); font-size: .82rem; font-weight: 600; transition: all .25s var(--ease); }
.gx-chip .icon { width: 16px; height: 16px; }
.gx-chip:hover { border-color: var(--text); }
.gx-chip[aria-pressed="true"] { background: var(--red); border-color: var(--red); color: #fff; }

/* ---------- Photos ---------- */
.gx-body { padding: clamp(16px, 3vw, 32px) var(--gutter) clamp(40px, 6vw, 80px); max-width: 1800px; margin: 0 auto; }
.gx-photos { --size: 300px; --gap: 10px; position: relative; }
.gx-item { position: relative; margin: 0; overflow: hidden; background: var(--surface-2); border-radius: 6px; container-type: inline-size; }
.gx-item--static { display: inline-block; width: 240px; margin: 4px; }
.gx-link { display: block; position: relative; height: 100%; cursor: zoom-in; -webkit-touch-callout: none; }
.gx-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .8s var(--ease), opacity .5s; opacity: 0; }
.gx-img.is-loaded, .gx-item--static .gx-img { opacity: 1; }
.gx-item:hover .gx-img { transform: scale(1.03); }
.gx-item.is-hidden { display: none; }
.gx-item:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }

/* hover overlay: title + actions */
.gx-over { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 10px; pointer-events: none; opacity: 0; transition: opacity .3s var(--ease); background: linear-gradient(180deg, rgba(0,0,0,.35) 0%, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 60%, rgba(0,0,0,.55) 100%); }
.gx-item:hover .gx-over, .gx-item:focus-within .gx-over, .gx-item.is-fav .gx-over { opacity: 1; }
.gx-item.is-fav:not(:hover) .gx-over { background: none; }
.gx-item.is-fav:not(:hover) .gx-cap, .gx-item.is-fav:not(:hover) .gx-act:not(.gx-act--fav) { opacity: 0; }
.gx-acts { display: flex; justify-content: flex-end; gap: 6px; }
.gx-act { pointer-events: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.92); color: #0B0B0B; box-shadow: 0 4px 14px -4px rgba(0,0,0,.4); transition: transform .25s var(--ease-spring), background .2s, opacity .2s; }
.gx-act .icon { width: 16px; height: 16px; }
.gx-act:hover { transform: scale(1.08); }
.gx-act--fav.is-on { background: var(--red); color: #fff; }
.gx-act--fav.is-on .icon { fill: currentColor; }
.gx-cap { color: #fff; font-size: .86rem; font-weight: 600; text-shadow: 0 1px 8px rgba(0,0,0,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .2s; }
.gx-photos.no-titles .gx-cap { display: none; }
@media (hover: none) { .gx-over { opacity: 1; background: none; } .gx-cap { display: none; } .gx-act { width: 30px; height: 30px; } }

/* watermark overlay (linked photos only; uploads have it baked in) */
.gx-wm { position: absolute; z-index: 2; pointer-events: none; height: auto; width: calc(var(--s) * 1cqw); opacity: var(--o); }
.gx-wm--top-left { top: calc(var(--m) * 1cqw); left: calc(var(--m) * 1cqw); }
.gx-wm--top-right { top: calc(var(--m) * 1cqw); right: calc(var(--m) * 1cqw); }
.gx-wm--bottom-left { bottom: calc(var(--m) * 1cqw); left: calc(var(--m) * 1cqw); }
.gx-wm--bottom-right { bottom: calc(var(--m) * 1cqw); right: calc(var(--m) * 1cqw); }
.gx-wm--center { top: 50%; left: 50%; transform: translate(-50%, -50%); }

/* layouts */
.gx-photos[data-layout="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--size), 100%), 1fr)); gap: var(--gap); }
.gx-photos[data-layout="grid"] .gx-item { aspect-ratio: 1; }
.gx-photos[data-layout="masonry"] { display: flex; gap: var(--gap); align-items: flex-start; }
.gx-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--gap); }
.gx-photos[data-layout="masonry"] .gx-item { aspect-ratio: var(--ar, 1.5); }
.gx-photos[data-layout="justified"] { display: flex; flex-direction: column; gap: var(--gap); }
.gx-row { display: flex; gap: var(--gap); }
.gx-photos[data-layout="justified"] .gx-item { flex: none; }
.gx-photos[data-layout="strip"] { display: flex; gap: var(--gap); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 12px; scrollbar-width: thin; overscroll-behavior-x: contain; }
.gx-photos[data-layout="strip"] .gx-item { flex: none; height: min(72vh, 760px); aspect-ratio: var(--ar, 1.5); scroll-snap-align: center; border-radius: 4px; }
.gx-photos[data-layout="strip"] .gx-img { object-fit: cover; }

/* inline slideshow */
.gx-ss { display: grid; gap: 12px; }
.gx-ss-stage { position: relative; height: min(76vh, 820px); background: #0B0B0B; border-radius: 8px; overflow: hidden; display: grid; place-items: center; }
.gx-ss-frame { position: relative; container-type: inline-size; }
.gx-ss-img { display: block; width: 100%; height: 100%; object-fit: contain; animation: gx-fade .6s var(--ease) both; }
@keyframes gx-fade { from { opacity: 0; } to { opacity: 1; } }
.gx-ss-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); color: #fff; backdrop-filter: blur(8px); transition: background .2s; z-index: 3; }
.gx-ss-nav:hover { background: rgba(255,255,255,.25); }
.gx-ss-nav--prev { left: 14px; } .gx-ss-nav--next { right: 14px; }
.gx-ss-nav--prev .icon { transform: rotate(180deg); }
.gx-ss-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; align-items: center; gap: 12px; padding: 14px 18px; color: #fff; background: linear-gradient(0deg, rgba(0,0,0,.6), transparent); }
.gx-ss-bar strong { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-ss-bar button { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.14); }
.gx-ss-bar .gx-ss-count { font-family: var(--font-mono); font-size: .78rem; opacity: .8; }
.gx-ss-progress { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--gold); z-index: 4; width: 0; }
.gx-ss-progress.is-running { animation: gx-progress var(--dur, 5s) linear forwards; }
@keyframes gx-progress { to { width: 100%; } }
.gx-thumbs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.gx-thumbs::-webkit-scrollbar { display: none; }
.gx-thumb { flex: none; width: 76px; height: 56px; border-radius: 4px; overflow: hidden; opacity: .5; transition: opacity .25s, transform .25s var(--ease); position: relative; }
.gx-thumb img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.gx-thumb:hover { opacity: .85; }
.gx-thumb.is-active { opacity: 1; box-shadow: 0 0 0 2px var(--gold); }

.gx-empty { display: grid; justify-items: center; text-align: center; gap: .5rem; padding: clamp(40px, 8vw, 90px) 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius-lg); }
.gx-empty-icon { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent-text); margin-bottom: .5rem; }

/* ---------- Credit footer (every gallery) ---------- */
.gx-credit { display: flex; justify-content: center; align-items: center; gap: .35rem; padding: 28px 0 36px; margin-top: 12px; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); letter-spacing: .02em; }
.gx-credit a { font-weight: 700; color: var(--text); }
.gx-credit a:hover { color: var(--accent-text); }

/* ---------- Lightbox / fullscreen (dark, edge-to-edge photos) ---------- */
.gx-lb { position: fixed; inset: 0; z-index: 300; background: #070707; color: #F6F2E8; display: grid; grid-template-rows: auto 1fr auto; grid-template-columns: 1fr auto; opacity: 0; transition: opacity .35s var(--ease); }
.gx-lb.is-open { opacity: 1; }
.gx-lb[hidden] { display: none; }
.gx-lb-top { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; padding: 10px 14px; min-height: 58px; transition: opacity .4s; }
.gx-lb-count { font-family: var(--font-mono); font-size: .78rem; color: #A8A295; min-width: 64px; }
.gx-lb-title { flex: 1; min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gx-lb-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: #F6F2E8; transition: background .2s; position: relative; }
.gx-lb-btn .icon { width: 19px; height: 19px; }
.gx-lb-btn:hover, .gx-lb-btn[aria-pressed="true"] { background: rgba(255,255,255,.12); }
.gx-lb-btn--fav.is-on { color: #FF5A6E; }
.gx-lb-btn--fav.is-on .icon { fill: currentColor; }
.gx-lb-sep { width: 1px; height: 22px; background: rgba(255,255,255,.14); }
.gx-lb-stage { position: relative; overflow: hidden; display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
.gx-lb-frame { position: relative; container-type: inline-size; transition: transform .45s var(--ease); cursor: zoom-in; }
.gx-lb-frame.is-zoomed { cursor: zoom-out; }
.gx-lb-img { display: block; width: 100%; height: 100%; object-fit: contain; animation: gx-fade .45s var(--ease) both; }
.gx-lb-shield { position: absolute; inset: 0; z-index: 3; }
.gx-lb-nav { position: absolute; top: 50%; transform: translateY(-50%); z-index: 4; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: rgba(255,255,255,.08); transition: background .2s, opacity .3s; }
.gx-lb-nav:hover { background: rgba(255,255,255,.2); }
.gx-lb-nav--prev { left: 16px; } .gx-lb-nav--next { right: 16px; }
.gx-lb-nav--prev .icon { transform: rotate(180deg); }
.gx-lb-nav[disabled] { opacity: 0; pointer-events: none; }
.gx-lb-bottom { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 8px 14px 12px; min-width: 0; transition: opacity .4s; }
.gx-lb-bottom .gx-thumbs { flex: 1; }
.gx-lb-bottom .gx-thumb { width: 64px; height: 46px; }
.gx-lb-credit { flex: none; font-size: .72rem; color: #8C877C; white-space: nowrap; }
.gx-lb-credit a { color: #F6F2E8; font-weight: 700; }
.gx-lb-progress { position: absolute; top: 0; left: 0; height: 2px; background: var(--gold); width: 0; z-index: 5; }
.gx-lb-progress.is-running { animation: gx-progress var(--dur, 5s) linear forwards; }
.gx-lb.is-idle .gx-lb-top, .gx-lb.is-idle .gx-lb-bottom, .gx-lb.is-idle .gx-lb-nav { opacity: 0; }
.gx-lb.is-idle { cursor: none; }

/* info panel */
.gx-lb-info { grid-row: 2; grid-column: 2; width: 0; overflow: hidden; transition: width .4s var(--ease); background: #111110; }
.gx-lb.show-info .gx-lb-info { width: min(340px, 86vw); }
.gx-lb-info-in { width: min(340px, 86vw); padding: 22px; display: grid; gap: 14px; align-content: start; height: 100%; overflow-y: auto; }
.gx-lb-info h2 { font-family: var(--font-display); font-size: 1.35rem; letter-spacing: -.02em; margin: 0; line-height: 1.15; }
.gx-lb-info p { margin: 0; color: #CFC9BC; font-size: .92rem; }
.gx-lb-info .gx-lb-meta { font-family: var(--font-mono); font-size: .72rem; color: #8C877C; letter-spacing: .04em; }
.gx-exif { display: flex; flex-wrap: wrap; gap: 6px; }
.gx-exif span, .gx-tag { font-size: .76rem; padding: .3rem .6rem; border-radius: 999px; background: rgba(255,255,255,.08); color: #E8E2D4; }
.gx-lb-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-lb-actions .btn { --bh: 38px; }

/* ---------- Share popover ---------- */
.gx-share { position: fixed; z-index: 320; width: 300px; max-width: calc(100vw - 24px); padding: 16px; border-radius: 18px; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); border: 1px solid var(--line); animation: gx-pop .3s var(--ease-spring) both; }
@keyframes gx-pop { from { opacity: 0; transform: translateY(6px) scale(.97); } }
.gx-share h3 { margin: 0 0 12px; font-size: .95rem; text-align: center; }
.gx-share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; }
.gx-share-grid a, .gx-share-grid button { display: grid; justify-items: center; gap: 6px; font-size: .7rem; color: var(--muted); }
.gx-share-grid i { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-style: normal; font-weight: 800; font-size: .95rem; transition: transform .25s var(--ease-spring); }
.gx-share-grid a:hover i, .gx-share-grid button:hover i { transform: scale(1.08); }
.gx-share-grid svg { width: 20px; height: 20px; }
.gx-share-url { display: flex; gap: 6px; margin-top: 14px; }
.gx-share-url input { flex: 1; min-width: 0; height: 38px; padding: 0 .7rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--bg-alt); font-size: .8rem; }
.gx-share-url button { height: 38px; padding: 0 .9rem; border-radius: 10px; background: var(--text); color: var(--bg); font-weight: 600; font-size: .82rem; }
.gx-lb .gx-share, .gx-share.is-dark { background: #1A1916; color: #F6F2E8; border-color: rgba(255,255,255,.1); }
.gx-lb ~ .gx-share.is-dark .gx-share-url input, .gx-share.is-dark .gx-share-url input { background: #0F0F0E; border-color: rgba(255,255,255,.15); color: #F6F2E8; }
.gx-share.is-dark .gx-share-url button { background: var(--gold); color: #111; }

/* ---------- Index cards ---------- */
.gx-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: clamp(16px, 2.4vw, 28px); margin-bottom: 20px; }
.gx-cards--drafts { margin: 12px 0 48px; }
.gx-card { display: grid; gap: 12px; }
.gx-card-media { position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.gx-card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.gx-card:hover .gx-card-media img { transform: scale(1.05); }
.gx-card-mark { font-size: 4rem; color: var(--accent-text); }
.gx-card-count { position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: .35rem; padding: .3rem .65rem; border-radius: 999px; background: rgba(0,0,0,.6); color: #fff; font-size: .76rem; font-weight: 600; backdrop-filter: blur(6px); }
.gx-card-count .icon { width: 14px; height: 14px; }
.gx-card-body { display: grid; gap: 2px; }
.gx-card-title { font-family: var(--font-display); font-size: 1.2rem; letter-spacing: -.02em; }

@media (max-width: 860px) {
  .gx-mode span, .gx-chip[data-gx-fullscreen] span { display: none; }
  .gx-mode { padding: 0 .65rem; }
  .gx-bar-title { display: none; }
  .gx-bar-inner { justify-content: space-between; }
  .gx-range input { width: 64px; }
  .gx-lb-nav { width: 42px; height: 42px; }
  .gx-lb-nav--prev { left: 6px; } .gx-lb-nav--next { right: 6px; }
  .gx-lb-credit { display: none; }
  .gx-lb.show-info .gx-lb-info { position: absolute; right: 0; top: 58px; bottom: 0; z-index: 6; }
}
@media (max-width: 520px) {
  .gx-range:nth-of-type(2) { display: none; }
  .gx-lb-btn { width: 36px; height: 36px; }
  .gx-lb-sep { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .gx-hero-img, .gx-lb-img, .gx-ss-img { animation: none; }
  .gx-img, .gx-lb-frame { transition: none; }
}
