/* Reading plans (js/bible-plans.js): the sheet that "Reading plans" opens among the reader's tools, the strip beneath a
   chapter of the plan, and the mark on the tools button while today's reading waits. Square corners and hairline rules,
   as in the rest of the reader; every color is a theme token, so the dark theme and the light are both served. */

/* the mark on the tools button: a small lozenge of rubric, as a scribe marks a place */
#bbPlansBtn .bb-tool-i { position: relative; }
#bbPlansBtn.has-due .bb-tool-i::after {
  content: ""; position: absolute; top: -5px; right: -3px; width: 6px; height: 6px;
  background: var(--rubric); box-shadow: 0 0 0 2px var(--bg); transform: rotate(45deg);
}

/* ---- the sheet ---- */
.bb-plans { box-sizing: border-box; width: calc(100% - 20px); max-width: 35rem; max-height: min(88vh, 46rem); max-height: min(88dvh, 46rem); padding: 0; border: 1px solid var(--press); border-radius: 0; background: var(--bg); color: var(--ink); box-shadow: 0 18px 50px var(--shadow); overflow: hidden; }
.bb-plans[open] { display: flex; flex-direction: column; }
.bb-plans::backdrop { background: var(--overlay); }
.bb-plans-head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 6px 6px 18px; border-bottom: 1px solid var(--rule); }
.bb-plans-head h3 { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.4rem; color: var(--rubric); }
.bb-plans-body { flex: 1 1 auto; min-height: 0; padding: 16px 18px 18px; overflow-y: auto; overscroll-behavior: contain; }
.bb-plans button, .bb-plan-strip button { margin: 0; border-radius: 0; box-shadow: none; font-family: inherit; line-height: 1.25; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bb-plans button:focus-visible, .bb-plans input:focus-visible, .bb-plan-strip button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.bb-plans-x { width: 2.6rem; height: 2.6rem; padding: 0 0 3px; border: 0; background: none; font-size: 1.7rem; line-height: 1; color: var(--muted); }
.bb-plans-x:hover { color: var(--ink); }

/* buttons: the thing to do, bordered in rubric; the quieter choices, as underlined words */
.bb-plans-btn { min-height: 2.6rem; padding: 8px 16px; border: 1px solid var(--rubric); background: none; font-size: 1.05rem; color: var(--rubric); }
.bb-plans-btn:hover { background: color-mix(in srgb, var(--rubric) 10%, transparent); }
.bb-plans-link { min-height: 2.5rem; padding: 6px 2px; border: 0; background: none; font-size: 1rem; color: var(--muted); text-decoration: underline dotted; text-underline-offset: 3px; }
.bb-plans-link:hover { color: var(--rubric); }
.bb-plans-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; }

/* the plan being read: its name and dates, how far, and a word if it is behind or finished */
.bb-plans-top { margin: 0 0 12px; text-align: center; }
.bb-plans-name { margin: 0; font-family: var(--display); font-weight: 400; font-size: 1.45rem; line-height: 1.2; color: var(--ink); }
.bb-plans-since { margin: 3px 0 0; font-style: italic; font-size: 0.95rem; color: var(--muted); font-feature-settings: "lnum"; }
.bb-plans-prog { margin: 0 0 14px; }
.bb-plans-meter { height: 8px; border: 1px solid var(--rule); overflow: hidden; }
.bb-plans-meter span { display: block; height: 100%; background: var(--rubric); transition: width 0.4s ease; }
.bb-plans-count { margin: 6px 0 0; text-align: center; font-size: 0.98rem; color: var(--muted); font-feature-settings: "lnum"; }
.bb-plans-behind { margin: 0 0 14px; padding: 6px 12px 2px; border-left: 3px solid var(--rubric); background: color-mix(in srgb, var(--rubric) 8%, transparent); }
.bb-plans-behind p { margin: 0; color: var(--ink); }
.bb-plans-behind .bb-plans-link { color: var(--rubric); }
.bb-plans-fin { margin: 0 0 16px; padding: 14px 16px 10px; border: 1px solid var(--rubric); text-align: center; }
.bb-plans-fin p { margin: 0 0 10px; line-height: 1.5; }
.bb-plans-fin .bb-plans-fin-h { margin-bottom: 4px; font-family: var(--display); font-size: 1.5rem; color: var(--rubric); }
.bb-plans-fin .bb-plans-acts { justify-content: center; }

