/* ============================================
   CASE STUDY — BASE
   ============================================ */

.cs-main {
  padding-bottom: 0;
}

/* ============================================
   BACK LINK
   ============================================ */

.cs-back {
  padding-top: 24px;
  padding-bottom: 0;
}

/* ============================================
   CASE STUDY HEADER
   ============================================ */

.cs-header {
  padding-top: 36px;
  padding-bottom: 16px;
}

.cs-eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: 20px;
}

.cs-title {
  font-family: var(--font-serif);
  font-size: clamp(36px, 4.5vw, 56px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}

.cs-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.7;
  max-width: 580px;
  margin-bottom: 24px;
}

.cs-header-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* META ROW — below hero image */
.cs-meta-row {
  padding-top: 0;
  padding-bottom: 0;
}

.cs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 24px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cs-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 120px;
  padding-right: 24px;
}

.cs-meta-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-light);
}

.cs-meta-value {
  font-size: 14px;
  font-weight: 400;
  color: var(--text);
}

/* ============================================
   OVERVIEW / STATS
   ============================================ */

.cs-overview {
  padding-top: 0;
  padding-bottom: 72px;
}

.cs-overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 32px 0;
  gap: 0;
}

.cs-stat {
  padding: 0 32px 0 0;
  border-right: 1px solid var(--border);
}

.cs-stat:first-child {
  padding-left: 0;
}

.cs-stat:last-child {
  padding-right: 0;
  border-right: none;
}

.cs-stat + .cs-stat {
  padding-left: 32px;
}

.cs-stat-number {
  font-family: var(--font-serif);
  font-size: clamp(28px, 3.5vw, 40px);
  font-weight: 400;
  color: var(--text);
  line-height: 1.1;
  margin-bottom: 8px;
}

.cs-stat-label {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   HERO IMAGE — contained
   ============================================ */

.cs-image-full {
  margin-top: 16px;
  margin-bottom: 32px;
}

.cs-image-placeholder {
  width: 100%;
  height: 480px;
  background: linear-gradient(135deg, #dde2e9 0%, #c8cdd6 100%);
  display: block;
  border-radius: var(--radius-lg);
}

.cs-image-placeholder--tall {
  height: 560px;
}

.cs-hero-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  object-fit: cover;
}

.cs-image-placeholder--short {
  height: 320px;
  border-radius: var(--radius-lg);
}

/* ============================================
   BODY — SINGLE COLUMN
   ============================================ */

.cs-body {
  padding-top: 72px;
  padding-bottom: 72px;
  max-width: 720px;
  margin-inline: auto;
}

.cs-section {
  margin-bottom: 48px;
}

.cs-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: 12px;
}

.cs-section-heading {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--text);
  margin-bottom: 20px;
}

.cs-text {
  font-size: 16px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 16px;
}

.cs-text:last-child {
  margin-bottom: 0;
}

.cs-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 64px 0;
}

/* ============================================
   ICON GRID
   ============================================ */

.cs-icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
  margin-bottom: 48px;
}

.cs-icon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 16px;
  border-right: 1px solid var(--border);
  color: var(--text);
  transition: background 0.15s;
}

.cs-icon-item:last-child {
  border-right: none;
}

.cs-icon-item:hover {
  background: var(--bg-alt);
}

.cs-icon-item span {
  font-size: 11px;
  color: var(--text-light);
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* ============================================
   PULL QUOTE
   ============================================ */

.cs-pullquote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.5;
  color: var(--text);
  border-left: 3px solid var(--text-accent);
  padding-left: 24px;
  margin: 48px 0;
}

/* ============================================
   IMAGE BLOCK
   ============================================ */

.cs-image-block {
  margin: 40px 0 48px;
}

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

/* ============================================
   TOKEN TABLE
   ============================================ */

.cs-table-block {
  margin: 40px 0 48px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
}

.cs-table {
  width: 100%;
}

.cs-table-header,
.cs-table-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.6fr;
  padding: 12px 20px;
  gap: 16px;
  align-items: center;
}

.cs-table-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-light);
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}

.cs-table-row {
  font-size: 13px;
  border-top: 1px solid var(--border);
}

.cs-table-row:first-of-type {
  border-top: none;
}

.cs-token-name {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text-accent);
  font-weight: 600;
}

.cs-token-value {
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: var(--text);
}

.cs-token-usage {
  color: var(--text-muted);
}

/* ============================================
   COLOR PALETTE
   ============================================ */

.cs-palette-section {
  padding: 72px 0;
  background: var(--bg);
}

.cs-palette-grid {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  margin-top: 0;
}

.cs-swatch {
  aspect-ratio: 1 / 1;
  transition: transform 0.15s;
}

.cs-swatch:hover {
  transform: scale(1.08);
  z-index: 1;
  position: relative;
}

/* ============================================
   COMPONENT TAXONOMY
   ============================================ */

