/*
 * Faith Matters Article Page Styles
 * Matches FM email visual language with proper reading ergonomics
 */

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: var(--fm-color-page-surround);
  font-family: var(--fm-font-serif);
  font-size: 18px;
  line-height: 1.7;
  color: var(--fm-q-green-5);
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
}

/* Canonical anchor state baseline.
 * Component rules below may intentionally add color or underlines. */
:where(a, a:link, a:visited, a:hover, a:active, a:focus) {
  color: inherit;
  text-decoration: none;
}

:where(a:focus-visible) {
  outline: var(--fm-button-stroke-w, 2px) solid var(--fm-color-gold);
  outline-offset: var(--fm-button-stroke-w, 2px);
}

/* ─────────────────────────────────────────────────────────────
   LAYOUT — 780px readable column
   ───────────────────────────────────────────────────────────── */

.fm-article {
  width: 100%;
  max-width: var(--fm-article-width);
  margin: 0 auto;
  background: var(--fm-color-white);
}

.fm-article-inner {
  padding: 0 var(--fm-article-inset);
}

@media (max-width: 600px) {
  .fm-article-inner {
    padding: 0 var(--fm-article-inset-mobile);
  }
}

/* ─────────────────────────────────────────────────────────────
   HEADER — FM brand bar
   ───────────────────────────────────────────────────────────── */

.fm-header {
  background: var(--fm-color-white);
  text-align: center;
  padding: 0;
  border-bottom: 1px solid var(--fm-color-gold);
}

.fm-header a {
  display: inline-block;
}

.fm-header img {
  display: block;
  max-width: 100%;
  height: auto;
}

.fm-pub-bar {
  background: var(--fm-color-gold);
  height: 28px;
  line-height: 28px;
  font-family: var(--fm-font-sans);
  font-size: 10px;
  font-weight: 700;
  color: var(--fm-color-white);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   BRACKETED SECTION HEADLINE — ○─| the Q |─○
   Matches FM email "FRAY T treatment"
   ───────────────────────────────────────────────────────────── */

.fm-section-headline {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--fm-article-section-pad-top) 0 var(--fm-article-section-pad-bottom);
  background: var(--fm-q-green-1);
}

/* Circle — 5px cell with 3px+1px border circle inside, directly adjacent to bracket */
.fm-bracket-circle {
  width: 5px;
  height: 5px;
  border: 1px solid var(--fm-q-green-5);
  border-radius: 50%;
  flex-shrink: 0;
}

/* Bracket — 61w × 29h, horizontal line touches circle, vertical at far end */
.fm-bracket-left,
.fm-bracket-right {
  width: 61px;
  height: 29px;
  flex-shrink: 0;
  position: relative;
}

/* Left bracket: vertical on RIGHT, horizontal extends LEFT to touch circle */
.fm-bracket-left::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  width: 1px;
  height: 29px;
  background: var(--fm-q-green-5);
}

.fm-bracket-left::after {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 60px;
  height: 1px;
  background: var(--fm-q-green-5);
}

/* Right bracket: vertical on LEFT, horizontal extends RIGHT to touch circle */
.fm-bracket-right::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 29px;
  background: var(--fm-q-green-5);
}

.fm-bracket-right::after {
  content: '';
  position: absolute;
  right: 0;
  top: 14px;
  width: 60px;
  height: 1px;
  background: var(--fm-q-green-5);
}

.fm-headline-text {
  padding: 0 20px;
  font-size: 32px;
  line-height: 1;
  color: var(--fm-q-green-5);
  white-space: nowrap;
}

.fm-headline-text strong {
  font-weight: 700;
  font-style: normal;
}

.fm-headline-text em {
  font-weight: 400;
  font-style: italic;
}

.fm-article--fray {
  color: var(--fm-fray-blue-4);
}

.fm-article--fray .fm-section-headline {
  background: var(--fm-fray-blue-1);
}

.fm-article--fray .fm-bracket-circle {
  border-color: var(--fm-fray-blue-4);
}

.fm-article--fray .fm-bracket-left::before,
.fm-article--fray .fm-bracket-left::after,
.fm-article--fray .fm-bracket-right::before,
.fm-article--fray .fm-bracket-right::after {
  background: var(--fm-fray-blue-4);
}

.fm-article--fray .fm-headline-text {
  color: var(--fm-fray-blue-4);
}

/* ─────────────────────────────────────────────────────────────
   HERO — green panel with photo + headline
   ───────────────────────────────────────────────────────────── */

