/* Article design: blog posts and guides (tools/article_design.py writes the markup).
   main.ad.ad-post = a post (news or opinion), main.ad.ad-guide = a long reference guide.
   Body copy size, colour and leading come from styles.css; this sets layout, spacing and width. */

main.ad { overflow-x: clip; }
main.ad + .site-footer { border-top: 6px solid var(--lime); }

/* ---------- hero: the photo full-bleed, the headline at the foot of it over a dark wash ---------- */
.ad-hero { position: relative; display: flex; align-items: flex-end; min-height: clamp(540px, 78vh, 820px); background: var(--black); color: #fff; overflow: hidden; isolation: isolate; }
.ad-guide .ad-hero { min-height: clamp(600px, 88vh, 920px); }
.ad-hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--pd, 50% 45%); z-index: -2; }
.ad-hero::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to top, rgba(14,14,14,.94) 0%, rgba(14,14,14,.82) 30%, rgba(14,14,14,.45) 58%, rgba(14,14,14,.12) 82%, rgba(14,14,14,0) 100%); }
.ad-hero-plain::after { content: none; }
.ad-hero-text { width: 100%; max-width: 1148px; margin: 0 auto; padding: 120px 24px 64px; }
.ad-hero h1 { color: #fff; max-width: 940px; font-size: clamp(2.5rem, 5.2vw, 4.8rem); line-height: 1; }
.ad-h-long h1, .ad-hero h1.hs-long { font-size: clamp(2.3rem, 4.2vw, 3.8rem); }
.ad-h-xlong h1 { font-size: clamp(2.1rem, 3.5vw, 3.2rem); }
.ad-hero .lead { color: rgba(255,255,255,.9); max-width: 700px; margin: 26px 0 0; }
.ad-byline { margin: 28px 0 0; padding-top: 16px; max-width: 700px; border-top: 1px solid rgba(255,255,255,.32); color: rgba(255,255,255,.88); font-weight: 700; }
.ad-byline::before { content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 12px; background: var(--lime); vertical-align: 0; }

/* a photo with a face low in the frame runs above the headline, fading into the black under it */
@media (min-width: 641px) {
  .ad-stack-d { display: block; min-height: 0; }
  .ad-guide .ad-stack-d { min-height: 0; }
  .ad-stack-d .ad-hero-img { position: relative; inset: auto; z-index: -2; height: clamp(320px, 46vh, 520px); object-position: var(--sd, 50% 40%); }
  .ad-stack-d::after { inset: auto 0 auto 0; top: calc(clamp(320px, 46vh, 520px) - 120px); height: 120px; background: linear-gradient(to bottom, rgba(14,14,14,0), var(--black)); }
  .ad-stack-d .ad-hero-text { padding-bottom: 56px; }
  .ad-stack-d .ad-hero-text { padding-top: 6px; }
}
@media (max-width: 640px) {
  .ad-stack-m { display: block; min-height: 0 !important; }
  .ad-stack-m .ad-hero-img { position: relative; inset: auto; z-index: -2; height: 380px; object-position: var(--sm, 50% 40%) !important; }
  .ad-stack-m::after { inset: auto 0 auto 0; top: 250px; height: 130px; background: linear-gradient(to bottom, rgba(14,14,14,0), var(--black)) !important; }
  .ad-stack-m .ad-hero-text { padding-top: 6px; }
}

/* ---------- the reading column: 700px centred; quotes, wide tables and photos break out of it ---------- */
.ad-read { padding: 64px 0 96px; }
.ad-wrap { max-width: 748px; margin: 0 auto; padding: 0 24px; }
.ad .ad-body { max-width: none; margin: 0; --wide: min(1100px, 100vw - 48px); }
.ad-body > :first-child { margin-top: 0; }

.ad-source { margin: 0 0 28px; }
.ad-source p { margin: 0; }
.ad .ad-source .mark { display: inline-block; background: none; padding: 2px 0 2px 14px; border-left: 4px solid var(--lime); text-decoration: none; color: var(--black); }
.ad .ad-source .mark:hover { text-decoration: underline; }

.ad-lede p { font-size: 1.3rem; line-height: 1.55; color: var(--black); margin-bottom: 30px; }

.ad .ad-body h2 { font-size: clamp(1.75rem, 2.7vw, 2.35rem); line-height: 1.05; margin: 60px 0 18px; }
.ad-post .ad-body h2::before { content: ""; display: block; width: 44px; height: 6px; margin-bottom: 18px; background: var(--lime); }
.ad-guide .ad-body { counter-reset: adsec; }
.ad-guide .ad-body h2 { counter-increment: adsec; }
.ad-guide .ad-body h2::before { content: counter(adsec, decimal-leading-zero); display: block; width: fit-content; margin-bottom: 14px; padding: 3px 9px 2px; background: var(--lime); color: var(--black); font: 900 .95rem/1.2 "Lato", Arial, sans-serif; letter-spacing: .04em; }
.ad .ad-body h3 { margin: 34px 0 10px; }

/* lists: ruled, with a square marker */
main.ad .ad-body.article-body > ul:not([class]) { display: block; list-style: none; padding: 0; margin: 4px 0 30px; border-top: 1px solid var(--line); }
main.ad .ad-body.article-body > ul:not([class]) > li { position: relative; margin: 0; padding: 13px 0 13px 30px; background: none !important; grid-column: auto !important; border-radius: 0; border-bottom: 1px solid var(--line); }
main.ad .ad-body.article-body > ul:not([class]) > li::before { content: ""; position: absolute; left: 3px; top: 22px; width: 9px; height: 9px; border-radius: 0; background: var(--lime); box-shadow: 0 0 0 2px var(--black); }
main.ad .ad-body.article-body > ol:not([class]) { display: block; list-style: none; counter-reset: adol; padding: 0; margin: 4px 0 30px; border-top: 1px solid var(--line); }
main.ad .ad-body.article-body > ol:not([class]) > li { counter-increment: adol; position: relative; margin: 0; padding: 13px 0 13px 44px; background: none; border-radius: 0; border-bottom: 1px solid var(--line); }
main.ad .ad-body.article-body > ol:not([class]) > li::before { content: counter(adol); position: absolute; left: 0; top: 13px; width: 28px; height: 28px; border-radius: 0; display: grid; place-items: center; background: var(--lime); color: var(--black); font: 900 .9rem/1 "Lato", Arial, sans-serif; box-shadow: none; }

/* pull quotes: the article's own sentence, set wider than the column */
.ad-pull { width: min(1000px, 100vw - 48px); margin: 54px 0 50px calc(50% - min(500px, 50vw - 24px)); padding: 26px 0 0; border-top: 6px solid var(--black); }
.ad-pull p { margin: 0; font-weight: 900; font-size: clamp(1.5rem, 2.5vw, 2.15rem); line-height: 1.25; color: var(--black); max-width: 900px; }
.ad-pull p::before { content: "\201C"; }
.ad-pull p::after { content: "\201D"; }

/* tables: ruled reference tables; four or more columns run the full width of the column and margin */
.ad .ad-body table { width: 100%; border-collapse: collapse; margin: 28px 0 30px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.ad .ad-body table th, .ad .ad-body table td { padding: 12px 16px 12px 0; text-align: left; vertical-align: top; border: 0; border-bottom: 1px solid var(--line); background: none; }
.ad .ad-body table thead th, .ad .ad-body table tr.hs-head th, .ad .ad-body table tr:first-child th { font-weight: 900; color: var(--black); border-bottom: 3px solid var(--black); padding-top: 0; }
.ad .ad-body table tbody th, .ad .ad-body table td:first-child { font-weight: 700; color: var(--black); }
.ad .ad-body table tr.total td, .ad .ad-body table tr.total th, .ad .ad-body table td.total { font-weight: 900; color: var(--black); background: var(--lime); border-bottom: 0; }
.ad .ad-body table tr.total td:first-child { padding-left: 12px; }
.ad .ad-body table caption { caption-side: bottom; text-align: left; padding-top: 10px; color: var(--grey); }
.ad-body > table:has(tr > :nth-child(4)), .ad-body > div:has(table tr > :nth-child(4)) { width: var(--wide); max-width: none; margin-left: calc(50% - var(--wide) / 2); }
.ad-body > div:has(> table) { overflow-x: auto; }
.ad .ad-body .source-note { color: var(--grey); font-size: .9rem; }
.ad .ad-body figure { margin: 30px 0; }
.ad .ad-body figure svg { max-width: 100%; height: auto; }
.ad .ad-body figcaption { color: var(--grey); font-size: .92rem; margin-top: 10px; }

/* a second photograph: a full-width break between two parts of the article */
.ad .ad-body > .ad-photo { max-width: none; width: 100vw; margin: 64px 0 56px calc(50% - 50vw); }
.ad-photo img { width: 100%; height: clamp(320px, 58vh, 600px); object-fit: cover; object-position: 50% 40%; }
.ad .ad-body > .ad-photo figcaption { max-width: 1040px; margin: 12px auto 0; padding: 0 24px; }

/* contents */
.ad-toc { margin: 8px 0 44px; padding: 22px 0 6px; border-top: 3px solid var(--black); border-bottom: 1px solid var(--line); }
.ad-toc-h { font-weight: 900; color: var(--black); margin: 0 0 12px; }
.ad-toc ol { list-style: none; margin: 0; padding: 0; counter-reset: adtoc; columns: 2; column-gap: 48px; }
.ad-toc li { counter-increment: adtoc; break-inside: avoid; display: grid; grid-template-columns: 34px 1fr; padding: 9px 0; border-top: 1px solid var(--line); font-size: .98rem; line-height: 1.4; }
.ad-toc li::before { content: counter(adtoc, decimal-leading-zero); font-weight: 900; color: var(--grey); }
.ad .ad-toc a { color: var(--black); font-weight: 700; text-decoration: none; }
.ad .ad-toc a:hover { text-decoration: underline; }
.ad-post .ad-toc ol { columns: 1; }

/* ---------- sign-off: the author, photo running the band's full height to the window edge ---------- */
.ad-sign { background: var(--black); color: #fff; }
.ad-sign .author-card { display: grid; grid-template-columns: minmax(260px, 34vw) minmax(0, 1fr); gap: 0; max-width: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; align-items: stretch; }
.ad-sign .author-card > img, .ad-sign .author-card > .initial { width: 100%; height: 100%; min-height: 380px; max-width: none; object-fit: cover; object-position: 50% 22%; border-radius: 0; margin: 0; }
.ad-sign .author-card > .initial { display: grid; place-items: center; background: var(--lime); color: var(--black); font: 900 4rem/1 "Lato", Arial, sans-serif; }
.ad-sign .author-card > div:last-child { padding: 72px max(24px, calc((100vw - 1088px) / 2 + 24px)) 72px 64px; align-self: center; }
.ad-sign .author-card .name { color: #fff; font-size: 1.5rem; margin-bottom: 14px; }
.ad-sign .author-card p { color: rgba(255,255,255,.86); max-width: 640px; font-size: 1rem; }
.ad-sign .author-card a { color: var(--lime); }
.ad-sign .hs-aside-cta { max-width: 1088px; margin: 0 auto; padding: 0 24px 64px; }

/* ---------- questions: question on the left, answer beside it, every answer open ---------- */
.ad .ad-qa { padding: 88px 0 72px; border-top: 0; }
.ad-qa-in { max-width: 1088px; margin: 0 auto; padding: 0 24px; }
.ad-qa h2 { margin: 0 0 34px; max-width: 700px; }
.ad-qa-list { border-top: 3px solid var(--black); }
.ad .ad-qa .faq-item { display: block; padding: 26px 0; margin: 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; box-shadow: none; }
.ad .ad-qa .faq-item::after { content: ""; display: table; clear: both; }
.ad .ad-qa .faq-item summary { float: left; width: 34%; padding: 0 40px 0 0; display: block; cursor: default; pointer-events: none; list-style: none; font-size: 1.12rem; line-height: 1.35; }
.ad .ad-qa .faq-item summary::after { content: none; }
.ad .ad-qa .faq-item > :not(summary) { margin: 0 0 0 34%; color: var(--charcoal); max-width: 700px; }
.ad .ad-qa .faq-item > :not(summary) + :not(summary) { margin-top: 12px; }

/* ---------- sections other tools add after the article: set as plain ruled blocks ---------- */
.ad .ad-gate, .ad > section.section:has(.guide-gate) { padding: 40px 0 72px; }
.ad .guide-gate { max-width: 1040px; margin: 0 auto; padding: 32px 0 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 56px; }
.ad .guide-gate > :not(form) { grid-column: 1; }
.ad .guide-gate > form { grid-column: 2; grid-row: 1 / span 4; }
.ad > section.section:has(.guide-gate) > .inner.narrow, .ad .ad-gate > .inner.narrow { max-width: 1088px; }

.ad > section[class*="-handover"] { padding: 64px 0; border-top: 1px solid var(--line); background: #fff; }
.ad > section[class*="-handover"] > .inner { max-width: 1088px; }
.ad > section[class*="-handover"] h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); margin-bottom: 12px; }
.ad > section[class*="-handover"] .grid { gap: 0 40px !important; margin-top: 22px !important; }
.ad > section[class*="-handover"] .card { padding: 18px 0 20px; border: 0; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none; background: none; }
.ad > section[class*="-handover"] .card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.ad > section[class*="-handover"] .card .btn, .ad > section[class*="-handover"] .btn-row .btn-outline { display: inline; padding: 0; border: 0; background: none; border-radius: 0; min-height: 0; font-weight: 900; color: var(--black); text-decoration: underline; text-underline-offset: .2em; box-shadow: none; }
.ad > section[class*="-handover"] .btn-row { gap: 14px 24px; align-items: center; }

/* related pages: a ruled list of what to read next */
.ad > .article-end-cta { background: #fff; padding: 80px 0 88px; border-top: 1px solid var(--line); }
.ad > .article-end-cta > .inner { max-width: 1088px; }
.ad .end-cta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; margin-top: 26px; border-top: 3px solid var(--black); }
.ad .end-cta-card { display: grid; grid-template-columns: 1fr auto; column-gap: 20px; padding: 20px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; }
.ad .end-cta-card strong { grid-column: 1; font-size: 1.15rem; color: var(--black); }
.ad .end-cta-card span { grid-column: 1; opacity: 1; color: var(--grey); }
.ad .end-cta-card::after { content: "\2192"; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 40px; height: 40px; display: grid; place-items: center; background: var(--lime); color: var(--black); font-weight: 900; }
.ad .end-cta-card:hover strong { text-decoration: underline; }
.ad .end-cta-line { margin-top: 22px; }

.ad > .cta-banner { background: #fff; padding: 64px 0; border-top: 1px solid var(--line); text-align: left; }
.ad > .cta-banner > .inner { max-width: 1088px; }
.ad > .cta-banner .btn-row { justify-content: flex-start; margin-top: 22px; }
.ad > .accred-strip { border-top: 1px solid var(--line); }

/* the close: the quote on lime and Business Pulse on black, side by side, edge to edge */
.ad .post-cta { padding: 0; background: var(--black); }
.ad .post-cta > .inner { max-width: none; padding: 0; }
.ad .post-cta .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 !important; align-items: stretch; }
.ad .post-cta .qstart { background: var(--lime); border-radius: 0; box-shadow: none; padding: 80px 64px 80px max(24px, calc((100vw - 1088px) / 2 + 24px)); }
.ad .post-cta .qstart form { max-width: 470px; }
.ad .post-cta .qstart h2 { font-size: clamp(2rem, 3.2vw, 2.8rem); margin-bottom: 12px; }
.ad .post-cta .qstart .qs-say { color: var(--black); }
.ad .post-cta .qstart .qs-opts label { background: #fff; border-color: #fff; }
.ad .post-cta .qstart .qs-opts label:hover, .ad .post-cta .qstart .qs-opts label:has(input:checked) { border-color: var(--black); }
.ad .post-cta .qstart .qs-opts label:has(input:checked) { background: #fff; }
.ad .post-cta .card { background: var(--black); color: #fff; border: 0; border-radius: 0; box-shadow: none; padding: 80px max(24px, calc((100vw - 1088px) / 2 + 24px)) 80px 64px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.ad .post-cta .card h3 { color: #fff; font-size: 1.5rem; margin-bottom: 14px; }
.ad .post-cta .card p { color: rgba(255,255,255,.86); max-width: 470px; }
.ad .post-cta .card p strong { color: var(--lime); }
.ad .post-cta .card .btn-outline { margin-top: 14px; border-color: var(--lime); color: var(--lime); background: none; }
.ad .post-cta .card .btn-outline:hover { background: var(--lime); color: var(--black); }

/* ---------- narrower screens ---------- */
@media (max-width: 900px) {
  .ad-sign .author-card { grid-template-columns: 1fr; }
  .ad-sign .author-card > img, .ad-sign .author-card > .initial { height: 360px; min-height: 0; }
  .ad-sign .author-card > div:last-child { padding: 40px 24px 48px; }
  .ad .ad-qa .faq-item summary { float: none; width: auto; padding: 0 0 10px; }
  .ad .ad-qa .faq-item > :not(summary) { margin-left: 0; }
  .ad .guide-gate { grid-template-columns: 1fr; }
  .ad .guide-gate > form { grid-column: 1; grid-row: auto; margin-top: 18px; }
  .ad .end-cta-grid { grid-template-columns: 1fr; }
  .ad .post-cta .grid { grid-template-columns: 1fr; }
  .ad .post-cta .qstart, .ad .post-cta .card { padding: 56px 24px; }
}
@media (max-width: 640px) {
  .ad-hero { min-height: 640px; }
  .ad-guide .ad-hero { min-height: 700px; }
  .ad-hero-img { object-position: var(--pm, 50% 50%); }
  .ad-hero::after { background: linear-gradient(to top, rgba(14,14,14,.95) 0%, rgba(14,14,14,.85) 42%, rgba(14,14,14,.4) 68%, rgba(14,14,14,.08) 90%); }
  .ad-hero-text { padding: 96px 20px 40px; }
  .ad-hero h1 { font-size: clamp(2.2rem, 10vw, 3rem); }
  .ad-h-long h1, .ad-hero h1.hs-long { font-size: clamp(2rem, 8.6vw, 2.6rem); }
  .ad-h-xlong h1 { font-size: clamp(1.8rem, 7.6vw, 2.3rem); }
  .ad-read { padding: 40px 0 64px; }
  .ad-wrap, .ad-qa-in { padding: 0 20px; }
  .ad-lede p { font-size: 1.15rem; }
  .ad-toc ol { columns: 1; }
  .ad-pull { margin-top: 40px; margin-bottom: 36px; }
  .ad .ad-body > .ad-photo { margin: 44px 0 40px calc(50% - 50vw); }
  .ad-photo img { height: 300px; }
  .ad .ad-qa { padding: 64px 0 48px; }
  .ad > .article-end-cta { padding: 56px 0 64px; }
}
