/* ══════════════════════════════════════════════════════════════════
   gov.css — "החלטות ממשלה" tab (Task D)
   All rules scoped under #tab-gov; every class prefixed gov-.
   RTL, Bootstrap 5 chrome to match the rest of the site.
   ══════════════════════════════════════════════════════════════════ */

#tab-gov { direction: rtl; }
#tab-gov .gov-wrap { max-width: 1080px; margin: 0 auto; padding: 24px 16px 48px; }

/* ── intro / hint ── */
#tab-gov .gov-hint {
  background: #eef3f7; border: 1px solid #d7e0e8; border-radius: 10px;
  padding: 12px 16px; color: #445; font-size: .9rem; margin-bottom: 18px;
}

/* ── toolbar (search + filters + sort) ── */
#tab-gov .gov-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 18px;
}
#tab-gov .gov-toolbar input[type="search"],
#tab-gov .gov-toolbar select {
  border: 1px solid #cdd6de; border-radius: 8px; padding: 9px 12px;
  font-family: inherit; font-size: .92rem; background: #fff; color: #2c3e50;
}
#tab-gov .gov-toolbar input[type="search"] { flex: 1 1 240px; min-width: 200px; }
#tab-gov .gov-search-btn {
  border: 0; border-radius: 8px; padding: 9px 20px; font-weight: 700;
  color: #fff; background: #2c5364; cursor: pointer; font-family: inherit;
}
#tab-gov .gov-search-btn:hover { background: #22424f; }

/* ── result count / status ── */
#tab-gov .gov-status { color: #6b7b88; font-size: .85rem; margin-bottom: 12px; }

/* ── decision cards (list) ── */
#tab-gov .gov-list { display: grid; gap: 14px; }
#tab-gov .gov-card {
  background: #fff; border: 1px solid #e2e8ee; border-radius: 12px;
  padding: 16px 18px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
  cursor: pointer; transition: box-shadow .15s, border-color .15s;
}
#tab-gov .gov-card:hover { box-shadow: 0 4px 14px rgba(0,0,0,.09); border-color: #b9c7d3; }
#tab-gov .gov-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
#tab-gov .gov-card-uid {
  font-weight: 700; color: #2c5364; font-size: .82rem;
  background: #eef3f7; border-radius: 6px; padding: 2px 8px; white-space: nowrap;
}
#tab-gov .gov-card-title { font-weight: 700; color: #223; font-size: 1.02rem; line-height: 1.4; margin: 2px 0 6px; }
#tab-gov .gov-card-meta { color: #6b7b88; font-size: .84rem; display: flex; flex-wrap: wrap; gap: 4px 14px; }
#tab-gov .gov-card-meta i { margin-inline-end: 4px; color: #93a3af; }

/* ── count chips ── */
#tab-gov .gov-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
#tab-gov .gov-chip {
  font-size: .76rem; font-weight: 700; border-radius: 20px; padding: 3px 10px;
  background: #f1f5f8; color: #47606f; border: 1px solid #e0e8ee;
}
#tab-gov .gov-chip.gov-chip-amend  { background: #fff3e6; color: #9a5b12; border-color: #f4dcc0; }
#tab-gov .gov-chip.gov-chip-amended{ background: #fdeaea; color: #9a2b2b; border-color: #f2cfcf; }

/* ── empty / error / loading states ── */
#tab-gov .gov-empty, #tab-gov .gov-loading {
  text-align: center; color: #7a8896; padding: 42px 20px;
}
#tab-gov .gov-empty i, #tab-gov .gov-loading i { font-size: 1.8rem; margin-bottom: 10px; display: block; color: #b6c2cc; }

/* ── pagination ── */
#tab-gov .gov-pager { display: flex; justify-content: center; gap: 8px; margin-top: 22px; }
#tab-gov .gov-pager button {
  border: 1px solid #cdd6de; background: #fff; border-radius: 8px; padding: 7px 16px;
  font-family: inherit; font-weight: 700; color: #2c5364; cursor: pointer;
}
#tab-gov .gov-pager button:disabled { opacity: .45; cursor: default; }

/* ══════════════ decision detail (in-tab panel) ══════════════ */
#tab-gov .gov-detail { background: #fff; border: 1px solid #e2e8ee; border-radius: 12px; }
#tab-gov .gov-detail-head {
  padding: 18px 20px; border-bottom: 1px solid #eef2f5;
  display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-start;
}
#tab-gov .gov-back {
  border: 0; background: none; color: #2c5364; font-weight: 700; cursor: pointer;
  font-family: inherit; padding: 0; font-size: .92rem;
}
#tab-gov .gov-back:hover { text-decoration: underline; }
#tab-gov .gov-detail-title { font-weight: 700; font-size: 1.25rem; color: #1f2d38; margin: 6px 0; flex-basis: 100%; }
#tab-gov .gov-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: #556; font-size: .88rem; flex-basis: 100%; }
#tab-gov .gov-detail-meta i { color: #93a3af; margin-inline-end: 4px; }
#tab-gov .gov-source-link {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  color: #2c5364; font-weight: 700; font-size: .88rem; text-decoration: none;
}
#tab-gov .gov-source-link:hover { text-decoration: underline; }

