/* Faez & Alya: sky-blue illustrated theme */

:root {
  --sky: #6db1e4;
  --sky-hero: #75b0e0;
  --navy: #14304f;
  --blue: #2d6bb0;
  --text: #3b4b5e;
  --muted: #6a7a8c;
  --page: #f4f7fb;
  --outer: #e9eff6;
  --paper: #ffffff;
  --tint: #eef3f8;
  --line: #dbe5f0;
  --field-line: #c9d8e8;
  --danger: #b4442f;
  --shadow: 0 6px 18px -10px rgba(20, 48, 79, 0.3);
  --shadow-lg: 0 12px 28px -8px rgba(20, 48, 79, 0.55);

  /* aliases used by the album and QR pages */
  --ink: var(--navy);
  --cream: var(--outer);
  --sage-wash: var(--tint);
  --sage-deep: var(--blue);
  --gold-soft: var(--field-line);

  --font-display: 'Bodoni Moda', 'Didot', 'Times New Roman', serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-hand: var(--font-display);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--outer);
  color: var(--navy);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- shared pieces ---------- */

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.names {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  margin: 0;
  line-height: 1.05;
}

.names .amp {
  font-size: 0.7em;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font: 700 15px var(--font-body);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.15s ease;
}

.btn:hover {
  background: var(--blue);
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled {
  background: #9fb0c2;
  cursor: default;
}

.btn.secondary {
  background: var(--tint);
  color: var(--navy);
}

.btn.secondary:hover {
  background: #e2ebf4;
}

.btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.link-btn {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}

.field {
  width: 100%;
  height: 54px;
  padding: 0 20px;
  border: 1.5px solid var(--field-line);
  border-radius: 999px;
  background: #fff;
  font: 500 15px var(--font-body);
  color: var(--navy);
  transition: border-color 0.15s ease;
}

.field::placeholder {
  color: var(--navy);
  opacity: 0.45;
}

.field:focus {
  outline: none;
  border-color: var(--blue);
}

.field.invalid {
  border-color: var(--danger);
}

.error-text {
  font-size: 12px;
  color: var(--danger);
  margin: -6px 0 0;
  padding-left: 20px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.88);
  color: var(--navy);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* ---------- landing ---------- */

.landing {
  position: relative;
  min-height: max(100dvh, 640px);
  max-width: 520px;
  margin: 0 auto;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--sky);
}

.landing-shade {
  position: absolute;
  inset: 0 0 auto 0;
  height: 55%;
  z-index: 1;
  background: linear-gradient(180deg, rgba(28, 72, 128, 0.55), rgba(28, 72, 128, 0));
  pointer-events: none;
}

.landing-head {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  padding: 44px 28px 20px;
  color: #fff;
  display: flex;
  flex-direction: column;
}

.landing-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.landing-names {
  margin: 24px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(44px, min(15vw, 7.5vh), 64px);
  line-height: 0.92;
  letter-spacing: -0.01em;
}

.landing-names .l1 {
  display: block;
  font-weight: 500;
}

.landing-names .l2 {
  display: block;
  margin-top: 6px;
  text-align: right;
  font-weight: 500;
}

.landing-names .amp {
  font-style: italic;
  font-weight: 400;
  font-size: 0.62em;
}

.landing-tag {
  margin: 16px 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 17px;
}

.landing-art {
  position: relative;
  flex: 1 0 auto;
  /* The illustration's sky runs up behind the names, so the whole couple stays in view */
  min-height: calc(min(100vw, 520px) * 1.4);
  margin-top: calc(min(100vw, 520px) * -0.64);
  margin-bottom: -28px;
  background: url('img/landing.jpg') 22% bottom / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 60px);
  mask-image: linear-gradient(180deg, transparent 0, #000 60px);
}

.landing-sheet {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-radius: 28px 28px 0 0;
  padding: 22px 24px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--navy);
}

.landing-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.landing-meta .tag {
  color: var(--blue);
  letter-spacing: 0.02em;
  text-transform: none;
  font-size: 14px;
}

