/* ══════════════════════════════════════════════════
   SINGLE CASE STUDY — /case-studies/{slug}/
   ══════════════════════════════════════════════════
   Enqueued before global.css and interior.css, so the
   .hero, .seo-content, .statement and .cta base layers
   there still win for anything shared. Only what is
   specific to this page lives here.
   ══════════════════════════════════════════════════ */

/* ─── Hero ───────────────────────────────────────────
   Two columns: the copy, and the same built face the
   cards use — logo chip, headline number, supporting
   stats. No hero image, because requiring one per case
   study is the thing that stops case studies getting
   published. */
/* background-color, not the shorthand: with a hero photo set the
   template puts a background-image on this same element inline, and
   the shorthand would reset it. */
.cs-single-hero{
  background-color:var(--obsidian);
  padding:120px 0 90px;
}
.cs-single-hero .crumbs{margin-bottom:34px;}
.cs-single-top{
  display:grid;
  grid-template-columns:1.05fr 0.95fr;
  gap:60px;
  align-items:center;
}
.cs-single-copy .hero-h1{
  font-size:clamp(40px,5.4vw,72px);
  line-height:0.98;
  letter-spacing:-2px;
}
.cs-single-copy .hero-p{max-width:46ch;}
/* No number and no screenshot: the copy takes the row. */
.cs-single-top-solo{grid-template-columns:1fr;}
.cs-single-top-solo .hero-p{max-width:60ch;}

/* The site itself, in a browser frame, for a study with no figures:
   the portfolio screenshot, cropped to the top of the page, which
   scrolls down slowly on hover. */