#tab-gov .gov-detail-body { padding: 18px 20px; }

/* ── derived-list sections ── */
#tab-gov .gov-section { margin-bottom: 26px; }
#tab-gov .gov-section > h3 {
  font-size: 1.02rem; font-weight: 700; color: #2c5364; margin: 0 0 12px;
  padding-bottom: 6px; border-bottom: 2px solid #eef2f5;
  display: flex; align-items: center; gap: 8px;
}
#tab-gov .gov-section > h3 .gov-count-badge {
  font-size: .74rem; background: #eef3f7; color: #47606f; border-radius: 20px; padding: 1px 9px;
}
#tab-gov .gov-item {
  border: 1px solid #e8edf1; border-inline-start: 3px solid #cbd6de;
  border-radius: 8px; padding: 11px 14px; margin-bottom: 10px; background: #fbfcfd;
}
#tab-gov .gov-item-title { font-weight: 700; color: #2a3a45; font-size: .94rem; margin-bottom: 4px; }
#tab-gov .gov-item-fields { color: #556; font-size: .85rem; display: flex; flex-wrap: wrap; gap: 2px 16px; }
#tab-gov .gov-item-fields b { color: #33454f; font-weight: 700; }
#tab-gov .gov-quote {
  margin-top: 8px; padding: 8px 12px; background: #fff; border-radius: 6px;
  border-inline-start: 3px solid #d7c48a; color: #5a5030; font-size: .84rem; line-height: 1.55;
}
#tab-gov .gov-quote::before { content: "\201C"; }
#tab-gov .gov-quote::after  { content: "\201D"; }

/* ── amendment link rows ── */
#tab-gov .gov-amend-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px;
  border: 1px solid #e8edf1; border-radius: 8px; padding: 10px 14px; margin-bottom: 9px; background: #fbfcfd;
}
#tab-gov .gov-amend-action {
  font-size: .74rem; font-weight: 700; border-radius: 6px; padding: 2px 9px;
  background: #eef3f7; color: #47606f; white-space: nowrap;
}
#tab-gov .gov-amend-action.gov-act-revoke { background: #fdeaea; color: #9a2b2b; }
#tab-gov .gov-amend-target {
  font-weight: 700; color: #2c5364; cursor: pointer; background: none; border: 0; font-family: inherit; padding: 0;
}
#tab-gov .gov-amend-target:hover { text-decoration: underline; }
#tab-gov .gov-amend-target.gov-unresolved { color: #8a97a2; cursor: default; }
#tab-gov .gov-amend-target.gov-unresolved:hover { text-decoration: none; }
#tab-gov .gov-amend-date { color: #7a8896; font-size: .82rem; }

/* ── versions placeholder (shown when no layered versions exist) ── */
#tab-gov .gov-versions-box {
  border: 1px dashed #c6d2db; border-radius: 10px; padding: 18px 20px;
  background: #f7fafc; color: #5b6b78; text-align: center;
}
#tab-gov .gov-versions-box i { font-size: 1.4rem; display: block; margin-bottom: 8px; color: #a9b7c1; }

/* ══════════════ versions: track-changes + switcher (Task F) ══════════════ */
#tab-gov .gov-versions { direction: rtl; }

/* mode toggle (עקוב / נוסח נקי) */
#tab-gov .gov-ver-modes {
  display: inline-flex; gap: 0; margin-bottom: 12px;
  border: 1px solid #cdd6de; border-radius: 8px; overflow: hidden; background: #fff;
}
#tab-gov .gov-ver-mode {
  border: 0; background: #fff; color: #47606f; font-family: inherit;
  font-weight: 700; font-size: .84rem; padding: 7px 16px; cursor: pointer;
}
#tab-gov .gov-ver-mode + .gov-ver-mode { border-inline-start: 1px solid #e0e8ee; }
#tab-gov .gov-ver-mode:hover { background: #f1f5f8; }
#tab-gov .gov-ver-mode.is-on { background: #2c5364; color: #fff; }

