/* BurnerPeople.com — the phone photo feed (feed.js). The viewer's night
   palette and the page's Oswald/Barlow pair. Everything is scoped under .bpf.
   Fonts come from the @font-face rules in gallery.css; the page-scroll lock
   (html.bpv-open) comes from viewer.css. */

.bpf {
  --night: #120e0a;
  --night-2: #1c1610;
  --night-ink: #efe4cf;
  --night-muted: #b8a68c;
  --night-rust: #d9703a;
  --rust: #b4551f;
  --display: Oswald, sans-serif;
  --text: Barlow, system-ui, sans-serif;
  --line: rgba(239,228,207,.12);
  --ease: cubic-bezier(.22,.68,.28,1);
  --top-h: calc(52px + env(safe-area-inset-top, 0px));

  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--night);
  color: var(--night-ink);
  font-family: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: contain;
}

.bpf,
.bpf *,
.bpf *::before,
.bpf *::after { box-sizing: border-box; }

.bpf[hidden],
.bpf [hidden] { display: none !important; }

.bpf:focus,
.bpf :focus { outline: none; }
.bpf :focus-visible { outline: 2px solid var(--night-rust); outline-offset: 2px; }

.bpf svg {
  display: block;
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

.bpf button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  margin: 0;
  padding: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.bpf-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.bpf.is-entering { animation: bpfIn .26s var(--ease) both; }
.bpf.is-leaving  { animation: bpfOut .2s ease-in both; pointer-events: none; }

@keyframes bpfIn  { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes bpfOut { from { opacity: 1; } to { opacity: 0; transform: translateY(10px); } }

/* ── the feed ─────────────────────────────────────────────────────────── */

/* Native scrolling does all the work: momentum, the rubber band at the ends,
   the scroll bar. The posts are absolutely placed on a sized track, so
   adding or dropping one never moves another. */
.bpf-scroll {
  position: absolute;
  inset: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.bpf-sizer { width: 1px; }

.bpf-post {
  position: absolute;
  left: 0;
  right: 0;
  width: var(--col-w, 100%);
  margin: 0 auto;
  contain: layout paint style;
}

.bpf-media {
  position: relative;
  overflow: hidden;
  background: var(--night-2);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;       /* no double-tap zoom: double-tap selects */
}

.bpf-img,
.bpf-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bpf-img { opacity: 0; transition: opacity .25s ease; }
.bpf-img.is-loaded { opacity: 1; }

/* The check that blooms where a double-tap landed. */
.bpf-pop {
  position: absolute;
  width: 92px;
  height: 92px;
  margin: -46px 0 0 -46px;
  color: #fff;
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,.45));
}
.bpf-pop svg { width: 100%; height: 100%; stroke-width: 1.5; }
.bpf-pop svg circle { fill: var(--rust); stroke: none; }
.bpf-pop.is-popping { animation: bpfPop .78s var(--ease) both; }

@keyframes bpfPop {
  0%   { opacity: 0; transform: scale(.4); }
  18%  { opacity: 1; transform: scale(1.12); }
  32%  { transform: scale(.96); }
  72%  { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(1.05) translateY(-10px); }
}

.bpf-post.is-selected .bpf-media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 3px var(--night-rust);
  pointer-events: none;
}

/* ── the action row under a photo ─────────────────────────────────────── */

.bpf-actions {
  display: flex;
  align-items: center;
  height: 48px;
  padding: 0 6px;
}

.bpf-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 8px;
  border-radius: 22px;
  color: var(--night-ink);
  font-family: var(--display);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color .15s, background .15s;
}

.bpf-act:active { background: rgba(255,250,238,.08); }
.bpf-act-more { margin-left: auto; padding: 0 12px; }

.bpf-act-select .bpf-ring { transition: fill .18s, stroke .18s; }
.bpf-act-select .bpf-tick { opacity: 0; transition: opacity .18s; }
.bpf-act-select.is-on { color: var(--night-rust); }
.bpf-act-select.is-on .bpf-ring { fill: var(--night-rust); stroke: var(--night-rust); }
.bpf-act-select.is-on .bpf-tick { opacity: 1; stroke: var(--night); stroke-width: 2.2; }

