/* Posts — a cute scrapbook wall of Moe's VR moments.
   Built on the shared design tokens in main.css, so it follows every theme. */

.posts-page main {
  padding-bottom: clamp(40px, 8vw, 90px);
}

/* ---- Hero ---------------------------------------------------------------- */
.posts-hero {
  position: relative;
  overflow: hidden;
  padding: clamp(34px, 6vw, 68px) clamp(20px, 5vw, 72px) clamp(26px, 4vw, 44px);
  text-align: center;
}

.posts-hero__inner {
  position: relative;
  z-index: 2;
  max-width: 760px;
  margin: 0 auto;
}

.posts-hero .eyebrow {
  justify-content: center;
}

.posts-hero h1 {
  margin: 0 0 14px;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: clamp(38px, 6.4vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.posts-hero__lead {
  margin: 0 auto 22px;
  max-width: 52ch;
  color: var(--text-soft);
  font-size: clamp(15px, 1.7vw, 18px);
  text-wrap: pretty;
}

.posts-hero__cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* floating candy stickers behind the hero copy */
.posts-hero__deco {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.posts-hero__deco span {
  position: absolute;
  font-size: clamp(22px, 3vw, 40px);
  opacity: 0.9;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.10));
  animation: posts-float 6s ease-in-out infinite;
}

.posts-hero__deco span:nth-child(1) { top: 14%; left: 8%;  animation-delay: 0s; }
.posts-hero__deco span:nth-child(2) { top: 22%; right: 10%; animation-delay: 0.8s; }
.posts-hero__deco span:nth-child(3) { top: 62%; left: 13%; animation-delay: 1.6s; }
.posts-hero__deco span:nth-child(4) { top: 58%; right: 14%; animation-delay: 2.2s; }
.posts-hero__deco span:nth-child(5) { top: 40%; left: 3%;  animation-delay: 1.1s; }
.posts-hero__deco span:nth-child(6) { top: 8%;  right: 30%; animation-delay: 2.8s; }

@keyframes posts-float {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50%      { transform: translateY(-14px) rotate(6deg); }
}

/* ---- Filter pills -------------------------------------------------------- */
.posts-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 0 auto clamp(22px, 3vw, 34px);
  padding: 0 20px;
}

.posts-filter button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  color: var(--text-soft);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  font-size: 14px;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.posts-filter button:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.posts-filter button.is-active {
  color: var(--btn-fg);
  background: var(--button-gradient);
  border-color: transparent;
  box-shadow: var(--shadow);
}

/* ---- Masonry wall -------------------------------------------------------- */
.posts-wall {
  max-width: 1220px;
  margin: 0 auto;
  padding: 0 clamp(14px, 4vw, 40px);
  column-gap: clamp(12px, 1.6vw, 20px);
  columns: 4 240px;
}

.post-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 clamp(12px, 1.6vw, 20px);
  padding: 0;
  color: inherit;
  background: var(--surface);
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(38, 32, 29, 0.10);
  break-inside: avoid;
  text-align: left;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 240ms cubic-bezier(.22,.9,.3,1.2), box-shadow 240ms ease;
  -webkit-tap-highlight-color: transparent;
}

/* gentle alternating tilt so the wall feels hand-pinned */
.post-card:nth-child(4n+1) { --tilt: -1.2deg; }
.post-card:nth-child(4n+2) { --tilt: 0.9deg; }
.post-card:nth-child(4n+3) { --tilt: -0.6deg; }
.post-card:nth-child(4n+4) { --tilt: 1.4deg; }

.post-card:hover,
.post-card:focus-visible {
  transform: rotate(0deg) translateY(-6px) scale(1.015);
  box-shadow: 0 20px 44px rgba(214, 84, 140, 0.24);
  outline: none;
}

.post-card__media {
  position: relative;
  display: block;
  width: 100%;
  background: var(--surface-soft);
  overflow: hidden;
}

.post-card__media img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 420ms ease;
}

.post-card:hover .post-card__media img {
  transform: scale(1.06);
}

/* colourful ring that rotates hue per card */
.post-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 18px;
  border: 2.5px solid var(--card-hue, var(--accent));
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.post-card:hover::after,
.post-card:focus-visible::after { opacity: 0.55; }

.post-card:nth-child(5n+1) { --card-hue: var(--momo); }
.post-card:nth-child(5n+2) { --card-hue: var(--aqua); }
.post-card:nth-child(5n+3) { --card-hue: var(--matcha); }
.post-card:nth-child(5n+4) { --card-hue: var(--yuzu); }
.post-card:nth-child(5n+5) { --card-hue: var(--ume); }

