/* ============================================
   Printable calendar
   ============================================
   Styles the document built by buildPrintDoc() in events.js.

   Lives in its own file, and outside any @media query, because it is loaded two
   ways: linked with media="print" on the events page (so a plain Cmd+P still
   produces the good document), and linked plainly inside the hidden print
   iframe, whose whole purpose is to be printed.

   Colors are hard-coded rather than tokenized so a printout is identical
   whether or not the reader has dark mode on. Sizes are in pt: this only ever
   renders to paper. */

@page { size: letter portrait; margin: 0.5in; }

html, body {
    margin: 0;
    background: #fff !important;
    /* dash.css keeps <body> hidden until auth resolves — printing must not
       depend on that class having landed. */
    visibility: visible !important;
    color: #1a1a1a;
    font-family: 'Open Sans', system-ui, sans-serif;
    font-size: 10pt;
    line-height: 1.4;
}

/* Tints and swatches carry meaning; ask the renderer to keep them. */
.print-doc, .print-doc * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
}

.print-head {
    border-bottom: 2pt solid #4A3B2A;
    padding-bottom: 8pt;
    margin-bottom: 12pt;
}
.print-troop {
    font-family: 'Oswald', system-ui, sans-serif;
    font-size: 9pt;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #876237;
}
.print-title {
    font-family: 'Oswald', system-ui, sans-serif;
    font-size: 21pt;
    font-weight: 700;
    color: #3A2E20;
    margin: 2pt 0 3pt;
    line-height: 1.1;
}
.print-printed { font-size: 8pt; color: #6B7280; }

.print-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 5pt 14pt;
    margin-bottom: 14pt;
}
.print-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 4pt;
    font-size: 8pt;
    font-weight: 600;
    color: #374151;
}
.print-legend-swatch {
    width: 8pt;
    height: 8pt;
    border-radius: 2pt;
    border: 0.75pt solid;
    flex: none;
}

.print-section { margin-bottom: 16pt; }
.print-section-title {
    font-family: 'Oswald', system-ui, sans-serif;
    font-size: 10pt;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #876237;
    border-bottom: 0.75pt solid #D8D2C6;
    padding-bottom: 3pt;
    margin-bottom: 10pt;
    break-after: avoid;
}

/* --- At a glance: mini calendars, three across ---
   Each month is boxed. Without the frame the grids run together into one
   field of numbers — the gutter alone reads as just wider cell spacing. */
.print-cal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14pt 18pt;
}
.print-cal-block {
    break-inside: avoid;
    border: 0.75pt solid #D8D2C6;
    border-radius: 3pt;
    padding: 7pt 9pt 9pt;
}
.print-cal-title {
    font-family: 'Oswald', system-ui, sans-serif;
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3A2E20;
    margin-bottom: 5pt;
    padding-bottom: 4pt;
    border-bottom: 0.75pt solid #EDEAE3;
}
.print-cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1.5pt;
    text-align: center;
}
.print-cal-head {
    font-size: 6.5pt;
    font-weight: 700;
    color: #9CA3AF;
    text-transform: uppercase;
    padding-bottom: 1pt;
}
.print-cal-cell {
    font-size: 7.5pt;
    color: #4B5563;
    padding: 2pt 0;
    border: 0.75pt solid transparent;
    border-radius: 2pt;
}
.print-cal-blank { visibility: hidden; }

/* --- Schedule --- */
.print-month-group { margin-bottom: 12pt; }
.print-month-title {
    font-family: 'Oswald', system-ui, sans-serif;
    font-size: 11pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #3A2E20;
    margin-bottom: 5pt;
    break-after: avoid;
}
/* Rows are small, so avoiding a break inside one never risks overflowing a
   page — unlike wrapping the whole month. */
.print-event {
    display: flex;
    gap: 10pt;
    padding: 3.5pt 0;
    border-bottom: 0.5pt solid #EDEAE3;
    break-inside: avoid;
}
.print-event-when {
    flex: none;
    width: 62pt;
    font-size: 9pt;
    font-weight: 700;
    white-space: nowrap;
}
.print-event-what { flex: 1; min-width: 0; }
.print-event-name {
    font-size: 9.5pt;
    font-weight: 600;
    color: #1F2937;
}
.print-dot {
    display: inline-block;
    width: 5pt;
    height: 5pt;
    border-radius: 50%;
    border: 0.75pt solid;
    margin-right: 4pt;
    vertical-align: middle;
}
.print-event-meta {
    font-size: 8.5pt;
    color: #4B5563;
    margin-top: 1pt;
}
.print-event-desc {
    font-size: 8.5pt;
    color: #374151;
    margin-top: 2pt;
    line-height: 1.45;
}
.print-event-notes {
    font-size: 8pt;
    color: #6B5A3E;
    margin-top: 2pt;
    padding-left: 5pt;
    border-left: 1.5pt solid #C9A227;
}
.print-badge {
    display: inline-block;
    font-size: 7pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5pt 3pt;
    border: 0.75pt solid #9CA3AF;
    border-radius: 2pt;
    color: #4B5563;
    vertical-align: middle;
}
.print-badge-cancelled { border-color: #BA272C; color: #BA272C; }

.print-foot {
    margin-top: 14pt;
    padding-top: 6pt;
    border-top: 0.75pt solid #D8D2C6;
    font-size: 7.5pt;
    color: #6B7280;
}
