/* ============================================================
   Brochure-format PDF export for case study articles.
   Linked with media="print", so zero effect on screen.

   Page 1   full-bleed cover
   Page 2+  body: numbered sections, bleed figures, spec panel
   Close    sign-off and colophon
   Running footer repeated on every page after the cover.

   Deliberate robustness decision:
   Chrome's "Background graphics" option defaults to OFF, which
   drops every CSS background. So the cover's dark ground is baked
   into cover.webp as a real image rather than painted in CSS, and
   nothing anywhere depends on a background fill for legibility.
   Turning the option on adds refinement; leaving it off still
   produces a correct document.
   ============================================================ */

/* named pages: the cover needs no margin, the body does */
@page {
  size: A4 portrait;
  margin: 19mm 18mm 24mm;
}
@page coverpage {
  size: A4 portrait;
  margin: 0;
}

/* ---------- strip the site chrome, and the on-page header that
     the cover replaces ---------- */
nav.navbar,
.mobile-nav,
.article__toolbar,
.article__back,
.pdf-btn,
.draft-flag,
.cta-banner,
.endnote .links a[data-enquire],
footer.footer,
.article__hero {
  display: none !important;
}

html, body {
  background: #fff !important;
  color: #14141a !important;
  font-size: 10.4pt;
  line-height: 1.5;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.article { padding: 0 !important; }
.article__wrap, .endnote { max-width: none !important; margin: 0 !important; }

/* ============================================================
   PAGE 1  COVER
   ============================================================ */
.brochure-cover {
  display: block !important;
  page: coverpage;
  break-after: page;
  position: relative;
  /* With @page coverpage the page box is the full sheet, so 100% resolves to
     210x297 and the cover bleeds. Without named-page support the page box is
     the margin box, and these clamp the cover to fit instead of overflowing
     onto a second sheet. */
  width: 210mm;
  height: 297mm;
  max-width: 100%;
  max-height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  color: #fff;
}
.brochure-cover__shot {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
  max-width: none !important;
  max-height: none !important;
}

/* masthead, over the photograph */
.brochure-cover__head {
  position: absolute;
  top: 17mm; left: 18mm; right: 18mm;
}
/* the real Charge Qube lockup, reversed out in brand orange:
   stacked wordmark in the display face plus the corner triangle.
   Both are text and borders rather than backgrounds, so they print
   whether or not "Background graphics" is enabled. */
.brochure-cover__logo {
  display: flex;
  align-items: flex-end;
  gap: 4pt;
}
.brochure-cover__wordmark {
  display: flex;
  flex-direction: column;
  font-family: var(--font-display), 'TWKLausanne', sans-serif;
  font-weight: 700;
  font-size: 21pt;
  line-height: 1.06;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FF7A00;
}
.brochure-cover__tri {
  width: 0; height: 0;
  border-left: 12pt solid transparent;
  border-bottom: 12pt solid #FF7A00;
  margin-bottom: 1.5pt;
  flex-shrink: 0;
}

/* what this document is */
.brochure-cover__subtitle {
  display: block;
  margin-top: 12pt;
  padding-top: 9pt;
  border-top: 0.75pt solid rgba(255,255,255,0.5);
  font-size: 9pt;
  letter-spacing: 2.6px;
  text-transform: uppercase;
  color: #fff;
}
/* driven off the page banner: with no banner it resolves empty and
   collapses, leaving no gap under the subheading */
.brochure-cover__flag:empty { display: none !important; }
.brochure-cover__flag {
  display: block;
  margin-top: 7pt;
  font-size: 7pt;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: #FFAE5C;
}

/* title block, over the dark foot of the image */
.brochure-cover__body {
  position: absolute;
  left: 18mm; right: 18mm; bottom: 20mm;
}
.brochure-cover__kicker {
  font-size: 7.5pt;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #FF9B3D;
  margin-bottom: 11pt;
}
.brochure-cover__kicker .sep { color: rgba(255,255,255,0.35); margin: 0 5pt; }
.brochure-cover__title {
  font-size: 29pt;
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.6pt;
  margin: 0 0 13pt;
  color: #fff;
  max-width: 152mm;
}
.brochure-cover__stand {
  font-size: 11.5pt;
  font-weight: 300;
  line-height: 1.46;
  color: rgba(255,255,255,0.88);
  margin: 0 0 15pt;
  max-width: 146mm;
}
.brochure-cover__meta {
  padding-top: 9pt;
  border-top: 0.75pt solid rgba(255,255,255,0.3);
  font-size: 8pt;
  line-height: 1.6;
  color: rgba(255,255,255,0.78);
}
.brochure-cover__meta b { font-weight: 400; color: #fff; }

/* ============================================================
   BODY
   ============================================================ */
.body {
  font-size: 10.4pt !important;
  line-height: 1.58 !important;
  color: #1e1e24 !important;
  counter-reset: sec;
  hyphens: auto;
}
.body p { margin: 0 0 8.5pt !important; orphans: 3; widows: 3; }
.body > *:first-child { margin-top: 0 !important; }

/* section openers carry a large numeral, brochure style */
.body h2 {
  font-size: 14pt !important;
  line-height: 1.22 !important;
  margin: 19pt 0 8pt !important;
  color: #14141a !important;
  counter-increment: sec;
  break-after: avoid;
  break-inside: avoid;
}
.body h2::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  font-size: 19pt;
  line-height: 1;
  letter-spacing: -0.5pt;
  color: #FF7A00;
  margin-bottom: 7pt;
}
.body h3 { font-size: 11pt !important; margin: 12pt 0 4pt !important; break-after: avoid; break-inside: avoid; }
.body h2 + p, .body h3 + p, .body h2 + ul, .body h3 + ul { break-before: avoid; }
.body strong { color: #14141a !important; }
.body a.inline { color: #14141a !important; border-bottom: 0.5pt solid #FF7A00 !important; }
.body ul { margin: 0 0 9pt !important; }
.body ul li { margin-bottom: 5pt !important; padding-left: 15pt !important; break-inside: avoid; }
.body ul li::before { top: 7.5pt !important; width: 7pt !important; background: #FF7A00 !important; }

/* ---------- pull quote ---------- */
.pull {
  break-inside: avoid;
  margin: 17pt 0 !important;
  padding: 3pt 0 3pt 15pt !important;
  border-left: 3pt solid #FF7A00 !important;
}
.pull p { font-size: 14pt !important; line-height: 1.34 !important; color: #14141a !important; margin-bottom: 7pt !important; }
.pull cite { font-size: 8.5pt !important; color: #55555e !important; }

/* ---------- spec panel ---------- */
.aside {
  break-inside: avoid;
  background: none !important;
  border: 0 !important;
  border-top: 2pt solid #14141a !important;
  border-bottom: 0.5pt solid #d4d4d8 !important;
  padding: 9pt 0 !important;
  margin: 17pt 0 !important;
}
.aside h3 { font-size: 7pt !important; letter-spacing: 1.8px; color: #A64B00 !important; margin: 0 0 9pt !important; }
.aside__cols { display: grid !important; grid-template-columns: 1.3fr 1fr !important; gap: 0 16pt !important; }
.aside__col + .aside__col { padding-left: 16pt; border-left: 0.5pt solid #d4d4d8; }
.aside__colhead { font-size: 7pt !important; letter-spacing: 1.5px; text-transform: uppercase;
  color: #77777f !important; margin: 0 0 6pt !important; padding-bottom: 4pt;
  border-bottom: 0.5pt solid #d4d4d8; }
.aside dl { display: block !important; }
.aside .row { padding: 3.5pt 0 !important; border-bottom: 0.5pt dotted #cfcfd4 !important; break-inside: avoid; }
.aside dt { font-size: 9pt !important; color: #55555e !important; }
.aside dd { font-size: 9pt !important; color: #14141a !important;
  font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.aside .note { font-size: 7.5pt !important; color: #77777f !important; margin-top: 9pt !important; line-height: 1.5 !important; }

/* ---------- figures bleed to the paper edge ---------- */
.figure {
  break-inside: avoid;
  margin: 16pt 0 !important;
  width: 100% !important;
  max-width: 150mm !important;   /* 3:2 lands at 100mm tall */
}
.figure .frame {
  display: block !important;
  aspect-ratio: auto !important;
  background: none !important;      /* no grey slab if a photo is missing */
  overflow: visible !important;     /* nothing clips the photo */
  border-radius: 0 !important;
  height: auto !important;
}
.figure img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  max-height: 115mm !important;  /* a safety valve, not a crop */
  object-fit: cover !important;
  object-position: center !important;
}
/* portrait photographs keep their proportions and sit narrower */
/* each shape sized so its natural height clears its own cap */
.figure--portrait { max-width: 85mm !important; margin-left: 0 !important; }
.figure--portrait img { max-height: 118mm !important; }   /* 3:4 -> 113mm */
.figure--full { max-width: 150mm !important; }
.figure--full img { max-height: 118mm !important; }
.figure--natural { max-width: 105mm !important; margin-left: 0 !important; }
.figure--natural img { max-height: 110mm !important; }    /* ~1:1 -> 107mm */

.figure figcaption {
  font-size: 8pt !important;
  line-height: 1.5 !important;
  color: #6a6a72 !important;
  margin: 5pt 0 0 !important;
  padding-left: 7pt;
  border-left: 1.5pt solid #FF7A00;
  max-width: none !important;
}

/* ---------- sign-off ---------- */
.endnote {
  border-top: 2.5pt solid #FF7A00 !important;
  padding: 10pt 0 0 !important;
  margin-top: 20pt !important;
}
.endnote p { font-size: 9pt !important; line-height: 1.55 !important; color: #3a3a42 !important; margin-bottom: 8pt !important; }
.endnote .links { display: none !important; }
.endnote::after {
  content: "Charge Qube is a Fellten product  ·  Fellten Ltd, Bristol, United Kingdom";
  display: block;
  margin-top: 10pt;
  font-size: 7.5pt;
  color: #8a8a92;
}

/* ---------- sources, closing the report ---------- */
.print-sources {
  break-inside: avoid;
  margin-top: 14pt;
  padding-top: 8pt;
  border-top: 0.5pt solid #e2e2e6;
}
.print-sources__label {
  display: block;
  font-size: 7pt;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: #A64B00;
  margin-bottom: 6pt;
}
.print-sources__row {
  display: block;
  font-size: 10pt;
  line-height: 1.7;
  color: #14141a;
}
.print-sources__row a { color: #14141a !important; text-decoration: none; }

/* The running footer was removed. position:fixed lands inside the content
   flow in paged media rather than in the page margin, so it printed over
   the copy. Browser print cannot number pages either way. */
.print-footer { display: none !important; }

figure, .aside, .pull { page-break-inside: avoid; }
img { break-inside: avoid; }
