.page-moments {
  background: #f6f6f8;
}

.moments-page {
  color: #25282a;
  padding: 52px 20px 64px;
}

.moments-layout {
  display: grid;
  grid-template-columns: minmax(210px, 260px) minmax(0, 740px);
  gap: clamp(28px, 5vw, 72px);
  max-width: 1110px;
  margin: 0 auto;
  align-items: start;
}

.moments-intro {
  position: sticky;
  top: 28px;
  padding-top: 13px;
}

.moments-kicker {
  color: #586d35;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
}

.moments-intro h1 {
  margin: 14px 0 8px;
  color: #1f2721;
  font-size: 2.5rem;
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -.025em;
}

.moments-intro p {
  color: #526053;
  line-height: 1.6;
}

.moments-feed,
.moments-detail {
  min-width: 0;
}

.moment-post {
  margin-bottom: 18px;
  padding: 28px;
  background: #fff;
  border: 1px solid #e4e8e1;
  border-radius: 12px;
}

.moment-post-header {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.moment-avatar {
  display: flex;
  width: 44px;
  height: 44px;
  flex: none;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #f1f3eb;
  border-radius: 50%;
}

.moment-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.moment-avatar.is-custom img {
  object-fit: cover;
}

.moment-post-identity {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.35;
}

.moment-post-identity strong {
  color: #202820;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.moment-post-identity time {
  margin-top: 4px;
  color: #607064;
  font-size: 12px;
}

.moment-pinned-badge {
  align-self: flex-start;
  margin-top: 7px;
  padding: 2px 7px;
  color: #536c2a;
  background: #edf2e4;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
}

.moment-post-content {
  overflow-wrap: anywhere;
  color: #252b27;
  font-size: 15px;
  line-height: 1.8;
  margin-bottom: 19px;
  white-space: normal;
}

.moment-media-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 20px;
}

.moment-media-grid:has(> .moment-image-link:nth-child(4):last-child):not(:has(> .moment-video-wrap)) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.moment-media-grid.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.moment-image-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 1;
  background: #e9ece8;
  border-radius: 5px;
}

.moment-media-grid.is-single .moment-image-link {
  width: min(100%, 500px);
  aspect-ratio: auto;
}

.moment-image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .2s ease-out;
}

.moment-image-link:hover img {
  transform: scale(1.035);
}

.moment-media-grid.is-single .moment-image-link img {
  height: auto;
  object-fit: contain;
}

.moment-media-grid.is-single .moment-image-link:hover img {
  transform: none;
}

.moment-video-wrap {
  position: relative;
  grid-column: 1 / -1;
  overflow: hidden;
  background: #111;
  border-radius: 6px;
}

.moment-video-backdrop {
  display: none;
}

.moment-video-wrap.is-portrait .moment-video-backdrop {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  filter: blur(14px) brightness(.78);
  transform: scale(1.08);
  pointer-events: none;
}

.moment-video-wrap.is-portrait {
  aspect-ratio: 16 / 9;
}

.moment-video-wrap.is-portrait video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
}

.moment-video-wrap video {
  position: relative;
  display: block;
  width: 100%;
  max-height: 480px;
  aspect-ratio: 16 / 9;
  object-fit: contain;
  background: transparent;
}

.moment-post-actions {
  display: flex;
  gap: 18px;
  align-items: center;
  padding-top: 13px;
  border-top: 1px solid #eef0ed;
}

.moment-post-actions form {
  margin: 0;
}

.moment-action {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  padding: 6px 2px;
  border: 0;
  background: transparent;
  color: #536356;
  font-size: 14px;
  text-decoration: none;
  cursor: pointer;
}

.moment-action:hover,
.moment-action:focus-visible,
.moment-action.is-liked {
  color: #536c2a;
  text-decoration: none;
}

.moment-action i {
  font-size: 18px;
}

.moment-comment-preview {
  margin-top: 7px;
  padding-top: 12px;
  border-top: 1px solid #eef0ed;
}

.moment-comment {
  padding: 9px 0;
  overflow-wrap: anywhere;
}

.moment-comment p {
  display: flex;
  flex-wrap: wrap;
  gap: 0 9px;
  margin: 0;
  color: #2a312a;
  font-size: 14px;
  line-height: 1.6;
}

.moment-comment strong {
  color: #334927;
  font-weight: 700;
}

.moment-comment-reply {
  margin-top: 7px !important;
  margin-left: 16px !important;
  padding: 8px 11px;
  background: #f3f6ee;
  border-radius: 6px;
}

.moment-view-comments,
.moment-login-link {
  display: inline-block;
  margin-top: 9px;
  color: #536c2a;
  font-size: 14px;
  text-decoration: none;
}

.moment-view-comments:hover,
.moment-login-link:hover {
  color: #334b18;
  text-decoration: underline;
}

.moments-detail {
  max-width: 740px;
  margin: 0 auto;
}

