/* ==========================================================================
   work.css — Trinity DEV v2
   Case-study archive (/darbi/) and case-study detail pages.
   Built on the tokens in styles.css. Prefixed .wk- to avoid collisions.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Archive: featured case study
   -------------------------------------------------------------------------- */
.wk-feature {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0;
  border-radius: var(--space--space-8);
  overflow: hidden;
  background: var(--color--gray-bg);
  color: inherit;
  text-decoration: none;
  position: relative;
  isolation: isolate;
}
.section--soft .wk-feature { background: var(--color--white-colour); }

.wk-feature-media {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  background: var(--color--dark-blue);
}
.wk-feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.6s var(--reveal-ease);
}
.wk-feature:hover .wk-feature-media img { transform: scale(1.03); }

.wk-feature-body {
  padding: var(--space--space-50);
  display: flex;
  flex-direction: column;
  gap: var(--space--space-24);
  justify-content: center;
}
.wk-feature-body h3 { margin: 0; }
.wk-feature-body > p { margin: 0; color: var(--color--secondary-blue); max-width: 46ch; }

.wk-client {
  display: flex;
  align-items: center;
  gap: var(--space--space-12);
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color--secondary-blue);
}
.wk-client i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--color--accent);
  flex: none;
}

/* the numbers strip — concrete, checkable facts, not vague adjectives */
.wk-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space--space-30);
  padding-top: var(--space--space-24);
  border-top: 1px solid #e6e3ee;
}
.wk-metrics div { min-width: 0; }
.wk-metrics b {
  display: block;
  font-size: var(--typography--h-04-size);
  line-height: var(--typography--h-04-height);
  letter-spacing: var(--typography--h-04-space);
  font-weight: var(--weight--weight-500);
  font-variant-numeric: tabular-nums;
}
.wk-metrics span {
  display: block;
  margin-top: 4px;
  max-width: 16ch;
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  color: var(--color--secondary-blue);
}

.wk-tags { display: flex; flex-wrap: wrap; gap: var(--space--space-8); margin: 0; padding: 0; list-style: none; }
.wk-tags li {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--color--accent-soft);
  color: var(--color--accent);
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  font-weight: var(--weight--weight-500);
}

.wk-more {
  display: inline-flex;
  align-items: center;
  gap: var(--space--space-8);
  color: var(--color--accent);
  font-weight: var(--weight--weight-500);
  font-size: var(--typography--p-02-size);
}

/* --------------------------------------------------------------------------
   2. Archive: logo wall + empty-state note
   -------------------------------------------------------------------------- */
/* The client logos are white-on-transparent PNGs (they live on the homepage's
   dark hero), so this band has to be dark or they render invisible. */
.wk-logos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--space--space-8);
  overflow: hidden;
  padding: 1px;
}
.wk-logos div {
  background: var(--color--dark-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space--space-30) var(--space--space-20);
  min-height: 116px;
}
.wk-logos img {
  max-width: 100%;
  max-height: 40px;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.6;
  transition: opacity 0.3s var(--reveal-ease);
}
.wk-logos div:hover img { opacity: 1; }

.wk-note {
  background: var(--color--accent-soft);
  border-radius: var(--space--space-8);
  padding: var(--space--space-30);
  max-width: 68ch;
}
.wk-note p { margin: 0; color: var(--color--dark-blue); }
.wk-note p + p { margin-top: var(--space--space-12); color: var(--color--secondary-blue); }

/* --------------------------------------------------------------------------
   3. Detail: hero + facts
   -------------------------------------------------------------------------- */
.wk-hero { background: var(--color--canvas-soft); padding: 148px 0 var(--space--space-60); }
.wk-hero h1 { margin: var(--space--space-16) 0 0; max-width: 18ch; }
.wk-hero .wk-lead {
  max-width: 60ch;
  margin: var(--space--space-24) 0 0;
  color: var(--color--secondary-blue);
}
.wk-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space--space-16);
  align-items: center;
  margin-top: var(--space--space-40);
}

.wk-shot {
  margin: 0;                      /* UA default is `figure { margin: 1em 40px }` */
  border-radius: var(--space--space-8);
  overflow: hidden;
  border: 1px solid #e6e3ee;
  background: var(--color--white-colour);
}
.wk-shot img { width: 100%; height: auto; }
.wk-shot figcaption {
  padding: var(--space--space-16) var(--space--space-20);
  border-top: 1px solid #e6e3ee;
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  color: var(--color--secondary-blue);
}

