/* =====================================================================
   mass-guide-print.css: print stylesheet for The Mass Guide pages
   Linked ONLY from /mass-guide/* pages with media="print", and every
   rule is scoped to body.mg-print, so no other page's print changes.
   Target: US Letter, black ink on white, readable at arm's length.
   ===================================================================== */
/* screen: print-only spans are hidden */
.print-only { display: none; }
@media print {

  /* ---------- Page box + running footer (Chrome 131+ margin boxes) ----------
     A NAMED page ("mg"), used only by body.mg-print, so even this @page rule
     cannot touch any other page's print. */
  body.mg-print { page: mg; }
  @page mg {
    size: letter;
    margin: 0.6in 0.7in 0.75in 0.7in;
    background: #fff;
    @bottom-left {
      content: "1765 \25C6  SANCTUM";
      font-family: 'Cinzel', 'Cinzel Fallback', serif;
      font-weight: 700; font-size: 7.5pt; letter-spacing: .18em;
      color: #6b5420; vertical-align: top; padding-top: 10pt;
    }
    @bottom-center {
      content: "1765sanctumco.com/mass-guide";
      font-family: 'EB Garamond', 'EB Garamond Fallback', serif;
      font-size: 8.5pt; color: #333; vertical-align: top; padding-top: 10pt;
    }
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font-family: 'EB Garamond', 'EB Garamond Fallback', serif;
      font-size: 8.5pt; color: #333; vertical-align: top; padding-top: 10pt;
    }
  }
  @page mg:first { margin-top: 0.5in; }
  /* /mass-guide/latin-mass-responses/ gets its own named page (body class "mg-print mg-lmr"), so its
     running footer prints its own URL, not the /mass-guide/ walkthrough's (QC r2 #1). Same box otherwise. */
  body.mg-print.mg-lmr { page: mg-lmr; }
  @page mg-lmr {
    size: letter;
    margin: 0.6in 0.7in 0.75in 0.7in;
    background: #fff;
    @bottom-left {
      content: "1765 \25C6  SANCTUM";
      font-family: 'Cinzel', 'Cinzel Fallback', serif;
      font-weight: 700; font-size: 7.5pt; letter-spacing: .18em;
      color: #6b5420; vertical-align: top; padding-top: 10pt;
    }
    @bottom-center {
      content: "1765sanctumco.com/mass-guide/latin-mass-responses";
      font-family: 'EB Garamond', 'EB Garamond Fallback', serif;
      font-size: 8.5pt; color: #333; vertical-align: top; padding-top: 10pt;
    }
    @bottom-right {
      content: "Page " counter(page) " of " counter(pages);
      font-family: 'EB Garamond', 'EB Garamond Fallback', serif;
      font-size: 8.5pt; color: #333; vertical-align: top; padding-top: 10pt;
    }
  }
  @page mg-lmr:first { margin-top: 0.5in; }

  /* ---------- White paper, dark ink, no dark bleed ---------- */
  html:has(body.mg-print), body.mg-print {
    background: #fff !important; background-image: none !important;
    color: #111 !important;
    -webkit-print-color-adjust: economy; print-color-adjust: economy;
  }
  body.mg-print { margin: 0 !important; padding: 0 !important; min-height: 0 !important; overflow: visible !important;
    font-size: 11pt; line-height: 1.4; orphans: 3; widows: 3; }
  /* film-grain overlay, candlelight and scroll-wick are fixed layers: they
     repeat on every printed sheet as a grey/dark wash. Remove them. */
  body.mg-print::before, body.mg-print::after { content: none !important; display: none !important; background: none !important; }
  body.mg-print .candlelight, body.mg-print .scroll-wick { display: none !important; }
  body.mg-print main, body.mg-print section, body.mg-print div, body.mg-print li,
  body.mg-print article, body.mg-print aside, body.mg-print table, body.mg-print td, body.mg-print th {
    background: transparent !important; background-image: none !important;
    box-shadow: none !important; text-shadow: none !important;
  }
  body.mg-print main { position: static !important; z-index: auto !important; }
  body.mg-print * { animation: none !important; transition: none !important; }
  body.mg-print .reveal, body.mg-print .reveal-clip, body.mg-print [class*="reveal"] {
    opacity: 1 !important; transform: none !important; clip-path: none !important; }

  /* ---------- Strip site chrome, CTAs, capture forms, popups ---------- */
  body.mg-print .skip-link, body.mg-print header.dispatch-nav, body.mg-print #site-nav,
  body.mg-print footer, body.mg-print .footer, body.mg-print .dcap, body.mg-print .ccc-notice,
  body.mg-print .print-cta, body.mg-print .no-print, body.mg-print .lib-cluster,
  body.mg-print .lmr-related, body.mg-print .cta-row, body.mg-print .close-aside,
  body.mg-print .lmr-back, body.mg-print .lmr-byline, body.mg-print .library,
  body.mg-print [role="dialog"], body.mg-print dialog, body.mg-print .modal,
  body.mg-print [class*="popup"], body.mg-print [class*="exit-intent"],
  body.mg-print [class*="cookie"], body.mg-print iframe, body.mg-print video,
  body.mg-print form, body.mg-print button,
  body.mg-print .progress-rail, body.mg-print .ctl-group, body.mg-print .seg { display: none !important; }

  /* ---------- Type: global ink + links ---------- */
  body.mg-print h1, body.mg-print h2, body.mg-print h3, body.mg-print h4 {
    color: #111 !important; break-after: avoid; page-break-after: avoid;
    break-inside: avoid; text-wrap: balance;
  }
  body.mg-print p, body.mg-print li { orphans: 3; widows: 3; }
  body.mg-print a { color: inherit !important; text-decoration: none !important; border-bottom: 0 !important; background: none !important; }
  body.mg-print strong { color: inherit !important; }
  body.mg-print em { color: inherit !important; }

  /* ======== /mass-guide/latin-mass-responses/ ======== */
  body.mg-print .lmr-hero {
    text-align: left; padding: 0 0 8pt; margin: 0 0 12pt;
    border-bottom: 1.25pt solid #6b5420;
  }
  body.mg-print .lmr-eyebrow { color: #6b5420 !important; font-size: 8pt; letter-spacing: .2em; margin: 0 0 4pt; }
  body.mg-print .lmr-headline { color: #111 !important; font-size: 20pt; line-height: 1.15; margin: 0 0 4pt; }
  body.mg-print .lmr-headline em { color: #6b5420 !important; }
  body.mg-print .lmr-sub { display: block !important; color: #333 !important; font-size: 11.25pt; font-family: 'EB Garamond', 'EB Garamond Fallback', serif; font-style: italic; margin: 4pt 0 0; max-width: none; text-align: left; }
  body.mg-print .lmr-answer { display: none !important; }

  body.mg-print .lmr-body, body.mg-print .lmr-order, body.mg-print .lmr-faq {
    max-width: none !important; padding: 0 !important; margin: 0 0 10pt !important;
    color: #111 !important; font-size: 11pt; line-height: 1.45;
  }
  body.mg-print .lmr-body p { margin: 0 0 7pt; color: #111 !important; }
  body.mg-print .lmr-body em { color: #111 !important; }
  body.mg-print .lmr-body h2, body.mg-print .lmr-order > h2 {
    color: #111 !important; font-size: 13.5pt; letter-spacing: .05em; line-height: 1.25;
    margin: 16pt 0 8pt; padding: 0 0 3pt; border-bottom: 0.75pt solid #6b5420;
  }
  /* QC Oct 21: the order's guidance notes (Judica me, both Confiteors, Misereatur, Indulgentiam, …) and the
     Sources DO print. Only the long screen sections and the FAQ stay off paper; .no-print spans (promos) hide. */
  body.mg-print .which-section, body.mg-print .pron-section, body.mg-print .commun-section,
  body.mg-print .first-section, body.mg-print .lmr-faq { display: none !important; }
  body.mg-print p.screen-only { display: block !important; color: #222 !important; font-size: 10pt; line-height: 1.4;
    margin: 0 0 6pt; padding-left: 9pt; font-style: italic; }
  body.mg-print .print-only { display: inline !important; }
  body.mg-print .print-only .url { white-space: nowrap; }
  body.mg-print .sources { display: block !important; font-size: 9pt; line-height: 1.35; color: #222 !important;
    margin: 12pt 0 0 !important; padding: 6pt 0 0 !important; border-top: 0.75pt solid #9a8a5e; max-width: none !important; }
  body.mg-print .sources p, body.mg-print .sources li { font-size: 9pt !important; margin: 0 0 4pt; color: #222 !important; }
  body.mg-print .sources h2, body.mg-print .sources h3 { font-size: 10.5pt !important; margin: 0 0 4pt !important; border: 0 !important; }

  /* The essential seven: two columns of unsplittable cards */
  body.mg-print .seven-grid {
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 6pt 12pt;   /* 6pt rows: the note under the cards fits on p1 (QC r2) */
    margin: 6pt 0 4pt; padding: 0; list-style: none;
  }
  body.mg-print .seven-card {
    break-inside: avoid; page-break-inside: avoid;
    padding: 7pt 9pt 7pt 30pt; border: 0.75pt solid #9a8a5e !important; border-radius: 3pt;
  }
  body.mg-print .seven-card::before { left: 9pt; top: 6pt; font-size: 14pt; color: #6b5420 !important; }
  body.mg-print .seven-card .s-latin { color: #111 !important; font-family: 'EB Garamond', 'EB Garamond Fallback', serif; font-weight: 500; font-size: 13pt; line-height: 1.25; margin: 0 0 2pt; }
  body.mg-print .seven-card .s-eng   { color: #222 !important; font-size: 11.25pt; line-height: 1.3; margin: 0 0 1pt; }
  body.mg-print .seven-card .s-phon  { color: #444 !important; font-size: 11.25pt; line-height: 1.3; margin: 0; }
  body.mg-print .seven-card .s-when  { display: block !important; color: #444 !important; font-size: 9pt; line-height: 1.3; margin: 4pt 0 0; }

  /* Order of Mass: one column, each response block unsplittable */
  body.mg-print .lmr-order { columns: auto !important; column-count: auto !important; }  /* undo the old 2-column print layout; multicol blocks page breaks */
  /* no forced page break before the Order (QC: no page but the last may be more than 1/3 empty) */
  body.mg-print .lmr-order > h2 { break-before: auto; margin-top: 14pt; }
  body.mg-print .order-legend { color: #333 !important; font-size: 9.5pt; line-height: 1.4; margin: 0 0 10pt; }
  body.mg-print .om-part {
    border: 0 !important; border-top: 0.75pt solid #9a8a5e !important; border-radius: 0;
    padding: 8pt 0 2pt; margin: 0 0 6pt;
    break-inside: auto;            /* long parts may continue on the next page… */
  }
  body.mg-print .om-part h3 { color: #111 !important; font-size: 12.5pt; line-height: 1.25; margin: 0 0 3pt; }
  body.mg-print .om-part h3 .om-num { color: #6b5420 !important; }
  body.mg-print .who-badge {
    color: #6b5420 !important; border: 0.75pt solid #9a8a5e !important;
    font-size: 7.5pt; letter-spacing: .12em; padding: 1.5pt 5pt; margin: 2pt 0 5pt;
    display: block !important; width: fit-content;   /* block-level, so break-after: avoid binds it to the cue/response below */
    break-after: avoid;
  }
  body.mg-print .om-cue { color: #222 !important; font-size: 10pt; line-height: 1.4; margin: 0 0 5pt; break-inside: avoid; break-after: avoid; }
  body.mg-print .om-cue strong { color: #111 !important; font-size: 8.5pt; }
  /* a word before a small-caps cue word keeps its space in print ("All genuflect", QC r2 #5) */
  body.mg-print .om-cue strong:not(:first-child) { margin-left: .2em; }
  /* …but a heading, its badge and cue never sit alone at a page foot */
  body.mg-print .om-part h3, body.mg-print .om-part .who-badge, body.mg-print .om-part .om-cue { break-after: avoid; page-break-after: avoid; }

  body.mg-print .resp {
    break-inside: avoid; page-break-inside: avoid;   /* …and no response box is ever split */
    margin: 0 0 5pt; padding: 3pt 0 3pt 9pt; border-radius: 0;
    border-left: 1.5pt solid #b9ad8c !important;
  }
  body.mg-print .resp.answer { border-left: 2.5pt solid #6b5420 !important; }
  /* a priest's line never ends a page: it stays with the answer below it (Sursum corda/Habemus, Pax Domini/Et cum spiritu, Sequentia/Gloria tibi, …) */
  body.mg-print .resp:not(.answer) { break-after: avoid; page-break-after: avoid; }
  body.mg-print .resp .r-who { color: #6b5420 !important; font-size: 7.5pt; letter-spacing: .14em; margin: 0 0 1pt; }
  body.mg-print .resp .r-latin {
    color: #111 !important; font-family: 'EB Garamond', 'EB Garamond Fallback', serif;
    font-weight: 400; font-size: 12pt; line-height: 1.3; margin: 0 0 1pt;
  }
  body.mg-print .resp.answer .r-latin { color: #000 !important; font-weight: 500; font-size: 12.5pt; }
  body.mg-print .resp .r-eng  { color: #222 !important; font-size: 11.25pt; line-height: 1.35; margin: 0 0 1pt; }
  body.mg-print .resp .r-phon { color: #444 !important; font-size: 11.25pt; line-height: 1.35; margin: 0; }

  body.mg-print .print-foot {
    display: block !important; text-align: center; break-inside: avoid;
    font-family: 'Cinzel', serif; font-size: 8pt; letter-spacing: .2em; text-transform: uppercase;
    color: #6b5420 !important; margin-top: 12pt; border-top: 0.75pt solid #9a8a5e; padding-top: 5pt;
  }

  /* ======== /mass-guide/ (the part-by-part walkthrough) ======== */
  /* cards become ruled sections: a long part may continue on the next page without a split box border */
  body.mg-print .part { break-inside: auto; border: 0 !important; border-top: 0.75pt solid #9a8a5e !important;
    border-radius: 0 !important; padding: 10pt 0 4pt !important; margin: 0 0 8pt !important; }
  body.mg-print .movement { break-inside: auto; }
  body.mg-print .part-done { display: none !important; }   /* interactive 'Mark known' tick box */
  body.mg-print .posture { border-color: #6b5420 !important; color: #6b5420 !important; }
  body.mg-print .part-top, body.mg-print .part-titles, body.mg-print .mv-eyebrow { break-after: avoid; }
  body.mg-print .said, body.mg-print .latin-resp, body.mg-print .ex, body.mg-print .cite,
  body.mg-print .lens, body.mg-print .deep, body.mg-print .essence, body.mg-print .responses {
    break-inside: avoid; page-break-inside: avoid;
  }
  body.mg-print .mass-today, body.mg-print .res-section { display: none !important; }
  body.mg-print, body.mg-print p, body.mg-print li, body.mg-print span, body.mg-print td, body.mg-print th,
  body.mg-print h1, body.mg-print h2, body.mg-print h3, body.mg-print h4, body.mg-print summary {
    color: #111 !important; -webkit-text-fill-color: currentColor !important;
  }
  body.mg-print .posture, body.mg-print .lmr-eyebrow, body.mg-print .r-who, body.mg-print .who-badge, body.mg-print .om-num,
  body.mg-print .lmr-headline em, body.mg-print .print-foot, body.mg-print .seven-card::before { color: #6b5420 !important; }
  body.mg-print .s-phon, body.mg-print .r-phon, body.mg-print .s-when { color: #444 !important; }
  body.mg-print details > *:not(summary) { display: block !important; } /* print collapsed details open */
}
