/* Glossary — supplements /assets/site.css */
/* Site-wide smooth scrolling makes long #letter-* jumps crawl through every term. */
html:has(body.glossary-page) {
  scroll-behavior: auto;
}
body.glossary-page .glossary-main {
  padding-bottom: 0;
}
.glossary-hero {
  background: var(--navy);
  color: white;
  padding: 28px 0 40px;
}
.glossary-hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 18px 0 12px;
  max-width: none;
}
.glossary-hero > p {
  color: #c2d1d7;
  font-size: clamp(1.02rem, 1.5vw, 1.12rem);
  max-width: 52ch;
  margin: 0;
  line-height: 1.65;
}
.glossary-meta-bar {
  background: var(--pale);
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 14px;
  color: var(--muted);
}
.glossary-meta-bar strong {
  color: var(--ink);
}
.glossary-meta-inner {
  width: min(100% - 36px, 820px);
}
.glossary-tools {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 14px 0;
  /* Search bar only — term list and A–Z live in .glossary-body (normal flow). */
}
/* Glossary index only: entire search block scrolls away (not checklist/journey). */
body.glossary-page:not(.checklist-page):not(.journey-page) .glossary-tools {
  position: static;
  top: auto;
  z-index: auto;
}
.glossary-tools .container {
  width: min(100% - 36px, 820px);
}
.glossary-body.container {
  width: min(100% - 36px, 820px);
  padding: 28px 0 48px;
}
.search-wrap label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}
.search-actions {
  display: contents;
}
.search-row input[type="search"] {
  flex: 1 1 12rem;
  min-width: 0;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid #b7c7cb;
  border-radius: 9px;
  font: inherit;
  font-size: 16px;
  box-sizing: border-box;
}
.search-submit {
  min-height: 44px;
  padding: 10px 20px;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  white-space: nowrap;
}
.search-clear {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 100px;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
  white-space: nowrap;
}
.search-clear:hover {
  border-color: var(--green);
  background: var(--pale);
}
.search-results-region:not(:empty) {
  scroll-margin-top: 100px;
}
.search-results-region .search-results-title:not([hidden]) + .search-status,
.search-results-region .search-results-title:not([hidden]) {
  margin-top: 0;
}
.glossary-body > .search-results-region {
  margin-top: 0;
  margin-bottom: 4px;
}
.search-results-region:focus {
  outline: none;
}
.search-results-title {
  margin: 16px 0 8px;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ink);
}
.search-status {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
  color: #3d5c22;
}
.glossary-body .term-card {
  scroll-margin-top: 120px;
}
html[lang="he"] .search-status,
html[lang="he"] .search-results-title {
  text-align: start;
}
.alpha-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 6px;
  width: 100%;
  margin: 4px 0 22px;
  padding: 2px 0;
  direction: ltr;
}
.alpha-nav__link,
.alpha-nav__disabled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 2.25rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-sizing: border-box;
}
.alpha-nav__link {
  text-decoration: none;
  color: var(--ink);
  background: var(--white);
}
.alpha-nav__link:hover {
  border-color: var(--green);
  background: var(--pale);
}
.alpha-nav__link:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}
.alpha-nav__disabled {
  opacity: 0.4;
  color: var(--muted);
  background: #f0f3f2;
  border-color: #d8e0de;
  cursor: default;
  user-select: none;
}
.compare-block {
  background: var(--pale);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--green);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 32px;
}
.compare-block h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}
.compare-block article {
  margin-bottom: 16px;
}
.compare-block article:last-child {
  margin-bottom: 0;
}
.compare-block h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: #3d5c22;
}
.compare-block p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}
.letter-group {
  margin-bottom: 28px;
  scroll-margin-top: calc(5.75rem + 8px);
}
.letter-group h2 {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #5d8b20;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.term-card {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 140px;
}
.term-card:last-child {
  border-bottom: 0;
}
.term-card h3 {
  margin: 0 0 8px;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}