.fm-hero {
  background: var(--fm-q-green-3);
  display: flex;
  align-items: stretch;
}

.fm-hero--fray {
  background: var(--fm-fray-blue-1);
  justify-content: center;
}

.fm-hero-heading {
  background: var(--fm-q-green-1);
  padding: 0 var(--fm-article-inset) var(--fm-article-footer-pad-y-mobile);
  text-align: center;
}

.fm-hero-heading h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--fm-q-green-5);
}

.fm-hero-image {
  width: 280px;
  flex-shrink: 0;
  background: var(--fm-q-green-5);
}

.fm-article--heyeck .fm-hero {
  background: var(--fm-q-green-5);
}

.fm-article--heyeck .fm-hero-image {
  width: 50%;
}

.fm-article--fray .fm-hero-image {
  background: var(--fm-fray-blue-4);
}

.fm-hero-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-hero-text {
  flex: 1;
  display: flex;
  align-items: center;
  padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-panel-inset);
}

.fm-article--fray .fm-hero-text {
  background: var(--fm-fray-blue-1);
  justify-content: center;
  padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-inset);
}

.fm-hero h1 {
  font-size: 32px;
  line-height: 1.2;
  font-weight: 700;
  color: var(--fm-color-white);
  margin: 0;
}

.fm-article--fray .fm-hero h1 {
  color: var(--fm-fray-blue-4);
  text-align: center;
}

.fm-article-hero-image {
  background: var(--fm-fray-blue-1);
  padding: 0;
  text-align: center;
}

.fm-article-hero-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 0;
}

.fm-hero-subhead {
  background: var(--fm-q-green-5);
  padding: var(--fm-article-body-gap) var(--fm-article-readable-inset);
  text-align: center;
}

.fm-article--heyeck .fm-hero-subhead {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-panel-inset);
  text-align: left;
}

.fm-hero-subhead--fray {
  background: var(--fm-fray-blue-4);
}

.fm-hero-subhead p {
  margin: 0;
  font-size: 16px;
  font-style: italic;
  color: var(--fm-color-white);
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────
   TREASURY ARTICLE THEME — gold highlight treatment
   ───────────────────────────────────────────────────────────── */

.fm-article--treasury {
  color: var(--fm-virtue-brown-5);
}

.fm-article--treasury .fm-hero {
  background: var(--fm-color-gold);
  justify-content: center;
}

.fm-article--treasury .fm-hero-text {
  justify-content: center;
  padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-panel-inset-wide);
  text-align: center;
}

.fm-article--treasury .fm-hero h1 {
  max-width: 560px;
  color: var(--fm-color-white);
  text-align: center;
}

.fm-article--treasury .fm-hero-subhead {
  background: var(--fm-virtue-brown-1);
  padding: 28px var(--fm-article-inset) var(--fm-article-footer-pad-y-mobile);
}

.fm-article--treasury .fm-hero-subhead p {
  max-width: 540px;
  margin: 0 auto;
  padding: 0 8%;
  font-size: 14px;
  line-height: 1.6;
  font-style: italic;
  font-weight: 400;
  color: var(--fm-color-gold);
}

.fm-article--treasury .fm-hero-subhead .fm-divider + p,
.fm-article--treasury .fm-hero-subhead p + .fm-divider {
  margin-top: var(--fm-article-body-gap);
}

.fm-article--treasury .fm-narrative {
  background: var(--fm-virtue-brown-1);
  padding-top: 0;
  padding-bottom: var(--fm-article-inset);
  color: var(--fm-virtue-brown-5);
}

.fm-article--treasury .fm-source {
  margin: var(--fm-article-source-gap) auto 0;
  font-size: 14px;
  line-height: 1.6;
  font-style: italic;
  font-weight: 400;
  text-align: center;
}

.fm-article--treasury .fm-source em {
  font-style: inherit;
  font-weight: inherit;
  text-align: inherit;
}

.fm-article--treasury .fm-divider-dot {
  border-color: var(--fm-color-gold);
}

.fm-article--treasury .fm-divider-line {
  background: var(--fm-color-gold);
}

