/* Human-reviewed community picture books: a regular grid plus an indexable detail landing page.
   The landing page launches the authoritative full-screen 2D/3D readers and never grows a third
   single-image reader of its own. */

.rk-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.rk-ugc-section {
  border: 1px solid color-mix(in srgb, var(--rk-emerald) 22%, var(--rk-line));
  border-radius: 28px;
  padding: clamp(24px, 4vw, 48px);
  background: color-mix(in srgb, var(--rk-emerald-soft) 34%, var(--rk-surface));
}

.rk-ugc-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.rk-ugc-section-head > div { min-width: 0; }
.rk-ugc-section-head h2 { margin: 8px 0 0; }
.rk-ugc-section-head > p {
  max-width: 52ch;
  margin: 0;
  color: var(--rk-ink-soft);
  line-height: 1.65;
}

.rk-ugc-label {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid color-mix(in srgb, var(--rk-emerald) 32%, transparent);
  border-radius: 999px;
  padding: 2px 9px;
  background: var(--rk-emerald-soft);
  color: var(--rk-emerald);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.rk-ugc-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  color: var(--rk-emerald);
  font-weight: 800;
  text-decoration: none;
}

.rk-ugc-all:hover { text-decoration: underline; text-underline-offset: 4px; }
.rk-ugc-empty { margin: 0; color: var(--rk-ink-soft); }

.rk-ugc-cover-empty {
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(145deg, color-mix(in srgb, var(--ugc-cloth) 86%, white), var(--ugc-cloth));
  color: white;
  text-align: center;
}

.rk-ugc-cover-empty span {
  font-family: var(--rk-font-display);
  font-size: clamp(17px, 2vw, 25px);
  line-height: 1.25;
}

.rk-ugc-breadcrumb {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto 28px;
  color: var(--rk-ink-muted);
  font-size: 13px;
}

.rk-ugc-breadcrumb a { color: inherit; text-decoration: none; }
.rk-ugc-breadcrumb a:hover { color: var(--rk-emerald); }

.rk-ugc-hub { padding-top: 36px; }
.rk-ugc-hub .rk-ugc-breadcrumb { width: 100%; }
.rk-ugc-library { margin-bottom: 40px; }
.rk-ugc-card .rk-sb-card-cover { aspect-ratio: var(--ugc-book-ratio, 3 / 4); }

.rk-ugc-empty-state {
  display: grid;
  min-height: 260px;
  place-items: center;
  align-content: center;
  gap: 16px;
  border: 1px dashed var(--rk-line-strong);
  border-radius: 24px;
  text-align: center;
}

.rk-ugc-empty-state h2 { margin: 0; font-size: clamp(22px, 3vw, 32px); }
.rk-ugc-empty-state a,
.rk-ugc-pager a { color: var(--rk-emerald); font-weight: 800; }

.rk-ugc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 44px;
}

.rk-ugc-pager > :last-child { justify-self: end; }

.rk-ugc-detail {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 clamp(72px, 9vw, 120px);
}

.rk-ugc-detail > .rk-ugc-breadcrumb { width: 100%; margin-bottom: 26px; }

.rk-ugc-detail-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 24px;
}

.rk-ugc-detail-head h1 {
  max-width: 820px;
  margin: 10px 0 6px;
  color: var(--rk-ink);
  font-family: var(--rk-font-display);
  font-size: clamp(32px, 5vw, 58px);
  line-height: 1.05;
}

.rk-ugc-detail-head p { max-width: 68ch; margin: 6px 0 0; color: var(--rk-ink-soft); }
.rk-ugc-book-meta { font-size: 13px; }

.rk-ugc-author {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--rk-ink-soft);
  font-size: 13px;
  font-style: normal;
  font-weight: 750;
}

.rk-ugc-author-avatar {
  display: grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  overflow: hidden;
  place-items: center;
  border: 1px solid var(--rk-line);
  border-radius: 50%;
  background: var(--rk-emerald-soft);
  color: var(--rk-emerald);
  font-size: 10px;
  font-weight: 850;
}