.post-card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.post-card__play i {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: rgba(20, 12, 18, 0.42);
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  backdrop-filter: blur(3px);
  transition: transform 220ms ease, background 220ms ease;
}

.post-card__play i::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 4px;
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent #fff;
}

.post-card:hover .post-card__play i {
  transform: scale(1.12);
  background: var(--accent);
}

.post-card__badge {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  color: #fff;
  background: rgba(20, 12, 18, 0.5);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.01em;
  backdrop-filter: blur(4px);
}

.post-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px 13px;
}

.post-card__likes {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 14px;
}

.post-card__date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.post-card__cap {
  margin: -2px 14px 12px;
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- Text / quote cards -------------------------------------------------- */
.post-card--text {
  padding: 20px 18px 4px;
  background:
    linear-gradient(150deg,
      color-mix(in srgb, var(--card-hue, var(--accent)) 22%, var(--surface)),
      var(--surface) 78%);
}

.post-card__quote {
  display: block;
  margin: -6px 0 -14px;
  color: var(--card-hue, var(--accent));
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 750;
  line-height: 1;
  opacity: 0.65;
}

.post-card__words {
  margin: 0 0 6px;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.5;
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 7;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card--text .post-card__foot { padding-top: 8px; }

/* ---- Sentinel / end ------------------------------------------------------ */
.posts-more {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 90px;
  margin-top: 26px;
  color: var(--muted);
  font-weight: 700;
}

.posts-spinner {
  width: 30px;
  height: 30px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: posts-spin 0.8s linear infinite;
}

@keyframes posts-spin { to { transform: rotate(360deg); } }

.posts-end {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-soft);
}

/* ---- Lightbox ------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 34px);
  background: rgba(24, 12, 20, 0.72);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 200ms ease;
}

.lightbox.is-open {
  display: flex;
  opacity: 1;
}

.lightbox__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(880px, 100%);
  max-height: 92vh;
  background: var(--surface-strong);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  transform: scale(0.94);
  transition: transform 240ms cubic-bezier(.22,.9,.3,1.2);
}

.lightbox.is-open .lightbox__stage { transform: scale(1); }

.lightbox__media {
  position: relative;
  display: grid;
  place-items: center;
  background: #0e0a10;
  min-height: 220px;
}

.lightbox__media video,
.lightbox__media img {
  display: block;
  width: 100%;
  max-height: 66vh;
  object-fit: contain;
}

.lightbox__media--text {
  background: linear-gradient(150deg, var(--surface-soft), var(--surface));
  padding: clamp(26px, 5vw, 54px) clamp(22px, 5vw, 48px);
}

.lightbox__quote {
  margin: 0;
  max-width: 40ch;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(19px, 3vw, 26px);
  font-weight: 500;
  line-height: 1.55;
  white-space: pre-line;
  text-wrap: pretty;
}

.lightbox__quote::before {
  content: "\201C";
  display: block;
  margin-bottom: -6px;
  color: var(--accent);
  font-size: 2.4em;
  line-height: 0.7;
  opacity: 0.5;
}

.lightbox__info {
  padding: 16px clamp(16px, 3vw, 26px) 20px;
  overflow-y: auto;
}

.lightbox__caption {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}

.lightbox__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.lightbox__meta .m-likes { color: var(--accent-strong); }

.lightbox__meta a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  color: var(--accent-strong);
  font-weight: 800;
}

.lightbox__meta a:hover { text-decoration: underline; }

.lightbox__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(20, 12, 18, 0.55);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  transition: background 160ms ease, transform 160ms ease;
}

.lightbox__close:hover { background: var(--accent); transform: rotate(90deg); }

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  color: #fff;
  background: rgba(20, 12, 18, 0.42);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  transition: background 160ms ease;
}

.lightbox__nav:hover { background: var(--accent); }
.lightbox__nav--prev { left: 12px; }
.lightbox__nav--next { right: 12px; }

@media (max-width: 560px) {
  .lightbox__nav { width: 40px; height: 40px; top: auto; bottom: calc(100% + 8px); }
  .posts-wall { columns: 2 150px; }
}

@media (prefers-reduced-motion: reduce) {
  .posts-hero__deco span,
  .post-card,
  .post-card__media img,
  .lightbox,
  .lightbox__stage { animation: none !important; transition: none !important; }
  .post-card { transform: none; }
}
