/* Calendar-only styles, loaded ONLY by public/calendar/.
   Split out of style.css on 2026-09-15. These rules use :has(), and style.css
   is loaded by all 33 boycott pages -- the biggest of which carries hundreds of
   records, each with a hidden <article>. There is a note in style.css saying a
   :has() selector on that page "stalled the page" once before. Putting more of
   them into the stylesheet those pages load was a mistake; a reader reported a
   spinning renderer on the Humans list, with no JavaScript anywhere on the site
   to blame. Keep page-specific CSS on its page. */
/* =====================================================================
   CALENDAR  (public/calendar/, generated by scripts/build-calendar.py)

   No JavaScript, so month paging and the event popups both run on :target
   -- the same fragment trick .bq-names uses to open a record. Consequences
   worth knowing before editing:

     - The visible month is whatever the URL fragment points at, so the
       browser Back button steps back through months. That is a feature.
     - :target cannot move focus, so a popup does not trap the keyboard the
       way a scripted dialog would. Its close control is therefore a real
       link, first in the card and reachable by Tab.
     - The grid is frozen at build time. It has no clock and cannot grey out
       a date once it has passed, so the recurring events are ALSO stated in
       words in a .standing block above it. That block is what people should
       believe if the two ever disagree.
   ===================================================================== */

.cal h1 { margin-bottom: .75rem; }
.cal .standing { margin: 2rem 0; }
.cal-placenote { font-weight: 400; }

/* Visually hidden, still read aloud. */
.cal-vh {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* --- next dates: the part that reads well on a phone --- */
.cal-next {
  list-style: none;
  padding: 0;
  margin: 1rem 0 0;
  border-top: 1px solid var(--rule);
  max-width: var(--measure);
}
/* The base rule puts a reading measure on every li; these are rows in a
   list, not paragraphs, so they opt out and the border runs full width. */
.cal-next li {
  max-width: none;
  font-family: var(--sans);
  font-size: .9375rem;
  padding: .6rem .25rem;
  border-bottom: 1px solid var(--rule);
}
.cal-next time { font-weight: 600; font-style: normal; }
.cal-skipped { color: var(--muted); }
.cal-skipped strong { color: var(--accent-dk); font-weight: 600; }
.cal-skipnote { font-style: italic; }

.cal-ics {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--muted);
  max-width: var(--measure);
  margin-top: 1.25rem;
}
.cal-ics a { color: var(--accent-dk); font-weight: 600; }

.cal-hint {
  font-family: var(--sans);
  font-size: .875rem;
  color: var(--muted);
  max-width: var(--measure);
  margin: .25rem 0 1rem;
}

/* --- one month at a time -------------------------------------------
   Order matters. .is-current is shown by a plain rule so a browser without
   :has() still renders a usable calendar -- it shows the current month
   alongside a chosen one rather than instead of it. The :has() rules below
   make the swap exact where they are supported. */
.cal-months { max-width: 34rem; }

.cal-month { display: none; }
.cal-month.is-current { display: block; }
.cal-month:target { display: block; }
.cal-month:has(.cal-pop:target) { display: block; }

.cal-months:has(.cal-month:target) .cal-month.is-current:not(:target) { display: none; }
.cal-months:has(.cal-pop:target) .cal-month.is-current:not(:has(.cal-pop:target)) { display: none; }

.cal-monthnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  margin-bottom: .5rem;
}
.cal-monthnav h3 {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  text-align: center;
  flex: 1;
}
.cal-arrow {
  font-family: var(--sans);
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  color: var(--accent-dk);
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--surface);
  padding: .3rem .7rem;
  /* Comfortably tappable -- this is the main control on a phone. */
  min-width: 2.75rem;
  text-align: center;
}
.cal-arrow:hover { border-color: var(--accent); background: var(--sunk); }
/* Kept in the layout at the ends of the range so the month name does not shift. */
.cal-arrow.is-off { color: var(--rule); border-color: var(--rule); background: transparent; }

