/* WordPress-specific styles on top of the design system components. */
html, body { margin: 0; }
body.mg { background: var(--surface); color: var(--text); min-height: 100vh; display: flex; flex-direction: column; }
.mg-main { flex: 1; }
.mg-skip { position: absolute; left: -9999px; top: 8px; background: var(--action); color: var(--on-action); padding: 8px 16px; border-radius: var(--radius-sm); z-index: 100; }
.mg-skip:focus { left: 8px; }
.mg-visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
img { max-width: 100%; height: auto; }
.mg-crisis__in, .mg-header__in, .mg-hero__in, .mg-footer__in, .mg-footer__base, .mg-container { padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px)); }

/* header */
.mg-header { position: sticky; top: 0; z-index: 40; }
.mg-header__logo img { width: 210px; }
.mg-nav { gap: var(--space-4); }
.mg-nav a { white-space: nowrap; }
.mg-header__in { gap: var(--space-5); }
@media (max-width: 1100px) { .mg-nav a[href$="/give/"] { display: none; } .mg-header__logo img { width: 180px; } }
.mg-nav a.mg-btn { border-bottom: 0; }
.mg-nav__mobile-actions { display: none; }
.mg-toggle { width: 48px; height: 48px; border: 1px solid var(--control-border); border-radius: var(--radius-sm); background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; }
.mg-toggle svg { width: 22px; height: 22px; }
.mg-toggle__moon { display: none; }
[data-theme="dark"] .mg-toggle__sun { display: none; }
[data-theme="dark"] .mg-toggle__moon { display: inline-flex; }
.mg-toggle:hover { background: var(--surface-alt); }
.mg-menu-btn__close { display: none; }
.mg-header--open .mg-menu-btn__open { display: none; }
.mg-header--open .mg-menu-btn__close { display: inline-flex; }
.mg-menu-btn span { display: inline-flex; }
.mg-footer__cols--4 { grid-template-columns: repeat(4, 1fr); }
.mg-section--newsletter { padding: var(--space-7) 0; }
.mg-newsletter__form { display: flex; gap: var(--space-3); }

/* hero */
.mg-hero__in { min-height: 620px; }
.mg-hero__copy { max-width: 38rem; }

/* home sections */
.mg-mission__text { font-weight: 400; }
.mg-mission__text strong { font-weight: 700; }
.mg-doer li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-teal); flex: none; }
.mg-video { margin: 0; aspect-ratio: 16 / 9; background: var(--canyon); border-radius: var(--radius-md); overflow: hidden; }
.mg-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.mg-video + .mg-video, .entry-content .mg-video { margin-top: var(--space-5); }
.mg-video-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.mg-video-grid p { margin: var(--space-3) 0 0; color: var(--text-muted); }

