/* ============================================================
   Growniti Travel — print / save-as-PDF stylesheet
   Goal: a document a traveller can fold into a bag. Ink-light,
   high contrast, no interface furniture, no half-cut cards.
   ============================================================ */

@media print {

  @page {
    size: A4 portrait;
    margin: 14mm 13mm 16mm;
  }

  /* ---- Reset the dark theme to paper ---- */
  :root {
    --text: #10161f;
    --text-soft: #333c48;
    --text-muted: #5b6672;
    --line: #c8d0da;
    --line-strong: #98a4b2;
  }

  html, body {
    background: #fff !important;
    color: #10161f !important;
    font-size: 10.5pt;
    line-height: 1.45;
  }

  body * {
    background-image: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
    animation: none !important;
    transition: none !important;
  }

  /* ---- Remove everything that is not the itinerary ---- */
  .site-header,
  .site-footer,
  .hero,
  #planner,
  #how,
  #data,
  #loadingSection,
  #errorSection,
  .no-print,
  .actionbar,
  .tuner,
  .favourites,
  .toast-region,
  .skip-link,
  .stop-actions,
  .day-tools,
  .combo-list,
  .routeline {
    display: none !important;
  }

  main, .section, .shell {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
  }

  .results { display: block !important; }

  /* ---- Masthead: repeats the brand at the top of page one ---- */
  .print-masthead {
    display: flex !important;
    align-items: baseline;
    justify-content: space-between;
    gap: 12pt;
    padding-bottom: 6pt;
    margin-bottom: 12pt;
    border-bottom: 2.5pt solid #10161f;
  }
  .print-masthead strong {
    font-family: "Poppins", Georgia, serif;
    font-size: 17pt;
    letter-spacing: -0.02em;
  }
  .print-masthead span {
    font-size: 8.5pt;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #5b6672;
  }

  /* ---- Trip overview block ---- */
  .overview {
    display: block !important;
    border: 0 !important;
    background: none !important;
    padding: 0 !important;
    margin-bottom: 10pt !important;
    break-inside: avoid;
  }
  .overview .eyebrow { color: #5b6672 !important; font-size: 8pt; margin-bottom: 3pt; }
  .overview h2 { font-size: 20pt; margin: 0 0 3pt; color: #10161f !important; }
  .overview-sub { color: #333c48 !important; font-size: 10pt; margin-bottom: 8pt; }

  .overview-facts {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 6pt 10pt !important;
    padding: 7pt 0;
    border-block: 0.6pt solid #c8d0da;
  }
  .overview-facts dt { font-size: 7pt !important; color: #5b6672 !important; }
  .overview-facts dd { font-size: 9.5pt !important; color: #10161f !important; }

  .overview-weather { border: 0 !important; padding: 8pt 0 0 !important; }
  .weather-strip { display: flex !important; flex-wrap: wrap !important; gap: 4pt !important; overflow: visible !important; }
  .weather-day {
    flex: 0 0 auto !important;
    border: 0.6pt solid #c8d0da !important;
    background: none !important;
    padding: 4pt 6pt !important;
    min-width: 46pt;
  }
  .weather-day .wd-icon { font-size: 11pt; }
  .weather-day.is-wet { border: 1.2pt solid #10161f !important; }

  /* ---- Indicators condense to one line of facts ---- */
  .indicators {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 5pt !important;
    margin: 8pt 0 !important;
    break-inside: avoid;
  }
  .indicator {
    border: 0.6pt solid #c8d0da !important;
    background: none !important;
    padding: 5pt 7pt !important;
  }
  .indicator .ind-value { font-size: 9.5pt !important; }
  .indicator .ind-note { font-size: 7.5pt !important; }
  .meter { border: 0.6pt solid #c8d0da; height: 4pt; background: none !important; }
  .meter i { background: #10161f !important; }

  .alert {
    border: 0.6pt solid #10161f !important;
    background: none !important;
    padding: 5pt 8pt !important;
    font-size: 9pt;
    break-inside: avoid;
  }

  /* ---- Day cards: never split a card across a page ---- */
  .days { display: block !important; }

  .day-card {
    break-inside: avoid;
    page-break-inside: avoid;
    border: 0.8pt solid #98a4b2 !important;
    border-radius: 4pt !important;
    background: none !important;
    margin-bottom: 9pt !important;
  }
  /* Long days are allowed to flow rather than overflow the page */
  .day-card.is-long { break-inside: auto; page-break-inside: auto; }

  .day-head {
    border-bottom: 0.8pt solid #98a4b2 !important;
    background: #eef2f6 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    padding: 6pt 9pt !important;
    break-after: avoid;
  }
  .day-number {
    background: #10161f !important;
    color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    width: 32pt !important; height: 32pt !important;
    border-radius: 4pt !important;
    font-size: 12pt;
  }
  .day-number small { font-size: 5pt; }
  .day-title h3 { font-size: 11.5pt; }
  .day-date { font-size: 8.5pt; color: #5b6672 !important; }

  .day-meta { padding: 6pt 9pt 0 !important; }
  .tag {
    border: 0.5pt solid #98a4b2 !important;
    background: none !important;
    color: #333c48 !important;
    font-size: 7.5pt !important;
    padding: 2pt 5pt !important;
  }

  .timeline { padding: 6pt 9pt 8pt !important; }
  .timeline::before { left: 40pt !important; background: #c8d0da !important; opacity: 1 !important; }

  .stop {
    display: block !important;
    break-inside: avoid;
    page-break-inside: avoid;
    padding-bottom: 7pt !important;
  }
  .stop-rail { display: flex !important; align-items: flex-start; gap: 8pt; }
  .stop-node { width: 42pt !important; }
  .stop-time {
    border: 0.6pt solid #10161f !important;
    background: none !important;
    font-size: 8.5pt !important;
    padding: 2pt 4pt !important;
    min-width: 38pt;
  }
  .stop-name { font-size: 10.5pt !important; margin-bottom: 2pt; }
  .stop-name a { text-decoration: none !important; color: #10161f !important; }
  .stop-desc { font-size: 9pt !important; color: #333c48 !important; margin-bottom: 3pt; }
  .stop-facts .tag { font-size: 7pt !important; }

  /* Images are dropped: they eat ink and add little on paper */
  .stop-media { display: none !important; }

  .break-card {
    border: 0.5pt dashed #98a4b2 !important;
    background: none !important;
    padding: 4pt 7pt !important;
  }

  .day-footer {
    border-top: 0.6pt solid #c8d0da !important;
    padding: 5pt 9pt !important;
    font-size: 8pt !important;
    color: #5b6672 !important;
  }

  .day-empty { padding: 8pt 9pt !important; font-size: 9pt; color: #333c48 !important; }

  /* ---- Attribution closes the document ---- */
  .attribution {
    border-top: 0.8pt solid #98a4b2 !important;
    margin-top: 10pt !important;
    padding-top: 6pt !important;
    font-size: 7.5pt !important;
    color: #5b6672 !important;
    break-inside: avoid;
  }

  /* Show link targets so a printed sheet is still actionable */
  .stop-name a::after {
    content: " (" attr(href) ")";
    font-size: 6.5pt;
    color: #5b6672;
    word-break: break-all;
    font-weight: 400;
  }

  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  .sr-only { display: none !important; }
}
