/* =========================================================
   /gallery: ivory paper, blush, and rosewood, drawn from the ceremony photograph.
   Photos as matted prints, each event on its own colour (--band / --tint).
   Tokens are re-set on .g-page only, so the invitation keeps its own palette.
   ========================================================= */
html:has(.g-page) {
  background: #faf6f2;
  scroll-behavior: auto;
}
.g-page {
  --bg: #faf6f2;
  --paper: #fffaf7;
  --ink: #3c2a2c;
  --ink-2: #7a6562;
  --green: #6e2c38; /* rosewood */
  --gold: #9a4a56;
  --gold-2: #e4c4c0;
  --line: #eadfd8;
  --tint: #8a6d33;
  --band: #f6e7e3;
  --foil: linear-gradient(105deg, #7a3040 0%, #d7a3a8 30%, #f8e4e0 48%, #a85a64 68%, #efd0cc 100%);
  /* woven threads, both ways: book linen over a colour */
  --linen: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='360'><filter id='w' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.03 1.1' numOctaves='1' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0 0.1 0 0 0 0.3 -0.09'/></filter><filter id='f' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='1.1 .03' numOctaves='1' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.3 0 0 0 0 0.22 0 0 0 0 0.1 0 0 0 0.3 -0.09'/></filter><rect width='100%25' height='100%25' filter='url(%23w)'/><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>");
  --linen-light: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='360' height='360'><filter id='w' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='.03 1.1' numOctaves='1' seed='4' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.8 0 0 0 0.34 -0.11'/></filter><filter id='f' x='0' y='0' width='100%25' height='100%25'><feTurbulence type='fractalNoise' baseFrequency='1.1 .03' numOctaves='1' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 0.95 0 0 0 0 0.8 0 0 0 0.34 -0.11'/></filter><rect width='100%25' height='100%25' filter='url(%23w)'/><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>");
  --print-shadow: 0 22px 40px -22px rgba(74, 52, 18, 0.55), 0 2px 6px rgba(74, 52, 18, 0.14);
  --col: 100vw;
  --vw: 1vw;
  --edge-gap: 16px;
  --gutter: clamp(16px, 5vw, 72px);
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --script: "Playfair Display", Georgia, "Times New Roman", serif;
  --caps: "Cormorant SC", "Cormorant Garamond", serif;
  /* style.css keeps the invitation in a phone-width column; the album gets the whole screen */
  max-width: none;
  box-shadow: none;
  background: var(--bg) var(--grain);
  overflow-x: clip;
}
.g-page .lightbox {
  max-width: none;
}
/* the page has its own pull-to-refresh (js/gallery.js); keep the browser's from reloading the page */
html:has(.g-page),
.g-page {
  overscroll-behavior-y: none;
}
.g-page .eyebrow,
.g-page .small-caps,
.g-page .btn,
.g-back,
.g-ev-n {
  font-family: var(--caps);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: 0.18em;
  text-transform: lowercase;
}
.g-page .eyebrow {
  color: var(--gold);
}
.g-page .btn {
  min-height: 46px;
  padding: 10px 28px;
  border-color: var(--green);
  color: var(--green);
  transition: background 0.3s, color 0.3s, border-color 0.3s, transform 0.3s var(--ease);
}
.g-page .btn:hover {
  background: var(--green);
  color: #fbf3f0;
  transform: translateY(-2px);
}
.g-page .btn.dark {
  background: var(--green);
  color: #fbf3f0;
}
.g-page .btn.dark:hover {
  background: var(--gold);
  border-color: var(--gold);
}
.g-page :focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.g-crest {
  display: block;
  width: 68px;
  height: 68px;
}

/* ---------- pull-to-refresh indicator ---------- */
.g-ptr {
  --pull: 0px;
  position: fixed;
  z-index: 20;
  top: 0;
  left: 50%;
  width: 40px;
  height: 40px;
  margin-left: -20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: var(--paper);
  color: var(--gold);
  box-shadow: 0 6px 18px -8px rgba(60, 40, 10, 0.45);
  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.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  /* the arrow winds round as you pull, a full turn at the trigger distance */
  transform: rotate(calc(var(--p, 0) * 300deg));
}
.g-ptr.ready {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
}
.g-ptr.spinning {
  transition: transform 0.2s ease;
}
.g-ptr.spinning svg {
  animation: spin 0.9s linear infinite;
}

/* ---------- the cover: ceremony photograph, names, then the three albums ---------- */
.g-cover {
  position: relative;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: #3a2428;
  color: #fffaf6;
  text-align: center;
}
.g-cover-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 42%;
  animation: g-drift 22s ease-out both;
}
@media (max-width: 760px) {
  .g-cover-photo img {
    /* portrait file is already cropped onto the couple; keep their faces above the names */
    object-position: 50% 32%;
  }
}
@keyframes g-drift {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
.g-cover::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(58, 28, 34, 0.28) 0, rgba(58, 28, 34, 0) 22%),
    linear-gradient(to top, rgba(48, 18, 26, 0.84) 0, rgba(48, 18, 26, 0.46) 26%, rgba(48, 18, 26, 0) 54%);
}
.g-cover::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: clamp(10px, 1.6vw, 22px);
  right: clamp(10px, 1.6vw, 22px);
  left: clamp(10px, 1.6vw, 22px);
  bottom: calc(78px + env(safe-area-inset-bottom));
  border: 1px solid rgba(255, 244, 236, 0.62);
  outline: 1px solid rgba(255, 244, 236, 0.28);
  outline-offset: -6px;
  pointer-events: none;
}
.g-cover-crest {
  position: absolute;
  z-index: 2;
  top: calc(18px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  color: #fff6f2;
}
.g-cover .g-find-open {
  position: static;
  z-index: 3;
  margin: 14px 0 0;
  min-height: 40px;
  padding: 8px 18px;
  font-size: 13px;
  letter-spacing: 0.14em;
}
@media (max-width: 380px) {
  .g-cover .g-find-open {
    margin-top: 10px;
    letter-spacing: 0.08em;
    padding: 7px 12px;
    font-size: 12px;
  }
}
.g-cover-text {
  position: absolute;
  z-index: 2;
  left: var(--gutter);
  right: var(--gutter);
  bottom: calc(84px + env(safe-area-inset-bottom));
}
.g-page .g-cover-text .small-caps {
  margin: 0;
  color: #fff1ea;
}
.g-names {
  margin: 0 0 4px;
  padding-top: 0.12em;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(34px, 6.6vw, 92px);
  letter-spacing: -0.02em;
  line-height: 1.22;
  white-space: nowrap;
  color: #fffaf6;
  text-shadow: 0 2px 18px rgba(48, 16, 24, 0.5);
}
.g-names > span {
  display: inline-block;
}
.g-names em {
  display: inline-block;
  margin: 0 0.1em;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: 0.72em;
  color: #f6d0cc;
  text-shadow: none;
}
.g-page .g-cover .btn {
  border-color: rgba(255, 244, 236, 0.85);
  color: #fffaf6;
  background: rgba(62, 28, 36, 0.32);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.g-page .g-cover .btn:hover {
  background: #fffaf6;
  border-color: #fffaf6;
  color: var(--green);
}
.g-find-open svg {
  flex: none;
  width: 16px;
  height: 16px;
}
.g-cover .g-live {
  color: #fff1ea;
  opacity: 0.92;
  margin-top: 6px;
}
@media (max-height: 640px) {
  .g-names { font-size: 30px; }
  .g-cover-crest { width: 46px; height: 46px; }
  .g-cover-text { bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* prints laid into view (js/gallery.js sets g-anim, g-in) */
.g-anim .g-story > .g-item:not(.g-in) {
  opacity: 0;
  transform: translateY(46px) rotate(calc(var(--r) * 3));
}
.g-story > .g-item:nth-child(2) { transition-delay: 0.08s; }
.g-story > .g-item:nth-child(3) { transition-delay: 0.16s; }
.g-story > .g-item:nth-child(4) { transition-delay: 0.24s; }
.g-story > .g-item:nth-child(5) { transition-delay: 0.32s; }

.g-back {
  position: absolute;
  z-index: 3;
  top: calc(18px + env(safe-area-inset-top));
  left: var(--gutter);
  text-decoration: none;
  color: var(--green);
}

/* ---------- tabs: a rosewood ribbon on the first screen, then sticky ---------- */
/* pulled up over the cover so Ảnh cưới / Phóng sự cưới / Khách chụp show without scrolling */
.g-tabs {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: center;
  align-items: center;
  box-sizing: border-box;
  height: calc(68px + env(safe-area-inset-bottom));
  margin-top: calc(-68px - env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--green);
  box-shadow: 0 8px 24px -14px rgba(62, 24, 32, 0.45);
}
@media (min-width: 900px) {
  .g-tabs {
    grid-template-columns: repeat(3, minmax(0, 280px));
  }
}
.g-tab {
  position: relative;
  padding: 11px 4px 12px;
  text-align: center;
  text-decoration: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(15px, 4.5vw, 23px);
  line-height: 1.2;
  color: rgba(246, 237, 215, 0.68);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s;
}
.g-tab:hover,
.g-tab[aria-selected="true"] {
  color: #fff8e8;
}
.g-tab small {
  display: block;
  margin-top: 2px;
  font-family: var(--caps);
  font-style: normal;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: inherit;
  opacity: 0.85;
}
.g-tab::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 56px;
  height: 3px;
  margin-left: -28px;
  background: var(--foil);
  transform: scaleX(0);
  transition: transform 0.4s var(--ease);
}
.g-tab[aria-selected="true"]::after {
  transform: scaleX(1);
}

/* ---------- grid: every photo a matted print ---------- */
.g-album {
  padding: clamp(14px, 2.4vw, 34px) clamp(8px, 2.4vw, 34px) 8px;
}
.g-album[hidden] {
  display: none;
}
[id^="album-"] {
  scroll-margin-top: 68px; /* an event page's album links open with the bar at the top */
}
/* a mosaic: 2:3 frames, a 3:2 photo spanning two columns fills the same row, and now and then a
   portrait goes double size (lib/gallery.js gridHtml picks them) */
.g-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-flow: dense;
  gap: clamp(6px, 1vw, 14px);
}
.g-grid > .g-item {
  aspect-ratio: 2 / 3;
  align-self: stretch;
  justify-self: stretch;
}
.g-grid > .g-wide {
  grid-column: span 2;
  aspect-ratio: 3 / 2;
}
.g-grid > .g-big {
  grid-column: span 2;
  grid-row: span 2;
}
@media (min-width: 720px) {
  .g-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1280px) {
  .g-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
.g-item {
  position: relative;
  display: block;
  background: var(--paper);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
.g-grid > .g-item {
  outline: 1px solid rgba(138, 109, 51, 0.16);
  outline-offset: -1px;
  transition: transform 0.45s var(--ease), box-shadow 0.35s;
}
@media (hover: hover) {
  .g-grid > .g-item:hover {
    z-index: 2;
    transform: translateY(-4px) rotate(-0.7deg);
    box-shadow: var(--print-shadow);
  }
  .g-grid > .g-item:nth-child(even):hover {
    transform: translateY(-4px) rotate(0.7deg);
  }
}
.g-video::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin: -22px 0 0 -22px;
  border-radius: 50%;
  background: rgba(27, 31, 40, 0.55)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path d='M9 7v10l8-5z' fill='white'/></svg>")
    center / 24px no-repeat;
}
.g-item > img {
  position: absolute;
  top: clamp(3px, 0.5vw, 6px);
  left: clamp(3px, 0.5vw, 6px);
  width: calc(100% - 2 * clamp(3px, 0.5vw, 6px));
  height: calc(100% - 2 * clamp(3px, 0.5vw, 6px));
  object-fit: cover;
  transition: opacity 0.4s;
}

/* who uploaded it (Khách chụp, from Google Photos): avatar + first name over the photo's corner */
.g-by {
  position: absolute;
  left: 6px;
  bottom: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 12px);
  padding: 2px 8px 2px 2px;
  border-radius: 999px;
  background: rgba(27, 31, 40, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #fff;
  font-size: 11px;
  line-height: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
}
.g-item .g-by img,
.g-by i {
  position: static;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  transition: none;
  transform: none;
}
.g-by i {
  display: grid;
  place-items: center;
  background: var(--gold);
  font-style: normal;
  font-size: 10px;
}

/* "● N người đang xem" under the header's button */
.g-live {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.02em;
  color: var(--ink);
  opacity: 0.72;
}
.g-live[hidden] {
  display: none;
}
.g-live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2fa35a;
}
.g-live-dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #2fa35a;
  animation: g-live-pulse 2s ease-out infinite;
}
#live-n {
  margin-right: -4px;
  font-weight: 500;
}
@keyframes g-live-pulse {
  from { transform: scale(1); opacity: 0.6; }
  to { transform: scale(3); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .g-live-dot::after { animation: none; }
}

/* ---------- tìm ảnh có bạn ---------- */
.g-find-open {
  margin-top: 22px;
}
.g-find-open svg,
.g-find-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.find-open,
.find-open body {
  overflow: hidden;
}
/* full screen, same column as the page; the lightbox (z 950) opens above it */
.g-find {
  position: fixed;
  inset: 0;
  z-index: 900;
  max-width: 600px;
  margin: 0 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg, #f4efe6);
  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 -52px;
  pointer-events: none; /* only its buttons take taps */
}
.g-find-bar > * {
  pointer-events: auto;
}
.g-find-bar .g-float-share {
  position: relative;
  top: auto;
  width: 40px;
  height: 40px;
  margin: 0;
}
.g-float-share[hidden] {
  display: none;
}
.g-find-close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.9);
  color: var(--gold);
  cursor: pointer;
}
.g-find-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 56px 26px 22px;
  text-align: center;
}
.g-find-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-style: italic;
  font-size: 28px;
  line-height: 1.2;
  color: var(--ink);
}
.g-find-head p {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--ink-2);
}
.g-find-me[hidden] {
  display: none; /* style.css makes every img display: block, which would beat [hidden] */
}
.g-find-me {
  width: 84px;
  height: 84px;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  object-fit: cover;
}
.g-find-pick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.g-find-head .btn {
  cursor: pointer;
}
.g-people {
  margin: 0 18px 26px;
  padding-top: 20px;
  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: 14px;
}
.g-people-more {
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--gold);
  cursor: pointer;
}
.g-people-more[hidden] {
  display: none;
}
/* after a search: the faces fold behind one "Gương mặt khác" link */
.g-people-open {
  display: block;
  margin: 0 auto;
  padding: 4px 8px;
  border: 0;
  background: none;
  font: italic 16px var(--serif);
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
/* floating "Copy link", top right: the event page's, and the face search's beside its close button */
.g-float-share {
  position: sticky;
  top: calc(12px + env(safe-area-inset-top));
  z-index: 5;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  /* no top margin: it would collapse through <body> and push the page down; sticky's top places it */
  margin: 0 12px -44px auto;
  padding: 0;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.9);
  box-shadow: 0 2px 10px rgba(31, 29, 26, 0.08);
  color: var(--gold);
  cursor: pointer;
}
/* back to the top: bottom right of the column, fades in a screen down */
.g-top {
  position: fixed;
  right: calc(var(--edge-gap) - 4px); /* 12px in from the column, under the share button */
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 15;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.92);
  box-shadow: 0 2px 10px rgba(31, 29, 26, 0.1);
  color: var(--gold);
  cursor: pointer;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
