/* ═══════════════════════════════════════════
   Memory Detail Page — Header, characters panel,
   photos, audio, video, stories, comments.
   ═══════════════════════════════════════════ */

/* ─── Memory Header ─── */
.memory-header {
  position: relative;
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 28px 24px 0;
}

.memory-header__top-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}

.memory-header__timeframe {
  font-family: var(--sc-font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--sc-rust);
  display: flex;
  align-items: center;
  gap: 8px;
}

.memory-header__timeframe svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-rust-soft);
  fill: none;
  flex-shrink: 0;
}

/* ─── Memory Type Badge ─── */
.memory-type {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.memory-type svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.memory-type--event     { color: var(--sc-rust); background: rgba(184, 96, 63, 0.08); border: 1px solid rgba(184, 96, 63, 0.15); }
.memory-type--character { color: var(--sc-bark); background: rgba(92, 64, 51, 0.06); border: 1px solid rgba(92, 64, 51, 0.12); }
.memory-type--random    { color: var(--sc-sage); background: rgba(107, 127, 94, 0.08); border: 1px solid rgba(107, 127, 94, 0.15); }
.memory-type--location  { color: var(--sc-bark-light); background: rgba(122, 92, 79, 0.07); border: 1px solid rgba(122, 92, 79, 0.14); }

.memory-header__title {
  font-family: var(--sc-font-display);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 400;
  line-height: 1.2;
  color: var(--sc-charcoal);
  margin-bottom: 12px;
}

.memory-header__description {
  font-size: 1.1rem;
  color: var(--sc-text-secondary);
  max-width: 680px;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Kiosk: selected prompt shown as description (HTML from server) */
.memory-header__description .memory-description__kiosk-prompt {
  margin: 0;
  padding: 1rem 1.15rem 1.1rem 1.35rem;
  border-left: 4px solid var(--sc-rust-soft);
  background: linear-gradient(
    135deg,
    rgba(184, 96, 63, 0.06) 0%,
    rgba(107, 127, 94, 0.05) 100%
  );
  border-radius: 0 var(--sc-radius-md) var(--sc-radius-md) 0;
  font-family: var(--sc-font-display);
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-style: italic;
  font-weight: 400;
  color: var(--sc-bark);
  line-height: 1.55;
  position: relative;
  box-shadow: var(--sc-shadow-sm);
}

.memory-header__description .memory-description__kiosk-prompt::before {
  content: '"';
  position: absolute;
  left: 0.5rem;
  top: 0.35rem;
  font-size: 2.25rem;
  line-height: 1;
  font-family: var(--sc-font-display);
  color: var(--sc-rust-soft);
  opacity: 0.35;
  font-style: normal;
  pointer-events: none;
}

/* Kiosk written story — guest attribution (appended server-side to text segment HTML) */
.kiosk-story-attribution {
  margin: 1.5rem 0 0;
  padding: 1rem 1.1rem;
  border-radius: var(--sc-radius-md);
  border: 1px solid var(--sc-border-subtle);
  background: color-mix(in srgb, var(--sc-sage) 10%, var(--sc-surface));
  box-shadow: var(--sc-shadow-sm);
}

.kiosk-story-attribution p {
  margin: 0;
  font-family: var(--sc-font-ui);
  font-size: var(--sc-text-sm, 0.9rem);
  line-height: 1.55;
  color: var(--sc-text-secondary);
}

.kiosk-story-attribution strong {
  font-weight: 600;
  color: var(--sc-text-primary);
}

.kiosk-story-attribution__known {
  font-style: italic;
  color: var(--sc-bark);
}

.memory-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 16px 0;
  border-top: 1px solid var(--sc-border-subtle);
  border-bottom: 1px solid var(--sc-border-subtle);
  margin-bottom: 8px;
}

/* Intrinsic SVG size can blow up rows without explicit dimensions */
.memory-header__meta svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sc-font-ui);
  font-size: var(--sc-text-sm);
  color: var(--sc-text-secondary);
}

.meta-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

.memory-header__tags-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0 0;
}

.memory-header__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.memory-header__tags-label {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-text-tertiary);
  margin-right: 4px;
}

