/*
 * Freelance Signal non-home template system v2.
 * Scoped to .template-system so the homepage and route views remain unchanged.
 */
:root {
  --ts-canvas: #f5f7fa;
  --ts-surface: #ffffff;
  --ts-surface-muted: #edf1f6;
  --ts-ink: #151c25;
  --ts-muted: #586474;
  --ts-rule: #d7dee7;
  --ts-rule-strong: #b9c4d1;
  --ts-accent: #3446a8;
  --ts-accent-soft: #eef1ff;
  --ts-positive: #087f78;
  --ts-radius: 14px;
  --ts-shadow: 0 18px 48px rgba(26, 35, 48, .08);
}

.template-system {
  min-width: 0;
  color: var(--ts-ink);
  overflow-x: clip;
  background: var(--ts-canvas);
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
}

.template-system :where(h1, h2, h3, h4, p, li, a, span) {
  overflow-wrap: anywhere;
}

.template-system :where(a, button):focus-visible {
  outline: 3px solid var(--ts-accent);
  outline-offset: 3px;
}

.template-system-hero {
  padding-block: clamp(2rem, 5vw, 4.5rem);
  background: var(--ts-surface);
  border-bottom: 1px solid var(--ts-rule);
}

.template-system-hero__layout {
  display: grid;
  gap: clamp(1.25rem, 4vw, 3rem);
  min-width: 0;
}