.cs-single-shot{
  position:relative;z-index:1;margin:0;
  border-radius:18px;overflow:hidden;
  border:1px solid rgba(255,255,255,0.14);
  background:#0c1a26;
  box-shadow:0 30px 70px rgba(0,0,0,0.5),0 0 0 1px rgba(0,0,0,0.3);
}
.cs-single-shot-bar{
  display:flex;align-items:center;gap:7px;height:34px;padding:0 14px;
  background:rgba(255,255,255,0.06);border-bottom:1px solid rgba(255,255,255,0.08);
}
.cs-single-shot-bar span{width:10px;height:10px;border-radius:50%;background:rgba(255,255,255,0.16);}
.cs-single-shot-bar span:first-child{background:rgba(22,192,183,0.7);}
.cs-single-shot-link{display:block;position:relative;color:#fff;text-decoration:none;}
.cs-single-shot img{
  display:block;width:100%;aspect-ratio:16/10;object-fit:cover;object-position:top;
  transition:object-position 7s linear;
}
.cs-single-shot-link:hover img{object-position:bottom;}
.cs-single-shot-cta{
  position:absolute;left:16px;bottom:16px;
  display:inline-flex;align-items:center;gap:8px;
  padding:9px 14px;border-radius:999px;
  font-size:13px;font-weight:700;color:#052e2c;background:var(--teal);
  box-shadow:0 10px 24px rgba(0,0,0,0.35);
  opacity:0;transform:translateY(6px);transition:opacity .25s ease,transform .25s ease;
}
.cs-single-shot-cta i{font-size:11px;}
.cs-single-shot-link:hover .cs-single-shot-cta,.cs-single-shot-link:focus-visible .cs-single-shot-cta{opacity:1;transform:none;}
@media (hover:none){.cs-single-shot-cta{opacity:1;transform:none;}}

.cs-single-face{
  position:relative;
  z-index:1;                        /* above .hero-has-image::before */
  overflow:hidden;
  border-radius:22px;
  border:1px solid rgba(255,255,255,0.07);
  background:var(--card-grad);
  padding:34px;
  display:flex;
  flex-direction:column;
  gap:24px;
}
/* Over a photo the panel needs to be opaque enough to read as a card
   rather than a tint. The gradients in seolocale_case_art() are solid
   colors, but the hero's own scrim sits behind them, so a backdrop
   blur is what actually separates the two. */
.cs-single-hero.hero-has-image .cs-single-face{
  border-color:rgba(255,255,255,0.14);
  box-shadow:0 30px 70px rgba(0,0,0,0.45);
  backdrop-filter:blur(2px);
}
/* Sized by the logo's HEIGHT, not a percentage width.
 *
 * The panel is a column flex container, so its cross size is
 * indefinite while the chip is being measured — which means a
 * percentage max-width on the image contributes nothing to the
 * intrinsic width and the chip sizes to the file's natural width
 * instead. A 900px-wide wordmark therefore stretched the chip into a
 * full-width white slab that outweighed the number it was there to
 * label. Height-driven sizing also normalizes a tall logo and a wide
 * one to the same optical weight, which is how a logo lockup should
 * be measured anyway. */
.cs-single-mark{
  position:relative;
  z-index:1;
  align-self:flex-start;
  background:#fff;
  border-radius:12px;
  padding:12px 18px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 8px 22px rgba(0,0,0,0.26);
}
.cs-single-mark img{
  height:46px;
  width:auto;
  max-width:230px;
  object-fit:contain;
  display:block;
}
.cs-single-word{
  font-family:var(--disp);
  font-size:22px;
  font-weight:900;
  letter-spacing:-0.6px;
  line-height:1.1;
  text-align:center;
  color:var(--ink);
}
.cs-single-stat{position:relative;z-index:1;}
.cs-single-num{
  display:block;
  font-family:var(--mono);
  font-size:clamp(56px,7vw,86px);
  font-weight:800;
  line-height:0.95;
  letter-spacing:-3px;
  color:var(--card-accent);
  text-shadow:0 4px 24px rgba(0,0,0,0.35);
}
/* Mono uppercase, matching every other stat label on the site — it was
   the only one set in the body face, which made it read as a caption
   rather than as the unit on the number above it. */
.cs-single-label{
  display:block;
  font-family:var(--mono2),var(--mono),monospace;
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.1em;
  color:rgba(255,255,255,0.72);
  margin-top:12px;
}
/* A rule rather than more boxes: the supporting numbers belong to the
   headline above them, and three separate panels inside one panel read
   as three unrelated tiles. */
.cs-single-minis{
  position:relative;
  z-index:1;
  display:flex;
  gap:14px;
  padding-top:22px;
  border-top:1px solid rgba(255,255,255,0.1);
}
.cs-single-mini{
  flex:1;
  min-width:0;
  padding:0;
}
.cs-single-mini + .cs-single-mini{
  padding-left:14px;
  border-left:1px solid rgba(255,255,255,0.1);
}
.cs-single-mini-val{
  display:block;
  font-family:var(--disp);
  font-size:clamp(24px,2.4vw,30px);
  font-weight:900;
  line-height:1;
  letter-spacing:-1px;
  color:var(--card-accent);
}
.cs-single-mini-label{
  display:block;
  font-family:var(--mono2),var(--mono),monospace;
  font-size:10.5px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:rgba(255,255,255,0.6);
  margin-top:8px;
}
.cs-single-watermark{
  position:absolute;
  right:-26px;
  bottom:-30px;
  font-size:190px;
  color:#fff;
  opacity:0.04;
  z-index:0;
}

/* ─── Body ───────────────────────────────────────────
   The write-up comes from the WP editor, so it can hold
   anything. These rules give the classic-editor output
   the same measure and rhythm as the rest of the site
   instead of leaving it at browser defaults. */
.cs-single-body h2{
  font-family:var(--disp);
  font-size:clamp(26px,3vw,38px);
  letter-spacing:-1px;
  line-height:1.1;
  margin:44px 0 16px;
}
.cs-single-body h3{
  font-size:clamp(19px,2vw,24px);
  font-weight:800;
  letter-spacing:-0.4px;
  margin:32px 0 12px;
}
.cs-single-body > *:first-child{margin-top:0;}
.cs-single-body p{margin:0 0 20px;line-height:1.8;}
.cs-single-body ul,
.cs-single-body ol{margin:0 0 22px;padding-left:22px;}
.cs-single-body li{margin-bottom:9px;line-height:1.75;}
.cs-single-body img{max-width:100%;height:auto;border-radius:14px;display:block;margin:26px 0;}
/* The write-up sits on the white .seo-content band, so the quote
   needs a light panel — --surface is the dark-chapter token and put
   ink text on a near-black block at about 1.2:1. */
.cs-single-body blockquote{
  margin:28px 0;
  padding:20px 26px;
  border-left:3px solid var(--teal-ink);
  background:var(--cream);
  border-radius:0 12px 12px 0;
  font-size:19px;
  line-height:1.65;
  color:var(--ink);
}
.cs-single-body blockquote p:last-child{margin-bottom:0;}

/* ─── Proof screenshots ──────────────────────────────
   Uploads arrive at whatever aspect the exporting tool
   produced: a 4:1 Search Console chart, a near-square
   Map Pack grab, the odd portrait. Letting each tile
   size to its own image turned the grid into a ragged
   mosaic, so every screenshot goes in the same window
   frame at the same ratio instead.

   contain, not cover: these are charts, and cropping one
   throws away the axis that made it proof. The frame is
   what makes the letterboxing read as a screenshot in a
   window rather than an image that failed to fit, and
   the full uncropped file is one click away. */
.cs-proof-section{padding:clamp(60px,6.5vw,92px) 0;background:var(--sand);}
.cs-proof-head{max-width:62ch;margin-bottom:34px;}
.cs-proof-head .eyebrow{color:var(--teal-ink);}
.cs-proof-head h2{
  font-family:var(--disp);
  font-size:clamp(30px,4vw,48px);
  letter-spacing:-1.5px;
  line-height:1;
  color:var(--ink);
  margin:10px 0 14px;
}
.cs-proof-head p{font-size:17px;line-height:1.7;color:var(--ink-soft);margin:0;}
.cs-proof-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(340px,1fr));
  gap:22px;
}
/* One screenshot in a multi-column grid stretches to the full width
   and turns a chart into a billboard. Cap it. */