/* Collections button (icon-only, tags row) */
.memory-header__collections-btn {
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid var(--sc-border);
  background: var(--sc-warm-white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  color: var(--sc-text-tertiary);
  flex-shrink: 0;
  transition: all 0.2s;
}

.memory-header__collections-btn:hover {
  border-color: var(--sc-sand);
  color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.04);
}

.memory-header__collections-btn svg {
  width: 18px;
  height: 18px;
}

.memory-header__collections-count {
  font-family: var(--sc-font-ui);
  font-size: 0.6rem;
  font-weight: 600;
  background: var(--sc-rust);
  color: white;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: 2px;
}

/* Header Action Icons (top-right) */
.memory-header__actions {
  position: absolute;
  top: 0;
  right: 24px;
  display: flex;
  gap: 4px;
}

.memory-header__action {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--sc-text-tertiary);
  text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.memory-header__action:hover {
  background: var(--sc-cream-dark);
  color: var(--sc-bark);
  border-color: var(--sc-border);
}

.memory-header__action svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
}

/* ─── Characters Panel ─── */
.characters-panel {
  max-width: var(--sc-content-max);
  margin: 24px auto 0;
  padding: 0 24px;
}

.characters-panel__inner {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 14px;
  padding: 18px 22px;
}

.characters-panel__label {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--sc-text-tertiary);
  margin-bottom: 14px;
}

.characters-panel__list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.character-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 4px 8px 4px 4px;
  border-radius: 10px;
  transition: background 0.2s;
  text-decoration: none;
  color: inherit;
}

.character-chip:hover { background: var(--sc-cream-dark); }

.character-chip__avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.character-chip__info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.character-chip__name {
  font-family: var(--sc-font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sc-bark);
  line-height: 1.2;
}

.character-chip__known-as {
  font-family: var(--sc-font-body);
  font-size: 0.78rem;
  font-style: italic;
  color: var(--sc-text-tertiary);
  line-height: 1.2;
}

/* ─── Photo Section Header + Density Control ─── */
.photo-section-header {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 36px 24px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.photo-section-header__label {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-bark-faint);
}

.photo-section-header__line {
  flex: 1;
  height: 1px;
  background: var(--sc-border-subtle);
}

.density-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.density-control__icon {
  width: 22px;
  height: 22px;
  color: var(--sc-text-tertiary);
}

.density-control__icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  fill: none;
}

.density-track {
  position: relative;
  width: 60px;
  height: 20px;
  display: flex;
  align-items: center;
}

.density-track__bar {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--sc-border);
  transform: translateY(-50%);
}

