/* =========================================================
   Kiên & Huyền. A fashion-magazine night: near-black, ivory type, one hot accent per album.
   The colours come from the photos: candle amber and champagne (Film), blush drapes (Tiệc),
   neon ember red (AfterParty).
   ========================================================= */
:root {
  --bg: #0a0807;
  --bg-2: #15110e;
  --ivory: #f5ecdd;
  --ivory-2: rgba(245, 236, 221, 0.62);
  --line: rgba(245, 236, 221, 0.16);
  --ember: #ff4a26;
  --accent: #e0bb78;
  --on-accent: #120d08;
  --serif: "Playfair Display", "Times New Roman", serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
[data-theme="film"] {
  --accent: #e0bb78;
  --on-accent: #120d08;
}
[data-theme="tiec"] {
  --accent: #efb3a0;
  --on-accent: #1a0d09;
}
[data-theme="after"] {
  --accent: #ff4a26;
  --on-accent: #fff6ef;
}

* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}
html:has(.g-page),
.g-page {
  overscroll-behavior-y: none; /* the page has its own pull-to-refresh */
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ivory);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img {
  display: block;
  max-width: 100%;
}
a {
  color: inherit;
}
button {
  font-family: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.g-kicker {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  transition: color 0.5s;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 26px;
  border: 1px solid var(--ivory);
  border-radius: 999px;
  background: transparent;
  color: var(--ivory);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s var(--ease);
}
.btn:hover {
  background: var(--ivory);
  color: var(--bg);
  transform: translateY(-2px);
}
.btn.hot {
  border-color: var(--ember);
  background: var(--ember);
  color: #fff6ef;
}
.btn.hot:hover {
  border-color: var(--ivory);
  background: var(--ivory);
  color: var(--bg);
}
.btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- hero ---------- */
.g-hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: #000;
}
.g-hero-strip {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr;
}
.g-hero-cell {
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
}
.g-hero-cell:nth-child(n + 2) {
  display: none;
}
.g-hero-cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 22%;
  opacity: 0;
  transform: scale(1.08);
  transition: opacity 1.6s ease, transform 9s linear;
}
.g-hero-cell img.on {
  opacity: 1;
  transform: scale(1);
}
.g-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(10, 8, 7, 0.55) 0, rgba(10, 8, 7, 0) 22%),
    linear-gradient(to top, var(--bg) 0, rgba(10, 8, 7, 0.72) 24%, rgba(10, 8, 7, 0) 58%);
  pointer-events: none;
}
.g-hero-top {
  position: absolute;
  z-index: 1;
  top: calc(18px + env(safe-area-inset-top));
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.28em;
}
.g-hero-text {
  position: absolute;
  z-index: 1;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(26px + env(safe-area-inset-bottom));
}
.g-names {
  margin: 10px 0 22px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(68px, 21vw, 124px);
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.g-names span {
  display: inline-block;
}
.g-names em {
  color: var(--ember);
  font-size: 0.82em;
  padding: 0 0.04em;
}
.g-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding-right: 52px; /* clear of the ♡ button in the corner */
}
.g-live {
  display: flex;
  align-items: center;
  margin: 0;
  font-size: 12px;
  color: var(--ivory-2);
}
.g-live[hidden] {
  display: none;
}
.g-live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--ember);
}
.g-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--ember);
  animation: g-live-pulse 2s ease-out infinite;
}
#live-n {
  font-weight: 600;
  color: var(--ivory);
}
@keyframes g-live-pulse {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(3.2); opacity: 0; }
}
@media (min-width: 900px) {
  .g-hero-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 3px;
  }
  .g-hero-cell:nth-child(n + 2) {
    display: block;
  }
  .g-names {
    font-size: clamp(110px, 13.5vw, 230px);
  }
  .g-hero-text {
    bottom: 40px;
  }
}

/* ---------- ticker ---------- */
.g-ticker {
  overflow: hidden;
  border-block: 1px solid var(--line);
  background: var(--bg);
}
.g-ticker-run {
  display: flex;
  width: max-content;
  padding: 11px 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  white-space: nowrap;
  animation: g-ticker 60s linear infinite;
}
.g-ticker-run i {
  margin: 0 22px;
  font-style: normal;
  color: var(--ember);
}
@keyframes g-ticker {
  to { transform: translateX(-50%); }
}

