/* Издательский печатный стиль maxlawman.ru
   Применяется только в @media print через media-query на linking tag.
   Цель: любая страница печатается как «премиальный документ A4». */

@page {
  size: A4;
  margin: 22mm 18mm 24mm 18mm;
  @bottom-right {
    content: counter(page) " / " counter(pages);
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 9pt;
    color: #6d6557;
  }
  @bottom-left {
    content: "maxlawman.ru · Макс Лоумен";
    font-family: 'Golos Text', sans-serif;
    font-weight: 600;
    font-size: 8pt;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9c6a32;
  }
}

@page :first {
  margin-top: 26mm;
}

html, body {
  background: #fff !important;
  color: #1c1813 !important;
  font-size: 10.5pt;
  line-height: 1.55;
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 400;
}

/* Hide everything chrome/UI */
.seo-header, header.seo-header,
nav.seo-nav, .seo-nav,
.breadcrumbs, .crumbs,
.mobile-cta, .stickbar, .stickbar-inner,
.cookie, .cookie-banner, #cookieBanner,
#gsbOverlay, .form-modal, .fm-card,
#newsletter, .channel-strip, .cs-tg,
.back-to-top, #ar-toc, #ar-bar,
.btn-cal-open, [data-cal-link],
.lang-switch, .exit-intent, .scroll-progress,
footer, .seo-footer,
.skip-link, .print-card .pc-foot a,
form, .of-go, .of-consent, .fd-btn, .filedrop,
audio, video, iframe, .yt, .yt-embed {
  display: none !important;
  visibility: hidden !important;
}

/* Hero — replace with editorial title block */
.hero, .hero-premium, .seo-hero, .ref-hero, .ks-hero, .rep-hero, .cl-hero, .pay-shell,
.rd-hero, .rcg-hero, .press-hero {
  background: none !important;
  color: #1c1813 !important;
  padding: 0 0 14mm 0 !important;
  border: none !important;
}
.hero-img, .hero-vignette, .hero-grain, .hero-cap,
.hero-eyebrow .he-line, .ks-hero::before, .rep-hero::before {
  display: none !important;
}

h1, .hero h1 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 22pt !important;
  line-height: 1.18 !important;
  color: #1c1813 !important;
  letter-spacing: -0.012em !important;
  margin: 0 0 8mm 0 !important;
  page-break-after: avoid;
}

h2 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 14pt !important;
  line-height: 1.22 !important;
  color: #1c1813 !important;
  margin: 9mm 0 3mm 0 !important;
  page-break-after: avoid;
  page-break-inside: avoid;
}

h3 {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-weight: 500 !important;
  font-size: 12pt !important;
  line-height: 1.3 !important;
  margin: 6mm 0 2mm 0 !important;
  page-break-after: avoid;
}

p, li {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 10.5pt !important;
  line-height: 1.55 !important;
  color: #1c1813 !important;
  orphans: 3;
  widows: 3;
}

/* Body typography polish */
.prose, .art-body, .wrap, main, article, section {
  max-width: none !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: none !important;
}

/* Links — keep readable but printable */
a {
  color: #1c1813 !important;
  text-decoration: none !important;
}
a[href^="http"]::after {
  content: " [" attr(href) "]";
  font-family: 'Golos Text', sans-serif;
  font-size: 8.5pt;
  color: #6d6557;
  font-weight: 400;
  word-break: break-all;
}
a[href^="/"]::after,
a[href^="mailto:"]::after,
a[href^="tel:"]::after,
a[href^="#"]::after {
  content: "";
}

/* Editorial cover page on first page — synthesised via body */
body::before {
  content: "Макс Лоумен";
  display: block;
  position: running(brand);
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 600;
  font-size: 16pt;
  letter-spacing: -0.01em;
  color: #1c1813;
  margin-bottom: 2mm;
}

@page :first {
  @top-left {
    content: "Макс Лоумен · Бизнес-юрист по защите собственников";
    font-family: 'Golos Text', sans-serif;
    font-weight: 600;
    font-size: 9pt;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9c6a32;
  }
  @top-right {
    content: "maxlawman.ru";
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: 9pt;
    color: #3a342b;
  }
}

@page {
  @top-left {
    content: "Макс Лоумен";
    font-family: 'Golos Text', sans-serif;
    font-weight: 600;
    font-size: 8pt;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #9c6a32;
  }
}

/* Cards / decorative blocks — flatten */
.tariff, .pquote, .qual, .comp, .testimonials, .objections, .quiz, .final,
.pdf, .whitepaper, .marquee, .channel-strip,
.ks-fact, .ks-svg, .ko-grid, .rb-cell,
.pub, .pub.feat, .stickbar,
.lm-cta, .ko-cta {
  background: none !important;
  color: #1c1813 !important;
  border: 1pt solid #ccc3ad !important;
  padding: 4mm 5mm !important;
  margin: 4mm 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  page-break-inside: avoid;
}

blockquote, .pquote-text, .pull-quote {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-style: italic !important;
  font-size: 12pt !important;
  line-height: 1.5 !important;
  color: #1c1813 !important;
  padding: 4mm 6mm !important;
  margin: 5mm 0 !important;
  border-left: 1.5pt solid #9c6a32 !important;
  page-break-inside: avoid;
}

table {
  border-collapse: collapse;
  width: 100%;
  margin: 4mm 0;
  font-size: 9.5pt;
  page-break-inside: avoid;
}
th, td {
  border: 0.5pt solid #ccc3ad;
  padding: 3mm 4mm;
  text-align: left;
  vertical-align: top;
}
th {
  background: #f1ece1 !important;
  font-family: 'Golos Text', sans-serif;
  font-weight: 600;
  font-size: 8.5pt;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1c1813;
}

img {
  max-width: 100% !important;
  height: auto !important;
  page-break-inside: avoid;
}

/* SVG — keep but desaturate slightly for ink economy */
svg {
  max-width: 100% !important;
  height: auto !important;
  filter: contrast(1.05);
}

/* Roman numerals decorative — hide */
[data-folio] {
  position: relative;
}
[data-folio]::before {
  display: none !important;
}

/* List restyling */
ul, ol {
  margin: 3mm 0 4mm 6mm;
  padding: 0;
}
ul li, ol li {
  margin-bottom: 1.5mm;
  page-break-inside: avoid;
}

/* Code, pre — keep monospace */
code, pre {
  font-family: 'Golos Text', sans-serif !important;
  font-size: 9pt;
  background: #f5f0e2 !important;
  padding: 1mm 2mm;
  border-radius: 0;
}

/* Avoid orphaned headings */
h1, h2, h3, h4 { break-after: avoid-page; }

/* Captions for figures */
figure { margin: 4mm 0; page-break-inside: avoid; }
figcaption {
  font-family: 'Golos Text', sans-serif;
  font-size: 8.5pt;
  letter-spacing: 0.04em;
  color: #6d6557;
  margin-top: 2mm;
  text-align: center;
}

/* Hero watermark (subtle ML monogram bottom-right via fixed positioning per @page) */
@page {
  @bottom-right {
    content: counter(page) " / " counter(pages);
  }
}

/* Ensure page breaks before major sections in long articles */
section.sec[data-folio="IV"],
section.sec[data-folio="VII"] {
  page-break-before: always;
}

/* TOC removal */
#ar-toc, #ar-bar { display: none !important; }