.cs-proof-solo{grid-template-columns:minmax(0,760px);}

.cs-shot{
  margin:0;
  border-radius:14px;
  overflow:hidden;
  background:var(--cream-card);
  border:1px solid rgba(30,52,72,0.13);
  box-shadow:0 10px 30px rgba(30,52,72,0.08);
  transition:box-shadow 0.25s ease,transform 0.25s ease,border-color 0.25s ease;
}
.cs-shot:hover{
  transform:translateY(-3px);
  border-color:rgba(30,52,72,0.22);
  box-shadow:0 22px 48px rgba(30,52,72,0.16);
}
.cs-shot-link{position:relative;display:block;text-decoration:none;}

/* Window chrome. The caption doubles as the tab label, which is why
   it is worth writing one — an uncaptioned screenshot is a screenshot
   nobody can interpret. */
.cs-shot-chrome{
  display:flex;
  align-items:center;
  gap:12px;
  padding:0 14px;
  height:38px;
  background:var(--cream);
  border-bottom:1px solid rgba(30,52,72,0.1);
}
.cs-shot-dots{display:flex;gap:6px;flex-shrink:0;}
.cs-shot-dots i{
  width:9px;
  height:9px;
  border-radius:50%;
  background:rgba(30,52,72,0.18);
  display:block;
}
.cs-shot-tab{
  font-family:var(--mono2),var(--mono),monospace;
  font-size:11px;
  font-weight:700;
  letter-spacing:0.02em;
  color:var(--ink-faint);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  min-width:0;
}
.cs-shot-window{
  display:block;
  position:relative;
  aspect-ratio:16 / 10;
  /* A tint rather than white. Most screenshots are white-backed, so a
     white mat makes a short chart look like it is floating in a broken
     card; a light board makes the same gap read as matting. */
  background:var(--cream);
  overflow:hidden;
  padding:10px;
}
.cs-shot-window img{
  width:100%;
  height:100%;
  object-fit:contain;
  /* Centered, not top-aligned. A 5:1 chart pinned to the top of a 16:10
     frame leaves two thirds of the tile empty underneath and reads as a
     failed layout; centered in the same frame it reads as a framed
     screenshot. */
  object-position:center;
  display:block;
  border-radius:4px;
}
.cs-shot-zoom{
  position:absolute;
  right:12px;
  bottom:12px;
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:7px 13px;
  border-radius:50px;
  background:rgba(5,11,18,0.82);
  color:#fff;
  font-size:12px;
  font-weight:800;
  letter-spacing:0.01em;
  opacity:0;
  transform:translateY(6px);
  transition:opacity 0.25s ease,transform 0.25s ease;
}
.cs-shot:hover .cs-shot-zoom,
.cs-shot-link:focus-visible .cs-shot-zoom{opacity:1;transform:translateY(0);}
.cs-shot-zoom i{font-size:11px;}

