/* =====================================================================
   components.css — Reusable UI pieces
   ---------------------------------------------------------------------
   Buttons, filter tags, photo/video cards, the social-icon buttons,
   the scroll fade-in animation, and the full-screen LIGHTBOX overlay.
   ===================================================================== */

/* ------------------------------ BUTTONS ---------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: 40px;
  border: 1.5px solid var(--ink);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}
.btn:hover { background: var(--ink); color: var(--cream); transform: translateY(-2px); }
.btn--clay  { border-color: transparent; background: var(--clay);  color: #fff; }
.btn--clay:hover  { background: var(--clay-ink); }
.btn--olive { border-color: transparent; background: var(--olive); color: #fff; }
.btn--olive:hover { filter: brightness(0.92); }

/* ----------------------- SOCIAL ICON BUTTONS ----------------------- */
/* round buttons used on the home + about pages */
.socials { display: flex; gap: 14px; }
.social {
  width: 46px; height: 46px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: background 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.social:hover { background: var(--clay); color: #fff; transform: translateY(-2px); }
.social svg { width: 20px; height: 20px; }

/* ---------------------------- FILTER TAGS -------------------------- */
/* the "All / Shanghai / Beijing ..." pills on Photos & Videos pages */
.tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 44px;
}
.tag {
  font-size: 15px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: 40px;
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.tag:hover { border-color: var(--ink); color: var(--ink); }
.tag.is-active { background: var(--clay); border-color: var(--clay); color: #fff; }

/* ----------------------------- CARD GRID --------------------------- */
/* uniform 3-column grid used for photo folders & videos */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}
@media (max-width: 900px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid { grid-template-columns: 1fr; } }

/* ---- Photo folder card (Photos page) ---- */
.card { cursor: pointer; }
.card__media {
  position: relative;          /* anchor the .img-frame fill below */
  overflow: hidden;            /* clip anything taller than the 4:3 box */
  aspect-ratio: 4 / 3;
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
/* Make the image wrapper fill the fixed 4:3 box so portrait photos get
   cropped to fit (via object-fit: cover) instead of stretching the card. */
.card__media > .img-frame {
  position: absolute;
  inset: 0;
}
/* zoom the photo + reveal a caption bar on hover */
.card__media > img { transition: transform 0.6s cubic-bezier(.2,.7,.3,1); }
.card:hover .card__media > img { transform: scale(1.06); }
.card__cap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}
.card__title { font-family: var(--font-serif); font-size: 21px; }
.card__loc {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--clay-ink);
  white-space: nowrap;
}
.card__view {
  margin-top: 4px;
  font-size: 13px; color: var(--ink-soft);
  display: inline-flex; align-items: center; gap: 6px;
  transition: gap 0.2s ease, color 0.2s ease;
}
.card:hover .card__view { gap: 12px; color: var(--clay-ink); }

/* ---- Video card (Videos page) ---- */
.vcard__media {
  aspect-ratio: 3 / 4;         /* tall portrait rectangle (was 16/9 landscape) */
  border-radius: 4px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #000;
}
/* show the WHOLE video inside the portrait box (letterboxed on black)
   instead of cropping it — overrides the cover rule in tokens.css */
.vcard__media > video {
  object-fit: contain;
}
.vcard__title { font-family: var(--font-serif); font-size: 21px; margin-top: 14px; }
.vcard__loc {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--clay-ink); margin-top: 2px;
}

/* --------------------- SCROLL FADE-IN ANIMATION -------------------- */
/* elements tagged .reveal start hidden + shifted down; js/main.js adds
   .is-visible when they scroll into view. Respects reduced-motion.    */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================== LIGHTBOX =========================== */
/* full-screen image viewer; opened by clicking a photo (js/main.js)   */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(24, 20, 16, 0.88);
  backdrop-filter: blur(8px);
}
.lightbox.is-open { display: flex; }
.lightbox__img {
  max-width: 88vw;
  max-height: 82vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.7);
  animation: lb-pop 0.3s ease;
}
@keyframes lb-pop { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
.lightbox__cap {
  position: absolute;
  bottom: 28px; left: 0; right: 0;
  text-align: center;
  color: rgba(255,255,255,0.8);
  font-size: 14px;
}
/* control buttons (close + prev/next) */
.lightbox__btn {
  position: absolute;
  display: flex; align-items: center; justify-content: center;
  width: 50px; height: 50px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease;
}
.lightbox__btn:hover { background: rgba(255,255,255,0.2); }
.lightbox__btn svg { width: 20px; height: 20px; }
.lightbox__close { top: 24px; right: 24px; }
.lightbox__prev  { left: 24px;  top: 50%; transform: translateY(-50%); }
.lightbox__next  { right: 24px; top: 50%; transform: translateY(-50%); }
/* hide prev/next when the lightbox shows a single image */
.lightbox.is-single .lightbox__prev,
.lightbox.is-single .lightbox__next { display: none; }