.cal-grid {
  border-collapse: collapse;
  width: 100%;
  font-family: var(--sans);
  font-size: .8125rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 4px;
}
.cal-grid th {
  font-size: .6875rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  padding: .4rem .2rem;
  border-bottom: 1px solid var(--rule);
}
/* Chrome underlines <abbr title>; the weekday heads are not glossary terms. */
.cal-grid th abbr { text-decoration: none; border: none; cursor: default; }
.cal-grid td {
  height: 3.4rem;
  vertical-align: top;
  padding: .2rem .25rem;
  border: 1px solid var(--rule);
  text-align: left;
}
.cal-pad { background: var(--sunk); border-color: var(--rule); }
.cal-num { display: block; color: var(--muted); font-size: .75rem; }
.cal-has-ev { background: var(--alert-bg); }
.cal-has-ev .cal-num { color: var(--text); font-weight: 700; }
.cal-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-today .cal-num { color: var(--accent-dk); font-weight: 700; }

/* The event inside a day. Wraps rather than truncating: a name cut off
   mid-word on a calendar is how someone turns up at the wrong thing. */
.cal-ev {
  display: block;
  font-size: .6875rem;
  line-height: 1.25;
  font-weight: 600;
  color: var(--accent-dk);
  margin-top: .1rem;
  text-decoration: none;
}
.cal-ev:hover { text-decoration: underline; }
.cal-ev-skip { color: var(--muted); font-weight: 400; text-decoration: line-through; }
.cal-has-skip { background: var(--sunk); }

/* --- the popup ------------------------------------------------------ */
.cal-pop { display: none; }
.cal-pop:target {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 50;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cal-pop-scrim {
  position: absolute;
  inset: 0;
  background: rgba(36, 33, 29, .55);
}
.cal-pop-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-left: 4px solid var(--accent);
  border-radius: 4px;
  padding: 1.25rem 1.5rem;
  width: min(100% - 2rem, 26rem);
  max-height: 80vh;
  overflow-y: auto;
  font-family: var(--sans);
  box-shadow: 0 8px 30px rgba(36, 33, 29, .25);
}
.cal-pop-card .kicker { margin-bottom: .25rem; }
.cal-pop-card h4 {
  margin: 0 0 .5rem;
  font-family: var(--sans);
  font-size: 1.25rem;
  letter-spacing: -0.01em;
}
.cal-pop-close {
  float: right;
  margin: -.25rem -.5rem 0 .5rem;
  font-size: .8125rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  padding: .25rem .4rem;
}
.cal-pop-close:hover { color: var(--accent-dk); }
.cal-pop-card p { max-width: none; margin: 0 0 .5rem; }
.cal-pop-card p:last-child { margin-bottom: 0; }
.cal-pop-time { font-weight: 700; font-size: 1.0625rem; }
.cal-pop-where { color: var(--muted); }
.cal-pop-blurb { font-size: .9375rem; }
.cal-pop-note, .cal-pop-off { font-size: .875rem; color: var(--muted); line-height: 1.5; }
.cal-pop-off strong { color: var(--accent-dk); }

/* The boycott page's disclaimer spans its full-width layout. This page's
   content column is 34rem, so the shared width: 100% would leave the notice
   stranded twice as wide as everything above it. */
.cal-disclaimer { margin-top: 2.5rem; max-width: 34rem; width: auto; }

.cal-generated {
  font-family: var(--sans);
  font-size: .8125rem;
  line-height: 1.55;
  color: var(--muted);
  max-width: var(--measure);
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}
.cal-generated time { font-style: normal; font-weight: 600; }
.cal-empty { color: var(--muted); font-family: var(--sans); }

@media (max-width: 34rem) {
  .cal-grid td { height: 3rem; }
  .cal-ev { font-size: .625rem; }
}

@media print {
  /* Printed and pinned to a noticeboard -- the likeliest offline use.
     :target means nothing on paper, so print every month and no popups. */
  .cal-month, .cal-month.is-current { display: block; page-break-inside: avoid; }
  .cal-pop, .cal-arrow, .cal-hint, .cal-ics { display: none !important; }
}
