/* Editorial typography for the rich-text areas of the section fields. */

.rich-text {
  color: var(--color-ink-soft);
  font-size: var(--text-m);
}

.rich-text > * + * { margin-top: 1.1em; }
.rich-text > :first-child { margin-top: 0; }
.rich-text > :last-child { margin-bottom: 0; }

.rich-text :where(h2, h3, h4, h5, h6) { text-wrap: pretty; }
.rich-text > :where(h2) { margin-top: 2em; }
.rich-text > :where(h3, h4) { margin-top: 1.75em; }
.rich-text > :where(h2, h3, h4):first-child { margin-top: 0; }

.rich-text h2 { font-size: var(--heading-3); }
.rich-text h3 { font-size: var(--heading-4); }
.rich-text h4 { font-size: var(--heading-5); }

.rich-text strong,
.rich-text b { color: var(--color-ink); font-weight: var(--font-weight-bold); }

.rich-text a {
  color: var(--color-gold-deep);
  font-weight: var(--font-weight-semibold);
  text-decoration-color: var(--color-line-medium);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.rich-text a:hover,
.rich-text a:focus-visible { text-decoration-color: currentColor; }

/* Buttons carried inside content keep their pill shape and never underline. */
.rich-text a.button,
.rich-text a.wp-element-button {
  color: var(--button-text);
  text-decoration: none;
}

.rich-text p:has(> a.button:only-child) { margin-top: 1.6em; }
.rich-text p:has(> a.button:only-child) + p:has(> a.button:only-child) { margin-top: 0.6em; }

/* Lists ------------------------------------------------------------------ */

.rich-text :where(ul, ol) {
  margin-top: 1.1em;
  padding-inline-start: 0;
  list-style: none;
}

.rich-text :where(ul, ol) li {
  position: relative;
  padding-inline-start: var(--space-l);
}

.rich-text :where(ul, ol) li + li { margin-top: 0.55em; }

.rich-text ul > li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: var(--space-2xs);
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--color-gold-soft);
}

.rich-text ol { counter-reset: rich-list; }

.rich-text ol > li::before {
  counter-increment: rich-list;
  content: counter(rich-list) ".";
  position: absolute;
  left: 0;
  color: var(--color-gold-deep);
  font-family: var(--font-family-heading);
  font-weight: var(--font-weight-bold);
}

.rich-text :where(ul, ol) :where(ul, ol) { margin-top: 0.55em; }

/* Media ------------------------------------------------------------------ */

.rich-text figure {
  margin: 1.9em 0;
  overflow: hidden;
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-soft);
}

.rich-text figure img,
.rich-text > img {
  display: block;
  width: 100%;
  height: auto;
}

.rich-text figcaption {
  padding: var(--space-s) var(--space-m);
  background: var(--color-card-warm);
  color: var(--color-ink-muted);
  font-size: var(--text-xs);
  text-align: center;
}

.rich-text .alignleft,
.rich-text .alignright { max-width: min(100%, 20rem); }
.rich-text .aligncenter { margin-inline: auto; }

/* Quotes ----------------------------------------------------------------- */

.rich-text blockquote {
  margin: 1.9em 0;
  padding: var(--space-2xs) 0 var(--space-2xs) var(--space-m);
  border-left: 2px solid var(--color-gold-soft);
  color: var(--color-ink);
  font-family: var(--font-family-heading);
  font-size: var(--text-l);
  font-style: normal;
  line-height: 1.45;
}

.rich-text blockquote:first-child { margin-top: 0; }

.rich-text blockquote cite {
  display: block;
  margin-top: var(--space-m);
  color: var(--color-gold-deep);
  font-family: var(--font-family-body);
  font-size: var(--text-meta);
  font-style: normal;
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--letter-spacing-meta);
  text-transform: uppercase;
}

/* The legacy editor emitted `.caption` / `.captionb` pull quotes. */
.rich-text .caption {
  margin: 2em 0 0;
  padding: clamp(var(--space-l), 3vw, var(--space-xl)) clamp(var(--space-l), 3vw, var(--space-xl)) var(--space-m);
  border-radius: var(--radius-l) var(--radius-l) 0 0;
  background: var(--color-cream-deep);
  color: var(--color-ink);
  font-family: var(--font-family-heading);
  font-size: var(--text-l);
  line-height: 1.55;
  text-align: center;
}

.rich-text .captionb {
  margin: 0 0 2em;
  padding: 0 clamp(var(--space-l), 3vw, var(--space-xl)) clamp(var(--space-l), 3vw, var(--space-xl));
  border-radius: 0 0 var(--radius-l) var(--radius-l);
  background: var(--color-cream-deep);
  color: var(--color-gold-deep);
  font-size: var(--text-meta);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.16em;
  text-align: center;
  text-transform: uppercase;
}

/* Tables ----------------------------------------------------------------- */

.rich-text table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-s);
}

.rich-text :where(th, td) {
  padding: var(--space-xs) var(--space-s);
  border-bottom: var(--border-width-thin) solid var(--color-line-soft);
  text-align: start;
}

.rich-text th { color: var(--color-ink); font-family: var(--font-family-heading); }

.rich-text hr {
  margin: 2.4em 0;
  border: 0;
  border-top: var(--border-width-thin) solid var(--color-line-soft);
}

/* Audio ------------------------------------------------------------------ */

.audio-card {
  margin-bottom: var(--space-xl);
  padding: clamp(var(--space-m), 3vw, var(--space-l));
  border: var(--border-width-thin) solid var(--color-line-soft);
  border-radius: var(--radius-l);
  background: var(--surface-accent-panel);
}

.audio-card h2 {
  margin-bottom: var(--space-s);
  font-size: var(--heading-4);
}

.audio-card .mejs-container,
.audio-card audio { width: 100% !important; }
