/* Long-form article layout, used by the blog articles (/blog/...) and reused by
   /dm-div and the resources block of /arianis. Editorial layout for search-intent
   content, built on the existing design tokens: shares the visual language of
   sector.css but optimised for long-form reading — a narrower measure, a citable
   summary card, definition lists and comparison tables.

   The .topic-* prefix predates the move of these pages into the blog and is kept
   because three page templates depend on it; the article-specific chrome (hero
   badges, meta, table of contents, product blocks, cards) lives in blog.css. */

.topic-page {
  --topic-glow: rgba(79, 70, 229, 0.13);
}

.topic-page--indigo  { --topic-glow: rgba(79, 70, 229, 0.13);  --topic-fg: #4338CA; --topic-bg: #EEF2FF; }
.topic-page--green   { --topic-glow: rgba(31, 182, 115, 0.13); --topic-fg: #059669; --topic-bg: #ECFDF5; }
.topic-page--amber   { --topic-glow: rgba(217, 119, 6, 0.12);  --topic-fg: #B45309; --topic-bg: #FFFBEB; }
.topic-page--rose    { --topic-glow: rgba(190, 18, 60, 0.11);  --topic-fg: #BE123C; --topic-bg: #FFF1F2; }
.topic-page--orange  { --topic-glow: rgba(194, 65, 12, 0.11);  --topic-fg: #C2410C; --topic-bg: #FFF7ED; }

.topic-container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 2rem;
}

.topic-measure {
  max-width: 780px;
}

/* ----------------------------------------------------------------------- HERO */

.topic-hero {
  padding: 64px 0 66px;
  background:
    radial-gradient(circle at top left, var(--topic-glow), transparent 34%),
    radial-gradient(circle at bottom right, rgba(79, 70, 229, 0.07), transparent 32%),
    var(--bg-primary);
  border-bottom: 1px solid var(--border);
}

.topic-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) 400px;
  gap: 46px;
  align-items: start;
}

.topic-hero h1 {
  color: var(--text-primary);
  font-size: clamp(32px, 4.4vw, 50px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.04;
  margin-bottom: 20px;
}

.topic-hero-lead {
  color: var(--text-secondary);
  font-size: 17px;
  line-height: 1.58;
}

/* The short answer: the block a generative engine can lift as-is. */
.topic-answer {
  padding: 26px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: var(--big-radius);
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.03),
    0 22px 70px rgba(0, 0, 0, 0.06);
}

.topic-answer-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 14px;
  padding: 5px 11px;
  background: var(--topic-bg, var(--bg-secondary));
  border-radius: 999px;
  color: var(--topic-fg, var(--text-secondary));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topic-answer p {
  color: var(--text-primary);
  font-size: 15px;
  line-height: 1.62;
}

.topic-answer p + p {
  margin-top: 12px;
}

/* ---------------------------------------------------------------------- STATS */

.topic-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
  margin-top: 34px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.topic-stat-value {
  display: block;
  color: var(--text-primary);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.topic-stat-label {
  display: block;
  margin-top: 5px;
  max-width: 230px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.45;
}

/* ------------------------------------------------------------------- SECTIONS */

.topic-section {
  padding: 66px 0;
  border-bottom: 1px solid var(--border);
}

.topic-section--muted { background: var(--bg-secondary); }
.topic-section--accent { background: var(--bg-accent); }

.topic-section h2 {
  color: var(--text-primary);
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.14;
  margin-bottom: 16px;
}

.topic-section h3 {
  color: var(--text-primary);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.topic-section-intro {
  color: var(--text-secondary);
  font-size: 16px;
  line-height: 1.6;
}

.topic-body > * + * {
  margin-top: 22px;
}

.topic-body p {
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.68;
}

.topic-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

.topic-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* --------------------------------------------------------------------- LISTS */

.topic-list {
  display: grid;
  gap: 12px;
  list-style: none;
  padding: 0;
}

.topic-list li {
  position: relative;
  padding-left: 28px;
  color: var(--text-secondary);
  font-size: 15.5px;
  line-height: 1.62;
}

.topic-list li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 9px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--topic-fg, var(--accent));
}

/* --------------------------------------------------------------- DEFINITIONS */

.topic-definitions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin: 0;
}

.topic-definition {
  padding: 22px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s;
}

.topic-definition:hover {
  border-color: var(--border-hover);
}

.topic-definition dt {
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topic-definition dd {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------- STEPS */

.topic-steps {
  display: grid;
  gap: 2px;
  counter-reset: topic-step;
  list-style: none;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.topic-steps li {
  counter-increment: topic-step;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 16px;
  padding: 20px 22px;
  background: var(--bg-primary);
}

.topic-steps li::before {
  content: counter(topic-step, decimal-leading-zero);
  color: var(--topic-fg, var(--accent));
  font-family: "DM Mono", ui-monospace, monospace;
  font-size: 13px;
  font-weight: 500;
  padding-top: 2px;
}

.topic-steps strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

.topic-steps span {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------- CARDS */

.topic-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.topic-card {
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, transform 0.15s;
}

.topic-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.topic-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 15px;
  border-radius: var(--small-radius);
  background: var(--topic-bg, var(--bg-secondary));
  color: var(--topic-fg, var(--text-secondary));
  font-size: 19px;
}

.topic-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.topic-card p {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ------------------------------------------------------------------- TABLE */

/* Comparison tables are wide by nature: they scroll inside their own box so the
   page body never scrolls horizontally on a phone. */
.topic-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-primary);
}

.topic-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 14.5px;
}

.topic-table th,
.topic-table td {
  padding: 15px 18px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
  line-height: 1.55;
}

.topic-table thead th {
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.topic-table tbody th {
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.topic-table tbody td {
  color: var(--text-secondary);
}

.topic-table tbody tr:last-child th,
.topic-table tbody tr:last-child td {
  border-bottom: none;
}

.topic-table-caption {
  margin-top: 12px;
  color: var(--text-tertiary);
  font-size: 13px;
  line-height: 1.5;
}

/* ----------------------------------------------------------------- CALLOUT */

.topic-callout {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 14px;
  padding: 22px;
  background: var(--topic-bg, var(--bg-secondary));
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.topic-callout i {
  color: var(--topic-fg, var(--text-secondary));
  font-size: 20px;
  padding-top: 1px;
}

.topic-callout strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}

.topic-callout p {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.62;
}

/* --------------------------------------------------------------- CHECKLIST */

.topic-checklist {
  padding: 30px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--big-radius);
}

.topic-checklist h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.topic-checklist > p {
  margin-bottom: 22px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.6;
}

.topic-checklist ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px 28px;
  list-style: none;
  padding: 0;
}

.topic-checklist li {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 11px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.55;
}

.topic-checklist li i {
  color: var(--topic-fg, var(--accent));
  font-size: 16px;
  padding-top: 2px;
}

/* ----------------------------------------------------------------- PRODUCT */

.topic-product {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  gap: 44px;
  align-items: center;
}

.topic-product-shot {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-primary);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.07);
}

