/* PDF-friendly print stylesheet для blog и cases страниц.
   Подключается через <link rel="stylesheet" media="print"> в blog/[slug].astro и cases/[slug].astro.
   Цель: чистая печатаемая статья без шапки/футера/CTA, оптимизированный размер шрифта, читаемые таблицы. */

@media print {
  @page {
    size: A4;
    margin: 18mm 16mm 20mm 16mm;
  }

  /* Скрываем всё, что не относится к контенту статьи */
  body > .site-footer,
  body > footer,
  body > .header-desktop,
  body > .mobile-nav-slot,
  body > .mobile-header,
  body > .mobile-bottom-bar,
  body > .trust-bar,
  body > .breadcrumbs,
  body > .sticky-desktop-cta,
  body > .sticky-desktop-cta-wrap,
  body > .cookie-banner,
  .be-leadmagnet,
  .be-cta,
  .ce-cta,
  .related-links,
  .related-list,
  .inline-cta,
  .blog-toc,
  .blog-progress {
    display: none !important;
  }

  /* Базовый сброс */
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.45;
  }

  main, .container, .be-article, .ce-article, .be-hero, .ce-hero, .ce-stats {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #555;
    word-break: break-all;
  }
  a[href^="/"]::after,
  a[href^="#"]::after {
    content: "";
  }

  h1 { font-size: 22pt; line-height: 1.15; margin: 0 0 12pt; page-break-after: avoid; }
  h2 { font-size: 16pt; margin: 18pt 0 8pt; page-break-after: avoid; }
  h3 { font-size: 13pt; margin: 14pt 0 6pt; page-break-after: avoid; }
  p, li { orphans: 3; widows: 3; }
  ul, ol { padding-left: 18pt; }

  /* Таблицы */
  table {
    border-collapse: collapse;
    width: 100%;
    page-break-inside: avoid;
    font-size: 10pt;
    margin: 10pt 0;
  }
  th, td {
    border: 1px solid #888;
    padding: 4pt 6pt;
    text-align: left;
  }
  thead { background: #eee !important; }

  /* Blockquotes (callouts) */
  blockquote {
    margin: 10pt 0;
    padding: 8pt 12pt;
    border-left: 3pt solid #000;
    background: #f7f7f7 !important;
    font-style: italic;
    page-break-inside: avoid;
  }

  /* Print-only header — название компании на каждой странице */
  body::before {
    content: "ПМК «Крепкий Остров» · krepkiyostrov.ru · +7 (909) 092-8157";
    display: block;
    font-size: 8pt;
    color: #666;
    border-bottom: 1pt solid #999;
    padding-bottom: 4pt;
    margin-bottom: 12pt;
  }

  /* Hero мета */
  .be-hero__meta, .ce-hero__meta {
    font-size: 9pt;
    color: #444;
    margin-bottom: 12pt;
  }

  /* Image поведение */
  img {
    max-width: 100% !important;
    height: auto !important;
    page-break-inside: avoid;
  }

  /* FAQ accordion в распечатке — все open */
  details {
    page-break-inside: avoid;
  }
  details > summary {
    list-style: none;
    cursor: default;
    pointer-events: none;
  }
  details > summary::-webkit-details-marker { display: none; }

  /* Skip block highlight */
  .be-callout, .ce-callout {
    border: 1pt solid #999;
    background: #fafafa !important;
    padding: 8pt 12pt;
    margin: 10pt 0;
    font-size: 10pt;
    page-break-inside: avoid;
  }
}