@media (max-width: 600px) {
  .fm-section-headline {
    padding-left: 16px;
    padding-right: 16px;
  }

  .fm-bracket-left,
  .fm-bracket-right {
    width: 21px;
  }

  .fm-bracket-left::after,
  .fm-bracket-right::after {
    width: 20px;
  }

  .fm-headline-text {
    padding: 0 12px;
    font-size: 28px;
    line-height: 1.1;
    text-align: center;
    white-space: normal;
  }

  .fm-hero {
    flex-direction: column;
  }

  .fm-hero-heading {
    padding: 0 var(--fm-article-readable-inset) var(--fm-article-body-gap);
  }

  .fm-hero-heading h1 {
    font-size: 30px;
  }

  .fm-hero-image {
    width: 100%;
    height: auto;
  }

  .fm-article--heyeck .fm-hero-image {
    width: 100%;
  }

  .fm-hero-image img {
    height: auto;
  }

  .fm-hero-text {
    background: var(--fm-q-green-5);
    padding: var(--fm-space-md) var(--fm-article-readable-inset) var(--fm-article-body-gap);
  }

  .fm-article--fray .fm-hero-text {
    background: var(--fm-fray-blue-1);
  }

  .fm-hero h1 {
    font-size: 30px;
  }

  .fm-hero-subhead {
    background: var(--fm-q-green-5);
    padding: var(--fm-article-body-gap) var(--fm-article-inset-mobile);
    text-align: center;
  }

  .fm-article--heyeck .fm-hero-subhead {
    display: block;
    padding: var(--fm-article-body-gap) var(--fm-article-inset-mobile);
    text-align: center;
  }

  .fm-hero-subhead--fray {
    background: var(--fm-fray-blue-4);
  }

  .fm-article--treasury .fm-hero-text {
    background: var(--fm-color-gold);
    padding: var(--fm-space-md) var(--fm-article-readable-inset);
  }

  .fm-article--treasury .fm-hero-subhead {
    background: var(--fm-virtue-brown-1);
    padding: var(--fm-space-md);
  }

  .fm-article--treasury .fm-hero-subhead p {
    padding: 0;
    font-size: 14px;
  }
}

/* ─────────────────────────────────────────────────────────────
   FRAY ARTICLE BODY
   ───────────────────────────────────────────────────────────── */

.fm-narrative {
  background: var(--fm-fray-blue-1);
  padding: var(--fm-article-section-pad-top) var(--fm-article-inset) 0;
  color: var(--fm-fray-blue-4);
}

.fm-narrative p {
  margin: 0;
}

.fm-narrative p + p {
  margin-top: var(--fm-article-narrative-gap);
}

.fm-narrative a {
  color: inherit;
  text-decoration: underline;
}

.fm-article--fray .fm-callout-text,
.fm-article--fray .fm-callout-text a {
  color: var(--fm-fray-blue-4);
}

.fm-article--fray .fm-divider-dot {
  border-color: var(--fm-fray-blue-4);
}

.fm-article--fray .fm-divider-line {
  background: var(--fm-fray-blue-4);
}

.fm-pullquote {
  text-align: center;
}

.fm-pullquote-text {
  margin: 0;
  padding: 0 var(--fm-article-pullquote-inset);
  font-family: var(--fm-font-serif);
  font-size: 22px;
  line-height: 1.5;
  font-style: italic;
  font-weight: 700;
  color: var(--fm-fray-blue-4);
  text-align: center;
}

@media (max-width: 600px) {
  .fm-narrative {
    padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-inset-mobile) 0;
  }

  .fm-pullquote-text {
    padding: 0;
  }
}

/* ─────────────────────────────────────────────────────────────
   Q&A SECTION — light green background
   ───────────────────────────────────────────────────────────── */

.fm-qa-section {
  background: var(--fm-q-green-1);
  padding: 0 0 var(--fm-article-inset);
}

/* Q&A pairs — 30px spacing between pairs */
.fm-qa-pair {
  margin: 0;
}

/* Question box — Q: and text, both vertically centered */
.fm-qa-question {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  background: var(--fm-article-question-bg);
  font-family: var(--fm-font-serif);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--fm-q-green-5);
}

/* Q: marker — vertically centered with question text */
.fm-qa-marker {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  align-self: stretch;
  background: var(--fm-article-question-bg);
  padding: var(--fm-space-sm) 0 var(--fm-space-sm) var(--fm-article-readable-inset);
  font-family: var(--fm-font-serif);
  font-size: 45px;
  line-height: 1;
  font-weight: 700;
  font-style: normal;
  color: var(--fm-q-green-2);
}

/* Question text — right padding to force 2-line wrap */
.fm-qa-text {
  padding: var(--fm-space-sm) var(--fm-article-readable-inset) var(--fm-space-sm) 18px;
}

