/* =========================================================
   Picturing Us — public gallery
   Full-bleed; no main-site template. Logo top-left only.
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0a0a0a;
  color: #eae6dc;
  font-size: 16px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
.muted { color: #8a847b; }

:root {
  --accent: #ff3b3b;
  --line: rgba(255,255,255,.1);
}

/* ----------------- Bar ----------------- */
.g-bar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 20px;
  background: rgba(10,10,10,.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.g-bar__brand {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 1rem; letter-spacing: -0.02em; color: #fff;
}
.g-bar__brand .dot { color: var(--accent); }
.g-bar__title {
  flex: 1; min-width: 0; text-align: center;
  font-family: 'Space Grotesk', sans-serif;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.g-bar__name { font-weight: 600; font-size: .95rem; letter-spacing: -0.01em; }
.g-bar__client { font-size: .75rem; color: #8a847b; letter-spacing: .04em; }
.g-bar__actions { display: flex; gap: 8px; align-items: center; }
.g-bar__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  font: inherit; font-size: .82rem; font-weight: 500;
  font-family: 'Space Grotesk', sans-serif;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.g-bar__btn:hover { border-color: var(--accent); color: #fff; }
.g-bar__btn--accent { background: var(--accent); border-color: var(--accent); }
.g-bar__btn--accent:hover { background: #fff; color: #0a0a0a; border-color: #fff; }
.g-bar__btn.is-active { background: var(--accent); border-color: var(--accent); }
.g-bar__fav-count { font-weight: 700; }

@media (max-width: 720px) {
  .g-bar__title { display: none; }
  .g-bar__btn { padding: 7px 10px; font-size: .75rem; }
}


/* ----------------- Welcome ----------------- */
.g-welcome { background: #111; padding: 32px 20px; border-bottom: 1px solid var(--line); }
.g-welcome__inner { max-width: 720px; margin: 0 auto; text-align: center; font-size: 1.05rem; color: #d8d4ca; }

/* ----------------- Stage / styles ----------------- */
.g-stage { padding: 24px 12px 80px; }

.g-tile {
  position: relative; display: block;
  cursor: zoom-in; overflow: hidden;
  background: #1a1a1a;
}
.g-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease, opacity .3s ease; }
.g-tile:hover img { transform: scale(1.03); opacity: .9; }
.g-tile__fav {
  position: absolute; top: 10px; right: 10px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  color: rgba(255,255,255,.55);
  font-size: 1rem;
  border: 0; border-radius: 50%;
  cursor: pointer;
  transition: color .2s, background .2s, transform .2s;
}
.g-tile__fav:hover { color: #fff; background: var(--accent); transform: scale(1.1); }
.g-tile.is-fav .g-tile__fav { color: #fff; background: var(--accent); }

.g-tile__views {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px;
  background: rgba(0,0,0,.55); color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-size: .7rem; font-weight: 600;
  letter-spacing: .1em;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0; transition: opacity .2s;
}
.g-tile:hover .g-tile__views { opacity: 1; }
.g-tile.is-client-hidden img { opacity: .35; filter: grayscale(1); }
.g-tile__eye {
  position: absolute; top: 10px; left: 10px;
  width: 32px; height: 32px;
  display: none; align-items: center; justify-content: center;
  background: rgba(0,0,0,.55); color: #fff;
  font-size: 14px;
  border: 0; border-radius: 50%; cursor: pointer;
  transition: background .15s;
}
body.gallery[data-is-client="1"] .g-tile__eye { display: flex; }

/* Hide heart / views / pick-anything UI from anonymous viewers — they only show for signed-in clients */
body.gallery:not([data-is-client="1"]) .g-tile__fav,
body.gallery:not([data-is-client="1"]) .g-tile__views,
body.gallery:not([data-is-client="1"]) .g-cinema__fav { display: none !important; }
.g-tile.is-client-hidden .g-tile__eye { background: rgba(220,40,40,.85); }
.g-tile__eye:hover { background: var(--accent); color: #fff; }

.g-bar__client-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: rgba(255,255,255,.08); color: #fff;
  font-family: 'Space Grotesk', sans-serif; font-size: .78rem;
  letter-spacing: .04em;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
}
.g-bar__signout {
  color: #ffb3b3; font-size: .72rem; padding-left: 6px;
  border-left: 1px solid rgba(255,255,255,.2);
}
.g-bar__signout:hover { color: #fff; }

/* Style: masonry */
.g-masonry { column-count: 4; column-gap: 8px; }
@media (max-width: 1200px) { .g-masonry { column-count: 3; } }
@media (max-width: 800px)  { .g-masonry { column-count: 2; } }
@media (max-width: 480px)  { .g-masonry { column-count: 1; } }
.g-stage--masonry .g-tile { margin: 0 0 8px; break-inside: avoid; }
.g-stage--masonry .g-tile img { height: auto; }

/* Style: uniform grid */
.g-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 6px;
}
.g-stage--grid .g-tile { aspect-ratio: 1 / 1; }

/* Style: cinema */
.g-cinema { max-width: 1200px; margin: 0 auto; display: grid; gap: 32px; }
.g-cinema__frame { position: relative; margin: 0; }
.g-cinema__frame img { width: 100%; height: auto; cursor: zoom-in; }
.g-cinema__frame figcaption {
  margin-top: 10px; text-align: center;
  font-family: 'Space Grotesk', sans-serif; font-size: .85rem;
  letter-spacing: .14em; text-transform: uppercase; color: #8a847b;
}
.g-cinema__fav {
  position: absolute; top: 14px; right: 14px;
  width: 40px; height: 40px;
  background: rgba(0,0,0,.55); color: rgba(255,255,255,.6);
  border: 0; border-radius: 50%;
  font-size: 1.1rem; cursor: pointer;
  transition: background .2s, color .2s, transform .2s;
}
.g-cinema__fav:hover { transform: scale(1.1); color: #fff; }
.g-cinema__frame.is-fav .g-cinema__fav { background: var(--accent); color: #fff; }

/* Style: mosaic / bento */
.g-mosaic {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-auto-rows: 180px;
  gap: 6px;
  grid-auto-flow: dense;
}
.g-mosaic__cell { grid-column: span 2; grid-row: span 1; }
.g-mosaic__cell.is-wide { grid-column: span 3; }
.g-mosaic__cell.is-tall { grid-row: span 2; }
.g-mosaic__cell.is-wide.is-tall { grid-column: span 4; grid-row: span 2; }
.g-stage--mosaic .g-tile img { height: 100%; }
@media (max-width: 900px) {
  .g-mosaic { grid-template-columns: repeat(4, 1fr); grid-auto-rows: 140px; }
  .g-mosaic__cell { grid-column: span 2; }
  .g-mosaic__cell.is-wide { grid-column: span 4; }
  .g-mosaic__cell.is-wide.is-tall { grid-column: span 4; grid-row: span 2; }
}
@media (max-width: 560px) {
  .g-mosaic { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 160px; }
  .g-mosaic__cell { grid-column: span 1; grid-row: span 1; }
  .g-mosaic__cell.is-wide { grid-column: span 2; }
  .g-mosaic__cell.is-tall { grid-row: span 2; }
  .g-mosaic__cell.is-wide.is-tall { grid-column: span 2; grid-row: span 2; }
}

/* Style: filmstrip */
.g-stage--filmstrip { padding: 0; }
.g-film {
  position: relative;
  height: calc(100vh - 56px - 110px);
  background: #050505;
  overflow: hidden;
}
.g-film__slide {
  position: absolute; inset: 0;
  margin: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.g-film__slide img {
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,.7);
}
.g-film__slide figcaption {
  position: absolute; left: 0; right: 0; bottom: 14px;
  text-align: center;
  font-family: 'Space Grotesk', sans-serif; font-size: .8rem;
  letter-spacing: .14em; text-transform: uppercase; color: #ccc;
}
.g-film__slide.is-active { opacity: 1; pointer-events: auto; }
.g-film__rail {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 10px 14px; background: #0a0a0a;
  border-top: 1px solid var(--line);
}
.g-film__chip {
  flex: 0 0 auto; width: 70px; height: 50px;
  padding: 0; border: 2px solid transparent; background: #1a1a1a;
  cursor: pointer; overflow: hidden;
  transition: border-color .15s;
}
.g-film__chip img { width: 100%; height: 100%; object-fit: cover; }
.g-film__chip.is-active { border-color: var(--accent); }
.g-film__nav {
  display: flex; justify-content: center; align-items: center; gap: 24px;
  padding: 14px;
  background: #0a0a0a;
  border-top: 1px solid var(--line);
}
.g-film__btn {
  width: 44px; height: 44px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 1.6rem; line-height: 1; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.g-film__btn:hover { border-color: var(--accent); background: var(--accent); }
.g-film__counter {
  font-family: 'Space Grotesk', sans-serif; font-size: .85rem;
  letter-spacing: .14em; text-transform: uppercase;
}

/* ----------------- Footer ----------------- */
.g-foot {
  padding: 32px 20px;
  text-align: center;
  font-size: .8rem; letter-spacing: .12em; text-transform: uppercase;
  color: #6b665d;
  border-top: 1px solid var(--line);
}
.g-foot__link:hover { color: var(--accent); }

/* ----------------- Lightbox ----------------- */
.g-lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,.97);
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
}
.g-lightbox.is-open { display: flex; }
.g-lb__figure {
  margin: 0; max-width: 100%; max-height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.g-lb__img {
  max-width: 100%; max-height: calc(100vh - 180px);
  width: auto; height: auto;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,.7);
}
.g-lb__cap {
  margin-top: 14px; text-align: center;
  display: flex; gap: 16px; align-items: center; justify-content: center;
}
.g-lb__caption {
  font-family: 'Space Grotesk', sans-serif; font-size: .8rem;
  letter-spacing: .16em; text-transform: uppercase; color: #ccc;
}
.g-lb__counter { font-size: .75rem; color: #888; letter-spacing: .1em; }
.g-lb__close, .g-lb__nav {
  position: absolute;
  width: 48px; height: 48px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  font-size: 1.6rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .2s, background .2s;
}
.g-lb__close { top: 20px; right: 20px; font-size: 1.8rem; }
.g-lb__nav--prev { left: 20px; top: 50%; transform: translateY(-50%); }
.g-lb__nav--next { right: 20px; top: 50%; transform: translateY(-50%); }
.g-lb__close:hover, .g-lb__nav:hover { background: var(--accent); border-color: var(--accent); }

.g-lb__actions {
  position: absolute; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px;
}
.g-lb__btn {
  padding: 10px 18px;
  background: rgba(255,255,255,.08); color: #fff !important;
  border: 1px solid rgba(255,255,255,.2);
  font-family: 'Space Grotesk', sans-serif; font-size: .82rem; font-weight: 500;
  letter-spacing: .04em; cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.g-lb__btn:hover { background: var(--accent); border-color: var(--accent); }
.g-lb__btn.is-active { background: var(--accent); border-color: var(--accent); }

@media (max-width: 600px) {
  .g-lb__close { top: 10px; right: 10px; }
  .g-lb__nav--prev { left: 8px; }
  .g-lb__nav--next { right: 8px; }
  .g-lb__actions { bottom: 10px; flex-wrap: wrap; padding: 0 10px; }
}

/* ----------------- Lock screen ----------------- */
.gallery--locked { min-height: 100vh; display: flex; flex-direction: column; }
.g-lock {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}
.g-lock__box {
  background: #141414; padding: 48px;
  border: 1px solid var(--line);
  width: 100%; max-width: 420px; text-align: center;
}
.g-lock__icon { display: block; font-size: 2.2rem; margin-bottom: 16px; }
.g-lock h1 { font-family: 'Space Grotesk', sans-serif; font-size: 1.6rem; margin: 0 0 8px; }
.g-lock p { color: #8a847b; }
.g-lock__form { display: grid; gap: 10px; margin-top: 18px; }
.g-lock__sep { margin: 18px 0 0; color: #6b665d; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; }

/* Gallery picker */
.g-picker { padding: 40px 24px; }
.g-picker__inner { max-width: 1200px; margin: 0 auto; }
.g-picker__inner h1 { font-family: 'Space Grotesk', sans-serif; font-size: 2rem; margin: 0 0 8px; }
.g-picker__grid {
  display: grid; gap: 18px; margin-top: 32px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.g-picker__card {
  background: #1a1a1a; overflow: hidden;
  transition: transform .2s, outline-color .2s;
  outline: 1px solid rgba(255,255,255,.08);
}
.g-picker__card:hover { transform: translateY(-2px); outline-color: var(--accent); }
.g-picker__img { aspect-ratio: 4 / 3; background: #111; overflow: hidden; }
.g-picker__img img { width: 100%; height: 100%; object-fit: cover; }
.g-picker__placeholder { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(45deg,#1a1a1a 0 8px,#222 8px 16px); }
.g-picker__meta { padding: 16px 18px; }
.g-picker__meta h2 { color: #fff; font-family: 'Space Grotesk', sans-serif; font-size: 1.2rem; margin: 0 0 4px; }
.g-empty { padding: 40px; background: #141414; text-align: center; margin-top: 32px; border: 1px solid rgba(255,255,255,.08); }

/* Share modal */
.g-share-pop {
  position: fixed; inset: 0;
  z-index: 120;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.g-share-pop[hidden] { display: none; }
.g-share-pop__card {
  background: #141414;
  border: 1px solid rgba(255,255,255,.15);
  padding: 24px;
  width: 100%; max-width: 360px;
  box-shadow: 0 30px 80px -10px rgba(0,0,0,.7);
}
.g-share-warn {
  background: rgba(255,193,7,.1);
  border: 1px solid rgba(255,193,7,.35);
  padding: 14px;
  margin-bottom: 14px;
  text-align: center;
}
.g-share-warn__icon { font-size: 1.4rem; margin-bottom: 6px; }
.g-share-warn__msg  { color: #ffd97a; font-size: .88rem; margin: 0 0 12px; line-height: 1.5; }
.g-share-warn__btn {
  display: block; width: 100%;
  padding: 10px 14px;
  background: var(--accent); color: #fff;
  border: 0; cursor: pointer;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: .82rem; letter-spacing: .06em; text-transform: uppercase;
  margin-bottom: 8px;
}
.g-share-warn__btn:hover { background: #fff; color: #0a0a0a; }
.g-share-warn .link-btn  { background: transparent; border: 0; color: #ccc; cursor: pointer; font: inherit; font-size: .8rem; }
.g-share-warn .link-btn:hover { color: #fff; }
.g-share-pop__head {
  display: flex; justify-content: space-between; align-items: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: #ddd; margin-bottom: 12px;
}
.g-share-pop__head .link-btn { background: transparent; border: 0; color: #aaa; cursor: pointer; font: inherit; }
.g-share-pop__head .link-btn:hover { color: #fff; }
.g-share-pop__buttons { display: grid; gap: 6px; }
.g-share-btn {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  font: inherit; font-size: .9rem;
  font-family: 'Space Grotesk', sans-serif; font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.g-share-btn:hover { background: var(--accent); border-color: var(--accent); }
.g-share-btn[data-share="facebook"] svg { color: #1877f2; }
.g-share-btn:hover svg { color: #fff; }

/* Settings dialog */
.g-dialog { border: 0; padding: 0; background: transparent; max-width: 520px; width: 92%; }
.g-dialog::backdrop { background: rgba(0,0,0,.7); }
.g-dialog__inner {
  background: #141414; color: #eae6dc;
  padding: 32px; position: relative;
  border: 1px solid rgba(255,255,255,.15);
}
.g-dialog__close {
  position: absolute; top: 14px; right: 14px;
  width: 36px; height: 36px;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.2);
  font-size: 1.4rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.g-dialog__close:hover { background: var(--accent); border-color: var(--accent); }
.g-dialog h2 { font-family: 'Space Grotesk', sans-serif; color: #fff; margin: 0 0 24px; font-size: 1.4rem; }
.g-dialog h3 { font-family: 'Space Grotesk', sans-serif; color: #fff; font-size: .85rem; letter-spacing: .14em; text-transform: uppercase; margin: 0 0 14px; }
.g-dialog__section { padding: 18px 0; border-top: 1px solid rgba(255,255,255,.1); }
.g-dialog__section:first-of-type { border-top: 0; padding-top: 0; }
.g-dialog__section label { display: block; margin-bottom: 12px; font-size: .92rem; }
.g-dialog__section input[type=text],
.g-dialog__section input[type=email] {
  display: block; width: 100%; padding: 10px 12px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  color: #fff; font: inherit; margin-top: 4px;
}
.g-dialog__section input:focus { outline: 0; border-color: var(--accent); }
.g-radio {
  display: block; padding: 12px 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  margin-bottom: 8px; cursor: pointer;
}
.g-radio:hover { border-color: var(--accent); }
.g-radio strong { color: #fff; display: block; margin-bottom: 2px; }
.g-radio small { color: #8a847b; display: block; }
.g-radio input { margin-right: 8px; }
.g-dialog__msg { font-size: .85rem; margin-top: 10px; min-height: 20px; }
.g-dialog__msg.ok  { color: #6acf8a; }
.g-dialog__msg.err { color: #ff7676; }
.g-lock form { display: grid; gap: 12px; margin-top: 24px; }
.g-lock input {
  width: 100%; padding: 14px; font: inherit;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15); color: #fff;
}
.g-lock input:focus { outline: 0; border-color: var(--accent); }
.g-lock__err {
  background: rgba(255,59,59,.15); color: #ffb3b3; padding: 10px;
  margin-top: 14px; font-size: .9rem;
}
.g-btn {
  display: inline-block; padding: 14px 24px;
  font-family: 'Space Grotesk', sans-serif; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; font-size: .9rem;
  background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.3);
  cursor: pointer; text-decoration: none;
}
.g-btn:hover { background: #fff; color: #0a0a0a; }
.g-btn--accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.g-btn--accent:hover { background: #fff; color: #0a0a0a; border-color: #fff; }

/* When user filters to favorites only */
.gallery.is-filter-favs .g-tile:not(.is-fav),
.gallery.is-filter-favs .g-cinema__frame:not(.is-fav),
.gallery.is-filter-favs .g-film__slide:not(.is-fav) {
  display: none;
}