/* the favourites page's button sits in that corner, so back-to-top goes above it */
.g-fav-float ~ .g-top {
  bottom: calc(72px + env(safe-area-inset-bottom));
}
/* ♡ to /gallery/yeu-thich, bottom right on every gallery page but its own; the count on its shoulder */
/* on a phone the album ribbon fills the bottom of /gallery's first screen: the heart and back-to-top sit above it */
@media (max-width: 899px) {
  .g-page:has(.g-tabs:not(.g-tabs--top)) .g-fav-float {
    bottom: calc(68px + 12px + env(safe-area-inset-bottom));
  }
  .g-page:has(.g-tabs:not(.g-tabs--top)) .g-fav-float ~ .g-top {
    bottom: calc(68px + 12px + 54px + env(safe-area-inset-bottom));
  }
}
.g-fav-float {
  position: fixed;
  right: calc(var(--edge-gap) - 4px);
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 15;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.92);
  box-shadow: 0 2px 10px rgba(31, 29, 26, 0.1);
  color: var(--gold);
  text-decoration: none;
}
.g-fav-float svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.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: 2px solid var(--bg, #f4efe6);
  border-radius: 999px;
  background: var(--gold);
  color: #fff;
  font: 500 10px/16px var(--sans);
  text-align: center;
}
.g-fav-n[hidden] {
  display: none;
}
.g-fav-save {
  margin-top: 6px;
}
.g-top--on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.g-top svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g-float-share svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.g-float-tip {
  position: absolute;
  right: calc(100% + 8px);
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 13px/1.3 var(--sans);
  white-space: nowrap;
}
.g-float-tip:empty {
  display: none;
}
.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;
}
.g-person {
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.g-person:hover,
.g-person:focus-visible {
  border-color: var(--gold);
  transform: scale(1.04);
  outline: none;
}
.g-person img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.g-find.busy .g-person {
  opacity: 0.6;
}
.g-find-status {
  margin: 0 22px 14px;
  text-align: center;
  font-style: italic;
  font-size: 17px;
  color: var(--ink-2);
}
.g-find-save {
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  font: italic 15px var(--serif);
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.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;
}
.g-grid--peek .g-item:nth-child(n + 5) {
  display: none;
}
.g-find.busy .g-find-status::after {
  content: "";
  display: block;
  width: 22px;
  height: 22px;
  margin: 14px auto 0;
  border: 1.5px solid var(--gold-2);
  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;
}
@keyframes g-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------- empty album ---------- */
.g-empty {
  margin: 28px 16px 12px;
  padding: 56px 20px 52px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}
.g-empty .orn {
  margin: 0 auto 18px;
}
.g-empty p {
  margin: 0 0 10px;
  font-style: italic;
  font-size: 20px;
  color: var(--ink);
}

/* ---------- guest upload call-out ---------- */
.g-upload {
  margin: 14px 10px 16px;
  padding: 26px 18px 22px;
  text-align: center;
  background: var(--paper);
  border: 1px solid var(--line);
}
.g-upload p {
  margin: 0 0 16px;
  font-style: italic;
  font-size: 19px;
  line-height: 1.4;
}
.g-note {
  display: block;
  margin-top: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  color: var(--ink-2);
}
.g-more {
  display: block;
  margin: 18px 0 4px;
  text-align: center;
  text-decoration: none;
  color: var(--gold);
}

.g-foot {
  padding: 28px 22px 56px;
  text-align: center;
}
/* /gallery has no footer: keep the last photos off the bottom edge */
.g-tabs + main {
  padding-bottom: calc(48px + env(safe-area-inset-bottom));
}

/* ---------- lightbox extras ---------- */
.lightbox figcaption {
  display: flex;
  justify-content: center;
  gap: 18px;
}
/* prev / next / close: thin gold-ringed circles with hairline icons, instead of bare ‹ › × glyphs.
   Close sits at the bottom centre, within thumb reach on a phone. */
.g-page .lb-nav,
.g-page .lb-close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  background: rgba(251, 248, 241, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  opacity: 1;
  box-shadow: 0 6px 18px -10px rgba(60, 40, 10, 0.45);
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.g-page .lb-close {
  top: auto;
  right: auto;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
}
.g-page .lb-nav svg,
.g-page .lb-close svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* centred on the photo area (figure: 10px from the top, 136px + safe area from the bottom),
   not on the whole screen, so the arrows sit at the photo's vertical middle */
.g-page .lb-nav {
  top: calc(50% - 63px - env(safe-area-inset-bottom) / 2);
}
.g-page .lb-prev {
  left: 10px;
}
.g-page .lb-next {
  right: 10px;
}
.g-page .lb-nav:hover,
.g-page .lb-nav:focus-visible,
.g-page .lb-close:hover,
.g-page .lb-close:focus-visible {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--paper);
  outline: none;
}
.g-page .lb-nav:active {
  transform: translateY(-50%) scale(0.94);
}
.g-page .lb-close:active {
  transform: translateX(-50%) scale(0.94);
}
/* the photo takes the whole screen above a bottom bar: count · close · download.
   No paper mat or shadow here, every pixel goes to the photo. */
.g-page .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));
}
.g-page .lightbox img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  padding: 0;
  background: none;
  box-shadow: none;
}
.g-page .lightbox figcaption {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  width: min(100vw, 600px);
  height: 44px;
  margin: 0;
  padding: 0 22px;
  transform: translateX(-50%);
  justify-content: space-between;
  align-items: center;
}
/* the bar spans the close button's row: let taps through to it except on the bar's own text */
.g-page .lightbox figcaption {
  pointer-events: none;
}
.g-page .lightbox figcaption > * {
  pointer-events: auto;
}
/* the full-screen figure comes later in the DOM, so lift the buttons above it */
.g-page .lb-close,
.g-page .lb-nav {
  z-index: 1;
}

