/* Blog lane: /blog/ and /blog/custom-vs-off-the-shelf/. Page-scoped (.blog-*) on top of site.css; nothing here edits shared classes.
   Spacing maps: docs/spacing-maps/blog.md and docs/spacing-maps/blog-custom-vs-off-the-shelf.md.

    1  Shared: visually hidden, closing call, quiet placeholder
    2  Index: page band, featured block
    3  Post: head, reading column, pull-quote, table, end-of-article cards
    4  Phone and touch (phone pass, 13 Oct)
    5  Reduced motion (fix 2, 14 Oct)
*/

/* ============================================================ 1. Shared */
.blog-sr {                                      /* visually hidden, still read by screen readers */
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* closing call: one line, the indigo WhatsApp button, the second link (grey band; the footer is the page's one black band) */
.blog-closing { padding-block: var(--s-64); text-align: center; }
.blog-closing .h3 { margin-bottom: var(--s-24); }
@media (max-width: 767px) { .blog-closing { padding-block: var(--s-48); } }

/* ============================================================ 2. Index: page band and featured block */
/* The page has a small hero, so the band pads 64 (not 96) above the heading, and 64 below so that the white band and the
   grey closing band sit 64 + 64 = 128 apart. */
.blog-band { padding-block: var(--s-64); }
.blog-top .section-head { margin-bottom: var(--s-48); }

/* The plate is 720 x 520 on the 1180 frame (it was 660 x 440): the text column keeps the 412 the title needs for three lines, the photo takes
   the rest, and a taller text column would only stretch it. */
.blog-featured {
  position: relative; display: grid; grid-template-columns: minmax(0, 412px) minmax(0, 1fr); gap: var(--s-48);
}
.blog-featured-text {
  display: flex; flex-direction: column; justify-content: space-between; gap: var(--s-48);
  padding: var(--s-16) 0 var(--s-24); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.blog-featured-body > * + * { margin-top: var(--s-16); }
.blog-featured-body > .eyebrow + * { margin-top: var(--s-12); }
.blog-featured-body > .blog-stretch { margin-top: var(--s-24); }
.blog-standfirst { color: var(--ink-2); font: 400 17px/24px var(--font-text); max-width: 420px; }
.blog-featured-media { position: relative; aspect-ratio: 72 / 52; overflow: hidden; border-radius: 24px; background: var(--tile); }
.blog-featured-media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: 70% 50%; transition: transform var(--d-hover) var(--ease); }   /* fills its cell if the text column is the taller one */
/* the whole block is the link (Legora): the arrow link stretches over it */
.blog-stretch::before { content: ""; position: absolute; inset: 0; z-index: 1; }
@media (hover: hover) { .blog-featured:hover .link-arrow::after { transform: translateX(var(--arrow-go)); } }
.blog-featured:has(.blog-stretch:active) .link-arrow::after { transform: translateX(var(--arrow-go)); }          /* a finger on the block: the photo presses in a little */
/* only the photo: shrinking the whole block slid its edge out from under the pointer, and a press near the edge opened nothing */
.blog-featured:has(.blog-stretch:active) .blog-featured-media img, .blog-featured:has(.blog-featured-tap:active) .blog-featured-media img { transform: scale(.985); }
.blog-featured-tap { position: absolute; inset: 0; }          /* the picture around the glass panel; the panel's own Read link is the one keyboards and screen readers reach */
.blog-featured:has(.blog-stretch:focus-visible) { outline: 2px solid var(--ring); outline-offset: 8px; border-radius: var(--r-24); }
.blog-stretch:focus-visible { outline: 0; }
@media (max-width: 1099px) {                   /* below this the text column is taller than the photo, so the block stacks */
  .blog-featured { grid-template-columns: 1fr; gap: var(--s-24); }
  .blog-featured-media { order: -1; aspect-ratio: 2 / 1; }
  .blog-featured-text { gap: var(--s-24); }
}
@media (max-width: 767px) { .blog-featured-media { aspect-ratio: 3 / 2; } }                   /* the phone shows the whole scene */
@media (max-width: 767px) {
  .blog-band { padding-block: var(--s-48); }
  .blog-top .section-head { margin-bottom: var(--s-32); }
}

/* ============================================================ 3. Post */
.section.blog-post { padding-block: var(--s-64); }
@media (max-width: 767px) { .section.blog-post { padding-block: var(--s-48); } }

/* The title block runs on the 1180 frame (its left edge is the logo's), the plate follows it at the same width, then the reading
   column and the sticky card. The hairline that used to close the head is gone: the plate closes it. */
.blog-post-head { margin-bottom: var(--s-48); }
.blog-post-head > .eyebrow { margin-top: var(--s-24); }
.blog-post-head > .h1 { margin-top: var(--s-12); max-width: 900px; }
.blog-post-head > .lead { margin-top: var(--s-16); max-width: 680px; }
.blog-byline { margin-top: var(--s-24); color: var(--ink-2); }

/* The plate: Phoenix Reach on a laptop and a phone (tools/render-blog-post-plate.py), the article's full width, sharp at 2x. */
.blog-plate { margin: 0 0 var(--s-64); overflow: hidden; border-radius: 24px; background: var(--tile); }
.blog-plate img { display: block; width: 100%; height: auto; aspect-ratio: 2360 / 1328; object-fit: cover; }
@media (max-width: 767px) { .blog-plate { margin-bottom: var(--s-48); } .blog-plate img { aspect-ratio: 3 / 2; } }   /* the phone crop shows the whole scene */

/* Reading column and the card beside it: from 1024 the card sticks under the nav for the whole article (it ends with the
   article, so it can never reach the footer); below that it sits inline after the two opening paragraphs. */
.blog-layout { display: block; }
.prose.blog-prose { max-width: 600px; }                  /* this font runs about 83 characters to a 680 line; 600 gives 65 to 75 */
.blog-aside { max-width: 600px; }
.blog-aside { margin-top: var(--s-32); }                 /* the next h2 brings its own 48 */
@media (min-width: 1024px) {
  .blog-layout { display: grid; grid-template-columns: minmax(0, 600px) 360px; justify-content: start; column-gap: var(--s-64); align-items: start; }
  .blog-prose-1 { grid-column: 1; grid-row: 1; }
  .blog-prose-2 { grid-column: 1; grid-row: 2; }
  .blog-aside { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; position: sticky; top: calc(var(--nav-h) + var(--s-24)); }
}

.blog-side { padding: var(--s-24); background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.blog-side > .eyebrow { margin-bottom: var(--s-16); }
.blog-side-fig + .blog-side-fig { margin-top: var(--s-24); }
.blog-side-name { font: 500 15px/20px var(--font-text); }
.blog-side-total { margin-top: var(--s-4); font: 600 28px/32px var(--font-display); letter-spacing: 0; font-variant-numeric: lining-nums; }   /* the answer is a big price: Display 600 at the h3 step (DEC-010), like compare and pricing; figures inside a line stay Mono */
@media (max-width: 767px) { .blog-side-total { font-size: 24px; line-height: 28px; } }
.blog-side-sum { margin-top: var(--s-8); color: var(--ink-2); font: 400 13px/16px var(--font-text); }
.blog-side-chip { display: inline-flex; max-width: 100%; margin-top: var(--s-24); }
.blog-side-note { margin-top: var(--s-12); }
.blog-side .link-arrow { min-height: 44px; margin-top: calc(var(--s-16) - 12px); margin-bottom: -12px; }

/* The bars, one drawing for the card and the figure: an 8px track, a fill that is a share of the scale and grows from the left
   when its block is revealed (transform only; reduced motion makes --d-reveal 0). Without script they are simply drawn. */
.blog-bar { display: block; height: 8px; margin-top: var(--s-12); overflow: hidden; border-radius: 980px; background: var(--grey); }
.blog-bar > i { display: block; width: var(--w, 100%); height: 100%; margin-left: var(--from, 0); border-radius: 980px; background: var(--line-strong); transform-origin: left center; transition: transform var(--d-reveal) var(--ease); }
.blog-bar.is-flat > i { background: var(--ink); }
.blog-bar > i.is-range { background: repeating-linear-gradient(135deg, var(--line-strong) 0 4px, transparent 4px 8px); box-shadow: inset 0 0 0 1px var(--line-strong); }
.js .blog-side:not(.is-in) .blog-bar > i, .js .blog-fig:not(.is-in) .blog-bar > i { transform: scaleX(0); }
.blog-fig-list > li:nth-child(2) .blog-bar > i { transition-delay: 60ms; }
.blog-fig-list > li:nth-child(3) .blog-bar > i { transition-delay: 120ms; }
.blog-fig-list > li:nth-child(4) .blog-bar > i { transition-delay: 180ms; }
.blog-fig-list > li:nth-child(5) .blog-bar > i { transition-delay: 240ms; }
.blog-fig-list > li:nth-child(6) .blog-bar > i { transition-delay: 300ms; }

/* The figure: the six options of the table above it, on one scale (zero to 12 lakh). The numbers are the article's own sums. */
.prose.blog-prose > .blog-fig { margin-top: var(--s-24); padding: var(--s-24) var(--s-32) var(--s-24); border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.prose.blog-prose > .blog-fig + .blog-table { margin-top: var(--s-32); }
.blog-fig > .eyebrow { margin-bottom: var(--s-24); }
.prose .blog-fig-list { padding: 0; list-style: none; }
.prose .blog-fig-list > li + li { margin-top: var(--s-16); }
.blog-fig-row { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: var(--s-12); }
.blog-fig-name { font: 500 17px/24px var(--font-text); }
.blog-fig-val { margin-left: auto; font-size: 15px; line-height: 24px; }
.blog-fig-row > .blog-bar { flex: 0 0 100%; margin-top: var(--s-8); }
.blog-fig-axis { display: grid; grid-template-columns: 1fr auto 1fr; margin-top: var(--s-16); padding-top: var(--s-8); border-top: 1px solid var(--line); color: var(--ink-2); font: 500 13px/16px var(--mono); }
.blog-fig-axis > :last-child { justify-self: end; }
@media (max-width: 767px) { .prose.blog-prose > .blog-fig { padding: var(--s-24) var(--s-16); } }

.blog-back { display: inline-flex; align-items: center; gap: var(--s-4); color: var(--ink-2); font: 500 15px/20px var(--font-text); transition: color var(--d-hover) var(--ease); }
.blog-back::before {                         /* the arrow of .link-arrow, turned to point left */
  content: ""; flex: none; width: 16px; height: 16px; background: currentColor; transform: scaleX(-1);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 12h16M14 6l6 6-6 6' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform var(--d-hover) var(--ease);
}
@media (hover: hover) {
  .blog-back:hover { color: var(--ink); }
  .blog-back:hover::before { transform: scaleX(-1) translateX(var(--arrow-go)); }
}
.blog-back:active { color: var(--ink); }
.blog-back:active::before { transform: scaleX(-1) translateX(var(--arrow-go)); }
/* Every link on the page is a 44 target, mouse or finger: the back link's box is 44 high and pulled back 12 above and below, so the words stay where they were. */
.blog-back { min-height: 44px; margin-top: -12px; }
@media (min-width: 768px) { .blog-back { margin-bottom: -12px; } }
.blog-closing .link-arrow { min-height: 44px; }

.blog-prose strong { font-weight: 600; }                                           /* the body face is loaded at 400, 500 and 600: no synthesised 700 */
@media (max-width: 767px) { .blog-prose h2 { font-size: 24px; line-height: 28px; } }   /* the phone scale's h3 step, not 28 */
.prose.blog-prose > .blog-table { margin-top: var(--s-24); }
.prose.blog-prose > .blog-note { margin-top: var(--s-12); }
.blog-th-r { text-align: right; }
.blog-sub { display: block; margin-top: var(--s-4); color: var(--ink-2); font-weight: 400; }
@media (max-width: 767px) {
  .blog-table > .table { min-width: 0; }                 /* two columns fit a phone, so no sideways scroll */
  .blog-table td.blog-range { white-space: normal; }
}

.prose.blog-prose > .blog-pull { margin-block: var(--s-48); padding-left: var(--s-24); border-left: 2px solid var(--ink); }
.blog-pull p { font: 500 28px/32px var(--font-display); text-wrap: balance; }
@media (max-width: 767px) { .blog-pull p { font-size: 24px; line-height: 28px; } }
.prose.blog-prose > .blog-sources { margin-top: var(--s-48); padding-top: var(--s-16); border-top: 1px solid var(--line); }

.blog-next { margin-top: var(--s-64); }
.blog-next .card { display: flex; flex-direction: column; gap: var(--s-12); }
.blog-next .card .link-arrow { margin-top: auto; padding-top: var(--s-4); }
@media (hover: hover) { .blog-next .card:hover .link-arrow::after { transform: translateX(var(--arrow-go)); } }
.blog-next .card:active .link-arrow::after { transform: translateX(var(--arrow-go)); }
@media (max-width: 767px) { .blog-next .grid-2 { gap: var(--s-16); } .blog-next { margin-top: var(--s-48); } }
.blog-nb { white-space: nowrap; }

/* ============================================================ 4. Phone and touch (phone pass, 13 Oct) */
/* Links are 44 targets (site.css gives a.link-arrow its 44 on a phone and a touch tablet): on a phone each is pulled back so the page keeps its spacing. */
@media (max-width: 767px), (pointer: coarse) {
  .blog-back { min-height: 44px; }
  .blog-closing .cluster { row-gap: var(--s-8); }                        /* button and link are two targets: 8 between them */
}
@media (max-width: 767px) {
  .blog-featured-body > .blog-stretch { margin-block: var(--s-12) -12px; }
  .blog-back { margin-top: -12px; }                                      /* 44 to tap, the words stay where they were */
  .blog-post-head > .eyebrow { margin-top: var(--s-16); }
}

/* ============================================================ 5. Reduced motion */
/* site.css makes every duration 0, but a transition that still has a delay (the bars' 60 to 300ms stagger) is created anyway and reports a
   transform run, so the page's own effects are switched off here, not left to the zero. What the page draws stays: the bars are simply there
   at full length, the plate and the cards are simply shown, hover and press change at once. */
@media (prefers-reduced-motion: reduce) {
  .blog-bar > i,
  .blog-featured-media img,
  .blog-back::before { transition: none; }
  .js .blog-side:not(.is-in) .blog-bar > i,
  .js .blog-fig:not(.is-in) .blog-bar > i { transform: none; }
}