.wk-shot figcaption b {
  color: var(--color--dark-blue);
  font-weight: var(--weight--weight-500);
}

.wk-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  background: #e6e3ee;
  border: 1px solid #e6e3ee;
  border-radius: var(--space--space-8);
  overflow: hidden;
}
.wk-facts div { background: var(--color--white-colour); padding: var(--space--space-24); }
.section--soft .wk-facts div { background: var(--color--canvas-soft); }
.wk-facts dt {
  margin: 0 0 var(--space--space-8);
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--color--secondary-blue);
  font-weight: var(--weight--weight-500);
}
.wk-facts dd {
  margin: 0;
  font-size: var(--typography--p-02-size);
  line-height: var(--typography--p-02-height);
  font-weight: var(--weight--weight-500);
}

/* --------------------------------------------------------------------------
   4. Before / after comparison slider
   The control is a real <input type="range"> so it works with a keyboard and
   announces itself to assistive tech; the visuals are painted on top.
   -------------------------------------------------------------------------- */
.wk-cmp {
  --pos: 50%;
  position: relative;
  border-radius: var(--space--space-8);
  overflow: hidden;
  border: 1px solid #e6e3ee;
  background: var(--color--dark-blue);
  line-height: 0;
  touch-action: pan-y;
}
.wk-cmp > img {
  display: block;
  width: 100%;
  height: auto;
}
.wk-cmp > img.is-after {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  clip-path: inset(0 0 0 var(--pos));
}

.wk-cmp-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  cursor: ew-resize;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  z-index: 3;
}
.wk-cmp-range:focus-visible + .wk-cmp-handle { outline: 3px solid var(--color--accent); outline-offset: 2px; }

.wk-cmp-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 2px;
  background: #fff;
  transform: translateX(-1px);
  pointer-events: none;
  z-index: 2;
  box-shadow: 0 0 0 1px rgba(8, 17, 34, 0.18);
}
.wk-cmp-handle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M9 7l-4 5 4 5M15 7l4 5-4 5' stroke='%236746b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 22px 22px no-repeat;
  box-shadow: 0 6px 20px rgba(8, 17, 34, 0.28);
}

.wk-cmp-tag {
  position: absolute;
  top: var(--space--space-16);
  z-index: 2;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  font-weight: var(--weight--weight-500);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  pointer-events: none;
  backdrop-filter: blur(8px);
}
.wk-cmp-tag.is-before { left: var(--space--space-16); background: rgba(8, 17, 34, 0.72); color: #fff; }
.wk-cmp-tag.is-after { right: var(--space--space-16); background: var(--color--accent); color: #fff; }

.wk-cmp-hint {
  margin: var(--space--space-12) 0 0;
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  color: var(--color--secondary-blue);
  display: flex;
  align-items: center;
  gap: var(--space--space-8);
}

/* side-by-side pair, used where a slider would hide detail */
.wk-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space--space-20); }
.wk-pair.is-narrow { grid-template-columns: repeat(2, minmax(0, 260px)); justify-content: center; }

/* --------------------------------------------------------------------------
   5. Detail: narrative blocks
   -------------------------------------------------------------------------- */
.wk-body > * + * { margin-top: var(--space--space-60); }
.wk-prose p { margin: 0 0 var(--space--space-16); color: var(--color--secondary-blue); }
.wk-prose p:last-child { margin-bottom: 0; }
.wk-prose strong { color: var(--color--dark-blue); font-weight: var(--weight--weight-500); }

.wk-work { display: grid; gap: var(--space--space-16); counter-reset: wk; }
.wk-work article {
  counter-increment: wk;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: var(--space--space-24);
  padding: var(--space--space-30);
  border-radius: var(--space--space-8);
  background: var(--color--gray-bg);
}
.section--soft .wk-work article { background: var(--color--white-colour); }
.wk-work article::before {
  content: counter(wk, decimal-leading-zero);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--color--accent-soft);
  color: var(--color--accent);
  font-weight: var(--weight--weight-500);
  font-variant-numeric: tabular-nums;
}
.wk-work h3 { margin: 0 0 var(--space--space-8); }
.wk-work p { margin: 0; color: var(--color--secondary-blue); }
.wk-work .wk-chip {
  display: inline-block;
  margin-top: var(--space--space-16);
  padding: 6px 12px;
  border-radius: var(--space--space-6);
  background: var(--color--dark-blue);
  color: #fff;
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* outcome list */
.wk-out { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space--space-10); }
.wk-out li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--space--space-12);
  align-items: start;
  padding: var(--space--space-16) var(--space--space-20);
  border-radius: var(--space--space-8);
  background: var(--color--white-colour);
  font-size: var(--typography--p-02-size);
  line-height: var(--typography--p-02-height);
}
.wk-out li::before {
  content: "";
  width: 18px; height: 18px; margin-top: 3px;
  border-radius: 50%;
  background: var(--color--accent-soft) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'%3E%3Cpath d='M2.5 6.2 4.8 8.5 9.5 3.8' stroke='%236746b5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px 12px no-repeat;
}