@media(max-width:600px){
  .cs-proof-grid{grid-template-columns:1fr;}
  .cs-shot-chrome{height:34px;padding:0 12px;}
}

/* Lightbox — built by case-study.js, styled here. */
.cs-lightbox{
  position:fixed;
  inset:0;
  z-index:400;
  display:none;
  align-items:center;
  justify-content:center;
  padding:5vh 4vw;
  background:rgba(5,11,18,0.92);
  backdrop-filter:blur(6px);
}
.cs-lightbox.open{display:flex;}
.cs-lightbox-fig{margin:0;max-width:100%;max-height:90vh;display:flex;flex-direction:column;gap:14px;}
.cs-lightbox-fig img{
  max-width:100%;
  max-height:78vh;
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:10px;
  background:#fff;
  display:block;
  margin:0 auto;
}
.cs-lightbox-fig figcaption{
  text-align:center;
  font-size:14px;
  font-weight:700;
  color:rgba(255,255,255,0.8);
}
.cs-lightbox-close{
  position:absolute;
  top:20px;
  right:24px;
  width:44px;
  height:44px;
  border-radius:50%;
  border:1px solid rgba(255,255,255,0.2);
  background:rgba(255,255,255,0.08);
  color:#fff;
  font-size:26px;
  line-height:1;
  cursor:pointer;
}
.cs-lightbox-close:hover{background:rgba(255,255,255,0.18);}

@media(max-width:640px){
  .cs-proof-grid{grid-template-columns:1fr;}
  .cs-shot{padding:10px;}
  .cs-shot-zoom{opacity:1;transform:none;}
}

/* ─── Related ────────────────────────────────────────
   "Is that a fluke" is the question a visitor has after
   one case study, so the answer is the next three in the
   same service. */
.cs-related{padding:clamp(60px,6.5vw,92px) 0;background:var(--cream);}
.cs-related-head{margin-bottom:34px;}
.cs-related-head .eyebrow{color:var(--teal-ink);}
.cs-related-head h2{
  font-family:var(--disp);
  font-size:clamp(30px,4vw,48px);
  letter-spacing:-1.5px;
  line-height:1;
  color:var(--ink);
  margin:10px 0 0;
}
.cs-related-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(260px,1fr));
  gap:18px;
}
.cs-related-card{
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:26px 24px 24px;
  border-radius:16px;
  background:var(--card-grad);
  border:1px solid rgba(30,52,72,0.2);
  text-decoration:none;
  transition:transform 0.25s ease,box-shadow 0.25s ease;
}
.cs-related-card:hover{
  transform:translateY(-4px);
  box-shadow:0 22px 50px rgba(30,52,72,0.26);
}
.cs-related-ind{
  font-family:var(--mono);
  font-size:10px;
  font-weight:800;
  letter-spacing:1px;
  text-transform:uppercase;
  color:var(--card-accent);
  margin-bottom:14px;
}
.cs-related-num{
  font-family:var(--mono);
  font-size:40px;
  font-weight:800;
  line-height:1;
  letter-spacing:-1.5px;
  color:var(--card-accent);
}
.cs-related-what{
  font-size:13px;
  font-weight:700;
  color:rgba(255,255,255,0.55);
  margin-bottom:14px;
}
.cs-related-client{
  font-size:17px;
  font-weight:900;
  letter-spacing:-0.3px;
  color:var(--text);
  margin-top:auto;
}

@media(max-width:900px){
  .cs-single-hero{padding:100px 0 60px;}
  .cs-single-top{grid-template-columns:1fr;gap:36px;}
  .cs-single-face{padding:26px;}
  .cs-single-watermark{font-size:150px;}
}
