/* clergy-tools.css — styles of public/clergy-tools.js (features 1–6 for the clergy, 2026-11-03).
   Colours come from the tokens of style.css (:root); nothing here changes the service text itself. */

/* ── 1. Day brief card ───────────────────────────────────────────────────── */
.day-brief { max-width: 1100px; margin: .6rem auto; padding: .7rem .9rem; background: var(--bg-card);
  border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: var(--radius); box-shadow: var(--shadow); }
.day-brief[hidden] { display: none; }
.day-brief-head { display: flex; flex-wrap: wrap; gap: .3rem .8rem; align-items: baseline; margin-bottom: .4rem; }
.day-brief-date { color: var(--text-dim); font-size: .85rem; }
.day-brief-saint { font-weight: 700; font-size: 1.05rem; overflow-wrap: anywhere; }
.day-brief-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: .4rem .8rem; margin: 0; }
.day-brief-facts dt { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-dim); }
.day-brief-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.day-brief-flags { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.day-brief-note { margin-top: .6rem; padding: .5rem .7rem; background: var(--bg-strip); border-radius: var(--radius-sm);
  border-left: 3px solid var(--red); font-size: .9rem; }
.day-brief-note p { margin: .25rem 0 0; }

/* ── Toolbar (role, parts, print, search) ────────────────────────────────── */
.clergy-toolbar { display: flex; flex-direction: column; gap: .5rem; margin-bottom: .7rem; position: relative; }
.clergy-row { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; }
.clergy-field { display: inline-flex; align-items: center; gap: .4rem; font-size: .9rem; }
.clergy-field select, .clergy-search input { min-height: 36px; padding: .2rem .4rem; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text); font: inherit; }
.clergy-role-info { font-size: .8rem; color: var(--text-dim); }
.clergy-search { display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; flex: 1 1 220px; min-width: 0; }
.clergy-search input { flex: 1 1 140px; min-width: 0; }
.clergy-search-count { font-size: .8rem; color: var(--text-dim); min-width: 3.5em; }
.clergy-toolbar .svc-print-btn { min-height: 36px; }

/* ── 2. Role mode: highlight only; text and order stay as they are ───────── */
.role-mine { background: rgba(198, 162, 75, .2); box-shadow: -4px 0 0 var(--gold); }
body:not([data-role="layperson"]) .role-other { opacity: .55; }
.role-folded { display: none !important; }

/* ── 5. Search hits ──────────────────────────────────────────────────────── */
mark.clergy-hit { background: #ffe58a; color: inherit; padding: 0 1px; border-radius: 2px; }
mark.clergy-hit-current { background: #ff9d3c; outline: 2px solid var(--accent); }

/* ── 3. Changeable parts sheet (dialog) ──────────────────────────────────── */
.clergy-sheet { position: fixed; inset: 0; z-index: 9000; background: var(--bg); overflow: auto; padding: 0 .9rem 2rem; }
.clergy-sheet[hidden] { display: none; }
.clergy-sheet-bar { position: sticky; top: 0; z-index: 1; display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
  padding: .6rem 0; background: var(--bg); border-bottom: 1px solid var(--border); }
.clergy-sheet-bar strong { flex: 1 1 100%; }
.clergy-sheet-mount { max-width: 820px; margin: .8rem auto; font-size: var(--service-font, 16px); line-height: 1.55; }
.clergy-office h4 { margin: 1.2rem 0 .3rem; padding-bottom: .2rem; border-bottom: 1px solid var(--border); color: var(--red); }
.clergy-office h5 { margin: .8rem 0 .2rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-dim); }
.clergy-part { margin-bottom: .6rem; break-inside: avoid; }
.clergy-part-label { font-style: italic; color: var(--red); font-size: .85em; }
.clergy-part-text { margin: .1rem 0; white-space: pre-line; }
.clergy-gap, .clergy-empty { color: var(--text-dim); font-style: italic; font-size: .9rem; }

/* ── 4. Print options popover ────────────────────────────────────────────── */
.clergy-print-box { position: absolute; top: 100%; left: 0; z-index: 50; display: flex; flex-direction: column; gap: .5rem;
  padding: .7rem; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.clergy-print-box[hidden] { display: none; }

/* ── 6. Online / offline badge ───────────────────────────────────────────── */
.clergy-net { position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 9500; max-width: 92vw;
  padding: .5rem 1rem; background: #333; color: #fff; border-radius: 999px; font-size: .85rem; text-align: center; }
.clergy-net[hidden] { display: none; }

@media (max-width: 480px) {
  .clergy-field { flex: 1 1 100%; justify-content: space-between; }
  .clergy-field select { flex: 1; }
}

/* ── 4. Print: A4/A5 sheet without the site chrome ───────────────────────── */
@media print {
  body.print-clergy { background: #fff; font-size: var(--print-font, 12pt); }
  body.print-clergy .app-header, body.print-clergy .day-nav, body.print-clergy .lang-row,
  body.print-clergy .service-tabs, body.print-clergy .day-strip, body.print-clergy .day-brief,
  body.print-clergy .feast-banner, body.print-clergy .audit-banner, body.print-clergy .app-footer,
  body.print-clergy .settings-panel, body.print-clergy .clergy-toolbar, body.print-clergy .clergy-net,
  body.print-clergy .game-toggle, body.print-clergy .svc-text-toolbar, body.print-clergy #cal-overlay,
  body.print-clergy #ctx-menu, body.print-clergy .clergy-sheet-bar { display: none !important; }
  body.print-clergy .panel { display: none !important; }
  body.print-clergy.print-clergy-service #panel-service-text { display: block !important; }
  /* the parts sheet: only the sheet is printed */
  body.print-clergy.print-clergy-parts #service-wrap, body.print-clergy.print-clergy-parts main { display: none !important; }
  body.print-clergy .clergy-sheet { display: none !important; }
  body.print-clergy.print-clergy-parts .clergy-sheet:not([hidden]) { position: static; display: block !important; overflow: visible; padding: 0; }
  body.print-clergy .clergy-sheet-mount { max-width: none; margin: 0; font-size: var(--print-font, 12pt); }
  body.print-clergy .troparion-text, body.print-clergy .kontakion-text, body.print-clergy .sticheron-text,
  body.print-clergy .service-text-fixed, body.print-clergy .prokeimenon-text,
  body.print-clergy .litany-petition, body.print-clergy .litany-response,
  body.print-clergy .clergy-part { font-size: var(--print-font, 12pt); break-inside: avoid; page-break-inside: avoid; }
  body.print-clergy .rubric { break-after: avoid; page-break-after: avoid; }
  body.print-clergy .lang-column { border: none; }
  body.print-clergy mark.clergy-hit { background: none; outline: none; }
  body.print-clergy .role-mine { background: none; box-shadow: none; }
  body.print-clergy .role-other { opacity: 1; }
  body.print-clergy .role-folded { display: none !important; }
}

/* The old toolbar (Print / PDF / Scheme) did not wrap and pushed the page 54 px wider than a 390 px phone. */
.svc-text-toolbar, .svc-btn-group { flex-wrap: wrap; }
