/* ==========================================================================
   Love Counter — print.css
   Two print modes:
     1. Default — a tidied version of whatever page is on screen (articles).
     2. Keepsake — triggered by the Print Keepsake button (or Ctrl+P while a
        counter is running). Everything but #lc-print-sheet is removed from
        the flow so the printout is the result and nothing else.
   ========================================================================== */
@media print {
  @page { margin: 14mm; }

  /* ---------- 1. General page tidy-up ---------- */
  .site-header, .site-footer, .scroll-top,
  .nav__backdrop, .hero__actions, .read-progress,
  .side-toc, .counter__actions, .reviews__controls, .toast {
    display: none !important;
  }
  body { background: #fff; color: #000; }
  .section--dark { background: #fff !important; color: #000 !important; }
  .section--dark h1, .section--dark h2, .section--dark h3,
  .section--dark p { color: #000 !important; }
  a { color: #000; text-decoration: underline; }
  .container { max-width: 100%; }
  .card, .feature, .counter, .result-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
    break-inside: avoid;
  }

  /* ---------- 2. Keepsake sheet ---------- */
  /* Present in the DOM but never printed unless keepsake mode is active,
     otherwise it would tack itself onto the end of an ordinary printout. */
  #lc-print-sheet { display: none; }

  body.is-keepsake-print {
    display: block !important;
    min-height: 0 !important;
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
  }
  /* The single rule that makes the printout the keepsake alone. */
  body.is-keepsake-print > *:not(#lc-print-sheet) { display: none !important; }
  body.is-keepsake-print #lc-print-sheet { display: block !important; }

  /* Card. Deliberately NOT break-inside:avoid — if the sheet ever ran a hair
     past the page, avoiding the break would push the whole thing to page two
     and leave page one blank. */
  .ps {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    font-family: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: #2A1128;
    border: 1pt solid #E7477E;
    border-radius: 5pt;
    padding: 13pt 16pt 10pt;
  }
  .ps * { box-sizing: border-box; }
  .ps p { max-width: none; margin: 0; }

  /* Masthead */
  .ps__head { text-align: center; }
  .ps__mark {
    display: block;
    width: 17pt;
    margin: 0 auto 3pt;
    color: #E7477E;
  }
  .ps__mark svg { width: 100%; height: auto; display: block; }
  .ps__brand {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 11pt;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: #6D214F;
  }
  .ps__kicker {
    font-size: 7.5pt;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #6E5763;
    margin-top: 2pt !important;
  }

  /* Couple */
  .ps__hero {
    text-align: center;
    margin-top: 11pt;
    padding-top: 11pt;
    border-top: 0.5pt solid #EAD4DD;
  }
  .ps__couple {
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 25pt;
    line-height: 1.15;
    color: #2A1128;
    margin: 0;
  }
  .ps__couple .amp { color: #C42B67; }
  .ps__since {
    font-size: 9.5pt;
    color: #6E5763;
    margin-top: 4pt !important;
  }

  /* Big numbers */
  .ps__grid {
    display: flex;
    gap: 7pt;
    margin-top: 13pt;
  }
  .ps__cell {
    flex: 1;
    text-align: center;
    padding: 9pt 3pt 8pt;
    border: 0.75pt solid #EAD4DD;
    border-radius: 4pt;
    background: #FDF2F6;
    break-inside: avoid;
  }
  .ps__num {
    display: block;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 800;
    font-size: 22pt;
    line-height: 1;
    color: #C42B67;
    font-variant-numeric: tabular-nums;
  }
  .ps__unit {
    display: block;
    margin-top: 4pt;
    font-size: 6.8pt;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #6E5763;
  }

  /* Anniversary strip */
  .ps__anniv {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10pt;
    margin-top: 9pt !important;
    padding: 7pt 11pt;
    border: 0.75pt solid #EAD4DD;
    border-left: 2.5pt solid #E7477E;
    border-radius: 4pt;
    background: #FDF2F6;
    break-inside: avoid;
  }
  .ps__anniv span {
    font-size: 8pt;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #6D214F;
  }
  .ps__anniv strong {
    font-family: "Playfair Display", Georgia, serif;
    font-size: 12pt;
    color: #C42B67;
  }

  /* Section blocks */
  .ps__block { margin-top: 14pt; break-inside: avoid; }
  .ps__h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10pt;
    font-family: "Poppins", sans-serif;
    font-weight: 600;
    font-size: 7.8pt;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #C42B67;
    margin: 0 0 7pt;
    padding-bottom: 4pt;
    border-bottom: 0.5pt solid #EAD4DD;
  }
  .ps__h em {
    font-style: normal;
    font-weight: 400;
    font-size: 7pt;
    letter-spacing: 0.06em;
    color: #6E5763;
    white-space: nowrap;
  }

  /* Totals */
  .ps__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 22pt;
    margin: 0;
  }
  .ps__row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8pt;
    padding: 4.5pt 0;
    border-bottom: 0.4pt dotted #EAD4DD;
    break-inside: avoid;
  }
  .ps__row dt {
    font-size: 8.5pt;
    color: #6E5763;
  }
  .ps__row dd {
    margin: 0;
    font-family: "Playfair Display", Georgia, serif;
    font-weight: 700;
    font-size: 10.5pt;
    color: #2A1128;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  /* Milestones */
  .ps__miles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5pt 10pt;
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .ps__mile {
    display: flex;
    align-items: center;
    gap: 6pt;
    padding: 5pt 7pt;
    border: 0.5pt solid #EAD4DD;
    border-radius: 3pt;
    break-inside: avoid;
  }
  .ps__mile.is-passed {
    background: #FDF2F6;
    border-color: #F0AFC7;
  }
  .ps__mile-mark {
    flex: none;
    display: block;
    width: 15pt;
    height: 15pt;
    line-height: 15pt;
    text-align: center;
    border-radius: 50%;
    border: 0.5pt solid #EAD4DD;
    background: #fff;
    font-size: 6.5pt;
    font-weight: 700;
    color: #C42B67;
  }
  .ps__mile.is-passed .ps__mile-mark {
    border-color: #E7477E;
    color: #C42B67;
    font-size: 8pt;
  }
  .ps__mile-body strong {
    display: block;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 9pt;
    line-height: 1.2;
    color: #2A1128;
  }
  .ps__mile-body span {
    display: block;
    font-size: 7pt;
    color: #6E5763;
  }

  /* Foot */
  .ps__foot {
    margin-top: 13pt;
    padding-top: 7pt;
    border-top: 0.5pt solid #EAD4DD;
    break-inside: avoid;
  }
  .ps__foot-note {
    font-size: 6.8pt;
    color: #8A7480;
    text-align: center;
  }
  .ps__foot-line {
    display: flex;
    justify-content: space-between;
    gap: 10pt;
    margin-top: 5pt !important;
    font-size: 7.2pt;
    letter-spacing: 0.06em;
    color: #6D214F;
  }
}
