/* ============================================================
   KODENZO CASE STUDIES — component stylesheet
   Enqueued on the Case Studies hub (is_page('case-studies')) and every
   single case study (is_singular('kodenzo_case_study')). Reuses
   .kodenzo-hero, .kodenzo-btn, .kodenzo-section-head, .kodenzo-case-
   studies/.kodenzo-cs-card (Featured, exactly 3 items), .kodenzo-chip-
   grid, .kodenzo-process__track, .kodenzo-final-cta, .kodenzo-hero-
   trust directly from style.css with zero changes. This file only
   covers what's genuinely new: the filterable Case Study Grid (which
   needs a flex-wrap layout, not the fixed 3-column .kodenzo-case-
   studies__grid — see the Products page lopsided-row lesson), the
   filter button bar, the testimonial block, and the single case study
   detail page's prose/list components.
   ============================================================ */

.kodenzo-page-section { padding: 120px 0; }
.kodenzo-page-section.is-light { background: var(--kz-light); }
.kodenzo-page-section.is-dark { background: var(--kz-navy); color: #fff; }
@media (max-width: 960px) { .kodenzo-page-section { padding: 80px 0; } }

/* ---------- Case filter bar ---------- */
.kodenzo-case-filter-bar { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 40px; }
.kodenzo-case-filter {
  font-size: 13px; font-weight: 600; color: var(--kz-muted); background: #fff; border: 1.5px solid var(--kz-border);
  border-radius: 999px; padding: 9px 20px; cursor: pointer; transition: border-color .2s ease, color .2s ease, background .2s ease;
}
.kodenzo-case-filter:hover { border-color: var(--kz-blue); color: var(--kz-blue); }
.kodenzo-case-filter.is-active { background: var(--kz-blue); border-color: var(--kz-blue); color: #fff; }
/* This page's own filter buttons had no explicit focus style — every
   other genuinely new interactive control on this page (cards, links)
   inherits a global rule from style.css, but this one didn't (SEO
   audit Finding 6.2). */
.kodenzo-case-filter:focus-visible { outline: 3px solid var(--kz-blue); outline-offset: 2px; }

/* ---------- Case Study Grid (filterable, flex-wrap centers any
   count — deliberately not a fixed grid-template-columns, per the
   Products page lopsided-row lesson) ---------- */
.kodenzo-case-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.kodenzo-case-tile {
  background: #fff; border: 1.5px solid var(--kz-border); border-radius: 18px; padding: 28px;
  display: flex; flex-direction: column; gap: 8px; flex: 1 1 300px; max-width: 360px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.kodenzo-case-tile:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(11,71,124,.08); }
.kodenzo-case-tile.is-hidden { display: none; }
.kodenzo-case-tile__industry { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--kz-blue); }
.kodenzo-case-tile__title { font-family: var(--kz-font-head); font-size: 18px; color: var(--kz-navy); }
.kodenzo-case-tile__desc { font-size: 13.5px; line-height: 1.55; color: var(--kz-muted); flex: 1; }
.kodenzo-case-tile__tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0; }
.kodenzo-case-tile__tag {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .3px; color: var(--kz-muted);
  background: var(--kz-light); border-radius: 999px; padding: 4px 10px;
}
.kodenzo-case-tile__link { font-size: 13px; font-weight: 600; color: var(--kz-blue); margin-top: 4px; }
/* Hover darkens blue rather than flipping to coral — standardized on
   blue for card accents/CTAs everywhere (dev feedback A4). */
.kodenzo-case-tile__link:hover { color: #08355E; }
.kodenzo-case-grid__empty { text-align: center; color: var(--kz-muted); padding: 40px; display: none; }
.kodenzo-case-grid__empty.is-visible { display: block; }

/* ---------- Testimonial (single verified quote, not a slider) ---------- */
.kodenzo-testimonial { max-width: 720px; margin: 0 auto; text-align: center; }
.kodenzo-testimonial__quote { font-family: var(--kz-font-head); font-size: 24px; line-height: 1.5; color: var(--kz-navy); margin-bottom: 20px; }
.kodenzo-testimonial__source { font-size: 13.5px; color: var(--kz-muted); font-style: normal; }
.kodenzo-testimonial__source cite { font-style: normal; color: var(--kz-blue); font-weight: 600; }

/* ---------- Single case study detail: prose blocks + lists ---------- */
.kodenzo-case-detail__block { max-width: 720px; margin: 0 auto; }
.kodenzo-case-detail__text { font-size: 16px; line-height: 1.7; color: var(--kz-muted); margin-top: 4px; }
.kodenzo-case-detail__columns { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; max-width: 960px; margin: 0 auto; }
.kodenzo-case-detail__list { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.kodenzo-case-detail__list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--kz-muted); }
.kodenzo-case-detail__list li svg { color: var(--kz-blue); flex-shrink: 0; margin-top: 2px; }
.kodenzo-case-detail__list--accent li svg { color: var(--kz-coral); }
@media (max-width: 780px) { .kodenzo-case-detail__columns { grid-template-columns: 1fr; gap: 36px; } }