.moments-back {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 18px;
  color: #40582d;
  text-decoration: none;
}

.moments-back:hover {
  color: #283c18;
  text-decoration: underline;
}

.moments-detail-comments {
  padding: 25px 28px;
  background: #fff;
  border: 1px solid #e4e8e1;
  border-radius: 12px;
  scroll-margin-top: 30px;
}

.moments-detail-comments h2 {
  margin: 0 0 18px;
  color: #252b27;
  font-size: 19px;
  font-weight: 700;
}

.moments-detail-comments h2 span {
  margin-left: 5px;
  color: #61715f;
  font-size: 15px;
  font-weight: 400;
}

.moment-comment-form {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin: 0 0 20px;
}

.moment-comment-form textarea {
  display: block;
  width: 100%;
  min-height: 94px;
  padding: 12px 14px;
  border: 1px solid #bdc9b8;
  border-radius: 8px;
  background: #fff;
  color: #242b24;
  resize: vertical;
}

.moment-comment-form textarea::placeholder {
  color: #667367;
}

.moment-comment-form button {
  padding: 9px 18px;
  border: 0;
  border-radius: 6px;
  background: #536c2a;
  color: #fff;
  font-weight: 600;
}

.moment-comment-form button:hover {
  background: #3c501d;
}

.moment-comment-list .moment-comment {
  border-top: 1px solid #eef0ed;
  padding: 15px 0;
}

.moment-message {
  margin-bottom: 16px;
  padding: 11px 15px;
  border-radius: 7px;
  background: #eaf2df;
  color: #29401d;
}

.moment-message.is-error {
  background: #fff0ee;
  color: #873a30;
}

.moment-empty {
  padding: 56px 28px;
  border: 1px solid #e4e8e1;
  border-radius: 12px;
  background: #fff;
  color: #506052;
  text-align: center;
}

.moments-pagination {
  margin: 25px 0;
}

.moment-lightbox {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: hidden;
}

.moment-lightbox[open] {
  display: block;
  overscroll-behavior: none;
  touch-action: pinch-zoom;
}

.moment-lightbox::backdrop {
  background: rgb(0 0 0 / .82);
}

.moment-lightbox-viewer {
  width: 100%;
  height: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pinch-zoom;
}

.moment-lightbox-viewer.is-single {
  cursor: default;
}

.moment-lightbox-track {
  display: flex;
  width: 100%;
  height: 100%;
  transition: transform .34s cubic-bezier(.22, .61, .36, 1);
  will-change: transform;
}

.moment-lightbox-track.is-dragging {
  transition: none;
}

.moment-lightbox-slide {
  box-sizing: border-box;
  display: grid;
  flex: 0 0 100%;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 16px;
}

.moment-lightbox-slide img {
  display: block;
  max-width: min(100%, 1200px);
  max-height: calc(100vh - 96px);
  max-height: calc(100dvh - 96px);
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.moment-lightbox-close {
  position: absolute;
  z-index: 2;
  top: max(16px, env(safe-area-inset-top));
  right: max(16px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: #1d241f;
  font-size: 27px;
  line-height: 1;
}

.moment-lightbox-nav {
  position: absolute;
  z-index: 2;
  top: 50%;
  width: 44px;
  height: 44px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / .88);
  color: #1d241f;
  font-size: 32px;
  line-height: 1;
}

.moment-lightbox-nav.is-previous {
  left: max(12px, env(safe-area-inset-left));
}

.moment-lightbox-nav.is-next {
  right: max(12px, env(safe-area-inset-right));
}

.moment-lightbox-nav:disabled {
  opacity: .35;
  cursor: default;
}

.moment-lightbox-nav[hidden],
.moment-lightbox-count[hidden] {
  display: none;
}

.moment-lightbox-count {
  position: absolute;
  z-index: 2;
  bottom: max(18px, env(safe-area-inset-bottom));
  left: 50%;
  padding: 5px 11px;
  transform: translateX(-50%);
  border-radius: 20px;
  background: rgb(0 0 0 / .55);
  color: #fff;
  font-size: 13px;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .moments-layout {
    display: block;
    max-width: 740px;
  }
  .moments-intro {
    position: static;
    padding: 0 0 20px;
  }
  .moments-intro h1 {
    margin: 5px 0;
    font-size: 2rem;
  }
  .moments-intro p {
    margin-bottom: 0;
  }
}

@media (max-width: 600px) {
  .moments-page {
    padding: 24px 12px 48px;
  }
  .moment-post,
  .moments-detail-comments {
    padding: 18px 16px;
    border-radius: 10px;
  }
  .moment-media-grid {
    gap: 4px;
  }
  .moment-post-content {
    font-size: 14px;
  }
  .moment-avatar {
    width: 40px;
    height: 40px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .moment-image-link img {
    transition: none;
  }
  .moment-lightbox-track {
    transition-duration: 0ms;
  }
}
