/* Case-study page template for romandanilchenkoseo.com.
   Loaded after site.css, which supplies the tokens, fonts and card system.
   Everything here is long-form reading furniture the landing never needed. */

/* Desktop runs a fixed meta rail beside a measured article column. The column is
   capped near 68 characters -- landing widths are unreadable for 1500 words. */
/* The header sits in its own row so the DOM can read header -> rail -> body.
   Collapsed to one column that order is the readable one; on desktop explicit
   placement puts the rail back alongside. */
.case-layout{display:grid;grid-template-columns:250px minmax(0,720px);gap:0 60px;
             justify-content:center;margin-bottom:88px}
.case-head{grid-column:2;grid-row:1}
.case-aside{grid-column:1;grid-row:1 / span 2;position:sticky;top:32px;align-self:start}
.case-main{grid-column:2;grid-row:2;min-width:0}

.crumbs{font:400 12.5px Inter,sans-serif;color:oklch(0.48 0.01 75);margin-bottom:24px}
.crumbs a{color:oklch(0.48 0.01 75)}
.crumbs a:hover{color:var(--accent-strong)}
.crumbs span{margin:0 7px;opacity:.5}

/* ---- header ---- */
.case-head{margin-bottom:44px}
.tags{display:flex;flex-wrap:wrap;gap:7px;margin-bottom:20px}
.tag{font:600 10.5px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
     padding:5px 10px;border-radius:99px;white-space:nowrap;
     background:oklch(0.45 0.1 300 / 0.09);color:oklch(0.36 0.09 300)}
.tag-mkt{background:oklch(0.5 0.09 232 / 0.10);color:oklch(0.34 0.09 232)}
.case-h1{font:400 clamp(30px,4.2vw,44px)/1.14 'Lora',serif;color:oklch(0.2 0.01 75);
         margin:0 0 20px;text-wrap:balance}
.case-lead{font:400 19px/1.68 Inter,sans-serif;color:oklch(0.34 0.01 75);margin:0}

/* ---- headline result, stated before the story ---- */
.result-card{border-radius:20px;padding:32px;margin-bottom:44px}
.result-top{display:flex;align-items:flex-end;justify-content:space-between;gap:24px;flex-wrap:wrap}
.result-metric{font:500 clamp(34px,4.6vw,44px)/1.05 'Lora',serif}
.result-label{font:600 10.5px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
              color:var(--accent);margin-bottom:8px}
.result-spark{width:100%;height:clamp(80px,8vw,112px);margin-top:22px;display:block}

/* ---- article body ---- */
.case-body{font:400 17px/1.75 Inter,sans-serif;color:oklch(0.32 0.01 75)}
.case-body h2{font:400 clamp(22px,2.6vw,28px)/1.25 'Lora',serif;color:oklch(0.2 0.01 75);
              margin:52px 0 18px;text-wrap:balance;scroll-margin-top:28px}
.case-body h2::before{content:"";display:block;width:30px;height:4px;border-radius:99px;
                      background:var(--grad);margin-bottom:16px}
.case-body h3{font:600 17px Inter,sans-serif;color:oklch(0.21 0.01 75);margin:32px 0 10px}
.case-body p{margin:0 0 18px}
.case-body strong{font-weight:600;color:oklch(0.22 0.01 75)}
.case-body>*:first-child{margin-top:0}

.case-body ul{list-style:none;padding:0;margin:0 0 20px;display:flex;flex-direction:column;gap:11px}
.case-body ul li{position:relative;padding-left:22px}
.case-body ul li::before{content:"";position:absolute;left:0;top:11px;width:7px;height:7px;
                         border-radius:99px;background:var(--grad)}

/* Set apart from the narrative: the working hypotheses, the shipped changes. */
.callout{border-radius:16px;padding:26px 28px;margin:26px 0 30px}
.callout .callout-t{font:600 11px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
                    color:var(--accent);margin-bottom:14px}
.callout ul{margin:0}

/* ---- timeline: the engagement genuinely runs in order, so order is the structure ---- */
.phases{position:relative;margin:30px 0 34px;padding-left:26px}
.phases::before{content:"";position:absolute;left:5px;top:6px;bottom:6px;width:2px;
                border-radius:99px;background:linear-gradient(oklch(0.56 0.17 300 / 0.55),oklch(0.46 0.16 322 / 0.12))}
.phase{position:relative;padding-bottom:24px}
.phase:last-child{padding-bottom:0}
.phase::before{content:"";position:absolute;left:-25px;top:5px;width:12px;height:12px;
               border-radius:99px;background:var(--grad);
               box-shadow:0 0 0 4px oklch(0.97 0.012 75)}
.phase-w{font:600 11.5px Inter,sans-serif;letter-spacing:.05em;text-transform:uppercase;
         color:var(--accent);margin-bottom:5px}
.phase-d{font:400 15px/1.6 Inter,sans-serif;color:oklch(0.36 0.01 75)}

/* ---- evidence: Search Console screenshots ---- */
/* Figures stay inside the reading column: breaking out past it read as a
   layout error rather than emphasis. */
.fig{margin:32px 0 34px}
.fig img{display:block;width:100%;height:auto;border-radius:12px;
         border:1px solid oklch(0.3 0.01 75 / 0.14);background:var(--card)}
.fig figcaption{font:400 13px/1.55 Inter,sans-serif;color:oklch(0.48 0.01 75);
                margin-top:11px;padding-left:2px}