.fm-article--heyeck .fm-qa-text {
  padding-right: var(--fm-article-readable-inset);
}

/* Answer — no left padding, just top spacing */
.fm-qa-answer {
  padding: var(--fm-space-md) var(--fm-article-readable-inset) 0;
  font-family: var(--fm-font-serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--fm-q-green-5);
}

.fm-qa-answer p {
  margin: 0;
}

.fm-qa-answer p + p {
  margin-top: var(--fm-article-body-gap);
}

.fm-qa-answer a {
  color: inherit;
  text-decoration: underline;
}

/* Article image — centered between Q&A pairs */
.fm-article-image {
  margin: 0 auto;
  text-align: center;
}

.fm-article-image img {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
  border: 0;
}

.fm-article-image--full {
  margin: 0 auto;
}

.fm-article-image--full img {
  max-width: 100%;
}

@media (max-width: 600px) {
  .fm-qa-section {
    padding-bottom: var(--fm-article-footer-pad-y-mobile);
  }

  .fm-qa-question {
    grid-template-columns: 64px 1fr;
  }

  .fm-qa-marker {
    font-size: 44px;
    padding-left: var(--fm-article-inset-mobile);
  }

  .fm-qa-text {
    padding: var(--fm-space-sm) var(--fm-article-inset-mobile) var(--fm-space-sm) 18px;
  }

  .fm-article--heyeck .fm-qa-text {
    padding-right: var(--fm-article-inset-mobile);
  }

  .fm-qa-answer {
    padding-left: var(--fm-article-inset-mobile);
    padding-right: var(--fm-article-inset-mobile);
  }
}

/* ─────────────────────────────────────────────────────────────
   REUSABLE DIVIDER — ○─────────○
   ───────────────────────────────────────────────────────────── */

.fm-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fm-divider-dot {
  width: 5px;
  height: 5px;
  border: 1px solid var(--fm-q-green-5);
  border-radius: 50%;
  flex-shrink: 0;
}

.fm-divider-line {
  width: 150px;
  height: 1px;
  background: var(--fm-q-green-5);
}

.fm-spacer {
  display: block;
  height: 0;
  line-height: 0;
  font-size: 0;
  overflow: hidden;
}

.fm-spacer--xs {
  height: var(--fm-space-xs);
}

.fm-spacer--small {
  height: var(--fm-space-sm);
}

.fm-spacer--medium {
  height: var(--fm-space-md);
}

.fm-spacer--large {
  height: var(--fm-space-lg);
}

.fm-spacer--xl {
  height: var(--fm-space-xl);
}

.fm-spacer--article-section {
  height: var(--fm-article-section-gap);
}

.fm-spacer--article-image {
  height: var(--fm-article-image-gap);
}

.fm-caption-bar,
.fm-subhead-bar {
  height: var(--fm-caption-min-height);
  padding: var(--fm-caption-padding-y) var(--fm-caption-padding-x);
  background: var(--fm-section-color);
  font-family: var(--fm-font-serif);
  font-size: var(--fm-caption-font-size);
  line-height: var(--fm-caption-line-height);
  font-style: italic;
  color: var(--fm-color-white);
  text-align: center;
  vertical-align: middle;
}

.fm-caption-bar--multiline {
  height: auto;
}

/* ─────────────────────────────────────────────────────────────
   FILM NOTE & BIO SECTIONS
   ───────────────────────────────────────────────────────────── */

.fm-film-note {
  padding: 0 var(--fm-article-note-inset);
  text-align: center;
}

.fm-film-note-text {
  margin: 0;
  padding: 0;
  font-family: var(--fm-font-serif);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  font-style: italic;
  color: var(--fm-q-green-5);
}

.fm-film-note-text + .fm-film-note-text {
  margin-top: var(--fm-article-note-gap);
}

.fm-film-note .fm-divider + .fm-film-note-text,
.fm-film-note-text + .fm-divider {
  margin-top: var(--fm-article-note-gap);
}

.fm-film-note-text a {
  color: var(--fm-q-green-5);
  text-decoration: underline;
}

/* ─────────────────────────────────────────────────────────────
   CALLOUT — inline reference link (tighter to content above)
   ───────────────────────────────────────────────────────────── */

.fm-callout {
  padding: 0;
  margin: 0;
  text-align: center;
}

.fm-callout-text {
  margin: 0;
  padding: 0;
  font-family: var(--fm-font-serif);
  font-size: 16px;
  line-height: 1.6;
  font-weight: 300;
  font-style: italic;
  color: var(--fm-q-green-5);
}