/* the photo and its two neighbours sit side by side in the figure; js/gallery.js slides them
   together on a swipe and drags the middle one down to close */
.g-page .lightbox {
  overflow: hidden;
  touch-action: none; /* every gesture in the viewer is ours (pinch zoom on the photo isn't supported) */
}
.g-page .lightbox figure > img {
  position: absolute;
  inset: 0;
  will-change: transform;
}
/* loading: the thumbnail (or a shimmer) fitted like the photo will be, see setSlide() */
.g-page .lightbox figure > img.lb-wait {
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}
.g-page .lightbox figure > img[hidden] {
  display: none;
}
/* zoomed in: the photo gets the whole screen (the people row and uploader step aside) and a mouse
   drags it around */
.g-page .lightbox :is(.lb-people, .lb-by) {
  transition: opacity 0.2s;
}
.g-page .lightbox.zoomed :is(.lb-people, .lb-by) {
  opacity: 0;
  pointer-events: none;
}
.g-page .lightbox.zoomed figure {
  cursor: grab;
}
.g-page .lightbox.zoomed figure:active {
  cursor: grabbing;
}
/* dragging the photo down: the controls fade out quickly, the album shows through behind */
.g-page .lightbox.dragging :is(.lb-nav, .lb-close, figcaption, .lb-people, .lb-by) {
  opacity: calc(1 - var(--drag, 0) * 4);
}
.g-page .lightbox.dragging .lb-side {
  visibility: hidden;
}