/* Words beside the icons while they fit; icons alone on the narrowest phones. */
@media (max-width: 370px) {
  .bpf-act-label { display: none; }
  .bpf-act { padding: 0 11px; }
}

.bpf-meta {
  margin: 0;
  height: 26px;
  padding: 2px 16px 0;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--night-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* The invitation at the end of my favs. */
.bpf-end {
  position: absolute;
  left: 0;
  right: 0;
  width: calc(var(--col-w, 100%) - 32px);
  margin: 0 auto;
  padding: 26px 22px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--night-2);
  font-size: 17px;
  line-height: 1.45;
  text-align: center;
}
.bpf-end span {
  display: block;
  margin-bottom: 12px;
  font-family: var(--display);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--night-muted);
}
.bpf-end a {
  display: inline-block;
  padding: 12px 18px;
  border: 1px solid var(--night-rust);
  border-radius: 2px;
  color: var(--night-rust);
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .16em;
  text-transform: uppercase;
  text-decoration: none;
}

/* ── top bar ──────────────────────────────────────────────────────────── */

/* Solid, not blurred: nothing behind it has to be repainted as the photos
   scroll under. It steps aside while scrolling down and comes back on the
   way up, the way a feed's header does. */
.bpf-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  height: var(--top-h);
  padding: env(safe-area-inset-top, 0px) 8px 0 4px;
  background: var(--night);
  border-bottom: 1px solid var(--line);
  transition: transform .26s var(--ease);
  will-change: transform;
}

.bpf.is-bars-hidden .bpf-top { transform: translateY(-100%); }

.bpf-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
}
.bpf-icon svg { width: 22px; height: 22px; }
.bpf-icon:active { background: rgba(255,250,238,.08); }

.bpf-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  flex: 1;
  font-family: var(--display);
  text-transform: uppercase;
}

.bpf-title-text {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .14em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bpf-count {
  font-size: 11.5px;
  letter-spacing: .16em;
  color: var(--night-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bpf-sel-badge {
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 13px;
  background: var(--night-rust);
  color: var(--night);
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  line-height: 26px;
  text-align: center;
}

/* ── selection bar ────────────────────────────────────────────────────── */

.bpf-selbar {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 8px 8px 18px;
  border-radius: 30px;
  background: #2a2119;
  box-shadow: 0 10px 30px rgba(0,0,0,.45), 0 0 0 1px var(--line);
  animation: bpfUp .3s var(--ease) both;
}

@keyframes bpfUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

.bpf-selbar-n {
  flex: 1;
  font-family: var(--display);
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.bpf-selbar-clear {
  height: 44px;
  padding: 0 12px;
  font-family: var(--display);
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--night-muted);
}

.bpf-selbar-dl {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px 0 14px;
  border-radius: 22px;
  background: var(--night-rust);
  color: #1a120b;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  white-space: nowrap;
}
.bpf-selbar-dl svg { width: 20px; height: 20px; stroke-width: 2; }

/* ── more sheet ───────────────────────────────────────────────────────── */

.bpf-sheet { position: absolute; inset: 0; z-index: 5; }

.bpf-sheet-back {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  animation: bpfFade .2s ease both;
}

@keyframes bpfFade { from { opacity: 0; } to { opacity: 1; } }

.bpf-sheet-card {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: 8px;
  animation: bpfUp .26s var(--ease) both;
}

.bpf-sheet-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 56px;
  border-radius: 14px;
  background: #2a2119;
  font-size: 16px;
}
.bpf-sheet-item svg { width: 20px; height: 20px; }
.bpf-sheet-remove { color: var(--night-rust); }
.bpf-sheet-cancel { font-weight: 600; }

/* ── toast ────────────────────────────────────────────────────────────── */

.bpf-toast {
  position: absolute;
  left: 50%;
  bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  z-index: 6;
  padding: 10px 16px;
  border-radius: 20px;
  background: rgba(239,228,207,.95);
  color: var(--night);
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
}
.bpf-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.bpf:not(.has-selbar) .bpf-toast { bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }

@media (prefers-reduced-motion: reduce) {
  .bpf *,
  .bpf *::before,
  .bpf *::after,
  .bpf {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
}