/* the day: ‹ Day 12 of 365 › Today, then its chapters */
.bb-plans-day { padding-top: 12px; border-top: 3px double var(--press); }
.bb-plans-nav { display: flex; align-items: center; gap: 8px; }
.bb-plans-step { flex: none; width: 2.6rem; height: 2.6rem; padding: 0 0 3px; border: 1px solid var(--rule); background: none; font-size: 1.6rem; line-height: 1; color: var(--muted); }
.bb-plans-today { flex: none; height: 2.6rem; padding: 0 12px; border: 1px solid var(--rule); background: none; font-family: var(--caps); font-size: 0.98rem; letter-spacing: 0.06em; color: var(--ink); }
.bb-plans-step:hover:not(:disabled), .bb-plans-today:hover:not(:disabled) { border-color: var(--rubric); color: var(--rubric); }
.bb-plans-step:disabled, .bb-plans-today:disabled { opacity: 0.35; cursor: default; }
.bb-plans-dayname { flex: 1; min-width: 0; margin: 0; display: flex; flex-direction: column; align-items: center; text-align: center; font-weight: 400; }
.bb-plans-dn { font-family: var(--text); font-size: 1.32rem; line-height: 1.15; color: var(--ink); font-feature-settings: "lnum"; }   /* the book face, for its lining figures */
.bb-plans-of { font-size: 0.78em; color: var(--muted); }
.bb-plans-tick { color: var(--rubric); }
.bb-plans-date { font-size: 0.92rem; font-style: italic; color: var(--muted); }
.bb-plans-dmeta { margin: 8px 0 4px; text-align: center; font-size: 0.95rem; color: var(--muted); font-feature-settings: "lnum"; }
.bb-plans-part { margin: 12px 0 0; padding-bottom: 2px; font-family: var(--caps); font-weight: 400; font-size: 0.9rem; letter-spacing: 0.14em; color: var(--rubric); }
.bb-plans-reads { margin: 0; padding: 0; list-style: none; }
.bb-plans-read { display: flex; align-items: center; border-bottom: 1px dotted var(--rule); }
.bb-plans-check { flex: none; display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; cursor: pointer; }
/* a square box drawn in the page's inks: an empty hairline square, and, ticked, a rubric square with a tick of the page's color */
.bb-plans-check input { -webkit-appearance: none; appearance: none; display: grid; place-content: center; box-sizing: border-box; width: 1.25rem; height: 1.25rem; margin: 0; border: 1px solid var(--muted); border-radius: 0; background: none; cursor: pointer; }
.bb-plans-check input::after { content: ""; width: 0.32rem; height: 0.66rem; margin-top: -0.14rem; border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg); visibility: hidden; }
.bb-plans-check input:checked { border-color: var(--rubric); background: var(--rubric); }
.bb-plans-check input:checked::after { visibility: visible; }
.bb-plans-check:hover input { border-color: var(--rubric); }
.bb-plans-ch { flex: 1; min-width: 0; min-height: 2.75rem; padding: 6px 8px 6px 4px; border: 0; background: none; text-align: left; font-size: 1.15rem; color: var(--ink); }
.bb-plans-ch:hover { color: var(--rubric); }
.bb-plans-read.is-done .bb-plans-ch { color: var(--muted); }
.bb-plans-read.is-done .bb-plans-ch:hover { color: var(--rubric); }
.bb-plans-go { display: block; width: 100%; margin: 14px 0 0; }
.bb-plans-daydone { margin: 14px 0 0; text-align: center; font-style: italic; color: var(--rubric); }