/* people in the photo: a row of avatars between the photo and the bottom bar */
.g-page .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, 600px);
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  transform: translateX(-50%);
}
.g-page .lb-people::-webkit-scrollbar {
  display: none;
}
.g-page .lb-people[hidden] {
  display: none;
}
.g-page .lb-person {
  flex: none;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid var(--gold-2);
  border-radius: 50%;
  overflow: hidden;
  background: var(--paper);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.g-page .lb-person:hover,
.g-page .lb-person:focus-visible {
  border-color: var(--gold);
  outline: none;
}
.g-page .lightbox .lb-person img {
  width: 100%;
  height: 100%;
  padding: 0;
  object-fit: cover;
}

/* uploader, over the top of the photo */
.g-page .lb-album {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 3px 14px;
  border: 1px solid var(--gold-2);
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--gold);
  font: 13px/24px var(--sans);
  text-decoration: none;
  white-space: nowrap;
  transform: translateX(-50%);
}
.g-page .lb-album[hidden],
.g-page .zoomed .lb-album {
  display: none;
}
/* under the uploader's pill when there is one */
.g-page .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;
}
/* the photo a link scrolled to (?at=, or the lightbox just closed on): a gold ring for a moment */
.g-item--here {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  animation: g-here 2.4s ease-out forwards;
}
@keyframes g-here {
  70% {
    outline-color: var(--gold);
  }
  to {
    outline-color: transparent;
  }
}
.g-page .lb-by {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 50%;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 3px 14px 3px 3px;
  border-radius: 999px;
  background: rgba(251, 248, 241, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  font-size: 13px;
  line-height: 24px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: translateX(-50%);
}
.g-page .lb-by[hidden] {
  display: none;
}
.g-page .lightbox .lb-by img {
  flex: none;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  object-fit: cover;
}
.g-page .lb-by:not(:has(img)) {
  padding-left: 14px;
}

#lb-dl {
  color: var(--gold);
  text-decoration: none;
  text-transform: uppercase;
}
.lb-acts {
  display: flex;
  align-items: center;
  gap: 14px;
}
/* the counter and ♡, left of the close button (the right side holds link + "Lưu ảnh") */
.lb-left {
  display: flex;
  align-items: center;
  gap: 10px;
}
/* ♡ the photo: an outline, filled once it's a favourite (with a little pop) */
.lightbox .lb-fav {
  display: flex;
  align-items: center;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--gold);
  cursor: pointer;
}
.lightbox .lb-fav[hidden] {
  display: none;
}
.lb-fav svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linejoin: round;
}
.lb-fav[aria-pressed="true"] svg {
  fill: currentColor;
}
.lb-fav--pop svg {
  animation: lb-fav-pop 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes lb-fav-pop {
  40% {
    transform: scale(1.35);
  }
}
/* copy the photo's link: a share icon, a ✓ in its place for a moment after */
.lightbox .lb-link {
  position: relative;
  display: flex;
  align-items: center;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--gold);
  font: inherit;
  cursor: pointer;
}
.lightbox .lb-link[hidden] {
  display: none;
}
.lb-link svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.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;
}