/* Pairs stay stacked rather than side by side: these screenshots carry the
   numbers the case is arguing, and at half width the tooltips stop being
   readable, which defeats the point of showing them at all. */
/* margin-block rather than the margin shorthand, so a side margin set elsewhere
   in the cascade survives. */
.fig-group{display:grid;gap:20px;margin-block:32px 34px}
.fig-group .fig{margin:0}

/* ---- pull quote: the client speaking, not the write-up ---- */
.quote{position:relative;margin:30px 0 32px;padding:2px 0 2px 26px}
.quote::before{content:"";position:absolute;left:0;top:4px;bottom:4px;width:4px;
               border-radius:99px;background:var(--grad)}
.quote p{font:400 17px/1.65 'Lora',serif;color:oklch(0.26 0.01 75);margin:0 0 10px;font-style:italic}
.quote cite{display:block;font:600 12.5px Inter,sans-serif;font-style:normal;
            color:oklch(0.48 0.02 75);letter-spacing:.02em}

/* ---- charts drawn from the case's own data ---- */
/* Below ~700px the point labels stop being readable if the chart shrinks with
   the column, so it keeps a floor width and scrolls inside its own box instead. */
.chart{overflow-x:auto;margin-block:4px 14px}
.chart svg{display:block;width:100%;min-width:660px;height:auto}
.chart-legend{display:flex;flex-wrap:wrap;gap:22px;margin-block:30px 0;
              font:500 12.5px Inter,sans-serif;color:oklch(0.36 0.01 75)}
.chart-legend span{display:inline-flex;align-items:center;gap:8px}
.chart-legend i{width:16px;height:3px;border-radius:2px}
.chart-note{font:400 12.5px/1.55 Inter,sans-serif;color:oklch(0.5 0.01 75);margin-block:0 30px}

/* ---- before / after metrics ---- */
/* Wrapped in its own scroller so a wide table never makes the page scroll sideways. */
.tblwrap{overflow-x:auto;margin:26px 0 30px;border-radius:16px}
.mtbl{width:100%;border-collapse:collapse;font:400 15px Inter,sans-serif;
      background:var(--card);min-width:420px}
.mtbl caption{caption-side:top;text-align:left;padding:0 2px 10px;
              font:400 13px/1.5 Inter,sans-serif;color:oklch(0.48 0.01 75)}
.mtbl th,.mtbl td{padding:13px 18px;text-align:left;
                  border-bottom:1px solid oklch(0.3 0.01 75 / 0.10)}
.mtbl thead th{font:600 10.5px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
               color:oklch(0.5 0.02 75);background:oklch(0.96 0.014 75)}
.mtbl tbody tr:last-child td{border-bottom:0}
.mtbl td:first-child{color:oklch(0.32 0.01 75)}
/* Digits line up column to column instead of jittering. */
.mtbl td:not(:first-child){font-variant-numeric:tabular-nums;font-weight:500;
                           color:oklch(0.24 0.01 75);white-space:nowrap}
.mtbl .up{color:oklch(0.38 0.09 300);font-weight:600}

/* ---- meta rail ---- */
.facts{border-radius:16px;padding:24px;margin-bottom:20px}
.facts dl{margin:0;display:flex;flex-direction:column;gap:16px}
.facts dt{font:600 10.5px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
          color:oklch(0.5 0.02 75);margin-bottom:4px}
.facts dd{margin:0;font:500 14px/1.5 Inter,sans-serif;color:oklch(0.24 0.01 75)}

.toc{padding:0 4px}
.toc-t{font:600 10.5px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
       color:oklch(0.5 0.02 75);margin-bottom:12px}
.toc ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px;
        counter-reset:toc}
.toc a{font:400 13.5px/1.45 Inter,sans-serif;color:oklch(0.4 0.01 75);display:block}
.toc a:hover{color:var(--accent-strong)}
.toc a.on{color:var(--accent);font-weight:600}

/* ---- source, stated plainly: these ran in Russian first ---- */
.source{border-radius:16px;padding:22px 26px;margin:44px 0 0;
        display:flex;align-items:center;justify-content:space-between;gap:18px;flex-wrap:wrap}
.source-t{font:400 14px/1.6 Inter,sans-serif;color:oklch(0.4 0.01 75)}
.source a{font:600 14px Inter,sans-serif;white-space:nowrap}

/* ---- prev / next ---- */
.pager{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:56px 0 0}
.pager a{border-radius:16px;padding:22px 24px;color:inherit;display:block}
.pager .pg-l{font:600 10.5px Inter,sans-serif;letter-spacing:.06em;text-transform:uppercase;
             color:var(--accent);margin-bottom:8px}
.pager .pg-t{font:600 15px/1.4 Inter,sans-serif;color:oklch(0.21 0.01 75)}
.pager .pg-next{text-align:right}

@media (max-width:1040px){
  .case-layout{grid-template-columns:minmax(0,720px);justify-content:center}
  .case-head,.case-aside,.case-main{grid-column:1;grid-row:auto}
  /* the rail becomes a plain block under the headline -- sticky in a single column
     would pin it over the text it is meant to introduce */
  .case-aside{position:static;margin:0 0 36px}
  .facts dl{display:grid;grid-template-columns:repeat(auto-fit,minmax(150px,1fr));gap:18px 24px}
  .toc{display:none}
}
@media (max-width:560px){
  .case-body{font-size:16px}
  .case-lead{font-size:17px}
  .result-card{padding:24px}
  .pager{grid-template-columns:1fr}
  .pager .pg-next{text-align:left}
  .source{padding:20px}
}