.landing-text {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  text-wrap: pretty;
}

.name-row {
  display: flex;
  gap: 8px;
}

/* iPhone Safari's floating toolbar sits over the bottom of the page; leave room for it */
@supports (-webkit-touch-callout: none) {
  .landing-sheet {
    padding-bottom: calc(84px + env(safe-area-inset-bottom));
  }
  .fab-wrap {
    bottom: calc(70px + env(safe-area-inset-bottom));
  }
  .lightbox .lb-info {
    padding-bottom: calc(78px + env(safe-area-inset-bottom));
  }
}

.inapp-banner {
  position: sticky;
  top: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: #fff4d9;
  color: #5b4718;
  font-size: 13px;
  line-height: 1.35;
  border-bottom: 1px solid #ebd194;
}

.inapp-banner span {
  flex: 1;
}

.inapp-btn {
  flex: none;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--navy);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.name-row .field {
  flex: 1;
  min-width: 0;
}

.name-row .btn {
  width: auto;
}

/* entrance */
.rise {
  animation: rise 0.8s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: var(--d, 0s);
}

.fade-in {
  animation: fade 1.2s ease both;
  animation-delay: var(--d, 0s);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
}

/* ---------- gallery ---------- */

.gallery-page {
  position: relative;
  min-height: 100dvh;
  max-width: 520px;
  margin: 0 auto;
  background: var(--page);
  color: var(--navy);
  padding-bottom: 110px;
}

.hero {
  position: relative;
  height: 500px;
  background: var(--sky-hero) url('img/gallery-hero.jpg') center bottom / 100% auto no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(24, 64, 118, 0.5) 0%, rgba(24, 64, 118, 0) 38%, rgba(244, 247, 251, 0) 72%, var(--page) 100%);
}

.hero .icon-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.hero-text {
  position: relative;
  padding: 40px 24px 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-text .eyebrow {
  margin: 0 40px;
}

.hero-text .names {
  font-size: 38px;
  margin-top: 12px;
}

.hero-meta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-top: 10px;
}

.hero-meta .tag {
  letter-spacing: 0.02em;
  text-transform: none;
}

.hero-sub {
  position: relative;
  margin-top: -36px;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}

.hero-message {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  line-height: 1.4;
  max-width: 380px;
  text-wrap: pretty;
}

.counter {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text);
}

.counter::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--blue);
}

.counter strong {
  color: var(--navy);
}

.grid-wrap {
  padding: 22px 14px 0;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: start;
}

.grid .col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.moment {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}

.moment .photo {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--tint);
  aspect-ratio: var(--ratio, 1);
  overflow: hidden;
}

.moment .photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.moment .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 10px 10px 12px;
}

.moment .who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.moment .caption {
  margin: 0;
  padding: 10px 12px 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 13px; /* 40 characters fit in two lines, even on 360px-wide phones */
  line-height: 1.25;
  overflow-wrap: anywhere;
  /* never more than two lines on a card; the full caption shows when the photo is opened */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.moment .caption + .meta {
  padding-top: 6px;
}

.moment .by {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  line-height: 1.35;
  color: var(--muted);
  min-width: 0;
}

.moment .by .n {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}

.nowrap {
  white-space: nowrap;
}

.like-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: var(--tint);
  color: var(--navy);
  border-radius: 999px;
  height: 32px;
  padding: 0 10px;
  font: 700 12px var(--font-body);
  transition: background 0.15s ease, color 0.15s ease;
}

.like-btn svg {
  width: 15px;
  height: 15px;
}

.like-btn.liked {
  background: var(--navy);
  color: #fff;
}

.like-btn.liked svg {
  fill: currentColor;
  animation: heart 0.35s ease;
}

.sentinel {
  height: 1px;
}

.grid-status {
  text-align: center;
  color: var(--muted);
  padding: 28px 16px;
  font-size: 14px;
}

.empty {
  text-align: center;
  padding: 40px 24px 10px;
  color: var(--text);
}

.empty .names {
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 6px;
}

.empty p {
  margin: 0;
  font-size: 14px;
}