.topic-product-shot img {
  display: block;
  width: 100%;
  height: auto;
}

.topic-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

/* ---------------------------------------------------------------------- FAQ */

.topic-faq {
  display: grid;
  gap: 2px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--border);
}

.topic-faq-item {
  background: var(--bg-primary);
}

.topic-faq-item summary {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 19px 22px;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.45;
  list-style: none;
}

.topic-faq-item summary::-webkit-details-marker {
  display: none;
}

.topic-faq-item summary::after {
  content: "\ea5f"; /* tabler chevron-down */
  font-family: "tabler-icons";
  margin-left: auto;
  color: var(--text-tertiary);
  font-size: 17px;
  font-weight: 400;
  transition: transform 0.18s;
}

.topic-faq-item[open] summary::after {
  transform: rotate(180deg);
}

.topic-faq-item summary:hover {
  background: var(--bg-secondary);
}

.topic-faq-answer {
  padding: 0 22px 22px 22px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.68;
}

/* ------------------------------------------------------------------ RELATED */

.topic-related {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.topic-related-card {
  display: block;
  padding: 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
}

.topic-related-card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.topic-related-card strong {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--text-primary);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.topic-related-card span {
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.58;
}

/* ---------------------------------------------------------------------- CTA */

.topic-cta {
  padding: 62px 0;
  background: var(--bg-secondary);
}

.topic-cta-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 34px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--big-radius);
}

.topic-cta-card h2 {
  margin: 6px 0 0;
  color: var(--text-primary);
  font-size: clamp(21px, 2.4vw, 27px);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.topic-cta-card > div > span {
  color: var(--text-tertiary);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.topic-cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* -------------------------------------------------------------- RESPONSIVE */

@media (max-width: 1000px) {
  .topic-hero-grid,
  .topic-product {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .topic-product-shot {
    order: -1;
  }
}

@media (max-width: 640px) {
  .topic-container {
    padding: 0 1.25rem;
  }

  .topic-hero {
    padding: 44px 0 46px;
  }

  .topic-section {
    padding: 46px 0;
  }

  .topic-stats {
    gap: 22px;
  }

  .topic-checklist,
  .topic-cta-card,
  .topic-answer {
    padding: 22px;
  }
}

/* Blocks that legitimately use the full container width (grids, tables) versus
   prose blocks, which blog/_article.php keeps inside .topic-measure. */
.topic-block-wide {
  width: 100%;
}

.topic-body > .topic-measure + .topic-measure,
.topic-body > .topic-block-wide + .topic-block-wide,
.topic-body > .topic-measure + .topic-block-wide,
.topic-body > .topic-block-wide + .topic-measure {
  margin-top: 22px;
}

/* The FAQ reads better at the same measure as the prose around it. */
.topic-faq {
  max-width: 860px;
}
