/* ── Week picker: W46 in the Weekly | Wnn switch ─────────────── */
/* Wider than 560px: a pop-up in the article reader's shell (reader.css).
   560px and narrower: a bottom sheet whose height week-picker.js sets to one of three
   stops. Below the reader (z-index 80), so an article opened from a parked sheet covers it. */
body.week-open { overflow: hidden; }
.week-overlay {
  position: fixed; inset: 0; z-index: 79;
  display: flex; align-items: center; justify-content: center; padding: 24px 20px;
  opacity: 0; transition: opacity .18s ease;
}
.week-overlay[hidden] { display: none; }
.week-overlay.open { opacity: 1; }
.week-dim { position: absolute; inset: 0; background: rgba(10,10,10,.38); }
.week-dialog {
  position: relative; width: min(480px, 100%); max-height: min(640px, calc(100vh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--bg); border: 1px solid var(--divider); border-radius: 12px;
  box-shadow: 0 18px 60px rgba(0,0,0,.22);
  transform: scale(.985); transition: transform .2s ease;
}
.week-overlay.open .week-dialog { transform: scale(1); }
.week-dialog:focus { outline: none; }
.week-grab { display: none; }
.week-head {
  flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 20px 14px 14px 22px; border-bottom: 1px solid var(--divider);
}
.week-head-text { min-width: 0; }
.week-title { font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.3px; color: var(--ink); }
.week-sub {
  margin-top: 4px; font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .5px; text-transform: uppercase; color: var(--ink-muted);
}
.week-close {
  flex: none; width: 36px; height: 36px; margin-top: -6px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: none; color: var(--ink-muted); font-size: 22px; line-height: 1; cursor: pointer;
}
.week-close:hover { color: var(--ink); }
.week-close:focus:not(:focus-visible) { outline: none; }
.week-close:focus-visible, .week-row:focus-visible, .week-foot:focus-visible, .week-grab:focus-visible {
  outline: 2px solid var(--ink-muted); outline-offset: -2px;
}
.week-scroll { position: relative; flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.week-list {
  position: relative; flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain; scrollbar-width: none; padding: 0 16px 0 8px;
}
.week-list::-webkit-scrollbar { display: none; }
.week-list > .week-row:last-child { margin-bottom: 8px; }
.week-month {
  position: sticky; top: 0; z-index: 1; padding: 12px 12px 4px; background: var(--bg);
  font-family: var(--mono); font-size: 9.5px; font-weight: 700; letter-spacing: 1.1px;
  text-transform: uppercase; color: var(--ink-muted);
}
.week-row {
  width: 100%; display: flex; gap: 10px; padding: 10px 12px; border: 0; border-radius: 8px;
  background: none; font: inherit; color: inherit; text-align: left; cursor: pointer;
}
@media (hover: hover) { .week-row:hover { background: var(--bg-subtle); } }   /* a tap must not leave a grey row behind */
.week-row.sel { background: color-mix(in srgb, var(--ink) 5%, var(--bg)); }
.week-dot { flex: none; width: 6px; height: 6px; margin-top: 7px; border-radius: 50%; }
.week-row.sel .week-dot { background: var(--section-major); }
.week-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.week-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.week-range {
  display: inline-flex; align-items: baseline; gap: 8px;
  font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap;
}
.week-latest {
  font-family: var(--mono); font-size: 8.5px; font-weight: 700; letter-spacing: .8px;
  text-transform: uppercase; color: var(--section-major);
}
.week-meta { font-family: var(--mono); font-size: 10px; color: var(--ink-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.week-headline {
  font-size: 13px; line-height: 1.45; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Sticks to the bottom of the pop-up while the list scrolls. */
.week-foot {
  position: sticky; bottom: 0; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  margin: 8px -16px 0 -8px; padding: 13px 22px; border-top: 1px solid var(--divider); background: var(--bg);
  font-size: 12.5px; color: var(--ink-muted); text-decoration: none;
}
.week-foot b {
  font-family: var(--mono); font-size: 10px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--ink); white-space: nowrap;
}
.week-foot:hover b { text-decoration: underline; text-underline-offset: 3px; }
/* Position-hue scrollbar, as in the article reader. */
.week-bar { position: absolute; top: 10px; bottom: 10px; right: 5px; width: 6px; display: none; }
.week-bar::before { content: ''; position: absolute; left: 2px; width: 2px; top: 0; bottom: 0; border-radius: 2px; background: #E4E4E0; }
.week-thumb {
  position: absolute; left: 0; right: 0; top: 0; width: 6px; border-radius: 99px;
  background: #D54438; box-shadow: 0 0 0 2px var(--bg); cursor: grab; touch-action: none;
}

@media (max-width: 560px) {
  .week-overlay { padding: 0; align-items: flex-end; opacity: 1; transition: none; }
  /* Minimum: the page behind scrolls and taps as normal. */
  .week-overlay.parked { pointer-events: none; }
  .week-dim { background: rgba(10,10,10,.34); opacity: 0; transition: opacity .3s ease; }
  .week-dialog {
    pointer-events: auto; width: 100%; height: 0; max-height: none;
    border: 0; border-top: 4px solid var(--ink); border-radius: 18px 18px 0 0;
    box-shadow: 0 -14px 42px rgba(0,0,0,.22);
    transform: none; transition: height .3s cubic-bezier(.2,.8,.2,1);
  }
  .week-overlay.open .week-dialog { transform: none; }
  .week-overlay.dragging .week-dialog, .week-overlay.dragging .week-dim { transition: none; }
  .week-grab {
    display: block; flex: none; position: relative; width: 100%; height: 24px;
    border: 0; padding: 0; background: none; cursor: grab; touch-action: none;
  }
  .week-grab::before {
    content: ''; position: absolute; left: 50%; top: 9px; width: 38px; height: 4px;
    transform: translateX(-50%); border-radius: 99px;
    background: color-mix(in srgb, var(--ink-muted) 42%, transparent);
  }
  .week-head { padding: 0 8px 12px 20px; cursor: grab; touch-action: none; -webkit-user-select: none; user-select: none; }
  .week-title { font-size: 17px; }
  .week-close { width: 44px; height: 44px; margin-top: -4px; }
  .week-list { padding: 0 14px calc(16px + env(safe-area-inset-bottom)) 6px; }
  .week-row { min-height: 56px; }
  .week-range { font-size: 15px; }
  .week-foot { position: static; margin: 10px 0 0 6px; padding: 14px 6px 4px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .week-overlay, .week-dialog, .week-dim { transition: none !important; }
}
