/* Long case-study pages (projects/airline-social-listening*.html), on top of styles.css */

.page-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
}
.page-top .back { margin-bottom: 0; }
.lang-switch {
  font-weight: 600;
  text-underline-offset: 4px;
}

.embed img,
.cs-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* Key numbers under the hero image */
.stats {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stats li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
}
.stats strong {
  display: block;
  font-family: var(--font-display);
  font-size: var(--step-3);
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stats span {
  display: block;
  margin-top: 6px;
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.4;
}

/* Text runs at reading width; figures use the full page width */
.cs-section { margin-top: clamp(48px, 6vw, 72px); }
.cs-section > h2 { font-size: var(--step-2); max-width: 46em; }
.cs-section > p,
.cs-section > ul,
.cs-section > ol,
.cs-section > table,
.cs-step > h3,
.cs-step > p,
.cs-step > table { max-width: 46em; }
.cs-section > p { margin-top: 16px; }
.cs-section > ul,
.cs-section > ol { margin: 16px 0 0; padding-left: 1.4em; }
.cs-section li + li { margin-top: 8px; }

.cs-step { margin-top: 36px; }
.cs-step > h3 { font-size: var(--step-1); }
.cs-step > h3 .num {
  display: inline-block;
  min-width: 1.6em;
  color: var(--muted);
}
.cs-step > p { margin-top: 10px; }

.cs-figure {
  margin: 24px 0 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}
.cs-figure.narrow { max-width: 820px; }
.cs-figure figcaption {
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
  color: var(--muted);
}

.cs-table {
  margin-top: 16px;
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}
.cs-table th,
.cs-table td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.cs-table th { font-weight: 600; color: var(--muted); }
.cs-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* DAX code: long lines scroll inside the box, never the page */
.cs-code {
  max-width: 46rem;
  margin: 14px 0 0;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow-x: auto;
  font: 0.875rem/1.55 Consolas, "Cascadia Mono", "Courier New", monospace;
  color: var(--ink);
}
.cs-code code { font: inherit; white-space: pre; }

/* Thai titles run longer in characters than the English ones the 20ch limit was set for */
:lang(th) .project-page h1 { max-width: 30ch; }

@media (max-width: 900px) {
  .stats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .stats strong { font-size: var(--step-2); }
}