.wk-quote {
  padding: var(--space--space-50);
  border-radius: var(--space--space-8);
  background: var(--color--dark-blue);
  color: #fff;
}
.wk-quote blockquote {
  margin: 0 0 var(--space--space-30);
  font-size: var(--typography--h-04-size);
  line-height: var(--typography--h-04-height);
  letter-spacing: var(--typography--h-04-space);
  font-weight: var(--weight--weight-500);
  max-width: 24ch;
}
.wk-quote figcaption { color: rgba(255, 255, 255, 0.6); font-size: var(--typography--p-02-size); }
.wk-quote figcaption b { display: block; color: #fff; font-weight: var(--weight--weight-500); }

/* sticky detail sidebar */
.wk-detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space--space-80); align-items: start; }
.wk-aside { position: sticky; top: 104px; display: flex; flex-direction: column; gap: var(--space--space-16); }

/* --------------------------------------------------------------------------
   8. Case-study page rhythm
   The narrative should read as one continuous piece, not a stack of separate
   pages, so the shared 80px section rhythm is tightened here and the inner
   headings drop from pill eyebrows to a lighter rule.
   -------------------------------------------------------------------------- */
.wk-page .wk-hero { padding: 128px 0 var(--space--space-40); }
.wk-page .wk-hero h1 { margin-top: var(--space--space-12); }
.wk-page .wk-hero .wk-lead { margin-top: var(--space--space-16); }
.wk-page .wk-hero-actions { margin-top: var(--space--space-30); }

.wk-page .page-section { padding-top: var(--space--space-50); padding-bottom: var(--space--space-50); }
.wk-page .content-wrapper { gap: var(--space--space-32); }
.wk-page .sv-pillar-head { margin-bottom: var(--space--space-24); }

.wk-detail { gap: var(--space--space-50); }
.wk-body > * + * { margin-top: var(--space--space-50); }

/* lighter section marker than the pill — reads as a continuous rule */
.wk-eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space--space-12);
  margin: 0 0 var(--space--space-10);
  font-size: 11px;
  line-height: 16px;
  font-weight: var(--weight--weight-500);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color--accent);
}
.wk-eyebrow::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2dfeb;
}
.wk-body h2 { margin: 0 0 var(--space--space-20); }
.wk-body > .sv-allservices { margin-top: var(--space--space-24); }

/* tighter component internals */
.wk-work { gap: var(--space--space-10); }
.wk-work article { padding: var(--space--space-24) var(--space--space-30); gap: var(--space--space-20); }
.wk-facts div { padding: var(--space--space-20); }
.wk-out li { padding: var(--space--space-12) var(--space--space-20); }
.wk-quote { padding: var(--space--space-40); }
.wk-pair { gap: var(--space--space-16); }
.wk-cmp-hint { margin-top: var(--space--space-10); }

@media (max-width: 900px) {
  .wk-page .wk-hero { padding: 108px 0 var(--space--space-30); }
  .wk-page .page-section { padding-top: var(--space--space-40); padding-bottom: var(--space--space-40); }
}

/* --------------------------------------------------------------------------
   7. Gallery + lightbox
   Each tile is a <button> so it is reachable by keyboard; the overlay is a
   native <dialog>, which brings Esc, focus trapping and inertness for free.
   -------------------------------------------------------------------------- */
.wk-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space--space-12);
}
/* the lead shot earns full width; the rest are teasers — detail is in the lightbox */
.wk-gallery > figure:first-child { grid-column: 1 / -1; }

.wk-g-item {
  margin: 0;
  border-radius: var(--space--space-8);
  overflow: hidden;
  background: var(--color--white-colour);
  border: 1px solid #e6e3ee;
  display: flex;
  flex-direction: column;
}
.section--soft .wk-g-item { background: var(--color--canvas-soft); }

