/* Topic screen — room header/context, edit control, topic heading,
   references + video preview (page-title-row base rides along here) */

.topic-screen {
  gap: var(--space-4);
}

/* Two columns, mimicking a room: the family rail (holding just the topic —
   you are here) · the page. room.css hides .lane-family under 900px. */
.topic-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--space-5);
  align-items: start;
}

.topic-main {
  display: grid;
  gap: var(--space-4);
  min-width: 0;
}

/* You-are-here: the card is context, not a door. It carries the old page
   title's verbs — bookmark at the right edge, edit pencil on hover — at
   card scale, not header scale. */
.topic-family .lane-family-source {
  cursor: default;
}

.topic-family .lane-family-source:hover {
  border-color: var(--line);
}

.topic-family .lane-family-source .bookmark {
  margin-left: auto;
}

.topic-family .lane-family-source .bookmark,
.topic-family .lane-family-source .edit-topic-button {
  width: 24px;
  height: 24px;
  font-size: 1.05rem;
}

.topic-family .lane-family-source .edit-topic-button {
  padding: var(--space-1);
}

@media (hover: hover) {
  .topic-family .edit-topic-button {
    opacity: 0;
    transition: opacity 120ms ease;
  }

  .topic-family .lane-family-source:hover .edit-topic-button,
  .topic-family .edit-topic-button:focus-visible {
    opacity: 1;
  }
}

@media (max-width: 900px) {
  .topic-layout {
    grid-template-columns: 1fr;
  }

  /* Unlike a room's rail, this one is the only place the topic is named —
     it stacks above the content instead of hiding (out-specifies room.css's
     .lane-family { display: none }). The space eyebrow yields to the
     breadcrumb, which survives on mobile. */
  .topic-layout .topic-family {
    display: grid;
  }

  .topic-layout .lane-family-space {
    display: none;
  }
}
.room-header {
  margin-bottom: var(--space-5);
}

.page-title-row {
  margin-bottom: var(--space-5);
}

.page-title-row h1 {
  margin-bottom: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.room-context-row {
  /* Align the source icon + pencil to the title's first line, not the vertical
     centre of a wrapped title. Each fixed-size control is nudged so its centre
     lands on the first line (same trick as the bookmark toggle). */
  align-items: flex-start;
  margin-bottom: 0;
}

.room-context-row .play-link {
  margin-bottom: 0;
  margin-top: calc((1.35rem * 1.2 - 17px) / 2);
}

.room-context-row .play-link-generic {
  margin-top: calc((1.35rem * 1.2 - var(--space-5)) / 2);
}

.room-context-row .edit-topic-button {
  margin-top: calc((1.35rem * 1.2 - 32px) / 2);
}

.room-context-row .topic-title {
  transform: translateY(0);
}

.edit-topic-button {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
}

.edit-topic-button:hover,
.edit-topic-button:focus-visible {
  background: var(--soft);
  color: var(--ink);
}

.edit-topic-button svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.room-subhead-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
}

.room-subhead-row > .mark-toggle {
  flex: 0 0 auto;
  /* Center the bookmark on the title's first line. */
  margin-top: calc((1.35rem * 1.2 - 32px) / 2);
}

.room-wordmark {
  margin: 0;
  color: var(--clay);
  font-family: var(--font-ui);
  font-size: 1.38rem;
  font-variant-caps: small-caps;
  font-weight: 820;
  letter-spacing: 0.035em;
  line-height: 1;
}

.topic-heading {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: var(--space-2);
}

.topic-title {
  max-width: 760px;
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.2;
}

.topic-references-body {
  display: grid;
  gap: var(--space-3);
}

.topic-screen .section-heading .section-toggle h2,
.topic-screen .section-chevron {
  font-size: 1.05rem;
}

.topic-screen .section-heading {
  min-height: var(--space-6);
}

.topic-threads {
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.topic-threads-body {
  display: grid;
  gap: var(--space-3);
}

.topic-video-preview {
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 640px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  aspect-ratio: 16 / 9;
}

.topic-references .topic-video-preview {
  width: calc(100% - var(--space-2));
  margin-left: var(--space-2);
}

.topic-video-preview::after {
  position: absolute;
  inset: 0;
  background: rgba(255, 248, 231, 0.46);
  content: "";
  mix-blend-mode: multiply;
  pointer-events: none;
}

.topic-video-preview iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  filter: saturate(0.58) sepia(0.14);
}

.reference-list {
  display: grid;
  gap: var(--space-3);
  max-width: 720px;
  margin: 0;
  padding-left: var(--space-5);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.reference-list a {
  color: var(--accent-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.reference-list a:hover,
.reference-list a:focus-visible {
  color: var(--ink);
}

/* Dialogue-at-scale: source + fresh shelf + discuss box
   ---------------------------------------------------------------- */

.topic-meta {
  margin: var(--space-2) 0 0;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.topic-source-body {
  display: grid;
  gap: var(--space-3);
  margin-top: var(--space-2);
}

.topic-source-body .topic-video-preview {
  max-width: 640px;
}

/* Fresh conversations shelf — small, contributable rooms as cards. */
.fresh-shelf {
  gap: var(--space-3);
}

.fresh-shelf-body {
  display: grid;
  gap: var(--space-3);
}

/* The count in the heading, quiet — normal weight, muted. */
.fresh-count {
  font-weight: 400;
  color: var(--muted);
}

/* Quiet expand text under the first three cards. */
.fresh-more {
  justify-self: start;
  margin-top: var(--space-1);
  padding: var(--space-1) 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  cursor: pointer;
}

.fresh-more:hover,
.fresh-more:focus-visible {
  color: var(--ink);
  outline: 0;
}

.conversation-card {
  display: grid;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--panel);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.conversation-card:hover,
.conversation-card:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.conversation-card-quote {
  color: var(--ink);
  font-family: var(--font-reading);
  font-size: 1.02rem;
  line-height: 1.35;
}

.conversation-card-quote::before { content: "\201C"; }
.conversation-card-quote::after { content: "\201D"; }

.conversation-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: baseline;
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

.conversation-card-author {
  color: var(--ink);
  font-weight: 600;
}

.conversation-card-people::before {
  margin-right: var(--space-2);
  color: var(--line);
  content: "\00B7";
}

/* Discuss box — opens the exchange, doesn't post. */
.topic-discuss {
  display: grid;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

.discuss-box {
  display: flex;
  gap: var(--space-2);
  align-items: center;
  padding: var(--space-2);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.discuss-box:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}

.discuss-box-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: var(--space-2) var(--space-3);
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
}

.discuss-box-input::placeholder {
  color: var(--muted);
}

.discuss-box-input:focus {
  outline: none;
}

.discuss-box-submit {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: var(--color-on-accent);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}

.discuss-box-submit:hover,
.discuss-box-submit:focus-visible {
  background: var(--accent-dark);
}

.discuss-box-hint {
  margin: 0 var(--space-3);
  color: var(--muted);
  font-family: var(--font-ui);
  font-size: 0.82rem;
}

/* ── Topic rail: unopened seeds (born from content) — a list of doors, the
   same species as a room rail's Rooms group. Dashed like the old seed cards:
   nothing exists yet. */

.lane-family-seed {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px dashed var(--line);
  background: transparent;
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
  font: 600 0.78rem var(--font-ui);
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
}

.lane-family-seed:hover,
.lane-family-seed:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
}