/* ============================================================
   SINGLE CASE STUDY — "premium engineering case study" redesign
   (round 2, 2026-07-28). Added per Lata's review: Project Summary
   Card, Before/After Challenge contrast, hub-and-spoke Architecture
   diagram, Implementation visual, Impact Chain, Related Solutions
   cards. Reuses design tokens from style.css only — no new colors.
   ============================================================ */

/* ---------- Project Summary Card ---------- */
.kodenzo-summary-card {
  background: #fff; border: 1px solid var(--kz-border); border-radius: var(--kz-radius-card);
  padding: 40px 48px; max-width: 960px; margin: 0 auto; box-shadow: 0 20px 50px rgba(11,71,124,.06);
}
.kodenzo-summary-card__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--kz-coral); margin-bottom: 22px; }
.kodenzo-summary-card__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }
.kodenzo-summary-card__field-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: var(--kz-hint); margin-bottom: 8px; }
.kodenzo-summary-card__field-value { font-family: var(--kz-font-head); font-size: 17px; color: var(--kz-navy); line-height: 1.3; }
@media (max-width: 900px) { .kodenzo-summary-card__grid { grid-template-columns: 1fr 1fr; row-gap: 24px; } }
@media (max-width: 560px) {
  .kodenzo-summary-card { padding: 32px 24px; }
  .kodenzo-summary-card__grid { grid-template-columns: 1fr; }
}

/* ---------- Challenge Before/After ---------- */
.kodenzo-case-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; max-width: 960px; margin: 0 auto; }
.kodenzo-case-compare__col { background: #fff; border: 1.5px solid var(--kz-border); border-radius: 18px; padding: 32px; }
.kodenzo-case-compare__col--before { border-color: rgba(255,107,90,.28); background: rgba(255,107,90,.03); }
.kodenzo-case-compare__col--after { border-color: rgba(11,71,124,.2); background: rgba(11,71,124,.03); }
.kodenzo-case-compare__title { font-family: var(--kz-font-head); font-size: 14px; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 18px; }
.kodenzo-case-compare__col--before .kodenzo-case-compare__title { color: var(--kz-coral); }
.kodenzo-case-compare__col--after .kodenzo-case-compare__title { color: var(--kz-blue); }
.kodenzo-case-compare__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.kodenzo-case-compare__list li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.5; color: var(--kz-muted); }
.kodenzo-case-compare__list li svg { flex-shrink: 0; margin-top: 2px; }
.kodenzo-case-compare__col--before .kodenzo-case-compare__list li svg { color: var(--kz-coral); }
.kodenzo-case-compare__col--after .kodenzo-case-compare__list li svg { color: var(--kz-blue); }
@media (max-width: 780px) { .kodenzo-case-compare { grid-template-columns: 1fr; } }

/* ---------- Hub-and-spoke architecture diagram (data-driven, no
   hardcoded diagram — see kodenzo_render_case_diagram()) ---------- */
.kodenzo-diagram { width: 100%; text-align: center; }
.kodenzo-diagram__hub {
  display: inline-block; background: var(--kz-blue); color: #fff; font-family: var(--kz-font-head);
  font-size: 15px; padding: 14px 30px; border-radius: 12px; position: relative; z-index: 1;
}
.kodenzo-diagram__connector { width: 2px; height: 32px; background: var(--kz-border); margin: 0 auto; }
.kodenzo-diagram__spokes { display: flex; flex-wrap: wrap; justify-content: center; gap: 0; border-top: 2px solid var(--kz-border); padding-top: 24px; }
.kodenzo-diagram__spoke {
  background: #fff; border: 1.5px solid var(--kz-border); border-radius: 12px; padding: 12px 20px;
  font-size: 13px; color: var(--kz-navy); margin: 0 12px 12px; position: relative;
}
.kodenzo-diagram__spoke::before { content: ''; position: absolute; top: -24px; left: 50%; width: 2px; height: 24px; background: var(--kz-border); }