.cs-taxonomy {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 24px 0;
  margin-bottom: 40px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.cs-taxon {
  font-family: var(--font-serif);
  font-size: clamp(16px, 2.2vw, 22px);
  font-weight: 400;
  padding: 2px 0;
}

.cs-taxon-sep {
  color: var(--text-light);
  font-size: 18px;
  padding: 0 4px;
}

.cs-taxon--component { color: #C4622D; }
.cs-taxon--variant   { color: #a84f22; }
.cs-taxon--action    { color: #0c8280; }
.cs-taxon--size      { color: #16a34a; }
.cs-taxon--type      { color: #ca8a04; }
.cs-taxon--state     { color: #e11d48; }

/* ============================================
   CHECKLIST
   ============================================ */

.cs-checklist {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 48px;
}

.cs-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.cs-checklist-item:last-child {
  border-bottom: none;
}

.cs-check {
  font-size: 14px;
  font-weight: 600;
  color: var(--status-green);
  flex-shrink: 0;
  margin-top: 2px;
  width: 20px;
}

.cs-checklist-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
}

.cs-checklist-desc {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================
   LEARNINGS
   ============================================ */

.cs-learnings {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-card);
  margin-bottom: 48px;
}

.cs-learning-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
}

.cs-learning-item:last-child {
  border-bottom: none;
}

.cs-learning-num {
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--text-accent);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 3px;
  min-width: 24px;
}

.cs-learning-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  font-family: var(--font-sans);
}

.cs-learning-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ============================================
   AT A GLANCE GRID
   ============================================ */

.cs-glance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 48px;
}

.cs-glance-item {
  padding: 28px 28px 32px;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}

.cs-glance-item:last-child {
  border-right: none;
}

.cs-glance-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-accent);
  margin-bottom: 10px;
}

.cs-glance-text {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

/* ============================================
   CALLOUT
   ============================================ */

.cs-callout {
  background: var(--bg-card);
  border-left: 3px solid var(--text-accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
  margin-bottom: 40px;
}

.cs-callout-text {
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
  margin: 0;
  font-style: italic;
}

/* ============================================
   BEFORE / AFTER COMPARE
   ============================================ */

.cs-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 48px;
}

.cs-compare-col {
  padding: 28px 28px 32px;
  background: var(--bg-card);
}

.cs-compare-col:first-child {
  border-right: 1px solid var(--border);
}

.cs-compare-label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.cs-compare-label--before {
  color: var(--text-muted);
}

.cs-compare-label--after {
  color: var(--text-accent);
}

.cs-compare-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cs-compare-list li {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
  padding-left: 16px;
  position: relative;
}

.cs-compare-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border);
}

.cs-compare-col:last-child .cs-compare-list li {
  color: var(--text);
}

.cs-compare-col:last-child .cs-compare-list li::before {
  background: var(--text-accent);
}

/* ============================================
   ORGANIZER NEEDS GRID
   ============================================ */

.cs-needs-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 48px;
}

.cs-need-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
}

.cs-need-icon {
  color: var(--text-accent);
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.cs-need-text {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin: 0;
  line-height: 1.4;
}

/* ============================================
   RESPONSIVE — TABLET
   ============================================ */

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

  .cs-glance-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .cs-glance-item:last-child {
    border-bottom: none;
  }

  .cs-compare {
    grid-template-columns: 1fr;
  }

  .cs-compare-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .cs-needs-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .cs-icon-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cs-icon-item:nth-child(4) {
    border-right: none;
  }

  .cs-icon-item:nth-child(5),
  .cs-icon-item:nth-child(6),
  .cs-icon-item:nth-child(7),
  .cs-icon-item:nth-child(8) {
    border-top: 1px solid var(--border);
  }

  .cs-overview-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .cs-stat {
    padding: 0 !important;
    border-right: none;
  }

  .cs-stat:nth-child(odd) {
    border-right: 1px solid var(--border);
    padding-right: 24px !important;
  }

  .cs-stat:nth-child(even) {
    padding-left: 24px !important;
  }

  .cs-palette-grid {
    grid-template-columns: repeat(9, 1fr);
  }

  .cs-taxonomy {
    gap: 6px;
  }
}

/* ============================================
   RESPONSIVE — MOBILE
   ============================================ */

@media (max-width: 600px) {
  .cs-icon-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .cs-header {
    padding-top: 48px;
    padding-bottom: 40px;
  }

  .cs-meta {
    gap: 20px;
  }

  .cs-overview-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px 0;
    gap: 20px;
  }

  .cs-stat:nth-child(odd) {
    padding-right: 16px !important;
  }

  .cs-stat:nth-child(even) {
    padding-left: 16px !important;
  }

  .cs-image-placeholder {
    height: 240px;
  }

  .cs-image-placeholder--tall {
    height: 280px;
  }

  .cs-image-placeholder--short {
    height: 200px;
  }

  .cs-body {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .cs-palette-grid {
    grid-template-columns: repeat(9, 1fr);
  }

  .cs-swatch {
    aspect-ratio: 1 / 1.2;
  }

  .cs-table-header,
  .cs-table-row {
    grid-template-columns: 1fr 1fr;
    padding: 10px 16px;
  }

  .cs-table-header span:last-child,
  .cs-token-usage {
    display: none;
  }

  .cs-taxonomy {
    gap: 4px;
  }

  .cs-taxon {
    font-size: 15px;
  }

  .cs-pullquote {
    font-size: 18px;
  }

  .cs-glance-grid {
    grid-template-columns: 1fr;
  }

  .cs-glance-item {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .cs-glance-item:last-child {
    border-bottom: none;
  }

  .cs-compare {
    grid-template-columns: 1fr;
  }

  .cs-compare-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .cs-needs-grid {
    grid-template-columns: 1fr;
  }
}