/* the foot: another plan, or none; a question asked waits on its own line */
.bb-plans-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 16px; margin: 18px 0 0; padding-top: 6px; border-top: 1px solid var(--rule); }
.bb-plans-ask { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; }
.bb-plans-foot .bb-plans-ask { flex: 1 1 100%; justify-content: flex-end; padding-bottom: 2px; }
.bb-plans-q { flex: 1 1 100%; font-style: italic; color: var(--ink); }
.bb-plans-foot .bb-plans-q { text-align: right; }

/* the plans to choose */
.bb-plans-intro { margin: 0 0 12px; font-style: italic; line-height: 1.45; color: var(--muted); }
.bb-plans-lead { margin: -6px 0 6px; }
.bb-plans-list { margin: 0; padding: 0; list-style: none; }
.bb-plans-item { padding: 12px 0 14px; border-top: 1px solid var(--rule); }
.bb-plans-item:first-child { border-top: 3px double var(--press); }
.bb-plans-item .bb-plans-name { font-size: 1.28rem; }
.bb-plans-item.is-on { padding-left: 12px; border-left: 3px solid var(--rubric); }
.bb-plans-now { margin-left: 4px; font-family: var(--caps); font-size: 0.72em; letter-spacing: 0.08em; white-space: nowrap; color: var(--rubric); }
.bb-plans-desc { margin: 3px 0 2px; font-size: 1.04rem; line-height: 1.45; }
.bb-plans-meta { margin: 0 0 8px; font-size: 0.93rem; color: var(--muted); font-feature-settings: "lnum"; }

/* ---- the strip beneath a chapter of the plan: slim and quiet, between the last verse and the buttons to turn the page ---- */
.bb-plan-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 22px 0 4px; padding: 2px 0 2px 12px; border-left: 2px solid var(--rubric); font-family: var(--text); font-size: 1rem; line-height: 1.3; color: var(--muted); }
.bb-plan-strip button { min-height: 2.25rem; padding: 4px 0; border: 0; background: none; font-size: inherit; color: inherit; }
.bb-plan-strip .bb-plan-day { font-family: var(--caps); letter-spacing: 0.05em; }
.bb-plan-strip .bb-plan-day:hover { color: var(--ink); }
.bb-plan-strip .bb-plan-mark { padding: 4px 12px; border: 1px solid var(--rule); color: var(--ink); }
.bb-plan-strip .bb-plan-mark:hover { border-color: var(--rubric); color: var(--rubric); }
.bb-plan-strip .bb-plan-mark[aria-pressed="true"] { border-color: var(--rubric); background: color-mix(in srgb, var(--rubric) 10%, transparent); color: var(--rubric); }
.bb-plan-strip .bb-plan-next { color: var(--rubric); }
.bb-plan-strip .bb-plan-next:hover { text-decoration: underline; text-underline-offset: 3px; }
.bb-plan-done { font-style: italic; }
.bb-plan-strip [hidden] { display: none; }

@media (max-width: 780px) {
  .bb-plans { width: calc(100% - 12px); max-height: calc(100vh - 16px); max-height: calc(100dvh - 16px); }
  .bb-plans-body { padding: 12px 12px 16px; }
  .bb-plans-head { padding-left: 14px; }
  .bb-plan-strip { gap: 2px 14px; }
  .bb-plan-strip button { min-height: 2.5rem; }
}
@media (prefers-reduced-motion: reduce) { .bb-plans-meter span { transition: none; } }
@media (forced-colors: active) { .bb-plans-check input { -webkit-appearance: auto; appearance: auto; } .bb-plans-check input::after { content: none; } }
@media print {
  .bb-plans, .bb-plan-strip { display: none !important; }
  #bbPlansBtn.has-due .bb-tool-i::after { display: none; }
}
