/* Worship service stylesheet */

:root {
  --rubric: #9E1B20;
  --text: #1a1a1a;
  --bg: #F8F4EC;
  --measure: 42em;
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: 1.1rem;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}

h1 {
  font-size: 1.8rem;
  font-weight: normal;
  font-variant: small-caps;
  letter-spacing: 0.06em;
  text-align: center;
  margin: 2rem 0 0.5rem;
}

.title-rule {
  width: 35%;
  height: 1px;
  background: var(--rubric);
  margin: 0.25rem auto 0.5rem;
}

h2 {
  font-size: 1.3rem;
  font-weight: normal;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  margin: 2.5rem 0 0.75rem;
  border-bottom: 1px solid #ccc;
  padding-bottom: 0.25rem;
}

p {
  margin: 0.5rem 0;
}

.subtitle {
  text-align: center;
  font-style: italic;
  color: #555;
  margin-bottom: 2rem;
}

.rubric {
  color: var(--rubric);
  font-size: 0.95rem;
}

.rubric-inline {
  color: var(--rubric);
}

.leader {
  margin: 0.4rem 0;
}

.people {
  margin: 0.4rem 0 0.4rem 1.5rem;
}

.hymn {
  margin: 0.75rem 0;
}

.hymn-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
}

.hymn-line .ref {
  font-size: 0.9rem;
  font-variant: small-caps;
  white-space: nowrap;
}

.hymn-line .hymn-note {
  font-size: 0.9rem;
  color: var(--rubric);
}

.silence {
  text-align: center;
  font-style: italic;
  color: #666;
  margin: 1rem 0;
}

.reading {
  font-style: italic;
}

.verse {
  margin: 0.3rem 0;
}

.response {
  margin: 0.3rem 0 0.3rem 1.5rem;
}

.litany {
  margin: 1rem 0;
  padding: 0.5rem 0;
}

.psalm {
  margin: 1rem 0;
  padding: 0.5rem 0;
}

.psalm-ref {
  font-style: italic;
  color: #555;
  font-size: 0.95rem;
}

.indent {
  margin-left: 1.5rem;
}

.half-line {
  color: #888;
}

.index-links {
  margin: 2.5rem 0;
  text-align: center;
}

.index-links a {
  display: block;
  font-size: 1.15rem;
  font-variant: small-caps;
  letter-spacing: 0.04em;
  color: var(--text);
  text-decoration: none;
  padding: 0.6rem 0;
  border-bottom: 1px solid #ddd;
}

.index-links a:first-child {
  border-top: 1px solid #ddd;
}

.index-links a:active {
  color: var(--rubric);
}

/* --- Music notation (\Melody → ABC.js) --- */

.melody {
  margin: 1rem 0;
  padding: 0.75rem 0;
  border-top: 1px solid #d8d2c6;
  border-bottom: 1px solid #d8d2c6;
}

/* ABC source: always present in the DOM (offline fallback + hand-reading).
   Visible by default so a failed render never leaves a blank block;
   hidden once .melody gains class="rendered" (set by the render script). */
.melody .melody-abc {
  font-family: inherit;
  font-size: 0.85rem;
  white-space: pre-wrap;
  color: #888;
  background: #f4f0e8;
  padding: 0.5rem;
  border: 1px solid #e0d9cc;
  margin: 0;
}

/* ABC.js injects a <div class="abcjs"> with an <svg>.  Hidden until the
   render script has actually filled it, so the source is the default. */
.melody .abcjs { display: none; }
.melody.rendered  .abcjs      { display: block; }
.melody.rendered  .melody-abc { display: none;  }

.melody .abcjs {
  overflow-x: auto !important;           /* keep very wide staves scrollable on narrow screens */
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.melody .abcjs svg {
  min-width: 500px;
  height: auto;
}