.template-system-hero h1 {
  max-width: 20ch;
  margin: .5rem 0 0;
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
  font-size: clamp(2rem, 5vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -.035em;
}

.template-system-label {
  margin: 0;
  color: var(--ts-accent);
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.template-system-hero__context {
  max-width: 34rem;
  padding: 1.1rem 0 0 1.25rem;
  color: var(--ts-muted);
  border-left: 3px solid var(--ts-accent);
}

.template-system-hero__context p { margin: 0 0 .75rem; }
.template-system-hero__context a { color: var(--ts-ink); font-weight: 750; text-underline-offset: .25em; }
.template-system-content { padding-block: clamp(2.25rem, 6vw, 5rem); }
.template-system-content--product{padding-block:clamp(2rem,5vw,4.25rem);background:var(--ts-canvas)}
.product-workspace{max-width:72rem}.product-workspace__surface{min-width:0}.product-workspace__surface+.product-workspace__surface{margin-top:clamp(2rem,5vw,4rem);padding-top:clamp(2rem,5vw,4rem);border-top:1px solid var(--ts-rule-strong)}
.product-workspace [data-fs-app="reality-gap"]{display:grid;grid-template-columns:minmax(220px,.55fr) minmax(0,1.45fr);gap:18px;align-items:start}.product-workspace [data-fs-app="reality-gap"] .fs-v2__metric{margin-top:0}.product-workspace [data-fs-app="reality-gap"] .fs-v2__results-head{grid-column:2;margin-top:0}.product-workspace [data-fs-app="reality-gap"] [data-results]{grid-column:2}
.template-system-reading-column { max-width: 78rem; }
.template-system-content--longform .template-system-reading-column { max-width: 52rem; }
.template-system-content--longform :where(p, li) { max-width: 70ch; line-height: 1.75; }
.template-system-content :where(h2, h3) { font-family: var(--fs-font-ui, Inter, system-ui, sans-serif); }
.template-system-content :where(table, pre, figure, iframe) { max-width: 100%; }
.template-system-content .table-scroll { max-width: 100%; overflow-x: auto; }

/* Full-width directories: utility rows, not decorative editorial cards. */
.template-system-directory__header {
  padding-block: clamp(2.25rem, 5vw, 4.25rem);
  background: var(--ts-surface);
  border-bottom: 1px solid var(--ts-rule);
}

.template-system-directory__heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .8rem;
  min-width: 0;
}

.template-system-directory h1 {
  max-width: 22ch;
  margin: 0;
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
  font-size: clamp(2.1rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -.035em;
}

.template-system-directory__intro {
  max-width: 60ch;
  margin: 0;
  color: var(--ts-muted);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  line-height: 1.65;
}

.template-platform-identity { grid-column: 1 / -1; margin: 0 0 .25rem; }
.template-platform-identity__mark { margin: 0; box-shadow: none; }

.template-system-directory__content { padding-block: clamp(2rem, 5vw, 4.5rem); }
.template-system-directory__canvas { width: 100%; max-width: 90rem; min-width: 0; }
.template-system-directory__body { max-width: 70rem; margin-bottom: clamp(2rem, 5vw, 4rem); }
.template-system-directory__body :where(h2, h3) { font-family: var(--fs-font-ui, Inter, system-ui, sans-serif); }
.template-system-directory__body :where(p, li) { max-width: 72ch; line-height: 1.7; }

.platform-utility { min-width: 0; }
.platform-utility__heading {
  display: grid;
  gap: .65rem;
  max-width: 65rem;
  margin-bottom: 1.5rem;
}

.platform-utility__heading h2 {
  max-width: 28ch;
  margin: 0;
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
  font-size: clamp(1.6rem, 3vw, 2.5rem);
  letter-spacing: -.025em;
}

.platform-utility__heading p { max-width: 62ch; margin: 0; color: var(--ts-muted); }
.platform-utility-list { border-top: 1px solid var(--ts-rule-strong); }

.platform-utility-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: clamp(.8rem, 2vw, 1.5rem);
  min-width: 0;
  min-height: 88px;
  align-items: center;
  padding: 1rem .25rem;
  color: var(--ts-ink);
  border-bottom: 1px solid var(--ts-rule);
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
  text-decoration: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.platform-utility-row--has-mark { grid-template-columns: 4.5rem minmax(0, 1fr) auto; }
.platform-utility-row{background:var(--ts-surface)}
.platform-utility-row:hover { color: var(--ts-accent); background: var(--ts-accent-soft); }
.platform-utility-row__mark { display: flex; align-items: center; justify-content: flex-start; }
.platform-utility-row__logo { width: 4rem; max-width: 100%; margin: 0; }
.platform-utility-row__copy { display: grid; gap: .3rem; min-width: 0; }
.platform-utility-row__copy strong { font-size: clamp(1.05rem, 2vw, 1.35rem); }
.platform-utility-row__copy > span { max-width: 58ch; color: var(--ts-muted); font-size: .9rem; line-height: 1.5; }
.platform-utility-row__action { display: inline-flex; min-height: 44px; align-items: center; gap: .5rem; font-size: .82rem; font-weight: 800; }
.template-system-empty { max-width: 46rem; padding: 1.25rem; color: var(--ts-muted); background: var(--ts-surface); border: 1px solid var(--ts-rule); }

/* Guide archive: an image-led first guide and compact supporting grid. */
.template-system-archive__header {
  padding-block: clamp(2.5rem, 6vw, 5rem);
  background: var(--ts-ink);
  color: #fff;
}

.template-system-archive__heading { display: grid; gap: .85rem; }
.template-system-archive__header .template-system-label{color:#8be0d6}
.template-system-archive__heading h1 {
  max-width: 18ch;
  margin: 0;
  color: #fff;
  font-family: var(--fs-font-ui, Inter, system-ui, sans-serif);
  font-size: clamp(2.3rem, 6vw, 4.5rem);
  line-height: 1;
  letter-spacing: -.04em;
}
.template-system-archive__heading > p:last-child { max-width: 62ch; margin: 0; color: #cbd4df; line-height: 1.65; }
.template-system-archive__listing { min-height: 50vh; padding-block: clamp(2rem, 5vw, 4.5rem); }
.template-guide-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; min-width: 0; }
.template-guide-grid--archive { align-items: stretch; }

.template-system .article-card {
  display: grid;
  min-width: 0;
  overflow: hidden;
  background: var(--ts-surface);
  border: 1px solid var(--ts-rule);
  border-radius: var(--ts-radius);
  box-shadow: none;
}

.template-system .article-card__image {
  display: block;
  min-width: 0;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: transparent;
}

.template-system .article-card__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
}
.template-system .article-card:hover .article-card__image img { transform: scale(1.018); }
.template-system .article-card__body { display: flex; min-width: 0; flex-direction: column; padding: 1.25rem; }
.template-system .article-card__meta { display: flex; flex-wrap: wrap; gap: .45rem .9rem; margin: 0 0 .8rem; color: var(--ts-muted); font-size: .72rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.template-system .article-card h2,
.template-system .article-card h3 {
  margin: 0 0 .75rem;
  font-family: var(--fs-font-editorial, Georgia, serif);
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
  line-height: 1.12;
}
.template-system .article-card h2 a,
.template-system .article-card h3 a { color: var(--ts-ink); text-decoration: none; }
.template-system .article-card h2 a:hover,
.template-system .article-card h3 a:hover { color: var(--ts-accent); text-decoration: underline; text-underline-offset: .2em; }
.template-system .article-card__excerpt { margin: 0 0 1.2rem; color: var(--ts-muted); font-size: .9rem; line-height: 1.6; }
.template-system .article-card__action { display: inline-flex; min-height: 44px; align-items: center; gap: .45rem; align-self: flex-start; margin-top: auto; color: var(--ts-accent); font-size: .82rem; font-weight: 850; text-decoration: none; }
.template-system .article-card__platforms { margin-bottom: .8rem; }

.template-system-archive .navigation.pagination { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--ts-rule-strong); }
.template-system-archive .nav-links { display: flex; flex-wrap: wrap; gap: .5rem; }
.template-system-archive .page-numbers { display: inline-flex; min-width: 44px; min-height: 44px; align-items: center; justify-content: center; padding: .55rem .8rem; color: var(--ts-ink); background: var(--ts-surface); border: 1px solid var(--ts-rule); text-decoration: none; }
.template-system-archive .page-numbers.current { color: #fff; background: var(--ts-accent); border-color: var(--ts-accent); }

/* Editorial article: restrained title, explicit metadata, narrow reading measure. */
.template-article-hero {
  padding-block: clamp(2.5rem, 6vw, 5.25rem);
  background: var(--ts-surface);
  border-bottom: 1px solid var(--ts-rule);
}
.template-article-hero__inner { display: grid; gap: 1.25rem; max-width: 62rem; }
.template-article-hero__badges { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.template-article-hero h1 {
  max-width: 21ch;
  margin: 0;
  font-family: var(--fs-font-editorial, Georgia, serif);
  font-size: clamp(2.1rem, 5vw, 3.8rem);
  font-weight: 600;
  line-height: 1.03;
  letter-spacing: -.03em;
}
.template-article-hero__meta { display: flex; flex-wrap: wrap; gap: .55rem 1.25rem; color: var(--ts-muted); font-size: .8rem; font-weight: 700; }
.template-article-hero__meta span + span { padding-left: 1.25rem; border-left: 1px solid var(--ts-rule-strong); }
.template-article-media { max-width: 76rem; margin-block: clamp(1.25rem, 4vw, 3rem) 0; }
.template-article-media__image { display: block; width: 100%; height: auto; max-height: 42rem; object-fit: cover; border-radius: var(--ts-radius); }
.template-article-body { padding-block: clamp(2.5rem, 6vw, 5.5rem); }
.template-article-reading-column { max-width: 48rem; }
.template-article-reading-column > :first-child { margin-top: 0; }
.template-article-reading-column :where(p, li) { font-size: clamp(1rem, 1.3vw, 1.08rem); line-height: 1.78; }
.template-article-reading-column :where(h2, h3, h4) { font-family: var(--fs-font-ui, Inter, system-ui, sans-serif); letter-spacing: -.02em; }
.template-article-reading-column h2 { margin: 2.2em 0 .7em; font-size: clamp(1.65rem, 3vw, 2.35rem); }
.template-article-reading-column h3 { margin: 1.9em 0 .65em; font-size: clamp(1.25rem, 2vw, 1.55rem); }
.template-article-reading-column blockquote,
.template-article-reading-column q { font-family: var(--fs-font-editorial, Georgia, serif); }
.template-article-reading-column blockquote { margin: 2rem 0; padding: 1.25rem 1.5rem; background: var(--ts-surface); border-left: 4px solid var(--ts-positive); }
.template-article-reading-column :where(img, video, iframe) { max-width: 100%; height: auto; }
.template-article-reading-column :where(table, pre) { max-width: 100%; overflow-x: auto; }

@media (min-width: 640px) {
  .template-system-directory__heading { grid-template-columns: minmax(0, 1.15fr) minmax(16rem, .85fr); align-items: end; }
  .template-system-directory__heading .template-system-label { grid-column: 1 / -1; }
  .template-guide-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .template-system .article-card--lead { grid-column: 1 / -1; }
  .template-system .article-card--lead.article-card--has-image { grid-template-columns: minmax(0, 1.15fr) minmax(18rem, .85fr); }
  .template-system .article-card--lead .article-card__image { aspect-ratio: auto; min-height: 22rem; }
  .template-system .article-card--lead .article-card__body { padding: clamp(1.5rem, 3vw, 2.25rem); }
  .template-system .article-card--lead h2 { font-size: clamp(1.75rem, 3.5vw, 2.65rem); }
}

@media (min-width: 760px) {
  .template-system-hero--product .template-system-hero__layout { grid-template-columns: minmax(0, 1.45fr) minmax(18rem, .55fr); align-items: end; }
  .platform-utility__heading { grid-template-columns: minmax(0, 1fr) minmax(18rem, .7fr); align-items: end; }
}

@media (min-width: 1040px) {
  .template-guide-grid--archive { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .template-guide-grid--archive .article-card--lead { grid-column: span 2; grid-row: span 2; }
  .template-guide-grid--archive .article-card--lead.article-card--has-image { grid-template-columns: 1fr; grid-template-rows: minmax(20rem, 1.25fr) auto; }
}

@media (max-width: 760px) {
  .product-workspace [data-fs-app="reality-gap"]{grid-template-columns:1fr}.product-workspace [data-fs-app="reality-gap"] .fs-v2__results-head,.product-workspace [data-fs-app="reality-gap"] [data-results]{grid-column:1}
}

@media (max-width: 360px) {
  .template-system-hero,
  .template-system-directory__header,
  .template-system-archive__header,
  .template-article-hero { padding-block: 1.75rem; }
  .template-system-hero h1,
  .template-system-directory h1,
  .template-system-archive__heading h1 { font-size: 2rem; }
  .template-article-hero h1 { font-size: 2.1rem; }
  .platform-utility-row { grid-template-columns: minmax(0, 1fr); padding-block: .85rem; }
  .platform-utility-row--has-mark { grid-template-columns: 3.25rem minmax(0, 1fr); }
  .platform-utility-row__logo { width: 3rem; }
  .platform-utility-row__action { grid-column: 1; justify-self: start; }
  .platform-utility-row--has-mark .platform-utility-row__action { grid-column: 2; }
  .template-article-hero__meta { display: grid; gap: .4rem; }
  .template-article-hero__meta span + span { padding-left: 0; border-left: 0; }
}

@media (max-width: 320px) {
  .template-system .shell { padding-inline: 1rem; }
  .template-system .article-card__body { padding: 1rem; }
  .platform-utility-row { gap: .65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .template-system *,
  .template-system *::before,
  .template-system *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
  .template-system .article-card:hover .article-card__image img { transform: none; }
}
