/* ============================================================================
   Printable calendar — /Calendar/Print
   ============================================================================
   The web equivalent of the church's "CALENDAR of EVENTS" Word document.

   This page is PAPER, and it is the one place on the site where that is the
   right call: it exists to be printed and handed out, so it keeps a fixed
   measure, serif headings and hairline rules rather than trying to be a second
   view of the website.

   It still consumes only --ac-* tokens, so it follows the church's theme on
   screen — but see the print block at the bottom, which forces ink-on-white
   regardless of theme. A dark-mode print is a wasted toner cartridge.
   ============================================================================ */

.calprint-toolbar {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--ac-surface);
    border-bottom: var(--ac-border-width) solid var(--ac-border);
    box-shadow: var(--ac-shadow-sm);
}

.calprint-toolbar__inner {
    max-width: 60rem;
    margin: 0 auto;
    padding: .625rem 1.25rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.calprint-toolbar__actions {
    margin-left: auto;
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
}

.calprint-year { margin: 0; }
.calprint-year .form-select { width: auto; min-width: 6rem; }

/* ---------------------------------------------------------------------------
   The sheet
   --------------------------------------------------------------------------- */

.calsheet {
    max-width: 52rem;
    margin: 2rem auto 4rem;
    padding: 0 1.25rem;
    color: var(--ac-text);
    font-size: 0.9375rem;
    line-height: 1.45;
}

.calsheet__masthead {
    text-align: center;
    padding-bottom: 1.25rem;
    margin-bottom: .5rem;
}

.calsheet__church {
    font-size: var(--ac-text-sm);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ac-text-muted);
    margin: 0 0 .35rem;
}

.calsheet__title {
    font-family: var(--ac-font-heading, Georgia, serif);
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: var(--ac-weight-heading);
    line-height: 1.1;
    margin: 0;
    text-wrap: balance;
}

.calsheet__theme {
    font-family: var(--ac-font-heading, Georgia, serif);
    font-size: 1.125rem;
    font-weight: var(--ac-weight-semibold);
    letter-spacing: .18em;
    text-transform: uppercase;
    margin: .75rem 0 .2rem;
}

.calsheet__themesub {
    font-size: var(--ac-text-sm);
    color: var(--ac-text-muted);
    margin: 0;
}

.calsheet__scripture {
    max-width: 34rem;
    margin: .9rem auto 0;
    padding: 0;
    border: 0;
    font-style: italic;
    font-size: var(--ac-text-sm);
    color: var(--ac-text-muted);
    text-wrap: balance;
}

.calsheet__scripture cite {
    display: block;
    font-style: normal;
    font-size: var(--ac-text-xs);
    letter-spacing: .06em;
    text-transform: uppercase;
    margin-top: .3rem;
}

.calsheet__legend {
    font-size: var(--ac-text-xs);
    color: var(--ac-text-muted);
    margin: 1.25rem 0 0;
}

/* The legend samples the real treatment rather than describing it — a reader
   should be able to match the swatch to a row without decoding a sentence. */
.calsheet__key--away     { font-style: italic; }
.calsheet__key--noservice { background: var(--ac-surface-sunken); padding: .05em .35em; border-radius: 2px; }
.calsheet__keysep { padding: 0 .5rem; opacity: .5; }

.calsheet__empty {
    text-align: center;
    color: var(--ac-text-muted);
    padding: 3rem 0;
}

/* ---------------------------------------------------------------------------
   Months
   --------------------------------------------------------------------------- */

.calsheet__month { margin-top: 1.75rem; }

/* break-inside avoids a month heading stranded at the foot of a page with its
   first entry overleaf. Months longer than a page still split, which is correct
   — the alternative is a page-break before every month and a lot of white. */
.calsheet__month, .calsheet__weekly { break-inside: auto; }

.calsheet__monthname {
    font-family: var(--ac-font-heading, Georgia, serif);
    font-size: 1.0625rem;
    font-weight: var(--ac-weight-semibold);
    letter-spacing: .16em;
    text-transform: uppercase;
    margin: 0 0 .35rem;
    padding-bottom: .25rem;
    border-bottom: 1px solid var(--ac-text);
    break-after: avoid;
}

.calsheet__table {
    width: 100%;
    border-collapse: collapse;
}

.calsheet__table td {
    padding: .28rem .5rem .28rem 0;
    vertical-align: top;
    border: 0;
}

.calsheet__table tr { break-inside: avoid; }