.density-track__stops {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.density-track__stop {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--sc-border);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.density-track__stop:hover {
  background: var(--sc-bark-faint);
}

.density-track__stop.active {
  background: var(--sc-rust);
  transform: scale(1.3);
}

/* ─── Photo Grid ─── */
.media-gallery {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 0 24px;
}

.photo-grid {
  columns: 4;
  column-gap: 8px;
}

.photo-grid--compact { columns: 5; }
.photo-grid--large { columns: 3; }

.photo-grid__item {
  position: relative;
  break-inside: avoid;
  margin-bottom: 8px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.photo-grid__item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.3s;
}

.photo-grid__item:hover img {
  transform: scale(1.03);
}

.photo-tag-count {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  background: rgba(20, 18, 16, 0.6);
  backdrop-filter: blur(6px);
  border-radius: 6px;
  font-family: var(--sc-font-ui);
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  z-index: 2;
}

.photo-tag-count svg {
  width: 11px;
  height: 11px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.photo-expand {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: none;
  background: rgba(20, 18, 16, 0.5);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
  z-index: 2;
}

.photo-grid__item:hover .photo-expand { opacity: 1; }
.photo-expand:hover { background: rgba(20, 18, 16, 0.75); }

/* Photo grid item wrapper for reply button positioning */
.photo-grid__item-wrap {
  position: relative;
  break-inside: avoid;
}

.photo-grid__item-wrap:hover .media-comment-btn { opacity: 1; }

/* ─── Media Comment Button (reply to photo/audio/video/story) ─── */
.media-comment-btn {
  position: absolute;
  bottom: 14px;
  right: 6px;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  background: rgba(20, 18, 16, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  opacity: 0;
  transition: opacity 0.2s, background 0.2s, color 0.2s;
  z-index: 2;
}

/* .photo-grid__item:hover — handled via .photo-grid__item-wrap:hover above */

.media-comment-btn:hover {
  background: rgba(184, 96, 63, 0.85);
  color: white;
}

.media-comment-btn svg {
  width: 14px;
  height: 14px;
}

/* Inline variant (for audio rows, video cards, story cards) */
.media-comment-btn--inline {
  position: static;
  opacity: 1;
  width: 28px;
  height: 28px;
  background: none;
  backdrop-filter: none;
  border: 1px solid var(--sc-border);
  border-radius: 6px;
  color: var(--sc-text-tertiary);
  flex-shrink: 0;
}

.media-comment-btn--inline:hover {
  border-color: var(--sc-rust-soft);
  color: var(--sc-rust);
  background: rgba(184, 96, 63, 0.04);
}

.media-comment-btn--inline svg { width: 13px; height: 13px; }

/* ─── Section Headers (Video, Audio, Stories, Comments) ─── */
.media-section-header {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 36px 24px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.media-section-header__label {
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc-bark-faint);
}

.media-section-header__line {
  flex: 1;
  height: 1px;
  background: var(--sc-border-subtle);
}

/* ─── Audio Players (compact rows) ─── */
.audio-list {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.audio-row {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.audio-row:hover {
  border-color: var(--sc-sand);
  box-shadow: 0 2px 10px rgba(90, 64, 50, 0.06);
}

/* Audio row controls */
.audio-row__controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.audio-row__play {
  width: 34px;
  height: 34px;
  background: var(--sc-bark);
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.audio-row__play:hover { background: var(--sc-rust); }

.audio-row__play svg {
  width: 13px;
  height: 13px;
  fill: white;
  margin-left: 2px;
}

.audio-row__stop {
  width: 28px;
  height: 28px;
  background: none;
  border: 1px solid var(--sc-border);
  border-radius: 6px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--sc-text-tertiary);
  transition: all 0.2s;
}

.audio-row__stop:hover { border-color: var(--sc-rust-soft); color: var(--sc-rust); }
.audio-row__stop svg { width: 12px; height: 12px; fill: currentColor; stroke: none; }

/* Pause icon hidden by default */
.audio-row__icon-pause { display: none; }
.audio-row__icon-play { display: block; }

/* Playing state */
.audio-row--playing .audio-row__icon-play { display: none; }
.audio-row--playing .audio-row__icon-pause { display: block; }
.audio-row--playing .audio-row__stop { display: flex; }
.audio-row--playing .audio-row__play { background: var(--sc-rust); }
.audio-row--playing .audio-row__elapsed { display: inline; }

/* Paused state */
.audio-row--paused .audio-row__icon-play { display: block; }
.audio-row--paused .audio-row__icon-pause { display: none; }
.audio-row--paused .audio-row__stop { display: flex; }
.audio-row--paused .audio-row__elapsed { display: inline; }

.audio-row__info { flex: 1; min-width: 0; }

.audio-row__label {
  font-family: var(--sc-font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--sc-bark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.audio-row__meta {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

.audio-row__description {
  font-family: var(--sc-font-body);
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--sc-text-secondary);
  margin: 4px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Waveform */
.audio-row__waveform {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 1.5px;
  height: 24px;
  max-width: 200px;
}

.waveform__bar {
  flex: 1;
  background: var(--sc-sand);
  border-radius: 1.5px;
  min-width: 2px;
  transition: background 0.15s;
}

.waveform__bar--played {
  background: var(--sc-rust);
}

/* Time display */
.audio-row__time {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  min-width: 36px;
  gap: 3px;
}

.audio-row__elapsed {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-rust);
  font-weight: 500;
  display: none;
}

.audio-row__duration {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-text-tertiary);
}

/* Waveform animation during playback */
.audio-row--playing .audio-row__waveform .waveform__bar--played {
  animation: waveform-pulse 0.6s ease-in-out infinite alternate;
}

@keyframes waveform-pulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* ─── Video Cards ─── */
.video-grid {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.video-card {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: box-shadow 0.25s, border-color 0.25s;
}

.video-card:hover {
  border-color: var(--sc-sand);
  box-shadow: 0 4px 16px rgba(90, 64, 50, 0.07);
}

.video-card__open {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.video-card__preview {
  position: relative;
  aspect-ratio: 16/9;
  background: var(--sc-charcoal);
  overflow: hidden;
}

.video-card__preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.8;
}

.video-card__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card__play-btn {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s;
}

.video-card:hover .video-card__play-btn { transform: scale(1.08); }

.video-card__play-btn svg {
  width: 22px;
  height: 22px;
  margin-left: 3px;
  fill: var(--sc-bark);
}

.video-card__info {
  padding: 14px 16px;
}

.video-card__label {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--sc-bark);
}

.video-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.video-card__meta-row--footer {
  padding: 6px 12px 9px;
  margin-top: 0;
}

.video-card__duration {
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-text-tertiary);
}

.video-card__description {
  font-family: var(--sc-font-body);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--sc-text-secondary);
  margin: 6px 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Text Stories ─── */
.stories-grid {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.story-card {
  background: var(--sc-warm-white);
  border: 1px solid var(--sc-border);
  border-radius: 12px;
  padding: 22px 20px;
  position: relative;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.25s, border-color 0.25s;
}

.story-card--split {
  padding: 0;
  cursor: default;
}

.story-card__open {
  flex: 1;
  width: 100%;
  margin: 0;
  padding: 22px 20px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.story-card__toolbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 9px 12px 9px;
  border-top: 1px solid var(--sc-border-subtle);
}

.story-card:hover {
  border-color: var(--sc-sage-light);
  box-shadow: 0 4px 16px rgba(107, 127, 94, 0.09);
}

.story-card--split:hover {
  border-color: var(--sc-sage-light);
  box-shadow: 0 4px 16px rgba(107, 127, 94, 0.09);
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sc-sage), var(--sc-sage-light));
  border-radius: 12px 12px 0 0;
}

.story-card__icon {
  width: 36px;
  height: 36px;
  background: rgba(107, 127, 94, 0.08);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.story-card__icon svg {
  width: 18px;
  height: 18px;
  stroke: var(--sc-sage);
  fill: none;
}

.story-card__title {
  font-family: var(--sc-font-display);
  font-size: 1.15rem;
  color: var(--sc-charcoal);
  margin-bottom: 8px;
}

.story-card__excerpt {
  font-size: 0.9rem;
  color: var(--sc-text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}

.story-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
}

.story-card__cta {
  font-family: var(--sc-font-ui);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--sc-sage);
  display: flex;
  align-items: center;
  gap: 4px;
}

.story-card__cta svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  transition: transform 0.2s;
}

.story-card:hover .story-card__cta svg { transform: translateX(3px); }

/* ─── Comments Section ─── */
.comments-section {
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 0 24px 40px;
}

.comments-count {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  color: var(--sc-text-tertiary);
  margin-bottom: 16px;
}

.comment {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 0;
}

.comment + .comment {
  border-top: 1px solid var(--sc-border-subtle);
}

.comment__avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: white;
  flex-shrink: 0;
}

.comment__body {
  flex: 1;
  min-width: 0;
}

.comment__header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.comment__author {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sc-bark);
}

.comment__time {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  color: var(--sc-text-tertiary);
}

.comment__reply-ref {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sc-text-tertiary);
  margin: 0 0 6px;
}