/* Compact variant used inside the hero's diagram stage. */
.kodenzo-diagram--compact .kodenzo-diagram__hub { font-size: 12px; padding: 10px 18px; }
.kodenzo-diagram--compact .kodenzo-diagram__connector { height: 20px; }
.kodenzo-diagram--compact .kodenzo-diagram__spokes { padding-top: 16px; }
.kodenzo-diagram--compact .kodenzo-diagram__spoke { font-size: 11px; padding: 8px 14px; margin: 0 8px 8px; }
.kodenzo-diagram--compact .kodenzo-diagram__spoke::before { height: 16px; top: -16px; }

/* ---------- Hero diagram/mockup stage + implementation visual —
   both size the reused .kodenzo-mock (height:100%) and the diagram
   consistently regardless of which one a given case study renders. ---------- */
.kodenzo-diagram-stage {
  height: 260px; max-width: 760px; margin: 48px auto 0; padding: 28px; display: flex;
  align-items: center; justify-content: center; border-radius: 20px;
  background: rgba(255,255,255,.03); border: 1px solid rgba(255,255,255,.08);
}
@media (max-width: 640px) { .kodenzo-diagram-stage { height: 220px; padding: 20px; margin-top: 32px; } }

.kodenzo-case-implementation { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.kodenzo-case-implementation__visual { height: 280px; border-radius: 20px; padding: 28px; box-shadow: 0 24px 48px rgba(0,0,0,.12); }
@media (max-width: 900px) {
  .kodenzo-case-implementation { grid-template-columns: 1fr; gap: 32px; }
  .kodenzo-case-implementation__visual { height: 240px; }
}

/* Technical Highlights — flex-wrap override so a 3-item
   key_features array (the common case) never leaves an empty slot
   in the fixed 4-column .kodenzo-differentiators__grid. */
.kodenzo-differentiators__grid--flex { display: flex; flex-wrap: wrap; justify-content: center; }
.kodenzo-differentiators__grid--flex .kodenzo-diff-card { flex: 1 1 260px; max-width: 320px; }

/* ---------- Results: Impact Chain (verified numbers only) ---------- */
.kodenzo-impact-chain { display: flex; flex-direction: column; align-items: center; gap: 2px; max-width: 640px; margin: 0 auto; }
.kodenzo-impact-chain__item {
  width: 100%; background: #fff; border: 1.5px solid var(--kz-border); border-radius: 14px; padding: 18px 28px;
  font-family: var(--kz-font-head); font-size: 16px; color: var(--kz-navy); text-align: center;
  box-shadow: 0 10px 24px rgba(11,71,124,.05);
}
.kodenzo-impact-chain__arrow { color: var(--kz-coral); font-size: 20px; line-height: 1.4; }

/* ---------- Related Solutions cards ---------- */
.kodenzo-related-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; }
.kodenzo-related-card {
  flex: 1 1 300px; max-width: 340px; background: #fff; border: 1px solid var(--kz-border); border-radius: 18px;
  padding: 28px; display: flex; flex-direction: column; gap: 10px; transition: transform .25s ease, box-shadow .25s ease;
}
.kodenzo-related-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(11,71,124,.08); }
/* Dark gray, not coral — tag/badge consistency (dev feedback A3). */
.kodenzo-related-card__badge {
  align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
  color: var(--kz-muted); background: var(--kz-light); border: 1px solid var(--kz-border); border-radius: 999px; padding: 4px 12px;
}
.kodenzo-related-card__title { font-family: var(--kz-font-head); font-size: 18px; color: var(--kz-navy); }
.kodenzo-related-card__desc { font-size: 13.5px; line-height: 1.55; color: var(--kz-muted); flex: 1; }
.kodenzo-related-card__link { font-size: 13px; font-weight: 600; color: var(--kz-blue); }
.kodenzo-related-card__link:hover { color: var(--kz-blue-2); }

/* ============================================================
   HUB ROUND 2 (2026-07-28, 9.4/10 review): Featured Card visual +
   snapshot + impact line, grid-tile impact line, the Deep Dive
   section, and Engineering Insights cards.
   ============================================================ */