/* ---------- tabs ---------- */
.g-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: rgba(10, 8, 7, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.g-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 11px 10px 12px;
  border-left: 1px solid var(--line);
  color: var(--ivory-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s, background 0.25s;
}
.g-tab:first-child {
  border-left: 0;
}
.g-tab-n {
  display: none;
}
.g-tab b {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(13px, 3.5vw, 22px);
  line-height: 1.3;
}
.g-tab small {
  margin-top: 3px;
  font-size: 10px;
  letter-spacing: 0.1em;
  opacity: 0.8;
}
.g-tab:hover {
  color: var(--ivory);
}
.g-tab[aria-selected="true"] {
  color: var(--ivory);
}
.g-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease), background 0.5s;
}
.g-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}
@media (min-width: 720px) {
  .g-tab {
    padding: 14px 24px 15px;
  }
  .g-tab small {
    font-size: 11px;
  }
}

/* ---------- an album: banner, then the mosaic ---------- */
.g-album[hidden] {
  display: none;
}
.g-cover {
  position: relative;
}
.g-cover-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--bg-2);
}
/* the photo melts into the page, and the album's name stays readable over a bright one */
.g-cover-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--bg) 0, rgba(10, 8, 7, 0.78) 24%, rgba(10, 8, 7, 0) 62%);
  pointer-events: none;
}
.g-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: g-cover-in 1.6s var(--ease) both;
}
@keyframes g-cover-in {
  from { transform: scale(1.08); opacity: 0.4; }
  to { transform: scale(1); opacity: 1; }
}
.g-cover-text {
  position: relative;
  margin-top: clamp(-74px, -9vw, -36px);
  padding: 0 var(--gutter) 28px;
}
.g-cover-text h2 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  /* room above the line: Vietnamese capitals carry stacked marks (Ề) */
  font-size: clamp(42px, 11vw, 150px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55);
}
.g-cover-count {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ivory-2);
}
@media (min-width: 900px) {
  .g-cover-frame {
    aspect-ratio: auto;
    height: min(78vh, 62vw);
  }
  .g-cover-frame::after {
    background: linear-gradient(to top, var(--bg) 0, rgba(10, 8, 7, 0.7) 14%, rgba(10, 8, 7, 0) 36%);
  }
  .g-cover-text {
    margin-top: clamp(-150px, -9vw, -90px);
    padding-bottom: 44px;
  }
}

/* uniform columns where a photo is 2:3, and a 3:2 one spanning two columns fills the same row: nearly
   nothing is cropped, and landscape and "big" frames break up the rhythm (js/gallery.js sets them) */
.g-mosaic {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-flow: dense;
  gap: 3px;
}
.g-mosaic:empty {
  min-height: 60vh;
}
.g-mosaic .g-item {
  aspect-ratio: 2 / 3;
  /* fill the row even with a ratio of its own: a 3:2 frame beside 2:3 ones would leave a gap under it */
  align-self: stretch;
  justify-self: stretch;
}
.g-mosaic .g-wide {
  grid-column: span 2;
  aspect-ratio: 3 / 2;
}
.g-mosaic .g-big {
  grid-column: span 2;
  grid-row: span 2;
}
@media (min-width: 720px) {
  .g-mosaic {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1280px) {
  .g-mosaic {
    grid-template-columns: repeat(6, 1fr);
  }
}
.g-item {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--bg-2);
  -webkit-tap-highlight-color: transparent;
}
.g-item img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.5s, transform 0.9s var(--ease), filter 0.5s;
}
.g-item::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 0 var(--accent);
  transition: box-shadow 0.25s;
  pointer-events: none;
}
@media (hover: hover) {
  .g-item:hover img {
    transform: scale(1.05);
  }
  .g-item:hover::after {
    box-shadow: inset 0 0 0 2px var(--accent);
  }
}
.g-item--wait {
  background: linear-gradient(100deg, var(--bg-2) 30%, #241d17 50%, var(--bg-2) 70%) 0 0 / 300% 100%;
  animation: g-shimmer 1.6s ease-in-out infinite;
}
.g-item--wait img {
  opacity: 0;
  transform: scale(1.06);
}
@keyframes g-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}
/* the photo a link scrolled to, or the viewer just closed on */
.g-item--here {
  z-index: 1;
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  animation: g-here 2.4s ease-out forwards;
}
@keyframes g-here {
  70% { outline-color: var(--accent); }
  to { outline-color: transparent; }
}