/* version switcher chips */
#tab-gov .gov-ver-bar { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
#tab-gov .gov-ver-chip {
  border: 1px solid #cdd6de; background: #fff; color: #2c5364; cursor: pointer;
  font-family: inherit; font-weight: 700; font-size: .8rem; border-radius: 20px;
  padding: 5px 13px; transition: background .15s, border-color .15s;
}
#tab-gov .gov-ver-chip:hover { background: #eef3f7; border-color: #b9c7d3; }
#tab-gov .gov-ver-chip.is-on { background: #2c5364; color: #fff; border-color: #2c5364; }
#tab-gov .gov-ver-chip.gov-ver-chip-review { border-color: #e6c15a; }
#tab-gov .gov-ver-chip.gov-ver-chip-review::after { content: " \26A0"; font-size: .78rem; }
#tab-gov .gov-ver-chip.gov-ver-chip-revoked { border-color: #e0a3a3; }
#tab-gov .gov-ver-chip.gov-ver-chip-revoked.is-on { background: #9a2b2b; border-color: #9a2b2b; }

/* version body */
#tab-gov .gov-ver-body { margin-top: 6px; }
#tab-gov .gov-ver-text {
  background: #fff; border: 1px solid #e8edf1; border-radius: 8px;
  padding: 14px 16px; color: #263038; font-size: .92rem; line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
  direction: rtl; text-align: start;
}

/* track-changes marks (Word conventions). unicode-bidi:isolate keeps each mark
   from disturbing the bidirectional ordering of the surrounding Hebrew, and
   dir="auto" gives number-/Latin-only marks the right internal direction. */
#tab-gov .gov-ver-text .gov-del,
#tab-gov .gov-ver-text .gov-ins {
  unicode-bidi: isolate;
}
#tab-gov .gov-del {
  color: #b3261e; text-decoration: line-through;
  text-decoration-thickness: 1.5px; background: #fdecec; border-radius: 3px;
}
#tab-gov .gov-ins {
  color: #1565c0; text-decoration: underline;
  text-decoration-thickness: 1.5px; background: #e8f1fc; border-radius: 3px;
}
#tab-gov .gov-ver-orphan {
  margin-top: 12px; padding-top: 10px; border-top: 1px dashed #e0e8ee;
  color: #6b7b88; font-size: .84rem;
}

/* banners (revoke / needs_review) */
#tab-gov .gov-ver-banner {
  border-radius: 8px; padding: 11px 14px; margin-bottom: 12px;
  font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 8px;
}
#tab-gov .gov-ver-banner i { font-size: 1rem; }
#tab-gov .gov-ver-banner-revoke { background: #fdeaea; color: #9a2b2b; border: 1px solid #f2cfcf; }
#tab-gov .gov-ver-banner-review { background: #fff6e5; color: #8a5b12; border: 1px solid #f2e0b8; }

/* per-version footnote + instruction source */
#tab-gov .gov-ver-foot, #tab-gov .gov-ver-src {
  margin-top: 12px; color: #556; font-size: .84rem; line-height: 1.6;
}
#tab-gov .gov-ver-foot i { color: #93a3af; margin-inline-end: 4px; }
#tab-gov .gov-ver-foot .gov-quote, #tab-gov .gov-ver-banner-review + .gov-quote {
  margin-top: 8px;
}

/* inline link to an amending decision (reuses the tab's uid-navigation) */
#tab-gov .gov-ver-link {
  border: 0; background: none; padding: 0; font-family: inherit;
  font-weight: 700; color: #2c5364; cursor: pointer; text-decoration: underline;
}
#tab-gov .gov-ver-link:hover { color: #22424f; }

/* ── per-decision permalink (?tab=gov&decision=<uid>) ── */
#tab-gov .gov-card-head { display: flex; align-items: flex-start; gap: 8px; }
#tab-gov .gov-card-head .gov-card-title { flex: 1 1 auto; }
#tab-gov .gov-card-link {
  flex: 0 0 auto; color: #93a3af; font-size: .8rem; text-decoration: none;
  padding: 2px 6px; border-radius: 6px; line-height: 1.6;
}
#tab-gov .gov-card-link:hover { color: #2c5364; background: #eef3f7; }
#tab-gov .gov-permalink {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 8px;
  margin-inline-start: 14px; padding: 0; border: 0; background: none;
  color: #2c5364; font-weight: 700; font-size: .88rem; cursor: pointer;
}
#tab-gov .gov-permalink:hover { text-decoration: underline; }

/* ── the decision's own נוסח ── */
#tab-gov .gov-decision-text {
  white-space: pre-wrap; unicode-bidi: isolate;
  border: 1px solid #e8edf1; border-inline-start: 3px solid #cbd6de;
  border-radius: 8px; padding: 14px 16px; background: #fbfcfd;
  color: #33454f; font-size: .9rem; line-height: 1.75;
  max-height: 460px; overflow-y: auto;
}
