/* =========================================================
   Worksonics — Case Studies page (case-studies.html only)
   Same layout and motion as the original page: an image stack
   that fans out, a 2-column grid of cards with a magnifier lens
   and a white drawer that slides in, then a CTA card.
   Only the colours and typography follow the design system; the
   theme screenshots were replaced with placeholder photos from
   the site (marked TODO in the markup) until real project shots exist.
   ========================================================= */

/* ---------- shared section heading ---------- */
.ws-cs-head { max-width: 820px; margin: 0 auto; text-align: center; }
.ws-cs-eyebrow { color: var(--link); }
.ws-cs-title { margin: 0 0 var(--space-4); font-family: var(--font); font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); color: var(--text-on-light); text-wrap: balance; }
.ws-cs-sub { margin: 0 auto var(--space-8); max-width: 600px; font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-on-light-muted); }

/* hero on dark green: light text */
.ws-cs-stunning .ws-cs-eyebrow { color: var(--color-accent); }
.ws-cs-stunning .ws-cs-title { color: var(--text-on-dark); }
.ws-cs-stunning .ws-cs-sub { color: var(--text-on-dark-muted); }

/* =========================================================
   1. STACK — five tall pages fan out from the centre
   ========================================================= */
.ws-cs-stunning {
  position: relative;
  padding: calc(var(--header-height) + var(--space-8)) 0 0;
  overflow: hidden;
  font-family: var(--font);
  text-align: center;
  background: var(--glow-corner), var(--color-dark);
}
.ws-stack { position: relative; width: 100%; max-width: 1400px; height: 640px; margin: 0 auto; overflow: hidden; }
.ws-stack__holder { position: relative; width: 100%; height: 100%; }
.ws-stack__img {
  position: absolute;
  bottom: 0;
  width: 31.75%;
  height: 100%;
  overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease,
              left 0.8s cubic-bezier(0.22, 1, 0.36, 1), right 0.8s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.8s ease;
}
.ws-stack__img.inner { height: calc(100% - 60px); }
.ws-stack__img.outer { height: calc(100% - 120px); }
.ws-stack:not(.stacked) .ws-stack__img { opacity: 0; box-shadow: none; }
.ws-stack.stacked .ws-stack__img { opacity: 1; box-shadow: 0 40px 60px -10px rgba(6, 43, 38, 0.28), 0 20px 25px -10px rgba(6, 43, 38, 0.18); }

.ws-stack__img--3 { left: 50%; transform: translateX(-50%) scale(1.15); z-index: 60; }
.ws-stack.stacked .ws-stack__img--3 { transform: translateX(-50%) scale(1); z-index: 90; }
.ws-stack:not(.stacked) .ws-stack__img--1,
.ws-stack:not(.stacked) .ws-stack__img--2 { left: 50%; transform: translateX(-50%); }
.ws-stack.stacked .ws-stack__img--2 { left: 35%; transform: translateX(-65%); z-index: 80; }
.ws-stack.stacked .ws-stack__img--1 { left: 2%; transform: translateX(0); z-index: 70; }
.ws-stack:not(.stacked) .ws-stack__img--4,
.ws-stack:not(.stacked) .ws-stack__img--5 { right: 50%; transform: translateX(50%); }
.ws-stack.stacked .ws-stack__img--4 { right: 35%; transform: translateX(65%); z-index: 80; }
.ws-stack.stacked .ws-stack__img--5 { right: 2%; transform: translateX(0); z-index: 70; }

/* centre pop-up card */
.ws-stack__pop {
  position: absolute;
  top: 46%;
  left: 50%;
  z-index: 100;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.7);
  transition: opacity 0.5s ease 0.4s, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
}
.ws-stack.stacked .ws-stack__pop { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.ws-stack__pop a { position: absolute; inset: 0; z-index: 105; }
.ws-stack__pop-img { width: 440px; filter: drop-shadow(0 20px 35px rgba(6, 43, 38, 0.3)); }
.ws-cs-stunning .ws-stack__pop-img img { display: block; width: 100%; height: auto; }

/* page screenshots: fill the panel from the top */
.ws-cs-stunning .ws-stack__photo { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }

/* =========================================================
   2. RESULTS — 2 columns, magnifier lens + sliding drawer
   ========================================================= */
.ws-cs-results { padding: 0; font-family: var(--font); color: var(--text-on-light); background: var(--color-bg); }
.ws-mag-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 50px 40px; }

.ws-mag {
  position: relative;
  background: #fff;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.3s ease;
  outline: none;
}
.ws-mag:hover { box-shadow: var(--shadow-lg); }
.ws-mag:focus-visible { outline: 2px solid var(--color-dark); outline-offset: 4px; }
.ws-mag__img { position: relative; overflow: hidden; }
.ws-cs-results .ws-mag__img img { display: block; width: 100%; aspect-ratio: 16 / 10; height: auto; object-fit: cover; transition: transform 0.4s ease; }
.ws-mag:hover .ws-mag__img img { transform: scale(1.02); }

