:root {
  color-scheme: light;
  --ink: #183b3b;
  --muted: #526766;
  --paper: #f6f5ef;
  --line: #d7dcd4;
  --gold: #ae8140;
  --white: #fff;
  --focus: #166b72;
  font-family: Arial, "Noto Sans Hebrew", sans-serif;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.65;
}
a {
  color: var(--ink);
  text-underline-offset: 3px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--white);
  padding: 0.55rem 0.9rem;
  color: var(--ink);
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button:hover:not(:disabled) {
  border-color: var(--gold);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
.masthead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem max(5vw, 1rem);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}
.brand {
  text-decoration: none;
  font:
    700 1.3rem Georgia,
    serif;
  letter-spacing: 0.15em;
  direction: ltr;
  display: flex;
  flex-direction: column;
}
.brand span {
  font:
    400 0.76rem Arial,
    sans-serif;
  letter-spacing: 0;
  direction: rtl;
}
.masthead nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
  font-size: 0.87rem;
}
.catalogue {
  max-width: 1300px;
  margin: auto;
  padding: 2.5rem 2rem;
}
.intro {
  max-width: 820px;
  margin: 0 0 2rem;
}
.eyebrow {
  font-size: 0.8rem;
  color: var(--gold);
  font-weight: 700;
}
h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.25;
  margin: 0.6rem 0;
}
h2 {
  line-height: 1.4;
}
.intro > p:not(.eyebrow) {
  color: var(--muted);
}
.overview {
  font-size: 0.88rem;
}
.search-panel {
  background: var(--white);
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 1.4rem;
  box-shadow: 0 6px 24px #173b3b08;
}
.search-panel > label {
  font-weight: 700;
}
.query-row {
  display: flex;
  gap: 0.7rem;
  margin: 0.5rem 0 1rem;
}
input,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  padding: 0.65rem 0.75rem;
  color: var(--ink);
}
.query-row button {
  background: var(--ink);
  color: white;
  min-width: 85px;
}
.filters {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}
.filters label {
  font-size: 0.8rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.text-button {
  border: 0;
  padding: 0.5rem 0;
  color: var(--muted);
  text-decoration: underline;
  font-size: 0.85rem;
}
.results-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-top: 2rem;
}
.results-heading h2 {
  font-size: 1.2rem;
}
.results-heading p {
  font-size: 0.85rem;
  color: var(--muted);
}
.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.card {
  padding: 1.3rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
  transition: box-shadow 0.15s;
}
.card:hover {
  box-shadow: 0 5px 20px #173b3b10;
}
.card.review {
  border-style: dashed;
}
.card h3 {
  font-size: 1.06rem;
  line-height: 1.55;
  margin: 0.7rem 0;
}
.card h3 a {
  text-decoration: none;
}
.card h3 a:hover {
  text-decoration: underline;
}
.card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.5rem 0;
  overflow-wrap: anywhere;
}
.card .meta {
  margin-top: auto;
  padding-top: 1rem;
  font-size: 0.75rem;
}
.tag-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.badge {
  font-size: 0.68rem;
  background: #edf2ed;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
}
.badge.review-label {
  background: #fff3db;
  color: #725223;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin: 2rem 0;
}
.notice:empty {
  display: none;
}
.notice {
  background: #fff6e7;
  border-inline-start: 3px solid var(--gold);
  padding: 0.9rem;
  overflow-wrap: anywhere;
}
footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.5rem max(5vw, 1rem);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
}
.reading {
  max-width: 920px;
  padding: 2.5rem 1.8rem;
  margin: auto;
  overflow-wrap: anywhere;
}
.reading h1 {
  font-size: clamp(1.65rem, 4vw, 2.4rem);
}
.reading .reader-meta {
  display: flex;
  gap: 0.6rem 1.4rem;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
  border-block: 1px solid var(--line);
  padding: 1rem 0;
  margin: 1.5rem 0;
}
.reading .body-text {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 1.5rem;
  margin: 1rem 0 2rem;
}
.reading .body-text > :first-child {
  margin-top: 0;
}
.reading pre {
  overflow: auto;
  white-space: pre-wrap;
}
.reading table {
  display: block;
  overflow: auto;
  max-width: 100%;
  border-collapse: collapse;
}
.reading td,
.reading th {
  padding: 0.5rem;
  border: 1px solid var(--line);
}
.reading blockquote {
  border-inline-start: 3px solid var(--gold);
  padding-inline-start: 1rem;
  margin-inline: 0;
}
.reading img {
  max-width: 100%;
  height: auto;
}
.source-link {
  display: inline-block;
  margin: 0.5rem 0;
}
.attribution {
  font-size: 0.82rem;
  color: var(--muted);
}
.health-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.health-item {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}
.health-item h2 {
  margin: 0.3rem 0;
  font-size: 1.1rem;
}
.health-item p {
  margin: 0.4rem 0;
  font-size: 0.9rem;
}
.health-item .detail {
  font-size: 0.8rem;
  color: var(--muted);
}
/* Song collections remain available independently of catalogue loading. */
.music-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid #d6bb8d;
  border-radius: 7px;
  padding: 0.4rem 0.7rem;
  background: #fff7e8;
  text-decoration: none;
  font-weight: 700;
}
.music-nav:hover {
  background: #f8ecd4;
}
.music-feature {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  margin: 0 0 2rem;
  padding: 1.4rem 1.6rem;
  border: 1px solid #a6824e;
  border-radius: 12px;
  background: linear-gradient(115deg, #173b3b, #254d47);
  color: #fff9eb;
}
.music-feature-note {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border: 1px solid #c7a66f;
  border-radius: 50%;
  color: #edce98;
  font-size: 2rem;
}
.music-feature-copy {
  flex: 1;
  min-width: 0;
}
.music-feature-copy p {
  margin: 0.3rem 0 0;
  color: #e2e6da;
  font-size: 0.86rem;
}
.music-feature-copy .music-feature-kicker {
  margin: 0;
  color: #edce98;
  font-weight: 700;
  font-size: 0.73rem;
}
.music-feature h2 {
  margin: 0.3rem 0;
  font-size: clamp(1.15rem, 2.2vw, 1.5rem);
}
.music-feature-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  flex-shrink: 0;
  border-radius: 7px;
  padding: 0.7rem 1rem;
  background: #f1d5a2;
  color: #173b3b;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.music-feature-link:hover {
  background: #fff1d4;
}
.music-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid #c9ad7e;
  scroll-margin-top: 1.5rem;
}
.music-section-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
}
.music-section-heading .eyebrow {
  margin: 0;
  color: #805b28;
}
.music-section-heading h2 {
  margin: 0.3rem 0;
  font-size: clamp(1.7rem, 3vw, 2.1rem);
}
.music-section-heading p:not(.eyebrow) {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.music-section-heading .music-tab-hint {
  font-size: 0.78rem;
}
.music-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.music-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 1.3rem;
  border: 1px solid #d4c4a8;
  border-radius: 10px;
  background: linear-gradient(145deg, #fffdf7, #fff);
  text-decoration: none;
  overflow-wrap: anywhere;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.music-card:hover {
  border-color: #a67b3d;
  box-shadow: 0 5px 20px #173b3b12;
}
.music-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #805b28;
  font-size: 0.72rem;
  font-weight: 700;
}
.music-card-symbol {
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  height: 32px;
  border: 1px solid #dbc49e;
  border-radius: 50%;
  background: #fff5e0;
  font-size: 1rem;
}
.music-card h3 {
  margin: 0.9rem 0 0.4rem;
  font-size: 1.08rem;
  line-height: 1.5;
}
.music-card p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.85rem;
}
.music-card-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid #e7decf;
  font-size: 0.8rem;
  font-weight: 700;
}
:root[lang="he"] .music-en,
:root[lang="en"] .music-he {
  display: none;
}
@media (prefers-reduced-motion: reduce) {
  .music-card {
    transition: none;
  }
}
@media (max-width: 900px) {
  .cards,
  .music-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .music-feature {
    flex-wrap: wrap;
    gap: 1rem;
  }
  .music-feature-link {
    margin-inline-start: 74px;
  }
  .filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .catalogue {
    padding: 2rem 1.2rem;
  }
}
@media (max-width: 560px) {
  .cards,
  .health-grid,
  .music-grid {
    grid-template-columns: 1fr;
  }
  .music-feature {
    padding: 1.1rem;
    gap: 0.8rem;
  }
  .music-feature-note {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .music-feature-link {
    margin-inline-start: 0;
    width: 100%;
  }
  .music-nav {
    padding: 0.3rem 0.45rem;
  }
  .music-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
  }
  .masthead {
    align-items: flex-start;
    padding: 1rem;
  }
  .masthead nav {
    gap: 0.5rem;
    font-size: 0.75rem;
  }
  .brand {
    font-size: 1.05rem;
  }
  .catalogue {
    padding: 1.6rem 0.9rem;
  }
  .search-panel {
    padding: 1rem;
  }
  .filters {
    gap: 0.7rem;
  }
  .reading {
    padding: 1.5rem 1rem;
  }
  .reading .body-text {
    padding: 1rem;
  }
  .results-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0;
  }
  .results-heading h2 {
    margin-bottom: 0;
  }
  .query-row {
    gap: 0.4rem;
  }
  footer {
    padding: 1rem;
  }
  .pagination {
    gap: 1rem;
  }
}