.comment__text {
  font-size: 0.9rem;
  color: var(--sc-text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Media reference in comment */
.comment__media-ref {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--sc-cream-dark);
  border: 1px solid var(--sc-border-subtle);
  border-radius: 8px;
  margin-top: 8px;
  font-family: var(--sc-font-ui);
  font-size: 0.75rem;
  color: var(--sc-bark-faint);
  cursor: pointer;
  transition: border-color 0.2s;
}

.comment__media-ref:hover { border-color: var(--sc-sand); }

.comment__media-ref img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  object-fit: cover;
}

/* Reply nesting (one level only) */
.comment--reply {
  margin-left: 44px;
  padding-left: 14px;
  border-left: 2px solid var(--sc-border-subtle);
}

.comment--reply + .comment--reply {
  border-top: none;
}

/* Reply button */
.comment__reply-btn {
  font-family: var(--sc-font-ui);
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--sc-text-tertiary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 0;
  margin-top: 4px;
  transition: color 0.2s;
}

.comment__reply-btn:hover { color: var(--sc-rust); }

/* Comment input */
.comment-input {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--sc-border-subtle);
  margin-top: 8px;
}

.comment-input__field {
  flex: 1;
  border: 1px solid var(--sc-border);
  border-radius: 10px;
  padding: 10px 14px;
  font-family: var(--sc-font-body);
  font-size: 0.9rem;
  color: var(--sc-text-primary);
  background: var(--sc-warm-white);
  resize: none;
  min-height: 40px;
  transition: border-color 0.2s;
}