/* floating magnifier lens: a zoomed-in look at the headline result */
.ws-mag__lens {
  position: absolute;
  z-index: 20;
  top: -8%;
  left: 10%;
  width: 26%;
  aspect-ratio: 1;
  overflow: hidden;
  border: 5px solid #fff;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 6px 18px rgba(6, 43, 38, 0.35);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* the lens shows the same picture, zoomed in */
.ws-cs-results .ws-mag__lens img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(2.2); transform-origin: 35% 40%; }
.ws-mag:hover .ws-mag__lens,
.ws-mag:focus-within .ws-mag__lens,
.ws-mag.is-active .ws-mag__lens { transform: translateX(18%) translateY(-4%) scale(1.06); }

/* sliding white drawer */
.ws-mag__wrap { position: absolute; inset: 0; z-index: 15; overflow: hidden; pointer-events: none; }
.ws-mag__panel {
  position: absolute;
  top: 0;
  left: -52%;
  width: 52%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 0 24px 28px;          /* content sits below the lens */
  text-align: center;
  background: #fff;
  box-shadow: 4px 0 20px rgba(6, 43, 38, 0.12);
  transition: left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
.ws-mag:hover .ws-mag__panel,
.ws-mag:focus-within .ws-mag__panel,
.ws-mag.is-active .ws-mag__panel { left: 0; }
.ws-mag__sub { display: flex; align-items: center; justify-content: center; gap: 8px; margin-bottom: 12px; font-size: var(--fs-xs); font-weight: var(--fw-bold); letter-spacing: 0.1em; text-transform: uppercase; color: var(--link); }
.ws-mag__sub i { width: 30px; height: 1px; background: var(--line-on-light); }
.ws-mag__title { display: block; margin: 0 0 12px; font-size: var(--fs-eyebrow); font-weight: var(--fw-bold); line-height: 1.3; color: var(--text-on-light); }
.ws-mag__text { margin: 0 0 20px; font-size: var(--fs-small); line-height: 1.5; color: var(--text-on-light-muted); }
.ws-mag__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 22px;
  border: 2px solid var(--color-dark);
  font-size: var(--fs-button); font-weight: var(--fw-button); letter-spacing: var(--ls-button); text-transform: var(--tt-button);
  color: var(--color-dark);
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}
.ws-mag__btn .ws-icon { width: 14px; height: 14px; transition: transform 0.25s ease; }
.ws-mag:hover .ws-mag__btn { background: var(--color-dark); color: var(--color-accent); }
.ws-mag:hover .ws-mag__btn .ws-icon { transform: translate(3px, -3px); }

/* =========================================================
   3. CTA card
   ========================================================= */
.ws-cs-cta { padding: 0 0 var(--section-padding); font-family: var(--font); background: var(--color-bg); }
.ws-cs-cta__card { padding: var(--space-8); background: #fff; border-left: 4px solid var(--color-accent); box-shadow: var(--shadow-sm); }
.ws-cs-cta__title { margin: 0 0 var(--space-3); font-size: var(--fs-h3); font-weight: var(--fw-bold); line-height: 1.25; color: var(--text-on-light); }
.ws-cs-cta__text { max-width: 640px; margin: 0 0 var(--space-5); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--text-on-light-muted); }

@media (prefers-reduced-motion: reduce) {
  .ws-stack__img, .ws-stack__pop, .ws-mag__panel, .ws-mag__lens, .ws-mag__img img { transition: none; }
}

/* ---------- Results header band: dark green, centred heading, CTA, filter bar ---------- */
.ws-csr-band { padding: var(--space-9) 0; color: var(--text-on-light); text-align: center; background: var(--glow-corner), var(--color-bg); }
.ws-csr-band__eyebrow { color: var(--link); }
.ws-csr-band__title { max-width: 900px; margin: 0 auto var(--space-7); font-size: var(--fs-h1); font-weight: var(--fw-bold); line-height: var(--lh-heading); letter-spacing: var(--ls-heading); color: var(--text-on-light); text-wrap: balance; }
.ws-csr-band .ws-btn .ws-icon { width: 18px; height: 18px; }

