/* ============================================================
   MOTEC IT GmbH – Druck  (assets/css/print.css, media="print")
   Navigation/Footer/Quickbar/Dialog ausblenden, Hotline und Notfallkarte groß, Links mit URL, Seitenumbrüche.
   ============================================================ */

@page { margin: 18mm 16mm; }

@media print {
  :root {
    --m-bg: #fff; --m-bg-alt: #f2f3f5; --m-bg-inverse: #fff; --m-bg-footer: #fff; --m-surface: #fff; --m-surface-inverse: #fff;
    --m-text: #000; --m-text-muted: #444; --m-text-inverse: #000; --m-text-inverse-muted: #444;
    --m-accent: #E84E0E; --m-accent-text: #000; --m-accent-text-inverse: #000; --m-accent-on-inverse: #E84E0E;
    --m-border: #999; --m-border-strong: #666; --m-border-inverse: #999;
    --m-photo-filter: grayscale(1);
  }

  *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; transform: none !important; opacity: 1 !important; translate: none !important; }
  html { font-size: 11pt; scroll-padding-top: 0; }
  body { background: #fff !important; color: #000 !important; padding-bottom: 0 !important; overflow: visible; }
  main { display: block; }

  /* Ausblenden */
  .m-header, .m-notice, .m-servicebar, .m-quickbar, .m-dialog, .m-skip-link, .m-theme-toggle, .m-theme-segment, .m-segment, .m-print-hint, .m-sentinel,
  .m-footer__list, .m-footer__legal, .m-footer__partners, .m-footer__region,
  .m-cta, .m-strip, .m-breadcrumbs, .m-pagination, .m-postnav,
  .m-hero__rule, .m-hero__media, .m-hero__actions, .m-btn-group,
  .m-form__pow, .m-form__honeypot, .m-form__actions, .m-notfall__print, .m-notfall__actions,
  .m-check__nav, .m-check__actions, .m-check__mode, .m-deadlines__filter, .m-partners, .m-map__legend,
  video, iframe, .m-nav__mega, .m-header__progress, .m-quickbar__progress, dialog, .m-footer__remote, .m-footer__note,
  [data-m-marquee-toggle] { display: none !important; }

  /* Footer-Logo: auf Papier die farbige Datei statt der negativen */
  .m-footer .m-logo__img--neg { display: none !important; }
  .m-footer .m-logo__img--color { display: block !important; height: 12mm; width: auto; }
  .m-footer__title::before { background: #E84E0E !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* Inseln hell, Linien bleiben */
  .m-inverse, .m-status, .m-hero--inverse, .m-island, .m-nav__mega-cta, .m-notfall__hotline, .m-team__placeholder {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #999 !important;
  }
  .m-status, .m-notfall__hotline, .m-island { border-top: 4px solid #E84E0E !important; }
  .m-section { padding-block: 6mm; }
  .m-section--muted { background: #fff; }
  .m-container, .m-container--wide { width: 100%; }
  .m-section__head { margin-bottom: 4mm; }

  /* Hotline groß */
  .m-status__tel, .m-hero__hotline a[href^="tel:"], .m-notfall__hotline a[href^="tel:"], .m-cta__hotline, .m-dialog__hotline a[href^="tel:"], .m-phone--lg, .m-phone--xl, .m-form__callbox a[href^="tel:"] {
    font-size: 22pt !important;
    font-weight: 700 !important;
    color: #000 !important;
    text-decoration: none !important;
  }
  .m-status__tel::after, .m-notfall__hotline a[href^="tel:"]::after, .m-hero__hotline a[href^="tel:"]::after { content: none !important; }

  /* Notfallkarte: Abschnitt #ransomware einseitig */
  #ransomware, .m-notfall { break-inside: avoid; page-break-inside: avoid; }
  .m-notfall { gap: 4mm; }
  .m-notfall__step { break-inside: avoid; page-break-inside: avoid; padding-block: 2.5mm; grid-template-columns: 12mm minmax(0, 1fr); }
  .m-notfall__num, .m-notfall__step::before { font-size: 16pt; }
  .m-notfall__title { font-size: 12pt; }
  .m-notfall__text { font-size: 10pt; color: #222; }
  .m-notfall__step--call { background: #f2f3f5 !important; border-left: 4px solid #E84E0E !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  /* Nur die Notfallkarte drucken (Button „Notfallkarte drucken“ bzw. Druckansicht ?print=1).
     Ausgeblendet wird jedes Element im Hauptbereich, das weder die Karte ist, noch in ihr liegt, noch sie enthält –
     unabhängig davon, wie tief die Karte verschachtelt ist (Support-Seite: main > article > section#ransomware).
     Mit JS markiert main.js die zum Button gehörende Karte (.is-print-target); ohne JS gilt #ransomware bzw. .m-notfall. */
  body.m-print-notfall .m-footer, body.m-print-notfall .m-header, body.m-print-notfall .m-hero { display: none !important; }
  body.m-print-notfall:has(.is-print-target) main *:not(:has(.is-print-target)):not(.is-print-target):not(.is-print-target *) { display: none !important; }
  body.m-print-notfall:not(:has(.is-print-target)) main *:not(:has(#ransomware, .m-notfall)):not(#ransomware):not(#ransomware *):not(.m-notfall):not(.m-notfall *) { display: none !important; }
  body.m-print-notfall main, body.m-print-notfall .m-main, body.m-print-notfall main .m-section, body.m-print-notfall main .m-container { padding: 0 !important; margin: 0 !important; }
  body.m-print-notfall .is-print-target, body.m-print-notfall #ransomware { padding-block: 0 !important; margin: 0 !important; }
  /* Karte auf eine A4-Seite: kompakter Kopf, Schritte zweispaltig (Spaltenfluss 1–4 | 5–8), Hotline-Kasten darunter */
  body.m-print-notfall main .m-section__head { margin: 0 0 4mm !important; padding: 0 !important; }
  body.m-print-notfall main .m-section__head .m-line { margin-block: 1.5mm !important; }
  body.m-print-notfall main .m-section__title { font-size: 18pt !important; line-height: 1.15 !important; margin: 0 !important; max-width: none !important; }
  body.m-print-notfall .m-notfall { gap: 3mm !important; }
  body.m-print-notfall .m-notfall__list { display: block !important; columns: 2; column-gap: 7mm; margin: 0 !important; padding: 0 !important; }
  body.m-print-notfall .m-notfall__step { break-inside: avoid; page-break-inside: avoid; padding-block: 1.8mm !important; margin: 0 0 1.5mm !important; }
  body.m-print-notfall .m-notfall__title { font-size: 11pt; }
  body.m-print-notfall .m-notfall__text { font-size: 9.5pt; line-height: 1.35; }
  body.m-print-notfall .m-notfall__hotline { margin-top: 3mm !important; padding: 3mm 4mm !important; break-inside: avoid; page-break-inside: avoid; }
  body.m-print-notfall .m-notfall__note { font-size: 9pt; margin-top: 2mm !important; }

  /* Typografie */
  h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; color: #000; }
  h1 { font-size: 22pt; } h2 { font-size: 17pt; } h3 { font-size: 13pt; } h4 { font-size: 12pt; }
  p, li, blockquote, .m-card, .m-quote, .m-alert-card, .m-deadlines__item, .m-faq__item, .m-steps__item, .m-remote__item, .m-job { break-inside: avoid; page-break-inside: avoid; }
  .m-prose > h2::before, .m-line, .m-rule { background: #E84E0E !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .m-line, .m-rule { height: 3px; }

  /* Links mit URL (nur echte, externe/absolute Ziele; keine Anker, keine tel/mailto-Doppelung) */
  a { color: #000 !important; text-decoration: underline; text-decoration-thickness: .5pt; }
  a[href^="http"]:not(.m-btn):not(.m-logo):not(.m-card__link)::after { content: " (" attr(href) ")"; font-size: .85em; font-weight: 400; color: #444; word-break: break-all; }
  a[href^="mailto:"]::after { content: none; }
  abbr[title]::after { content: " (" attr(title) ")"; }
  .m-btn { border: 1px solid #000 !important; background: none !important; color: #000 !important; padding: 2mm 4mm; }
  .m-btn::before, .m-card__link::after { content: none !important; }

  /* Karten/Komponenten flach */
  .m-card, .m-alert-card, .m-remote__item, .m-job, .m-check, .m-map, .m-deadlines--card .m-deadlines__item { border: 1px solid #999 !important; background: #fff !important; }
  .m-card::before, .m-job::before { display: none !important; }
  .m-bento, .m-grid, .m-cards, .m-quotes, .m-team, .m-remote, .m-stats { display: block; }
  .m-bento > *, .m-grid > *, .m-cards > *, .m-quotes > *, .m-team > *, .m-remote > *, .m-stats > * { margin-bottom: 4mm; }
  .m-faq__item { padding-left: 0 !important; }
  .m-faq__item::before, .m-faq__summary::before, .m-faq__summary::after { display: none !important; }
  .m-faq__item:not([open]) .m-faq__content { display: block; }
  details:not([open]) > :not(summary) { display: block; }
  .m-faq__summary { padding-left: 0 !important; }
  .m-team__photo, .m-media img, .m-hero__media img, .m-card__media img { filter: grayscale(1) !important; }
  .m-timeline__rail, .m-steps::before, .m-deadlines--table .m-deadlines__list::before { background: #E84E0E !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .m-check__question[hidden] { display: grid !important; }
  .m-check__result[hidden] { display: none !important; }
  .m-form__success, .m-form__status, .m-form__summary { border: 1px solid #999 !important; background: #fff !important; }

  /* Tabellen */
  .m-table__wrap { overflow: visible; }
  .m-table th, .m-table td { border-bottom: .5pt solid #999; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }

  /* Footer: nur Firmenblock */
  .m-footer { border-top: 1pt solid #000; padding-top: 4mm; margin-top: 8mm; font-size: 9pt; }
  .m-footer__grid { display: block; padding: 0; }
  .m-footer__col:not(.m-footer__col--brand) { display: none; }
  .m-footer__claim { font-size: 10pt; }
  .m-footer__addr, .m-footer__address { color: #000 !important; }
  .m-footer .m-logo { color: #000 !important; }

  /* Platzhalter erscheinen nie (Kundenvorgabe 2) – auch nicht im Druck */
  .m-placeholder { display: none !important; }

  /* Dunkle Abschnitte (Styleguide v2) hell drucken */
  .m-section--dark, .m-section--island, [data-m-dark] { background: #fff !important; color: #000 !important; box-shadow: none !important; }
  .m-footer { background: #fff !important; color: #000 !important; }
  .m-footer__address, .m-footer__claim, .m-footer__region, .m-footer__small, .m-footer__tel { color: #000 !important; }
}
