/* Shared page structure. Existing navigation, typography, cards and share controls
   keep their established theme. Headings and their ad form one reading unit. */
.site-main-flow, .reader-heading { min-width: 0; }
.reader-heading { display: flow-root; width: 100%; }
.site-main-flow .article-layout > * { min-width: 0; }
[data-page-layout="article"] .article-layout {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1080px;
  margin-inline: auto;
}
[data-page-layout="article"] .article-layout > :is(.side,.sidebar) {
  position: static; width: 100%; max-width: none;
  grid-template-columns: minmax(0,1fr);
}
[data-page-layout="article"] .article > :is(p,ul,ol) { max-width: 82ch; }
.site-main-flow :is(.section-head,.driver-download-callout,.download-panel):has(.reader-heading) {
  display: block;
}
.site-main-flow .download-panel:has(.reader-heading)::after { content: none; }
.site-main-flow .download-panel .download-info { width: 100%; max-width: none; }
.site-main-flow .section-head:has(.reader-heading) > div { width: 100%; }
.site-main-flow .driver-download-callout:has(.reader-heading) .driver-download-callout-copy { width: 100%; }
.site-main-flow .reader-heading + :is(a,button) { position: relative; }

.ad-frame.heading-placement {
  box-sizing: border-box; display: block; position: relative;
  min-width: 0; min-height: 0; aspect-ratio: auto; padding: 0;
  width: min(100%, 970px); margin: 20px auto 28px;
  background: #fff; border: 0; outline: 1px solid #e6ebf1;
}
.reader-heading > .heading-placement > ins.adsbygoogle,
.reader-heading > .heading-placement:has(> template)::before {
  content: ""; display: block; box-sizing: border-box;
  width: 100%; height: 250px; min-height: 0;
}
.heading-placement[data-heading-ad="side"] { width: min(100%, 300px); }
.heading-placement[data-heading-ad="side"] > ins,
.heading-placement[data-heading-ad="side"]:has(> template)::before {
  content: ""; display: block; width: 100%; height: 600px;
}
@media screen and (min-width: 961px) {
  [data-page-layout="home"] .hero-grid { grid-template-columns: minmax(0, 1fr); }
  [data-page-layout="home"] .hero-content { position: relative; z-index: 1; }
  [data-page-layout="home"] .hero-content > :not(.reader-heading) { max-width: 660px; }
  [data-page-layout="home"] .hero-art { position: absolute; inset: 0 0 0 auto; width: 44%; }
}
@media screen and (max-width: 960px) {
  .reader-heading > .ad-frame.heading-placement { width: min(100%, 300px); }
  .reader-heading > .heading-placement > ins.adsbygoogle,
  .reader-heading > .heading-placement:has(> template)::before { height: auto; aspect-ratio: 1 / 1; }
  .heading-placement[data-heading-ad="side"] { display: none; }
}
.article-ads-unavailable .ad-frame.heading-placement,
.ad-frame.heading-placement[data-request-failed],
.ad-frame.heading-placement:has(> ins[data-ad-status="unfilled"]) { display: none; }
@media print {
  .ad-frame.heading-placement { display: none !important; }
}

/* The title block and the reading column share the same edges. */
@media screen {
  main[data-page-layout="article"] {
    --reading-width: 720px;
    --reading-gutters: 40px;
  }
  main[data-page-layout="article"] > .site-main-flow > :is(.page-hero, .wrap) {
    box-sizing: border-box;
    width: min(var(--reading-width), calc(100% - var(--reading-gutters)));
    max-width: var(--reading-width);
    margin-inline: auto;
  }
  main[data-page-layout="article"] .reader-heading > h1 {
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    text-align: center;
    font-size: clamp(1.75rem, 4.5vw, 2.625rem);
    line-height: 1.28;
    letter-spacing: -0.035em;
    text-wrap: balance;
    overflow-wrap: anywhere;
  }
  main[data-page-layout="article"] .reader-heading > h1 .title-phrase {
    white-space: nowrap;
  }
  main[data-page-layout="article"] .reader-heading > h1:lang(ko) {
    word-break: keep-all;
  }
  main[data-page-layout="article"] .page-hero > .wrap,
  main[data-page-layout="article"] .reader-heading > .heading-placement[data-heading-ad="h1"] {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
  }
}
@media screen and (max-width: 640px) {
  main[data-page-layout="article"] { --reading-gutters: 26px; }
}
@media screen {
  main[data-page-layout="article"],
  main[data-page-layout="article"] :is(.article-layout, .article, .page-hero, .page-heading, .download-panel, .driver-download-callout, .model-toc, .checklist, .legacy-note, .translation-note) {
    background: #fff;
  }
  main[data-page-layout="article"] .article-layout { container-type: inline-size; }
  main[data-page-layout="article"] .article-layout .heading-placement:is([data-heading-ad="h2"], [data-heading-ad="side"]) {
    /* Include the inset of padded cards while keeping the ad on the reading column. */
    width: 100cqi;
    max-width: none;
    margin-inline: calc((100% - 100cqi) / 2);
  }
  main[data-page-layout="article"] .heading-placement { outline: none; }
  main[data-page-layout="article"] .heading-placement[data-heading-ad="side"] > ins,
  main[data-page-layout="article"] .heading-placement[data-heading-ad="side"]:has(> template)::before {
    height: 250px;
  }
}