.fab-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  justify-content: center;
  pointer-events: none;
  z-index: 20;
}

.fab {
  pointer-events: auto;
  width: auto;
  height: 56px;
  padding: 0 26px;
  box-shadow: var(--shadow-lg);
}

/* photo limit: "7 left" inside the share button */
.fab .left-pill {
  display: inline-block;
  margin-left: 2px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
  font-weight: 700;
}

.fab.limit-done {
  background: #7d8a99;
}

.left-line {
  display: inline-block;
  margin-top: 6px;
  color: var(--navy);
}

/* Ruang Detik promotion */
.promo-card {
  margin: 22px 0 4px;
  padding: 16px 16px 14px;
  border-radius: 18px;
  background: var(--tint);
  text-align: center;
}

.promo-title {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 18px;
  color: var(--navy);
}

.promo-card p {
  margin: 4px auto 12px;
  font-size: 13px;
  color: var(--text);
  max-width: 280px;
}

.promo-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.btn.promo-btn {
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  font-size: 14px;
  background: #1f8f4e;
}

.btn.promo-btn:hover {
  background: #187a41;
}

.btn.secondary.promo-btn {
  background: #fff;
  color: var(--navy);
}

.btn.promo-btn svg {
  width: 18px;
  height: 18px;
}

.promo-line {
  margin: 8px 16px 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.promo-line strong,
.promo-card strong {
  color: var(--navy);
  white-space: nowrap;
}

.promo-line-links {
  display: flex;
  gap: 14px;
}

.promo-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #1f8f4e;
  font-weight: 700;
  text-decoration: none;
}

.promo-link svg {
  width: 15px;
  height: 15px;
}

.new-pill {
  position: fixed;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: var(--blue);
  color: #fff;
  font: 700 13px var(--font-body);
  box-shadow: var(--shadow-lg);
}

.closed-box {
  margin: 30px 24px;
  padding: 26px 22px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--text);
}

.closed-box .names {
  font-size: 26px;
  color: var(--navy);
}

/* ---------- sheets & dialogs ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 48, 79, 0.45);
  z-index: 40;
  animation: fade 0.2s ease both;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  max-width: 520px;
  max-height: 92dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -10px 40px rgba(20, 48, 79, 0.18);
  animation: slide-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--line);
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 26px;
  line-height: 1.1;
}

.sheet-head p {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.sheet-head .icon-btn {
  background: var(--tint);
}

.sheet-body {
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}

.sheet-foot {
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

.menu-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom));
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 18px;
  background: var(--tint);
  color: var(--navy);
  text-align: left;
  text-decoration: none;
  font: 500 15px var(--font-body);
}

.menu-item svg {
  width: 20px;
  height: 20px;
  color: var(--blue);
}

.handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--line);
  margin: 10px auto 0;
}

/* upload */

.as-who {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 12px;
}

.as-who strong {
  color: var(--navy);
}

.upload-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-item {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 18px;
}

.upload-item img {
  width: 68px;
  height: 68px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--tint);
}

.upload-item .caption-input {
  width: 100%;
  border: 0;
  border-bottom: 1.5px solid var(--field-line);
  background: transparent;
  padding: 8px 2px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--navy);
}

.upload-item .caption-input::placeholder {
  color: var(--navy);
  opacity: 0.4;
}

.upload-item .caption-input:focus {
  outline: none;
  border-bottom-color: var(--blue);
}

.upload-item .state {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.upload-item .state.ok {
  color: var(--blue);
  font-weight: 700;
}

.upload-item .state.err {
  color: var(--danger);
}

.progress {
  height: 4px;
  border-radius: 4px;
  background: var(--tint);
  overflow: hidden;
  margin-top: 6px;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--blue);
  transition: width 0.2s ease;
}