.ws-csf { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 56px; gap: var(--space-4); margin-top: var(--space-8); padding: var(--space-3); border: 1px solid var(--line-on-light); background: rgba(255, 255, 255, 0.6); box-shadow: var(--shadow-sm); text-align: left; }
/* custom dropdowns: trigger + tile panel */
.ws-csf { position: relative; }
.ws-dd { position: relative; }
.ws-dd--wide { position: static; }                /* wide panels span the whole filter bar */
.ws-dd__trigger {
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  width: 100%; height: 100%;
  padding: var(--space-3) 56px var(--space-3) var(--space-6);
  border: 1px solid var(--line-on-light);
  background: #fff;
  font-family: var(--font); text-align: left; color: var(--text-on-light);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease);
}
.ws-dd__trigger:focus { background: #fff; color: var(--text-on-light); }
.ws-dd__trigger:hover, .ws-dd__trigger[aria-expanded="true"] { border-color: var(--color-dark); background: #fff; }
.ws-dd__label { font-size: var(--fs-small); font-weight: var(--fw-bold); letter-spacing: 0.04em; text-transform: uppercase; }
.ws-dd__value { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-body); color: var(--text-on-light-muted); }
.ws-dd__chev { position: absolute; right: var(--space-5); top: 50%; width: 18px; height: 18px; color: var(--link); transform: translateY(-50%); transition: transform var(--dur-fast) var(--ease); }
.ws-dd__trigger[aria-expanded="true"] .ws-dd__chev { transform: translateY(-50%) rotate(180deg); }

.ws-dd__panel {
  position: absolute;
  z-index: 30;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: 0;
  padding: var(--space-6);
  list-style: none;
  background: #fff;
  border: 1px solid var(--color-dark);
  box-shadow: var(--shadow-lg);
}
.ws-dd__panel[hidden] { display: none; }
.ws-dd--wide .ws-dd__panel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3) var(--space-6); }
.ws-dd__opt {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%;
  padding: 12px var(--space-5);
  border: 1px solid var(--line-on-light);
  background: var(--color-bg);
  font-family: var(--font); font-size: var(--fs-body); text-align: left;
  color: var(--text-on-light);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease), background-color var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.ws-dd__opt:focus { background: var(--color-bg); color: var(--text-on-light); }
.ws-dd__opt:hover, .ws-dd__opt:focus-visible { border-color: var(--color-dark); background: rgba(207, 245, 90, 0.25); color: var(--text-on-light); }
.ws-dd__tick { display: none; flex: none; width: 18px; height: 18px; color: var(--link); }
.ws-dd__opt.is-selected { border-color: var(--color-dark); background: rgba(207, 245, 90, 0.4); font-weight: var(--fw-bold); }
.ws-dd__opt.is-selected .ws-dd__tick { display: block; }
.ws-csf__go { display: flex; align-items: center; justify-content: center; padding: 0; border: 0; background: var(--color-dark); color: var(--color-accent); cursor: pointer; transition: background-color var(--dur-fast) var(--ease); }
.ws-csf__go:focus { background: var(--color-dark); color: var(--color-accent); }
.ws-csf__go:hover { background: var(--color-accent); color: var(--color-dark); }
.ws-csf__go .ws-icon { width: 22px; height: 22px; }

.ws-csr-list { padding-top: var(--space-6); padding-bottom: var(--section-padding); }
.ws-mag-item[hidden] { display: none; }
.ws-mag { display: block; color: inherit; }
.ws-csr-empty { margin: 0; text-align: center; color: var(--text-on-light-muted); }

/* =========================================================
   Tablet (≤ 1024px) and mobile (≤ 767px)
   ========================================================= */
@media (max-width: 1024px) {
  .ws-stack { height: 440px; }
  .ws-stack__pop-img { width: 320px; }
  .ws-mag-grid { gap: var(--space-6); }
  /* filter bar: three dropdowns stacked, search button full width */
  .ws-csf { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
  .ws-dd--wide { position: relative; }
  .ws-dd__trigger { min-height: 64px; }
  .ws-dd--wide .ws-dd__panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws-dd__panel { max-height: 60svh; overflow-y: auto; padding: var(--space-4); }
  .ws-csf__go { min-height: 52px; }
}
@media (max-width: 767px) {
  .ws-stack { height: 300px; }
  .ws-stack__pop-img { width: 200px; }
  .ws-mag-grid { grid-template-columns: minmax(0, 1fr); }
  /* no hover on phones: the drawer content sits under the photo, no lens */
  .ws-mag__lens { display: none; }
  .ws-mag__wrap { position: static; overflow: visible; }
  .ws-mag__panel,
  .ws-mag:hover .ws-mag__panel,
  .ws-mag.is-active .ws-mag__panel { position: static; left: auto; width: 100%; height: auto; padding: var(--space-5); box-shadow: none; }
  .ws-dd--wide .ws-dd__panel { grid-template-columns: minmax(0, 1fr); }
  .ws-cs-cta__card { padding: var(--space-6) var(--space-5); }
}