.rk-ugc-author-avatar img { display: block; width: 100%; height: 100%; object-fit: cover; }
.rk-ugc-author-name { overflow: hidden; min-width: 0; text-overflow: ellipsis; white-space: nowrap; }
.rk-ugc-author.is-detail { width: fit-content; max-width: min(520px, 70vw); margin-top: 12px; font-size: 14px; }
.rk-ugc-author.is-detail .rk-ugc-author-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 12px; }

.rk-ugc-like {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  border: 1px solid var(--rk-line);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--rk-surface);
  color: var(--rk-ink-soft);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.rk-ugc-like svg { width: 18px; height: 18px; }
.rk-ugc-like:hover { border-color: var(--rk-emerald); color: var(--rk-emerald); }
.rk-ugc-like.is-liked { border-color: var(--rk-emerald); background: var(--rk-emerald-soft); color: var(--rk-emerald); }
.rk-ugc-like.is-liked svg { fill: currentColor; }

.rk-ugc-launch {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border: 1px solid var(--rk-line);
  border-radius: 26px;
  padding: clamp(18px, 3vw, 34px);
  background: color-mix(in srgb, var(--rk-surface) 96%, var(--rk-paper));
  box-shadow: 0 24px 60px -48px rgba(20, 30, 25, .58);
}

.rk-ugc-launch-cover {
  display: grid;
  place-items: center;
  min-height: min(620px, calc(100dvh - 260px));
  overflow: hidden;
  border-radius: 18px;
  background: var(--rk-paper);
  text-decoration: none;
}

.rk-ugc-launch-cover img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: min(620px, calc(100dvh - 260px));
  object-fit: contain;
}

.rk-ugc-launch-cover .rk-ugc-cover-empty {
  display: grid;
  width: 100%;
  min-height: min(620px, calc(100dvh - 260px));
  place-items: center;
}

.rk-ugc-launch-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.rk-ugc-format {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  min-height: 48px;
  border: 1px solid var(--rk-line);
  border-radius: 999px;
  padding: 0 24px;
  background: var(--rk-surface);
  color: var(--rk-ink-soft);
  text-decoration: none;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.rk-ugc-format strong {
  color: var(--rk-ink);
  font-family: var(--rk-font-display);
  font-size: 18px;
}

.rk-ugc-format span { display: none; }
.rk-ugc-format:hover {
  border-color: var(--rk-emerald);
  box-shadow: 0 16px 34px -26px rgba(25, 105, 79, .8);
  transform: translateY(-2px);
}

.rk-ugc-format.is-primary { border-color: var(--rk-emerald); background: var(--rk-emerald); color: white; }
.rk-ugc-format.is-primary strong { color: white; }
.rk-ugc-like-hint { flex-basis: 100%; color: var(--rk-danger); text-align: right; }
.rk-ugc-like-hint:empty { display: none; }
.rk-ugc-like-hint a { color: var(--rk-emerald); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }

.rk-ugc-like:focus-visible,
.rk-ugc-launch-cover:focus-visible,
.rk-ugc-format:focus-visible { outline: 3px solid var(--rk-focus-ring); outline-offset: 3px; }

@media (max-width: 760px) {
  .rk-ugc-section-head { display: block; }
  .rk-ugc-section-head > p { margin-top: 10px; }
  .rk-ugc-detail { width: min(100% - 20px, 1240px); padding-top: 22px; }
  .rk-ugc-detail-head { align-items: flex-start; }
  .rk-ugc-detail-head h1 { font-size: clamp(30px, 10vw, 44px); }
  .rk-ugc-launch { border-radius: 18px; padding: 12px; }
  .rk-ugc-launch-cover,
  .rk-ugc-launch-cover img,
  .rk-ugc-launch-cover .rk-ugc-cover-empty { min-height: min(58dvh, 520px); height: min(58dvh, 520px); }
  .rk-ugc-launch-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .rk-ugc-format { width: 100%; min-width: 0; min-height: 48px; }
  .rk-ugc-like-hint { grid-column: 1 / -1; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .rk-ugc-format { transition: none; }
}