.term-card h3 .term-english {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.95em;
}
html[lang="he"] .term-card h3 .term-english {
  unicode-bidi: isolate;
}
.term-card .term-id {
  font-size: 11px;
  color: var(--muted);
  font-family: ui-monospace, monospace;
  margin-bottom: 4px;
}
.term-card p {
  margin: 0 0 10px;
}
.term-card .sources {
  font-size: 13px;
  color: var(--muted);
  margin: 0;
  padding-left: 1.2rem;
}
.term-card .sources a {
  color: #315c22;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.term-card .sources li {
  margin-bottom: 4px;
}
.review-flag {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 6px;
  background: #fff4e5;
  border: 1px solid #e8c89a;
  font-size: 12px;
  font-weight: 700;
  color: #6b4420;
}
.glossary-disclaimer,
.glossary-sources-section {
  background: var(--pale);
  border-radius: 12px;
  padding: 20px 22px;
  margin-top: 40px;
  font-size: 15px;
  color: var(--muted);
}
.glossary-disclaimer h2,
.glossary-sources-section h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
  color: var(--ink);
}
.glossary-sources-section ul {
  margin: 0;
  padding-left: 1.2rem;
}
.glossary-sources-section a {
  color: #315c22;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.no-results {
  display: none;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.term-card[hidden],
.letter-group[hidden] {
  display: none !important;
}
@media (max-width: 700px) {
  .letter-group {
    scroll-margin-top: calc(9.5rem + 8px);
  }
  .glossary-tools {
    padding: 10px 0;
  }
  .search-row {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
  }
  .search-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 8px 10px;
    width: 100%;
  }
  .search-row input[type="search"] {
    flex: none;
    width: 100%;
  }
  .search-actions .search-submit,
  .search-actions .search-clear {
    flex: 1 1 8.5rem;
    min-width: 0;
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
    box-sizing: border-box;
  }
}
@media (min-width: 700px) {
  .glossary-tools .container,
  .glossary-body.container {
    width: min(100% - 48px, 820px);
  }
  .glossary-hero {
    padding: 36px 0 48px;
  }
}

/* Glossary page only — reduce outer padding on shared navy contact block */
body.glossary-page:not(.checklist-page):not(.journey-page) #contact.contact {
  padding-top: 45px;
  padding-bottom: 23px;
}

@media (max-width: 700px) {
  body.glossary-page:not(.checklist-page):not(.journey-page) #contact.contact {
    padding-top: 38px;
    padding-bottom: 18px;
  }
}

/* Glossary-only floating back-to-top (not checklist/journey planners) */
body.glossary-page:not(.checklist-page):not(.journey-page) .glossary-back-to-top {
  --glossary-btt-inset-x: 20px;
  --glossary-btt-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  position: fixed;
  z-index: 15;
  width: 48px;
  height: 48px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  bottom: var(--glossary-btt-bottom);
  right: calc(var(--glossary-btt-inset-x) + env(safe-area-inset-right, 0px));
  left: auto;
}
body.glossary-page:not(.checklist-page):not(.journey-page) .glossary-back-to-top img {
  display: block;
  width: 48px;
  height: 48px;
  pointer-events: none;
}
body.glossary-page:not(.checklist-page):not(.journey-page) .glossary-back-to-top:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 7px;
}
body.glossary-page:not(.checklist-page):not(.journey-page).contact-open .glossary-back-to-top,
body.glossary-page:not(.checklist-page):not(.journey-page) dialog.contact-dialog[open] ~ .glossary-back-to-top {
  visibility: hidden;
  pointer-events: none;
}
html[lang="he"] body.glossary-page:not(.checklist-page):not(.journey-page) .glossary-back-to-top {
  left: calc(var(--glossary-btt-inset-x) + env(safe-area-inset-left, 0px));
  right: auto;
}
@media (max-width: 700px) {
  body.glossary-page:not(.checklist-page):not(.journey-page) .glossary-back-to-top {
    --glossary-btt-inset-x: 16px;
  }
}