.fm-callout-text a {
  color: var(--fm-q-green-5);
  text-decoration: underline;
}

.fm-bio {
  background: var(--fm-q-green-5);
  padding: var(--fm-article-footer-pad-y) var(--fm-article-inset);
  color: var(--fm-q-green-1);
}

/* Bio image — centered at top of bio section */
.fm-bio-image {
  margin: 0 auto var(--fm-space-md);
  text-align: center;
}

.fm-bio-image img {
  display: block;
  max-width: 280px;
  height: auto;
  margin: 0 auto;
}

.fm-bio-label {
  font-family: var(--fm-font-sans);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--fm-q-green-2);
  margin-bottom: var(--fm-article-body-gap);
}

.fm-bio p {
  margin: 0 0 var(--fm-article-body-gap) 0;
  font-size: 16px;
  line-height: 1.6;
}

.fm-bio p:last-child {
  margin-bottom: 0;
}

.fm-bio a {
  color: var(--fm-q-green-1);
  text-decoration: underline;
}

@media (max-width: 600px) {
  .fm-bio {
    padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-inset-mobile);
  }
}

/* ─────────────────────────────────────────────────────────────
   NAVIGATION
   ───────────────────────────────────────────────────────────── */

.fm-nav {
  background: var(--fm-color-white);
  padding: var(--fm-article-footer-pad-y) 0;
  text-align: center;
  border-top: 1px solid var(--fm-color-gold);
}

a.fm-button,
.fm-button {
  display: inline-block;
  background: var(--fm-color-gold);
  color: var(--fm-color-white);
  padding: 0 var(--fm-article-button-pad-x);
  height: var(--fm-article-button-height);
  line-height: var(--fm-article-button-height);
  font-family: var(--fm-font-sans);
  font-size: var(--fm-fs-button);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  text-decoration: none;
  border-radius: var(--fm-article-button-radius);
  transition: opacity 0.2s;
  max-width: 100%;
  box-sizing: border-box;
}

a.fm-button:hover,
.fm-button:hover {
  opacity: 0.9;
  text-decoration: none;
}

.fm-button--green {
  background: var(--fm-q-green-3);
}

.fm-cta {
  padding: var(--fm-cta-space-before) 0 var(--fm-cta-space-after);
  text-align: center;
}

.fm-cta--compact-after {
  padding-bottom: var(--fm-cta-space-after-sm);
}

.fm-section-nav,
.fm-qa-nav {
  padding-top: 0;
  text-align: center;
}

/* ─────────────────────────────────────────────────────────────
   SIGN-OFF
   ───────────────────────────────────────────────────────────── */

.fm-signoff {
  background: var(--fm-color-white);
  padding: var(--fm-article-footer-pad-y) var(--fm-article-inset);
  text-align: center;
  border-top: 1px solid var(--fm-color-gold);
}

.fm-signoff-logo {
  max-width: 100%;
  height: auto;
  margin-bottom: var(--fm-article-body-gap);
}

.fm-signoff-contact {
  font-size: 16px;
  color: var(--fm-article-footer-text);
  line-height: 1.5;
  margin-bottom: var(--fm-space-md);
}

.fm-signoff-contact a {
  color: var(--fm-article-footer-text);
  text-decoration: none;
}

@media (max-width: 600px) {
  .fm-signoff {
    padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-inset-mobile);
  }
}

/* ─────────────────────────────────────────────────────────────
   LEGAL
   ───────────────────────────────────────────────────────────── */

.fm-legal {
  background: var(--fm-color-legal-bg);
  padding: var(--fm-article-legal-pad-y) var(--fm-article-inset);
  border-top: 1px solid var(--fm-color-gold);
}

.fm-legal p {
  font-size: var(--fm-fs-legal);
  line-height: 1.6;
  color: var(--fm-article-legal-text);
  margin: 0 0 var(--fm-article-body-gap) 0;
}

.fm-legal p:last-child {
  margin-bottom: 0;
}

.fm-legal a {
  color: var(--fm-article-legal-text);
  text-decoration: underline;
}

.fm-legal-code {
  font-size: 10px;
  text-align: center;
  color: var(--fm-article-legal-text);
  margin-top: var(--fm-space-md);
}

@media (max-width: 600px) {
  .fm-legal {
    padding: var(--fm-article-footer-pad-y-mobile) var(--fm-article-inset-mobile);
  }
}