.remove-btn {
  border: 0;
  background: none;
  color: var(--muted);
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.remove-btn svg {
  width: 18px;
  height: 18px;
}

/* film filters (share sheet) */
.fx {
  margin-bottom: 12px;
}

.fx-preview canvas {
  display: block;
  max-width: 100%;
  max-height: 42vh;
  margin: 0 auto;
  border-radius: 16px;
  background: var(--tint);
}

.fx-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 2px 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.fx-row::-webkit-scrollbar {
  display: none;
}

.fx-chip {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: 0;
  background: none;
  font: 500 12px var(--font-body);
  color: var(--muted);
}

.fx-chip canvas {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  outline: 2px solid transparent;
  outline-offset: 2px;
  transition: outline-color 0.15s ease;
}

.fx-chip[aria-checked='true'] {
  color: var(--navy);
  font-weight: 700;
}

.fx-chip[aria-checked='true'] canvas {
  outline-color: var(--navy);
}

.has-fx .upload-item {
  grid-template-columns: 1fr auto;
}

.has-fx .upload-item img {
  display: none;
}

/* share sheet: one photo with a live upload status */
.share-photo img {
  display: block;
  width: 100%;
  max-height: 38vh;
  object-fit: contain;
  border-radius: 16px;
  background: var(--tint);
}

.share-status {
  min-height: 20px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.share-status.ok {
  color: var(--blue);
  font-weight: 700;
}

.share-status.err {
  color: var(--danger);
}

.caption-wrap {
  position: relative;
  margin-top: 10px;
}

.caption-field {
  width: 100%;
  height: 50px;
  padding: 0 64px 0 18px;
  border: 1.5px solid var(--field-line);
  border-radius: 999px;
  background: #fff;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--navy);
}

.caption-field::placeholder {
  color: var(--navy);
  opacity: 0.4;
}

.caption-field:focus {
  outline: none;
  border-color: var(--blue);
}

.caption-count {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--muted);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 12px 0 0;
}

.success {
  text-align: center;
  padding: 26px 6px 8px;
}

.success .names {
  font-size: 30px;
}

.success p {
  color: var(--text);
  margin: 10px auto 22px;
  max-width: 320px;
  font-size: 15px;
}

.success .btn + .btn {
  margin-top: 10px;
}

/* my photos */

.mine-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mine-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--tint);
}

.mine-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mine-tile button {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.92);
  color: var(--danger);
  display: grid;
  place-items: center;
}

.mine-tile button svg {
  width: 16px;
  height: 16px;
}

/* lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 26, 44, 0.96);
  display: flex;
  flex-direction: column;
  color: #fff;
  animation: fade 0.2s ease both;
}

.lightbox .lb-top {
  display: flex;
  justify-content: flex-end;
  padding: 14px;
}

.lightbox .lb-stage {
  flex: 1;
  min-height: 0;
  position: relative;
}

/* Absolutely sized frame, so tall photos shrink to fit above the caption on every browser */
.lightbox .lb-frame {
  position: absolute;
  inset: 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox .lb-frame img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 14px;
}

.lightbox .nav {
  z-index: 1;
}

.lightbox .lb-info {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px calc(22px + env(safe-area-inset-bottom));
}

.lightbox .lb-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 20px;
  line-height: 1.3;
  margin: 0 0 4px;
}

.lightbox .lb-meta {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
}

.lightbox .icon-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* small spinner while the sharper copy of a photo loads */
.lightbox .lb-stage.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 34px;
  height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: lb-spin 0.8s linear infinite;
  z-index: 2;
}

@keyframes lb-spin {
  to { transform: rotate(360deg); }
}

.lightbox .nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox .nav.prev {
  left: 10px;
}

.lightbox .nav.next {
  right: 10px;
}

.lightbox .like-btn {
  height: 40px;
  padding: 0 14px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.lightbox .like-btn svg {
  width: 18px;
  height: 18px;
}

.lightbox .like-btn.liked {
  background: #fff;
  color: var(--navy);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 60;
  background: var(--navy);
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: fade 0.2s ease both;
  max-width: calc(100% - 32px);
  text-align: center;
}

/* ---------- animations ---------- */

@keyframes fade {
  from { opacity: 0; }
}

@keyframes slide-up {
  from { transform: translateY(100%); }
}

@keyframes heart {
  50% { transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
