/* The Sermon overview (2026-11-30, scripts/website-overview.mjs): a closed card between the Bible text and Notable
   quotes, in Notable quotes' style, that opens to the summary, the sermon's shape and its outline. The colours are the
   site's tokens (so Dark works); the sermon's own colour is --ov-accent, set on the card from its picture.
   Loaded after styles.css and library.css on sermon pages that have an overview.
   Type (owner, 2026-11-30: "using the standard library sizing"): the site's own sizes and line heights (styles.css
   :root), as every other line of the site: body for the summary, label for a point's title, meta (a step bolder, as the
   site's meta text is) for the gist, the sub-points, the passages, the numerals and the segments' numbers. */

.ov {
  /* The numerals in the picture's colour; a lighter step of it in Dark, where the plain accent is too dim on the page */
  --ov-ink: var(--ov-accent);
  margin: 24px var(--column) 0;
  border: 1px solid var(--stone-200);
  border-radius: 24px;
  background: var(--page);
}
html.dark .ov {
  --ov-ink: color-mix(in srgb, var(--ov-accent) 55%, #fff);
}
.ov-heading {
  margin: 0;
  font: inherit;
}
/* The whole row is the button */
.ov-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 24px 32px;
  border: 0;
  border-radius: 24px;
  background: none;
  color: var(--ink);
  font-family: var(--text);
  font-size: var(--fs-body);
  font-weight: var(--semibold);
  line-height: var(--lh-label);
  text-align: left;
  cursor: pointer;
}
.ov-toggle:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: -2px;
}
.ov-icon,
.ov-chev {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ov-chev {
  margin-left: auto;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}
.ov.is-open .ov-chev {
  transform: rotate(180deg);
}
.ov.is-open .ov-toggle {
  border-radius: 24px 24px 0 0;
}

/* Open: under a hairline. Closed only once JavaScript runs, so without it the overview is simply there. */
.ov-body {
  margin: 0 32px;
  padding: 20px 0 28px;
  border-top: 1px solid var(--divider);
}
html.js .ov:not(.is-open) .ov-body {
  display: none;
}

.ov-summary {
  margin: 0;
  font-family: var(--text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-body);
}

/* The shape: one segment a part, as long as its words */
.ov-shape {
  display: flex;
  gap: 3px;
  margin-top: 20px;
}
.ov-seg {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-basis: 0;
  min-width: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text-muted);
  font: inherit;
}
button.ov-seg {
  min-height: 44px;
  cursor: pointer;
}
.ov-bar {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--ov-accent) var(--ov-mix, 100%), var(--page));
  transition: background-color 0.15s ease;
}
.ov-seg-pale .ov-bar {
  background: color-mix(in srgb, var(--ov-accent) 22%, var(--page));
}
.ov-seg[aria-pressed='true'] .ov-bar {
  background: var(--ink);
}
.ov-seg:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
  border-radius: 4px;
}
.ov-seg-num {
  margin-top: 6px;
  font-family: var(--text);
  font-size: var(--fs-meta);
  font-weight: var(--medium);
  line-height: var(--lh-meta);
  color: var(--text-muted);
}
.ov-seg[aria-pressed='true'] .ov-seg-num {
  color: var(--ink);
  font-weight: var(--semibold);
}

/* The outline: the numeral in a 32px column, a line down to the next point */
.ov-points {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}
.ov-point {
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0 12px;
  padding: 12px 12px 16px;
  margin: 0 -12px;
  border-radius: 16px;
  transition: background-color 0.15s ease;
}
/* The line between the circles (owner, 2026-11-30: "place them in a light gray circle so the lines between them
   align"): down the middle of the 32px column, from 4px under one circle to 4px above the next */
.ov-point:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 48px;
  bottom: -8px;
  left: 27.5px;
  width: 1px;
  background: var(--stone-200);
}
.ov-point.is-active {
  background: var(--stone-100);
}
/* The numeral, centred in a light gray circle */
.ov-numeral {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--stone-100);
  font-family: var(--text);
  font-size: var(--fs-meta);
  font-weight: var(--semibold);
  line-height: 1;
  color: var(--ov-ink);
}
/* VIII and the like: the letters a touch closer, to stay inside the circle (the size stays the site's meta) */
.ov-numeral-long {
  letter-spacing: -0.03em;
}
/* On a lit point the circle turns white, so it still shows on the gray */
.ov-point.is-active .ov-numeral {
  background: var(--page);
}
/* Themes have no numerals: a dot in the accent, in the circle */
.ov-themes .ov-numeral::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ov-ink);
}
/* The title's first line centred on the circle */
.ov-point-body {
  padding-top: 4px;
}
.ov-title {
  margin: 0;
  font-family: var(--text);
  font-size: var(--fs-label);
  font-weight: var(--semibold);
  line-height: var(--lh-label);
  color: var(--ink);
}
.ov-title a {
  color: inherit;
  text-decoration: none;
}
.ov-title a:hover,
.ov-title a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.ov-gist {
  margin: 4px 0 0;
  font-family: var(--text);
  font-size: var(--fs-meta);
  font-weight: var(--medium);
  line-height: var(--lh-meta);
  color: var(--text-body);
}
.ov-subs,
.ov-refs {
  margin: 6px 0 0;
  font-family: var(--text);
  font-size: var(--fs-meta);
  font-weight: var(--medium);
  line-height: var(--lh-meta);
  color: var(--text-muted);
}
.ov-refs {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.ov-book {
  flex: none;
  width: 14px;
  height: 14px;
  margin-top: 2px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Where a point's title leads in the text: clear of the header */
.sermon-text [id^='b-'] {
  scroll-margin-top: 120px;
}

@media (max-width: 809px) {
  .ov,
  .ov-toggle {
    border-radius: 16px;
  }
  .ov.is-open .ov-toggle {
    border-radius: 16px 16px 0 0;
  }
  .ov-toggle {
    padding: 18px 20px;
  }
  .ov-body {
    margin: 0 20px;
    padding-bottom: 20px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ov-chev,
  .ov-bar,
  .ov-point {
    transition: none;
  }
}