/* content (block editor output + converted Tithely pages) */
.entry-content { font-size: 17px; line-height: 1.6; }
.entry-content > * { max-width: var(--measure); }
.entry-content > .alignwide, .entry-content > .alignfull, .entry-content > .mg-orders, .entry-content > .mg-scripture, .entry-content > .mg-beliefs-toc, .entry-content > .mg-video, .entry-content > .mg-video-grid, .entry-content > details, .entry-content > .mg-downloads, .entry-content > ul, .entry-content > ol, .entry-content > hr, .entry-content > table { max-width: none; }
.entry-content p { margin: 0 0 var(--space-4); }
.entry-content h2 { font-family: var(--font-display); font-weight: 500; font-size: 34px; line-height: 1.15; margin: var(--space-7) 0 var(--space-4); }
.entry-content h3 { font-family: var(--font-display); font-weight: 500; font-size: 26px; line-height: 1.2; margin: var(--space-6) 0 var(--space-3); }
.entry-content h4 { font-family: var(--font-body); font-weight: 700; font-size: 20px; line-height: 1.3; margin: var(--space-5) 0 var(--space-2); }
.entry-content h5 { font-family: var(--font-body); font-weight: 700; font-size: 17px; margin: var(--space-4) 0 var(--space-2); }
.entry-content h2:first-child, .entry-content h3:first-child { margin-top: 0; }
.entry-content ul, .entry-content ol { margin: 0 0 var(--space-4); padding-left: var(--space-5); }
.entry-content li { margin-bottom: var(--space-2); }
.entry-content a { color: var(--link); text-decoration: underline; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration-thickness: 2px; }
.entry-content hr { border: 0; border-top: 1px solid var(--line); margin: var(--space-6) 0; }
.entry-content blockquote { margin: 0 0 var(--space-4); border-left: 4px solid var(--rule-accent); background: var(--surface-warm); padding: var(--space-4) var(--space-5); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.entry-content blockquote p { font-family: var(--font-scripture); font-style: italic; font-size: 19px; line-height: 1.55; margin: 0 0 var(--space-2); }
.entry-content blockquote p:last-child { margin: 0; font-family: var(--font-body); font-style: normal; font-weight: 700; font-size: 14px; }
.entry-content blockquote em { font-style: italic; }
.entry-content img { border-radius: var(--radius-md); }
.entry-content figure { margin: 0 0 var(--space-5); }
.entry-content figcaption { font-size: 14px; color: var(--text-muted); margin-top: var(--space-2); }
.entry-content .mg-lead { font-size: 20px; line-height: 1.5; color: var(--text-muted); }
.entry-content .wp-block-buttons .wp-block-button__link, .entry-content .wp-element-button { background: var(--action); color: var(--on-action); border-radius: var(--radius-sm); font-weight: 700; padding: 0 var(--space-5); height: var(--button-height); display: inline-flex; align-items: center; text-decoration: none; }
.entry-content table { border-collapse: collapse; width: 100%; }
.entry-content td, .entry-content th { border-bottom: 1px solid var(--line); padding: var(--space-3); text-align: left; vertical-align: top; }

/* folding sections (Armor of God, General Orders imported accordions) */
details.mg-fold { border-top: 1px solid var(--line); }
details.mg-fold:last-of-type { border-bottom: 1px solid var(--line); }
details.mg-fold summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); padding: var(--space-4) 0; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.25; color: var(--text); }
details.mg-fold summary::-webkit-details-marker { display: none; }
details.mg-fold summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--link); border-bottom: 2px solid var(--link); transform: rotate(45deg); transition: transform .2s ease; flex: none; margin-right: 6px; }
details.mg-fold[open] summary::after { transform: rotate(-135deg); }
details.mg-fold summary:hover { color: var(--link); }
details.mg-fold .mg-fold__body { padding: 0 0 var(--space-5); }
details.mg-fold .mg-fold__body > :first-child { margin-top: 0; }

/* downloads list */
.mg-downloads-list { list-style: none; padding: 0; margin: 0 0 var(--space-5); border-top: 1px solid var(--line); }
.mg-downloads-list li { padding: var(--space-3) 0; border-bottom: 1px solid var(--line); margin: 0; }
.mg-downloads-list a { font-weight: 700; text-decoration: none; }
.mg-downloads-list a::before { content: "↓ "; color: var(--eyebrow); }

/* doc layout with sidebar */
.mg-doc { padding: var(--space-7) 0 var(--space-8); }
.mg-doc__side { order: -1; }
.mg-subnav h2 { margin: 0 0 var(--space-3); }
.mg-subnav ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.mg-subnav li a { display: block; padding: 10px 12px; border-bottom: 1px solid var(--line); color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; }
.mg-subnav li li a { padding-left: 28px; font-weight: 400; }
.mg-subnav a:hover { color: var(--link); background: var(--surface-alt); }
.mg-subnav a[aria-current="page"] { background: var(--surface-wash); color: var(--link); border-left: 3px solid var(--brand-teal); }
.mg-doc__art { border-radius: var(--radius-md); margin-bottom: var(--space-5); display: block; }
.mg-doc .mg-sidebar { position: sticky; top: calc(var(--space-5) + 88px); }
.mg-doc .mg-doc__main { min-width: 0; }
.mg-doc { grid-template-columns: 280px 1fr; }