/* ---------- phóng sự: each event a chapter on its own colour, its prints laid beside the title ---------- */
.g-album:has(.g-event) {
  padding: 0;
}
/* the events under the album bar, each a link to its page; it sticks below the bar, and scrolls sideways
   on a phone */
.g-subnav {
  --gap: clamp(6px, 1.6vw, 22px);
  position: sticky;
  top: calc(68px + env(safe-area-inset-bottom));
  z-index: 9;
  display: flex;
  gap: var(--gap);
  padding: 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 6px 16px -14px rgba(62, 24, 32, 0.45);
}
.g-subnav::-webkit-scrollbar {
  display: none;
}
.g-subnav a {
  position: relative;
  flex: none;
  padding: 11px 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  color: var(--green);
  -webkit-tap-highlight-color: transparent;
  transition: color 0.25s;
}
.g-subnav a:first-child {
  margin-left: auto;
}
.g-subnav a:last-child {
  margin-right: auto;
}
.g-subnav a:hover {
  color: var(--gold);
}
/* a dot between two events, in the middle of the gap */
.g-subnav a + a::before {
  content: "·";
  position: absolute;
  top: 50%;
  left: calc(var(--gap) / -2);
  transform: translate(-50%, -50%);
  font-style: normal;
  color: var(--gold);
  pointer-events: none;
}
.g-subnav a[aria-current] {
  box-shadow: inset 0 -2px var(--green);
}
.g-event {
  scroll-margin-top: 112px; /* clear of the sticky tabs and events, for links to one event */
  --gold: var(--tint);
  display: grid;
  gap: 8px;
  padding: clamp(44px, 7vw, 96px) max(var(--gutter), calc((100vw - 1180px) / 2));
  background: var(--linen), var(--band);
}
.g-ev-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.g-ev-n {
  color: var(--tint);
}
.g-ev-head h2 {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(38px, 5.6vw, 72px);
  line-height: 1.1;
  color: var(--green);
}
.g-ev-head h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.25s;
}
.g-ev-head h2 a:hover {
  color: var(--tint);
}
.g-ev-icon {
  display: none;
}
.g-ev-head small {
  margin-top: 4px;
  font-family: var(--caps);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.g-ev-head .btn {
  margin-top: 16px;
}
.g-story {
  position: relative;
  display: block;
  width: 100%;
  max-width: 620px;
  margin: 18px auto 0;
  aspect-ratio: 1 / 1.08;
}
.g-story > .g-item {
  --r: 0deg;
  position: absolute;
  width: 40%;
  aspect-ratio: 4 / 5;
  background: var(--paper);
  box-shadow: var(--print-shadow);
  outline: 0;
  transform: rotate(var(--r));
  transition: transform 0.7s var(--ease), box-shadow 0.4s, opacity 0.9s;
}
.g-story > .g-item:hover {
  z-index: 6;
  transform: rotate(0) scale(1.06);
}
.g-story > .g-item > img {
  top: 4%;
  left: 4%;
  width: 92%;
  height: 92%;
  object-position: 50% 22%;
}
.g-story > .g-item:nth-child(1) { --r: -1.5deg; left: 24%; top: 19%; width: 54%; z-index: 4; }
.g-story > .g-item:nth-child(2) { --r: -6deg; left: 0; top: 2%; z-index: 2; }
.g-story > .g-item:nth-child(3) { --r: 5deg; right: 0; top: 0; z-index: 1; }
.g-story > .g-item:nth-child(4) { --r: 4deg; left: 2%; bottom: 0; z-index: 3; }
.g-story > .g-item:nth-child(5) { --r: -4deg; right: 1%; bottom: 3%; z-index: 3; }
@media (min-width: 900px) {
  .g-event {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    align-items: center;
    column-gap: clamp(32px, 6vw, 96px);
  }
  .g-event:nth-child(even) .g-ev-head {
    order: 2;
  }
  .g-story {
    margin-top: 0;
  }
  .g-event .g-video-embed {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
    margin-top: 44px;
  }
}
/* face-search results keep their title and "Lưu tất cả" on one line, on the plain page */
.g-find .g-event {
  display: block;
  padding: 8px 0 26px;
  background: none;
}
.g-find .g-ev-head {
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 10px;
  text-align: left;
}
.g-find .g-ev-head h2 {
  font-size: clamp(22px, 4vw, 28px);
}
/* uniform frames: favourites, face-search results, and an event's own page. Photos whose shape is
   known (Google Photos) span two columns when landscape, so group shots aren't cropped */
.g-grid--drive > .g-item {
  aspect-ratio: 3 / 4;
}
.g-grid--drive > .g-wide {
  aspect-ratio: 3 / 2;
}
@media (min-width: 720px) {
  .g-find .g-grid--drive {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 1100px) {
  .g-find .g-grid--drive {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  /* (js/gallery.js PEEK) a full row before "Xem thêm" */
  .g-grid--peek .g-item:nth-child(n + 5) {
    display: block;
  }
  .g-grid--peek .g-item:nth-child(n + 7) {
    display: none;
  }
}
.g-find {
  max-width: none;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.g-find-bar {
  z-index: 3;
}
.g-find-results {
  max-width: 1440px;
  margin-inline: auto;
}
/* before a search: an invitation, not a page */
.g-find-head {
  gap: 8px;
  max-width: 720px;
  margin-inline: auto;
  padding: 40px 22px 18px;
}
.g-page .g-find-head .eyebrow {
  margin: 0;
}
.g-find-head h2 {
  font-size: clamp(28px, 4.4vw, 42px);
  color: var(--green);
}
.g-find-head p {
  font-size: 17px;
  margin: 0;
}
.g-find-main {
  margin-top: 8px;
}
.g-find-summary {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.g-find .g-find-status {
  margin: 0;
}
.g-find-status:empty {
  display: none;
}
.g-people-open {
  display: none;
}
.g-people.collapsed {
  display: none;
}
/* after: one slim row that stays on top, and the photos straight under it */
.g-find.searched .g-find-head {
  position: sticky;
  z-index: 2;
  top: 0;
  flex-direction: row;
  max-width: none;
  padding: 10px 104px 10px clamp(12px, 3vw, 28px);
  background: rgba(250, 246, 242, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.g-find.searched .g-find-head > :is(.eyebrow, h2, p, .g-note) {
  display: none;
}
.g-find.searched .g-find-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  margin: 0;
}
.g-find.searched .g-find-me {
  flex: none;
  width: 52px;
  height: 52px;
  border-width: 1px;
}
.g-find.searched .g-find-summary {
  align-items: flex-start;
  gap: 0;
  min-width: 0;
}
.g-find.searched .g-find-status {
  font-size: 21px;
  line-height: 1.25;
  text-align: left;
  color: var(--green);
}
.g-find.searched.busy .g-find-status::after {
  display: inline-block;
  width: 14px;
  height: 14px;
  margin: 0 0 0 8px;
  vertical-align: -2px;
}
.g-find.searched .g-find-pick {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0 14px;
}
/* the buttons become quiet links */
.g-page .g-find.searched .g-find-pick :is(.btn, .g-people-open) {
  display: inline;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--gold);
  font: 500 14px/1.5 var(--caps);
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  transform: none;
  cursor: pointer;
}
.g-page .g-find.searched .g-find-pick .g-people-open[hidden] {
  display: none;
}
.g-find.searched .g-people {
  margin-block: 14px 8px;
  padding-top: 0;
  border: 0;
}
.g-find.searched .g-find-bar {
  top: 16px;
}
.g-find.searched .g-find-bar > * {
  width: 40px;
  height: 40px;
}
.g-find.searched .g-event {
  padding: 4px 4px 22px;
}
.g-find.searched .g-event:first-child .g-ev-head {
  padding-top: 14px;
}
.g-people {
  max-width: 720px;
  margin-inline: auto;
  padding-inline: 18px;
}
@media (min-width: 620px) {
  .g-people-grid {
    grid-template-columns: repeat(6, 1fr);
  }
}
/* the event page's frames before their photo arrives (js/gallery.js): a soft shimmer, then the
   photo fades in */
.g-item--wait {
  background: linear-gradient(100deg, var(--paper) 30%, #f0e6d0 50%, var(--paper) 70%) 0 0 / 300% 100%;
  animation: g-shimmer 1.4s ease-in-out infinite;
}
.g-item--wait > img {
  opacity: 0;
}
@keyframes g-shimmer {
  from {
    background-position: 100% 0;
  }
  to {
    background-position: 0 0;
  }
}
/* a face avatar (find panel, lightbox people row) whose crop is still on its way */
.g-face-wait,
.g-page .lb-person.g-face-wait {
  background: linear-gradient(100deg, #ebe3d4 30%, #f6f1e7 50%, #ebe3d4 70%) 0 0 / 300% 100%;
  animation: g-shimmer 1.4s ease-in-out infinite;
}
.g-face-wait img {
  opacity: 0;
}
.g-person img,
.g-page .lightbox .lb-person img {
  transition: opacity 0.25s;
}
.g-more {
  margin: 26px 0 0;
  text-align: center;
}
.g-more[hidden],
.g-more .btn[hidden] {
  display: none;
}
/* YouTube video of an event, full width above its photos */
.g-video-embed {
  position: relative;
  width: 100%;
  max-width: 980px;
  margin: 26px auto 0;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  padding: 6px;
  box-shadow: var(--print-shadow);
}
.g-video-embed iframe {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  border: 0;
}
.g-album--event .g-video-embed {
  margin: 0 auto clamp(16px, 3vw, 34px);
}
/* a video until it's tapped: its thumbnail and a play button */
.g-video-poster {
  position: absolute;
  inset: 6px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #1c1416;
}
.g-video-poster img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* YouTube's 4:3 thumbnail has black bars above and below a 16:9 video */
}
.g-video-poster svg {
  position: relative;
  width: 68px;
  height: 48px;
  transition: transform 0.25s var(--ease);
}
.g-video-poster rect {
  fill: var(--green);
  opacity: 0.92;
}
.g-video-poster path {
  fill: #fbf3f0;
}
.g-video-poster:hover svg {
  transform: scale(1.08);
}
.g-soon {
  margin: 18px 0 0;
  padding: 26px 16px;
  text-align: center;
  font-style: italic;
  font-size: 19px;
  color: var(--ink-2);
  background: var(--paper);
}

/* ---------- an event's own page, and the favourites: the title on the event's colour ---------- */
.g-head {
  position: relative;
  padding: calc(64px + env(safe-area-inset-top)) var(--gutter) clamp(34px, 5vw, 60px);
  background: var(--linen), var(--band);
  text-align: center;
}
/* an event's page: the album bar is its first row, then sticks, with the share button floating under it */
.g-tabs--top {
  height: calc(68px + env(safe-area-inset-top));
  margin-top: 0;
  padding-top: env(safe-area-inset-top);
  padding-bottom: 0;
}
.g-tabs--top ~ .g-subnav {
  top: calc(68px + env(safe-area-inset-top));
}
.g-tabs--top ~ .g-float-share {
  top: calc(68px + 44px + 12px + env(safe-area-inset-top));
}
.g-tabs--top ~ .g-head {
  padding-top: 64px; /* clear of the share button: the prints fill the width on a phone */
}
@media (min-width: 720px) {
  .g-tabs--top ~ .g-head {
    padding-top: 40px;
  }
}
/* five prints, each shown whole: one row on a wide screen, three over two on a phone, the middle one
   on top. --i is a print's place (-2..2), --a that place from the middle (0..2), set in lib/gallery.js leadHtml */
.g-ev-lead {
  position: relative;
  left: 50%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  width: min(96vw, 1040px);
  margin: 0 0 26px;
  /* centred on the header, not inside its gutters: on a phone it's wider than they leave */
  transform: translateX(-50%);
}
.g-ev-lead figure {
  --r: calc(var(--i) * 1.6deg);
  position: relative;
  order: calc(var(--a) * (var(--a) - 1) * 10 + var(--i));
  box-sizing: border-box;
  width: 32%;
  margin: 0 -0.5% -1.5%;
  padding: 1.2%;
  background: var(--paper);
  box-shadow: var(--print-shadow);
  transform: rotate(var(--r));
  animation: g-lay 0.9s var(--ease) both;
  animation-delay: calc((2 - var(--a)) * 0.12s);
}
@media (min-width: 720px) {
  .g-ev-lead {
    flex-wrap: nowrap;
    align-items: center;
  }
  .g-ev-lead figure {
    order: var(--i);
    width: calc(23% - var(--a) * 1.5%);
    margin: 0 -0.6%;
    padding: 0.6%;
    transform: translateY(calc(var(--a) * 5px)) rotate(var(--r));
  }
}
.g-ev-lead img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: 50% 22%;
}
@keyframes g-lay {
  from { opacity: 0; translate: 0 26px; }
  to { opacity: 1; translate: 0 0; }
}
.g-ev-title {
  margin: 2px 0 8px;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(44px, 8vw, 92px);
  line-height: 1.1;
  color: var(--green);
}
/* a title broken over lines (Lễ Thành Hôn & Tiệc Cưới, lib/gallery.js titleLines): half the size */
.g-ev-title:has(br) {
  font-size: clamp(22px, 4vw, 46px);
}
.g-head .btn {
  margin-top: 18px;
}
.g-album--event {
  max-width: 1680px;
  margin-inline: auto;
}

/* ---------- the viewer and small things, in the album's voice ---------- */
.g-page .lightbox {
  background: rgba(250, 246, 242, 0.98);
}
.g-page .lightbox figcaption {
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--green);
}
#lb-dl {
  color: var(--green);
  font-family: var(--caps);
  font-size: 15px;
  text-transform: lowercase;
}
.g-empty,
.g-upload {
  max-width: 720px;
  margin-inline: auto;
}
.g-tabs + main {
  /* tall enough that the album bar can always reach the top of the screen */
  min-height: calc(100vh - 68px);
  padding-bottom: 0;
}
.g-tabs + main .g-album:not(:has(.g-event)) {
  padding-bottom: 40px;
}

/* ---------- the last page ---------- */
.g-colophon {
  padding: clamp(50px, 8vw, 90px) var(--gutter) calc(56px + env(safe-area-inset-bottom));
  background: var(--linen-light), var(--green);
  color: #fbf3f0;
  text-align: center;
}
.g-colophon .g-crest {
  margin: 0 auto 10px;
  color: #f0c9c6;
}
.g-colophon p {
  margin: 0;
  padding-top: 0.08em;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-weight: 500;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.25;
}
.g-page .g-colophon .small-caps {
  display: block;
  margin-top: 8px;
  color: #f0c9c6;
}

@media (prefers-reduced-motion: reduce) {
  .g-cover-photo img,
  .g-ev-lead figure,
  .g-item--wait,
  .g-face-wait {
    animation: none;
  }
}