/* uniform grids: favourites and face-search results */
.g-grid--drive {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 3px;
}
.g-grid--drive .g-item {
  aspect-ratio: 2 / 3;
}
.g-grid--peek .g-item:nth-child(n + 5) {
  display: none;
}
@media (min-width: 720px) {
  .g-page--fav .g-grid--drive {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1280px) {
  .g-page--fav .g-grid--drive {
    grid-template-columns: repeat(6, 1fr);
  }
}

.g-empty {
  margin: 28px var(--gutter);
  padding: 56px 20px;
  border: 1px solid var(--line);
  text-align: center;
  color: var(--ivory-2);
  font-size: 13px;
}
.g-empty[hidden] {
  display: none;
}
.g-empty p {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  color: var(--ivory);
}

/* ---------- footer ---------- */
.g-foot {
  padding: 72px var(--gutter) calc(64px + env(safe-area-inset-bottom));
  text-align: center;
}
.g-foot-mark {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(42px, 9vw, 110px);
  line-height: 1.1;
}
.g-foot-mark em {
  color: var(--ember);
}
.g-credit {
  margin: 40px 0 0;
  font-size: 12px;
  color: var(--ivory-2);
}
.g-credit a {
  color: var(--ivory);
  text-underline-offset: 3px;
}
.g-credit a:hover {
  color: var(--accent);
}

/* ---------- favourites page ---------- */
.g-fav-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: calc(22px + env(safe-area-inset-top)) var(--gutter) 30px;
}
.g-fav-head h1 {
  margin: 34px 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(48px, 13vw, 120px);
  line-height: 1.12;
}
.g-back {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
}
.g-note {
  display: block;
  font-size: 12px;
  color: var(--ivory-2);
}
.g-fav-save {
  margin: 6px 0;
}

/* ---------- pull-to-refresh ---------- */
.g-ptr {
  --pull: 0px;
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  border-radius: 50%;
  background: var(--ivory);
  color: var(--bg);
  transform: translateY(calc(var(--pull) - 48px));
  opacity: min(1, calc(var(--p, 0) * 1.75));
  pointer-events: none;
}
.g-ptr svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: rotate(calc(var(--p, 0) * 300deg));
}
.g-ptr.ready {
  background: var(--ember);
  color: #fff6ef;
}
.g-ptr.spinning {
  transition: transform 0.2s ease;
}
.g-ptr.spinning svg {
  animation: g-spin 0.9s linear infinite;
}
@keyframes g-spin {
  to { transform: rotate(360deg); }
}

/* ---------- floating round buttons ---------- */
.g-fav-float,
.g-top,
.g-find-close,
.g-float-share {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(21, 17, 14, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--ivory);
  text-decoration: none;
  cursor: pointer;
}
.g-fav-float,
.g-top {
  position: fixed;
  right: 14px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 15;
}
.g-fav-float ~ .g-top {
  bottom: calc(68px + env(safe-area-inset-bottom));
}
.g-top {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.g-top--on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.g-fav-float svg,
.g-top svg,
.g-find-close svg,
.g-float-share svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g-fav-float:has(.g-fav-n:not([hidden])) {
  color: var(--ember);
}
.g-fav-float:has(.g-fav-n:not([hidden])) svg {
  fill: currentColor;
}
.g-fav-n {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--ember);
  color: #fff6ef;
  font: 600 10px/20px var(--sans);
  text-align: center;
}
.g-fav-n[hidden] {
  display: none;
}
.g-float-share[hidden] {
  display: none;
}
.g-float-share {
  position: relative;
}
.g-float-tip {
  position: absolute;
  right: calc(100% + 8px);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ivory);
  color: var(--bg);
  font: 13px/1.3 var(--sans);
  white-space: nowrap;
}
.g-float-tip:empty {
  display: none;
}

