/**
 * Print stylesheet for single koulutus pages.
 * Hides site chrome and decorative elements; reflows content to a
 * clean single-column black-on-white printable sheet.
 */

@media print {
  /* ── Hide site chrome ──────────────────────────────────────── */
  header,
  footer,
  .site-nav,
  .skip-link,
  .menu-toggle,

  /* Sticky "Ilmoittaudu" anchor CTA button */
  .sya-anchor-cta,

  /* PDF / print button itself */
  .sya-pdf-button,

  /* Registration form section */
  #ilmoittaudu,

  /* Koulutuskalenteri block — outer div wrapper (heading + carousel).
     Selector targets the <div> tag specifically: the hero uses <section>
     and the footer uses <footer>, so div.sya-pattern-bg is kalenteri-only
     on single-koulutus pages. */
  div.sya-pattern-bg,

  /* Back-link inside hero */
  .sya-back-link {
    display: none !important;
  }

  /* ── Page setup ────────────────────────────────────────────── */
  @page {
    margin: 1.5cm;
  }

  /* ── Base reset for print ──────────────────────────────────── */
  *,
  *::before,
  *::after {
    background: transparent !important;
    background-image: none !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* ── Course title (still inside the hero section) ─────────── */
  .sya-hero {
    background: transparent !important;
    clip-path: none !important;
    padding-block: 0 !important;
  }

  .sya-hero__title {
    font-size: 22pt !important;
    color: #000 !important;
    margin-block-end: 0.5em !important;
  }

  /* ── Single-column layout ──────────────────────────────────── */
  .sya-single-body,
  .sya-single-layout {
    display: block !important;
    width: 100% !important;
  }

  .sya-sidebar {
    position: static !important;
    width: 100% !important;
    margin-block-end: 1em;
  }

  .sya-single-layout__main {
    width: 100% !important;
  }

  /* ── Meta card ─────────────────────────────────────────────── */
  .sya-sidebar .koulutus-meta {
    border-block-start: 2px solid #000 !important;
    padding: 0.5em 0 !important;
  }

  /* ── Post content and trainers ─────────────────────────────── */
  .wp-block-post-content,
  .sya-trainers {
    width: 100% !important;
  }

  /* ── Links ─────────────────────────────────────────────────── */
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 10pt;
    color: #444 !important;
  }

  /* Skip printing hrefs for anchor-only and utility links */
  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: none;
  }

  /* ── Avoid page breaks inside important elements ───────────── */
  .koulutus-meta,
  .sya-trainer-card,
  h2,
  h3 {
    break-inside: avoid;
  }
}