.wk-g-item > button {
  display: block;
  padding: 0;
  border: 0;
  margin: 0;
  background: var(--color--dark-blue);
  cursor: zoom-in;
  position: relative;
  overflow: hidden;
  line-height: 0;
  width: 100%;
}
.wk-g-item > button img {
  width: 100%;
  height: auto;
  transition: transform 0.5s var(--reveal-ease);
}
.wk-g-item > button:hover img { transform: scale(1.02); }
.wk-g-item > button:focus-visible { outline: 3px solid var(--color--accent); outline-offset: -3px; }

/* the zoom affordance — otherwise nothing says these open */
.wk-g-item > button::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92) url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none'%3E%3Cpath d='M4 9V4h5M20 15v5h-5M15 4h5v5M9 20H4v-5' stroke='%236746b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px 18px no-repeat;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s var(--reveal-ease), transform 0.3s var(--reveal-ease);
}
.wk-g-item > button:hover::after,
.wk-g-item > button:focus-visible::after { opacity: 1; transform: none; }

.wk-g-item figcaption {
  padding: var(--space--space-12) var(--space--space-16);
  border-top: 1px solid #e6e3ee;
  font-size: var(--typography--p-03-size);
  line-height: var(--typography--p-03-height);
  color: var(--color--secondary-blue);
}
.wk-g-item figcaption b {
  display: block;
  margin-bottom: 2px;
  color: var(--color--dark-blue);
  font-weight: var(--weight--weight-500);
  font-size: var(--typography--p-02-size);
  line-height: var(--typography--p-02-height);
}

/* ---- lightbox ---- */
.wk-lb {
  padding: 0;
  border: 0;
  background: transparent;
  max-width: 100vw;
  max-height: 100vh;
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.wk-lb::backdrop { background: rgba(5, 7, 11, 0.9); }

.wk-lb-inner {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: var(--space--space-20);
  padding: clamp(16px, 4vw, 48px);
  align-items: center;
  justify-items: center;
}
.wk-lb img {
  max-width: min(1280px, 100%);
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--space--space-8);
  background: var(--color--dark-blue);
}
.wk-lb-bar {
  display: flex;
  align-items: center;
  gap: var(--space--space-20);
  max-width: min(1280px, 100%);
  color: #fff;
}
.wk-lb-cap { margin: 0; font-size: var(--typography--p-02-size); line-height: var(--typography--p-02-height); }
.wk-lb-cap b { display: block; font-weight: var(--weight--weight-500); }
.wk-lb-cap span { color: rgba(255, 255, 255, 0.6); }

.wk-lb-nav { display: flex; gap: var(--space--space-8); flex: none; margin-left: auto; }
.wk-lb button {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background-color 0.2s;
}
.wk-lb button:hover { background: rgba(255, 255, 255, 0.2); }
.wk-lb button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.wk-lb button svg { width: 20px; height: 20px; }
.wk-lb-close { position: absolute; top: clamp(12px, 3vw, 28px); right: clamp(12px, 3vw, 28px); }

@media (max-width: 1100px) {
  .wk-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .wk-lb-bar { flex-direction: column; align-items: flex-start; gap: var(--space--space-12); }
  .wk-lb-nav { margin-left: 0; }
}

@media (max-width: 640px) {
  .wk-gallery { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .wk-g-item > button img,
  .wk-g-item > button::after { transition: none; }
  .wk-g-item > button:hover img { transform: none; }
}

/* --------------------------------------------------------------------------
   6. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 1100px) {
  .wk-detail { grid-template-columns: minmax(0, 1fr); gap: var(--space--space-40); }
  .wk-aside { position: static; }
}

@media (max-width: 900px) {
  .wk-hero { padding: 120px 0 var(--space--space-40); }
  .wk-feature { grid-template-columns: minmax(0, 1fr); }
  .wk-feature-media { min-height: 260px; }
  .wk-feature-body { padding: var(--space--space-30); }
  .wk-cmp-handle::after { width: 38px; height: 38px; }
}

@media (max-width: 640px) {
  .wk-pair { grid-template-columns: minmax(0, 1fr); }
  .wk-pair.is-narrow { grid-template-columns: minmax(0, 1fr); }
  .wk-work article { grid-template-columns: minmax(0, 1fr); gap: var(--space--space-16); padding: var(--space--space-24); }
  .wk-quote { padding: var(--space--space-30); }
  .wk-quote blockquote { font-size: var(--typography--h-05-size); line-height: var(--typography--h-05-height); max-width: none; }
  .wk-metrics { gap: var(--space--space-24); }
}

@media (prefers-reduced-motion: reduce) {
  .wk-feature-media img, .wk-logos img { transition: none; }
  .wk-feature:hover .wk-feature-media img { transform: none; }
}