/* ---------- tìm ảnh có bạn ---------- */
.find-open,
.find-open body {
  overflow: hidden;
}
.g-find {
  position: fixed;
  inset: 0;
  z-index: 900;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  padding-bottom: calc(40px + env(safe-area-inset-bottom));
}
.g-find[hidden] {
  display: none;
}
.g-find-bar {
  position: sticky;
  top: 12px;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin: 12px 12px -56px;
  pointer-events: none;
}
.g-find-bar > * {
  pointer-events: auto;
}
.g-find-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 64px 22px 24px;
  text-align: center;
}
.g-find-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(34px, 8vw, 64px);
  line-height: 1.2;
}
.g-find-head p {
  margin: 0 0 6px;
  color: var(--ivory-2);
}
.g-find-me[hidden] {
  display: none;
}
.g-find-me {
  width: 88px;
  height: 88px;
  border: 2px solid var(--ember);
  border-radius: 50%;
  object-fit: cover;
}
.g-find-pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.g-people {
  max-width: 760px;
  margin: 0 auto 26px;
  padding: 20px 18px 0;
  border-top: 1px solid var(--line);
}
.g-people[hidden] {
  display: none;
}
.g-people-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.g-people-more,
.g-people-open,
.g-find-save {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--ivory);
  font-size: 13px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.g-people-more[hidden] {
  display: none;
}
.g-people-open {
  display: block;
  margin: 0 auto;
}
.g-people:not(.collapsed) .g-people-open,
.g-people.collapsed .g-people-head,
.g-people.collapsed .g-people-grid {
  display: none;
}
.g-people-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 10px;
}
@media (min-width: 620px) {
  .g-people-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
.g-person {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s;
}
.g-person:hover {
  border-color: var(--ember);
  transform: scale(1.05);
}
.g-person img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s;
}
.g-find.busy .g-person {
  opacity: 0.6;
}
.g-find-status {
  margin: 0 22px 16px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
}
.g-find.busy .g-find-status::after {
  content: "";
  display: block;
  width: 24px;
  height: 24px;
  margin: 14px auto 0;
  border: 2px solid var(--ember);
  border-top-color: transparent;
  border-radius: 50%;
  animation: g-spin 0.9s linear infinite;
}
.g-find.busy #find-pick {
  pointer-events: none;
  opacity: 0.5;
}
.g-find-results {
  max-width: 1280px;
  margin: 0 auto;
}
.g-event {
  margin: 0 0 34px;
}
.g-ev-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px 12px;
}
.g-ev-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(22px, 5vw, 32px);
  line-height: 1.25;
}
.g-ev-head h2 a {
  text-decoration: none;
}
.g-ev-head h2 a:hover {
  color: var(--accent);
}
.g-ev-icon {
  display: none;
}
.g-find-save {
  flex: none;
}
.g-more {
  margin: 18px 0 4px;
  text-align: center;
}
.g-score {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font: 600 12px/1.3 ui-monospace, monospace;
  pointer-events: none;
}
@media (min-width: 720px) {
  .g-find-results .g-grid--drive {
    grid-template-columns: repeat(4, 1fr);
  }
}
.g-face-wait,
.lb-person.g-face-wait {
  background: linear-gradient(100deg, var(--bg-2) 30%, #2a221b 50%, var(--bg-2) 70%) 0 0 / 300% 100%;
  animation: g-shimmer 1.6s ease-in-out infinite;
}
.g-face-wait img {
  opacity: 0;
}

/* ---------- viewer ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 950;
  overflow: hidden;
  background: rgba(6, 5, 4, 0.98);
  touch-action: none; /* every gesture in the viewer is ours */
}
.lightbox[hidden] {
  display: none;
}
.lightbox figure {
  position: absolute;
  top: 10px;
  left: 0;
  right: 0;
  /* the bottom bar, plus the people row's space, kept even while it loads or when nobody's in the
     photo, so the photo never jumps when the faces arrive */
  bottom: calc(136px + env(safe-area-inset-bottom));
  margin: 0;
}
.lightbox figure > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  will-change: transform;
}
.lightbox figure > img.lb-wait {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.lightbox figure > img[hidden] {
  display: none;
}
.lightbox figcaption {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100vw, 640px);
  height: 44px;
  padding: 0 18px;
  color: var(--ivory);
  font-size: 12px;
  letter-spacing: 0.14em;
  transform: translateX(-50%);
  pointer-events: none; /* it spans the close button's row */
}
.lightbox figcaption > * {
  pointer-events: auto;
}
.lb-close,
.lb-nav {
  position: absolute;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(21, 17, 14, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ivory);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.lb-close svg,
.lb-nav svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lb-close {
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
/* centred on the photo area, not the whole screen */
.lb-nav {
  top: calc(50% - 63px - env(safe-area-inset-bottom) / 2);
  transform: translateY(-50%);
}
.lb-prev {
  left: 10px;
}
.lb-next {
  right: 10px;
}
.lb-nav:hover,
.lb-close:hover {
  border-color: var(--ember);
  background: var(--ember);
  color: #fff6ef;
}
.lb-nav:active {
  transform: translateY(-50%) scale(0.94);
}
.lb-close:active {
  transform: translateX(-50%) scale(0.94);
}
.lightbox :is(.lb-people, .lb-by) {
  transition: opacity 0.2s;
}
.lightbox.zoomed :is(.lb-people, .lb-by) {
  opacity: 0;
  pointer-events: none;
}
.lightbox.zoomed figure {
  cursor: grab;
}
.lightbox.zoomed figure:active {
  cursor: grabbing;
}
.lightbox.dragging :is(.lb-nav, .lb-close, figcaption, .lb-people, .lb-by) {
  opacity: calc(1 - var(--drag, 0) * 4);
}
.lightbox.dragging .lb-side {
  visibility: hidden;
}
.lb-people {
  position: fixed;
  left: 50%;
  bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 1;
  display: flex;
  gap: 8px;
  max-width: min(100vw, 640px);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  transform: translateX(-50%);
}
.lb-people::-webkit-scrollbar {
  display: none;
}
.lb-people[hidden] {
  display: none;
}
.lb-person {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-2);
  cursor: pointer;
}
.lb-person:hover {
  border-color: var(--ember);
}
.lb-person img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.lb-album,
.lb-by {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  padding: 4px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(21, 17, 14, 0.8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ivory);
  font-size: 13px;
  line-height: 24px;
  text-decoration: none;
  white-space: nowrap;
  transform: translateX(-50%);
}
.lb-album[hidden],
.lb-by[hidden],
.zoomed .lb-album {
  display: none;
}
.lb-by:not([hidden]) + .lb-album {
  top: calc(52px + env(safe-area-inset-top));
}
.lb-album svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#lb-dl {
  color: var(--ivory);
  font-weight: 500;
  text-decoration: none;
  text-transform: uppercase;
}
.lb-acts,
.lb-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.lb-fav,
.lb-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--ivory);
  font: inherit;
  cursor: pointer;
}
.lb-fav[hidden],
.lb-link[hidden] {
  display: none;
}
.lb-fav svg,
.lb-link svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.lb-fav[aria-pressed="true"] {
  color: var(--ember);
}
.lb-fav[aria-pressed="true"] svg {
  fill: currentColor;
}
.lb-fav--pop svg {
  animation: lb-fav-pop 0.35s var(--ease);
}
@keyframes lb-fav-pop {
  40% { transform: scale(1.35); }
}
.lb-link span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  font-size: 18px;
}
.lb-link span:empty,
.lb-link span:not(:empty) + svg {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .g-ticker-run,
  .g-live-dot::after,
  .g-item--wait,
  .g-face-wait,
  .g-cover-img {
    animation: none;
  }
  .g-hero-cell img {
    transform: none;
    transition: opacity 0.4s;
  }
}