/* ---------- Featured card additions (.kodenzo-cs-card itself stays
   exactly as style.css defines it — these are new child elements the
   homepage's own "Proof, Not Promises" usage of the same card doesn't
   render, so nothing changes there). ---------- */
.kodenzo-cs-card__visual {
  height: 130px; border-radius: 10px; background: var(--kz-navy); padding: 14px; margin-bottom: 16px;
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
/* margin-top: auto (2026-08-26) — this box just followed the case-
   fields list in normal flow, so it landed at a different height on
   every card depending on how many fields that study had. Auto-margin
   pushes it (and the button right after it) down together as a unit,
   so the box and the button both line up across a row instead of just
   the button. See .kodenzo-cs-card__impact + .kodenzo-cs-card__link
   below for the fixed small gap between the two once they're grouped. */
.kodenzo-cs-card__impact {
  font-size: 13px; font-weight: 600; color: #fff; background: rgba(255,107,90,.1);
  border-left: 3px solid var(--kz-coral); padding: 8px 12px; margin: auto 0 16px; line-height: 1.4;
}
/* Fixed gap when the impact box directly precedes the CTA — overrides
   .kodenzo-cs-card__link's own margin-top:auto (style.css) so the two
   don't fight over the same flexible space; the auto-margin above on
   .kodenzo-cs-card__impact already did that job. */
.kodenzo-cs-card__impact + .kodenzo-cs-card__link { margin-top: 0; }
/* Only rendered when a study has a real impact_line, so it's absent on
   some cards in a row — no negative margin, same rhythm as a tag, so
   its presence/absence reads as a small detail rather than a full
   extra block breaking row spacing (dev feedback, "Browse by
   Category" grid). .kodenzo-case-tile__desc's flex:1 already
   equalizes each card's overall height within the row. */
.kodenzo-case-tile__impact { font-size: 12px; font-weight: 600; color: var(--kz-blue); line-height: 1.4; margin: 0 0 4px; }

/* ---------- Deep Dive (Challenge / Architecture / Trade-offs / Outcome) ---------- */
.kodenzo-deep-dive { display: grid; grid-template-columns: 1fr 1.4fr; gap: 56px; align-items: start; max-width: 1080px; margin: 0 auto; }
.kodenzo-deep-dive__visual {
  position: sticky; top: 120px; height: 320px; border-radius: 20px; background: var(--kz-navy); padding: 28px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 24px 48px rgba(0,0,0,.12);
}
.kodenzo-deep-dive__body { min-width: 0; }
.kodenzo-deep-dive__block { margin-bottom: 28px; }
.kodenzo-deep-dive__block:last-of-type { margin-bottom: 24px; }
.kodenzo-deep-dive__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--kz-coral); margin-bottom: 8px; }
.kodenzo-deep-dive__text { font-size: 15px; line-height: 1.65; color: var(--kz-muted); }
@media (max-width: 900px) {
  .kodenzo-deep-dive { grid-template-columns: 1fr; gap: 32px; }
  .kodenzo-deep-dive__visual { position: static; height: 220px; }
}

/* ---------- Engineering Insights — exactly 3 cards, 3-column grid
   (safe: matches the lesson from every other fixed-grid bug on this
   site — only use a fixed column count when the item count matches it
   exactly). ---------- */
.kodenzo-insights__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.kodenzo-insight-card {
  background: #fff; border: 1px solid var(--kz-border); border-radius: 18px; padding: 32px;
  display: flex; flex-direction: column; gap: 12px; transition: transform .25s ease, box-shadow .25s ease;
}
.kodenzo-insight-card:hover { transform: translateY(-4px); box-shadow: 0 20px 40px rgba(11,71,124,.08); }
.kodenzo-insight-card__title { font-family: var(--kz-font-head); font-size: 18px; color: var(--kz-navy); }
.kodenzo-insight-card__desc { font-size: 14px; line-height: 1.6; color: var(--kz-muted); flex: 1; }
.kodenzo-insight-card__link { font-size: 13px; font-weight: 600; color: var(--kz-blue); }
.kodenzo-insight-card__link:hover { color: var(--kz-blue-2); }
/* Straight to 1 column below the 3-col breakpoint — a 2-col
   intermediate would leave the 3rd card alone on its own row, the
   same lopsided-grid bug class fixed elsewhere on this site. */
@media (max-width: 860px) { .kodenzo-insights__grid { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .kodenzo-case-studies-page *, .kodenzo-case-detail * { animation: none !important; transition: none !important; }
}
