/* SPDX-License-Identifier: AGPL-3.0-or-later
   Commercial license available
   © Code 2020–2026 Miroslav Šotek. All rights reserved.
   Fluctara — Topic page styles. main.css carries the shared shell; this file
   styles only the generated topic pages, which is why it is loaded by them
   alone rather than added to an already-full main stylesheet. */

.topic-main {
  padding-block: calc(var(--nav-height) + 48px) 96px;
}

/* Nested inside a full-width container so the reading column starts on the
   same left edge as the page header, rather than being centred against the
   viewport and landing somewhere else. */
.topic-container {
  max-width: 780px;
}

.topic-header {
  padding-bottom: 34px;
  border-bottom: 1px solid var(--border-subtle);
}

/* The ordinal sits close above its heading rather than at the section's own
   top margin, where it would read as belonging to the paragraph before it. */
/* The ordinal carries the space between sections so it stays attached to the
   heading it numbers rather than floating between two of them. */
.topic-main .eyebrow {
  margin: 64px 0 4px;
}

.topic-main .eyebrow + h2 {
  margin-top: 0;
}

.topic-main .section-intro .eyebrow {
  margin: 0 0 28px;
}

/* Weight and leading come from `.section-intro`, but not its size: the landing
   hero is a poster and this is a page of prose, and the same 80px that reads as
   confident there reads as shouting above a 780px column. */
.topic-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3.6vw, 2.7rem);
}

.topic-lede {
  margin: 0;
  color: var(--text-secondary);
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  line-height: 1.72;
}

.topic-main h2 {
  margin: 52px 0 16px;
  font-size: 1.34rem;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.topic-main p {
  margin: 0 0 16px;
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.76;
}

.topic-rows {
  margin: 22px 0 0;
  display: grid;
  gap: 1px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  background: var(--border-subtle);
  overflow: hidden;
}

.topic-rows > div {
  display: grid;
  gap: 6px 22px;
  padding: 18px 22px;
  background: var(--bg-primary);
  grid-template-columns: minmax(120px, 1fr) 3fr;
}

.topic-rows dt {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.94rem;
}

.topic-rows dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
  line-height: 1.68;
}

.topic-bullets {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 14px;
}

.topic-bullets li {
  position: relative;
  padding-left: 26px;
  color: var(--text-secondary);
  line-height: 1.72;
}

.topic-bullets li::before {
  content: '';
  position: absolute;
  top: 0.62em;
  left: 4px;
  width: 9px;
  height: 1px;
  background: var(--accent-cyan);
}

.topic-figures {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

.topic-figure {
  margin: 0;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.topic-figure-visual {
  position: relative;
  background: var(--bg-secondary);
}

.topic-figure-visual svg {
  display: block;
  width: 100%;
  height: auto;
}

/* main.css already owns .cymatics-rings, .stimulus-field, and .visual-stamp,
   including their deliberate multi-tone ring colouring. Only the phase-wave
   rules need restating here: main.css scopes those to .showcase-phase, a
   wrapper the generated figures do not use. */
.topic-figure-visual .wave,
.topic-figure-visual .axis {
  fill: none;
  stroke: var(--accent-cyan);
  stroke-width: 1.6;
}

.topic-figure-visual .wave-one { opacity: 0.85; }
.topic-figure-visual .wave-two { opacity: 0.6; }
.topic-figure-visual .wave-three { opacity: 0.42; }
.topic-figure-visual .axis { opacity: 0.3; stroke-width: 1; }

.topic-figure figcaption {
  padding: 20px 22px;
}

.topic-figure figcaption > span {
  display: block;
  margin-bottom: 8px;
  color: var(--accent-cyan);
  font: 0.56rem/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.topic-figure figcaption h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.topic-figure figcaption p {
  margin: 0;
  font-size: 0.9rem;
}

.topic-boundary {
  margin-top: 60px;
  padding: 26px 28px;
  border: 1px solid var(--border-subtle);
  border-left: 2px solid var(--accent-cyan);
  border-radius: var(--radius);
  background: var(--surface-hint);
}

.topic-boundary h2 {
  margin: 0 0 12px;
  font-size: 0.94rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.topic-boundary p {
  margin: 0;
  font-size: 0.95rem;
}

.topic-related {
  margin-top: 46px;
  padding-top: 30px;
  border-top: 1px solid var(--border-subtle);
}

.topic-related h2 {
  margin: 0 0 16px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.topic-related ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.topic-related a {
  display: inline-block;
  padding: 4px 0;
  color: var(--accent-cyan);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.topic-related a:hover,
.topic-related a:focus-visible {
  border-bottom-color: var(--accent-cyan);
}

@media (max-width: 640px) {
  .topic-rows > div {
    grid-template-columns: 1fr;
  }
}