.comment-input__field:focus {
  outline: none;
  border-color: var(--sc-rust-soft);
}

.comment-input__field::placeholder {
  color: var(--sc-text-tertiary);
}

.comment-input__submit {
  font-family: var(--sc-font-ui);
  font-size: 0.82rem;
  font-weight: 600;
  color: white;
  background: var(--sc-rust);
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.comment-input__submit:hover { background: var(--sc-bark); }

.comment-input__media-preview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 12px;
  margin-bottom: 8px;
  background: rgba(184, 96, 63, 0.06);
  border: 1px solid rgba(184, 96, 63, 0.15);
  border-radius: 8px;
  font-family: var(--sc-font-ui);
  font-size: 0.78rem;
  color: var(--sc-bark);
}

.comment-input__media-preview button {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--sc-text-tertiary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.comment-input__media-preview button:hover { color: var(--sc-rust); }

/* ─── Contribution cards + detail modal ─── */
.contrib-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  max-width: var(--sc-content-max);
  margin: 0 auto;
  padding: 0 24px 24px;
}

.contrib-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 16px 18px;
  text-align: left;
  background: var(--sc-surface-raised);
  border: 1px solid var(--sc-border-subtle);
  border-radius: var(--sc-radius-md);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  font: inherit;
  color: inherit;
}

.contrib-card:hover {
  border-color: var(--sc-border-strong);
  box-shadow: var(--sc-shadow-sm);
}

.contrib-card:focus-visible {
  outline: 2px solid var(--sc-rust);
  outline-offset: 2px;
}

.contrib-card__label {
  font-family: var(--sc-font-ui);
  font-size: var(--sc-text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--sc-text-tertiary);
}

.contrib-card__title {
  font-family: var(--sc-font-ui);
  font-size: var(--sc-text-md);
  font-weight: 600;
  color: var(--sc-text-primary);
}

.contrib-card__meta {
  font-size: var(--sc-text-sm);
  color: var(--sc-text-secondary);
}

.contrib-card__excerpt {
  font-size: var(--sc-text-sm);
  color: var(--sc-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.contrib-detail__meta {
  display: grid;
  gap: var(--sc-space-md, 12px);
  margin: 0 0 var(--sc-space-lg, 16px);
}

.contrib-detail__meta dt {
  font-size: var(--sc-text-xs, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sc-text-tertiary);
  margin: 0 0 4px;
}

.contrib-detail__meta dd {
  margin: 0;
  color: var(--sc-text-primary);
}

.contrib-detail__note-label {
  display: block;
  font-size: var(--sc-text-xs, 0.75rem);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sc-text-tertiary);
  margin-bottom: 6px;
}

.contrib-detail__note-body {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.55;
}

.contrib-detail__empty-note {
  margin: 0;
  line-height: 1.55;
}

.contrib-detail__hint {
  margin: 0;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .photo-section-header { padding-left: 16px; padding-right: 16px; }
  .photo-grid { columns: 3; }
  .photo-grid--compact { columns: 4; }
  .photo-grid--large { columns: 2; }
  .video-grid { grid-template-columns: 1fr; }
  .stories-grid { grid-template-columns: 1fr; }
  .memory-header { padding: 20px 16px 0; }
  .memory-header__title { font-size: 1.75rem; }
  .media-gallery, .characters-panel, .audio-list, .comments-section { padding-left: 16px; padding-right: 16px; }
  .media-section-header { padding-left: 16px; padding-right: 16px; }
  .audio-row__waveform { display: none; }
}

@media (max-width: 480px) {
  .memory-header__meta { gap: 12px; }
  .characters-panel__list { gap: 10px; }
  .photo-grid { columns: 2; }
  .photo-grid--compact { columns: 3; }
  .photo-grid--large { columns: 1; }
  .comment--reply { margin-left: 20px; }
}