.calsheet__date {
    width: 7.5rem;
    white-space: nowrap;
    color: var(--ac-text-muted);
    font-size: var(--ac-text-sm);
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------------
   Admin edit shortcut -- SCREEN ONLY

   A pencil in the gutter left of the title, jumping to that event's edit page.
   Deliberately quiet: the sheet is a document, not an admin screen, so this is
   borderless and dimmed until hover rather than the full bordered .ac-icon-btn.

   It keeps the .ac-icon-btn class for the shared hover/focus semantics and
   because the icon-only a11y gate in Tools/check-migration-progress.js keys off
   it -- which is why the anchor carries BOTH aria-label and data-bs-title.

   Overrides are scoped .calsheet__table td.calsheet__editcell rather than using
   !important: the base rule .calsheet__table td is 0,1,1 and would otherwise win.
   --------------------------------------------------------------------------- */
.calsheet__table td.calsheet__editcell {
    width: 1.6rem;
    padding-right: .15rem;
}

.calsheet__edit.ac-icon-btn {
    width: 1.3rem;
    height: 1.3rem;
    border: 0;
    background: transparent;
    font-size: .78rem;
    color: var(--ac-text-muted);
    opacity: .5;
}

.calsheet__edit.ac-icon-btn:hover,
.calsheet__edit.ac-icon-btn:focus-visible {
    background: transparent;
    color: var(--ac-brand);
    opacity: 1;
}

.calsheet__what { width: auto; }
.calsheet__what.is-away { font-style: italic; }

.calsheet__detail {
    width: 16rem;
    color: var(--ac-text-muted);
    font-size: var(--ac-text-sm);
}

/* Shaded = no service. Paired with the word "No" in every such title, so the
   meaning never rests on the shading alone — WCAG 1.4.1. */
.calsheet__table tr.is-noservice td {
    background: var(--ac-surface-sunken);
}

/* ---------------------------------------------------------------------------
   Every week
   --------------------------------------------------------------------------- */

.calsheet__weekly {
    margin-top: 2rem;
    padding: 1.25rem;
    background: var(--ac-brand-soft);
    border-radius: var(--ac-radius-sm);
}

.calsheet__weekgrid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
    gap: 1rem 1.75rem;
}

.calsheet__day { break-inside: avoid; }

.calsheet__dayname {
    font-size: var(--ac-text-xs);
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--ac-text-muted);
    font-weight: var(--ac-weight-semibold);
    margin: 0 0 .25rem;
}

.calsheet__daylist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.calsheet__daylist li {
    padding: .1rem 0;
    font-size: var(--ac-text-sm);
}

.calsheet__itemtime { color: var(--ac-text-muted); }
.calsheet__itemtime::before { content: "  ·  "; opacity: .5; }
.calsheet__itemloc { color: var(--ac-text-muted); }
.calsheet__itemloc::before { content: "  ·  "; opacity: .5; }

.calsheet__note {
    margin: .9rem 0 0;
    font-size: var(--ac-text-sm);
    color: var(--ac-text-muted);
}

/* ---------------------------------------------------------------------------
   Footer
   --------------------------------------------------------------------------- */

.calsheet__foot {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--ac-border);
    font-size: var(--ac-text-xs);
    color: var(--ac-text-muted);
    text-align: center;
}

.calsheet__foot p { margin: 0 0 .4rem; }

/* ============================================================================
   Print
   ============================================================================
   Forced to ink-on-white regardless of the church's theme. A themed print is a
   wasted cartridge, and a dark theme would print a solid black page.

   These are the only literal colours in this file, and they are deliberate:
   this block describes PAPER, which has no theme — the same reasoning
   CLAUDE.md applies to the bulletin builder's --bb-paper.
   ============================================================================ */

@media print {
    .calprint-toolbar { display: none !important; }

    /* The admin edit pencil is chrome too -- it must never reach paper. */
    .calsheet__editcell { display: none !important; }

    /* The site's own chrome has no business on a handout. */
    header nav, .navbar, footer:not(.calsheet__foot) { display: none !important; }

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

    html, body {
        background: #ffffff !important;
        color: #111111 !important;
    }

    .calsheet {
        max-width: none;
        margin: 0;
        padding: 0;
        font-size: 10pt;
        color: #111111;
    }

    .calsheet__church,
    .calsheet__themesub,
    .calsheet__scripture,
    .calsheet__legend,
    .calsheet__date,
    .calsheet__detail,
    .calsheet__dayname,
    .calsheet__itemtime,
    .calsheet__itemloc,
    .calsheet__note,
    .calsheet__foot { color: #555555 !important; }

    .calsheet__title { font-size: 22pt; }
    .calsheet__monthname { font-size: 11pt; border-bottom-color: #111111; }

    /* Browsers drop background fills when printing unless asked; without this
       the shaded "no service" rows and the weekly panel print as plain white
       and the legend stops being true. */
    .calsheet__table tr.is-noservice td,
    .calsheet__weekly {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .calsheet__table tr.is-noservice td { background: #f4f5f7 !important; }
    .calsheet__weekly { background: #edf2f9 !important; }
    .calsheet__foot { border-top-color: #cccccc; }
}