/* prose page */
.mg-prose-page { padding: var(--space-7) 0 var(--space-8); }
.mg-tabs { margin-bottom: var(--space-6); flex-wrap: wrap; }

/* hub cards */
.mg-hub__intro { padding: var(--space-7) 0 var(--space-5); }
.mg-card__img--empty { background: var(--surface-wash); }
.mg-card h3 a { color: var(--text); text-decoration: none; }
.mg-card h3 a:hover { color: var(--link); }
.mg-card__more { color: var(--link); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.mg-card__more svg { width: 18px; height: 18px; }

/* news */
.mg-post-row h3 { margin: 0 0 var(--space-2); }
.mg-post-row h3 a { color: var(--text); text-decoration: none; }
.mg-post-row h3 a:hover { color: var(--link); }
.mg-post-row p { margin: 0 0 var(--space-2); color: var(--text-muted); }
.mg-post__img { max-height: 480px; }
.mg-post .entry-content > * { max-width: none; }
.mg-pagination { display: flex; gap: var(--space-3); justify-content: center; padding: var(--space-6) 0 0; }
.mg-pagination a, .mg-pagination span { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; font-weight: 700; }
.mg-pagination .current { background: var(--action); color: var(--on-action); border-color: var(--action); }

/* give */
.mg-give-hero { background: var(--surface-wash); padding: var(--space-8) 0; }
.mg-give-hero .mg-display { color: var(--text); font-size: 48px; }
.mg-give-hero .mg-lead { font-size: 22px; line-height: 1.5; margin: var(--space-4) 0 var(--space-5); max-width: 40rem; }
.mg-give-hero .entry-content { max-width: 40rem; }
.mg-give-text { background: var(--surface-card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-6); }
.mg-give-text .mg-h2 { margin-bottom: var(--space-2); }
.mg-give-text .mg-h4 { color: var(--link); margin-bottom: var(--space-3); }

/* events */
.mg-events-cards .mg-card__body { gap: var(--space-3); }
.mg-events-cards .mg-card__body p { color: var(--text); }

/* podcast */
.mg-podcast-embed { aspect-ratio: auto; height: 1200px; }

/* get help */
.mg-callnum__item b { font-size: 18px; }

/* 404 / search */
.mg-404 { padding: var(--space-9) 0; text-align: center; }

@media (max-width: 960px) {
  .mg-footer__cols--4 { grid-template-columns: 1fr 1fr; }
  .mg-doc { grid-template-columns: 1fr; }
  .mg-doc .mg-sidebar { position: static; }
  .mg-video-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mg-header__logo img { width: 120px; }
  .mg-post-row .mg-photo-ph { display: none; }
  .mg-nav { display: none; }
  .mg-header--open .mg-nav { display: flex; flex-direction: column; position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--line); padding: var(--space-4) var(--space-4) var(--space-5); gap: 0; margin: 0; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
  .mg-header--open .mg-nav a { padding: 14px 4px; border-bottom: 1px solid var(--line); font-size: 18px; }
  .mg-header--open .mg-nav a[aria-current="page"] { color: var(--link); }
  .mg-nav__mobile-actions { display: flex; gap: var(--space-3); padding-top: var(--space-4); }
  .mg-nav__mobile-actions .mg-btn { flex: 1; border-bottom: 2px solid transparent; }
  .mg-nav__mobile-actions .mg-btn--secondary { border-color: var(--secondary); }
  .mg-header__actions .mg-btn--primary { display: none; }
  .mg-hero__in { min-height: 520px; }
  .mg-newsletter__form { flex-direction: column; }
  .mg-give-hero .mg-display { font-size: 36px; }
  .mg-podcast-embed { height: 900px; }
  .entry-content h2 { font-size: 28px; }
  .entry-content h3 { font-size: 22px; }
  details.mg-fold summary { font-size: 19px; }
}
@media print {
  .mg-crisis, .mg-header, .mg-section--newsletter, .mg-footer__cols, .mg-toggle { display: none !important; }
}

/* General Orders accordion inside page content */
.entry-content .mg-orders { max-width: 880px; margin: var(--space-5) 0 var(--space-6); }
.entry-content .mg-order summary { padding: var(--space-5) 0; }
.entry-content .mg-order__text { font-family: var(--font-body); }
.entry-content .mg-scripture { margin: 0 0 var(--space-4); }
.entry-content .mg-scripture + .mg-scripture { margin-top: var(--space-3); }
.entry-content .mg-scripture p { font-family: var(--font-scripture); font-style: italic; font-size: 19px; }
.entry-content .mg-scripture cite { font-style: normal; font-family: var(--font-body); font-weight: 700; font-size: 14px; display: block; }
.mg-beliefs-toc { columns: 2; column-gap: var(--space-6); list-style: none; padding: 0; margin: 0 0 var(--space-6); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: var(--space-4) 0; }
.mg-beliefs-toc li { break-inside: avoid; margin: 0; }
.mg-beliefs-toc a { display: block; padding: 6px 0; text-decoration: none; font-weight: 700; font-size: 15px; }
.mg-beliefs-toc a:hover { text-decoration: underline; }
.entry-content .mg-belief { padding-top: var(--space-5); }
.entry-content .mg-belief h2 { display: flex; gap: var(--space-3); align-items: baseline; margin-top: var(--space-5); }
.entry-content .mg-belief h2 .mg-numeral { font-size: 28px; }
@media (max-width: 720px) { .mg-beliefs-toc { columns: 1; } }

/* coffee card: no photo yet, teal wash with a mug */
.mg-card__img--coffee { display: flex; align-items: center; justify-content: center; background: var(--surface-wash); color: var(--heading-accent); }
.mg-card__img--coffee svg { width: 72px; height: 72px; }
.entry-content .mg-steps { max-width: 40rem; margin: var(--space-4) 0 var(--space-5); }
.entry-content .mg-steps li { margin: 0; }
.entry-content .mg-steps li div { font-size: 17px; }

/* book recommendations */
.entry-content > .mg-book { max-width: 44rem; }
.entry-content .mg-book { grid-template-columns: 112px 1fr; gap: var(--space-5); padding: var(--space-5) 0; }
.entry-content .mg-book img { width: 112px; height: auto; border-radius: var(--radius-sm); box-shadow: 0 2px 8px rgba(43,33,26,.18); }
.entry-content .mg-book__ph { width: 112px; height: 168px; border-radius: var(--radius-sm); background: var(--surface-wash); color: var(--text-muted); display: flex; align-items: center; justify-content: center; text-align: center; padding: 8px; font: 500 13px/1.3 var(--font-display); letter-spacing: .04em; text-transform: uppercase; }
.entry-content .mg-book__title { margin: 0 0 6px; font-size: 24px; }
.entry-content .mg-book__meta { margin: 0 0 10px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.entry-content .mg-book p { margin: 0 0 var(--space-3); }
.entry-content .mg-book__links { font-weight: 700; }
.entry-content .mg-book__links a { text-decoration: none; }
.entry-content .mg-book__links a:hover { text-decoration: underline; }
.entry-content .mg-book__sep { margin: 0 10px; color: var(--text-muted); }
@media (max-width: 720px) { .entry-content .mg-book { grid-template-columns: 88px 1fr; gap: var(--space-4); } .entry-content .mg-book img, .entry-content .mg-book__ph { width: 88px; } .entry-content .mg-book__ph { height: 132px; } }
