/* Image framing, navigation and responsive corrections — October 2026. */
/* Keep every grid child shrinkable, including long original captions. */
.wrap, main, section, article, aside, .hero-grid > *, .split > *,
.cards > *, .steps-grid > *, .article-layout > *, .source-gallery > *,
.visit-panel > *, .footer-top > *, .services > * { min-width: 0; }
.card-body, .content-section, .form-handoff, .footer-col, .field-list span {
  overflow-wrap: anywhere;
}
img { max-width: 100%; }

/* Real chevrons: stable strokes and alignment across fonts and browsers. */
.nav-group summary { gap: 7px; min-height: 44px; }
.nav-group summary::after { content: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::marker { content: ''; }
.nav-chevron {
  display: block; width: 15px; height: 15px; flex: 0 0 15px;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  transition: transform 180ms ease;
}
.nav-group[open] .nav-chevron { transform: rotate(180deg); }
.nav-group[open] > summary { color: var(--ink); }
.nav-dropdown { max-height: calc(100dvh - 135px); overflow-y: auto; }

/* Photos and artwork retain their full native proportions. */
.hero-photo {
  min-height: 0; aspect-ratio: 1 / 1; align-self: center;
  background: var(--ink);
}
.hero-photo > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; object-position: center;
}
.photo-stack { padding: 0; }
.photo-stack > img {
  width: 100%; height: auto; aspect-ratio: auto; object-fit: contain;
  border-radius: 25px 25px 0 0;
}
.photo-note {
  position: relative; inset: auto; max-width: none; width: 100%;
  padding: 22px 28px; border-radius: 0 0 25px 25px;
}
.card-image, .ministries .card-image, .leaders .card-image {
  display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 4 / 3; margin: 12px 12px 0; min-width: 0;
}
.ministries .card-image { background: var(--white); }
.leaders .card-image { aspect-ratio: 1 / 1; }
.card-image img, .ministries .card-image img, .leaders .card-image img {
  display: block; width: 100%; height: 100%; min-height: 0;
  max-height: 100%; aspect-ratio: auto;
  object-fit: contain; object-position: center;
}
.prayer-portrait { min-height: 0; aspect-ratio: 1 / 1; align-self: center; }
.prayer-portrait img { object-fit: contain; object-position: center; }
.prayer-portrait .pill {
  left: 20px; right: 20px; bottom: 20px;
  text-align: center; max-width: calc(100% - 40px);
}
.gallery-item {
  display: flex; flex-direction: column; align-items: stretch;
  width: 100%; min-width: 0; height: 100%;
}
.gallery-item img {
  display: block; width: 100%; height: auto; aspect-ratio: 4 / 3;
  object-fit: contain; object-position: center;
}
.gallery-item span { overflow-wrap: anywhere; }
.split > div > img { width: 100%; height: auto; border-radius: 25px; }
dialog { max-width: min(1100px, calc(100vw - 24px)); }
dialog img {
  display: block; width: auto; height: auto;
  max-width: 100%; max-height: calc(90dvh - 85px); object-fit: contain;
}
.btn { max-width: 100%; white-space: normal; text-align: center; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.content-section img { width: auto; height: auto; max-width: 100%; }
.content-section table { display: block; max-width: 100%; overflow-x: auto; }
.service-row > strong { white-space: nowrap; }
.service-list { min-width: 0; }

@media (max-width: 1100px) {
  .desktop-nav { gap: 16px; }
  .hero-copy h1 { font-size: clamp(3rem, 5.8vw, 4.6rem); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaders .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .source-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: block; }
  .mobile-nav.is-open {
    display: grid; position: fixed; z-index: 49; top: 99px;
    left: 24px; right: 24px; padding: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px;
    max-height: calc(100dvh - 120px); overflow-y: auto;
    overscroll-behavior: contain; background: #fff;
    border: 1px solid var(--line); border-radius: 20px;
    box-shadow: 0 20px 40px #0002;
  }
  .mobile-nav a {
    display: flex; align-items: center; min-height: 44px; padding: 10px;
    font-size: 14px; font-weight: 700; border-radius: 8px;
    overflow-wrap: anywhere;
  }
  .mobile-nav a:hover { background: var(--aqua); }
  .hero-grid, .split, .prayer-panel, .visit-panel { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: clamp(3.3rem, 7.4vw, 5rem); }
  .hero-photo { width: 100%; max-width: 640px; justify-self: center; }
  .hero-copy p { max-width: 560px; }
  .prayer-portrait { width: 100%; max-width: 560px; justify-self: center; }
  .prayer-panel { gap: 0; }
  .photo-stack { order: initial; }
  .leaders .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .leaders .card, .ministries .card { display: flex; flex-direction: column; }
  .leaders .card-body, .ministries .card-body { flex: 1; }
  .steps-grid { grid-template-columns: 1fr; }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .article-side { position: static; margin-top: 0; }
  .article-side .btn { width: auto; margin-right: 8px; }
  .giving-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-header { flex-wrap: wrap; }
  .section-header > p { max-width: 100%; }
  .visit-panel { gap: 30px; }
  .service-list { width: 100%; }
}

@media (max-width: 640px) {
  .wrap { width: calc(100% - 32px); }
  .hero-grid { gap: 20px; }
  .hero-copy h1 { font-size: clamp(2.75rem, 10.5vw, 4rem); }
  .hero-photo { min-height: 0; aspect-ratio: 1 / 1; }
  .hero-copy .eyebrow { gap: 8px; }
  .hero-copy .year { margin-left: 0; }
  .hero-copy .actions { display: grid; grid-template-columns: 1fr; }
  .hero-copy .actions .btn { width: 100%; }
  .photo-caption { left: 20px; right: 20px; bottom: 22px; }
  .photo-caption strong { font-size: clamp(1.4rem, 6vw, 1.85rem); }
  .photo-caption small { font-size: 10px; margin-bottom: 5px; }
  .photo-note { max-width: none; padding: 22px; font-size: 23px; }
  .cards, .ministries .cards, .leaders .cards,
  .source-gallery, .giving-levels { grid-template-columns: minmax(0, 1fr); }
  .ministries .card, .leaders .card { display: flex; flex-direction: column; }
  .card-image, .ministries .card-image, .leaders .card-image {
    display: grid; margin: 12px 12px 0; aspect-ratio: 4 / 3;
  }
  .leaders .card-image { aspect-ratio: 1 / 1; }
  .card-image img, .ministries .card-image img, .leaders .card-image img {
    min-height: 0; height: 100%; width: 100%; aspect-ratio: auto;
    object-fit: contain;
  }
  .card-body, .ministries .card-body, .leaders .card-body { padding: 25px; }
  .ministries .card-body h3, .leaders .card-body h3 { font-size: 28px; }
  .ministries .card-body p, .leaders .card-body p { font-size: 16px; }
  .ministries .pill, .leaders .pill { font-size: 11px; }
  .gallery-item img { height: auto; aspect-ratio: 4 / 3; }
  .prayer-portrait { min-height: 0; aspect-ratio: 1 / 1; }
  .prayer-portrait .pill { font-size: 10px; bottom: 18px; }
  .section { padding: 48px 0; }
  .page-heading h1 { font-size: clamp(2.35rem, 9vw, 3rem); word-break: normal; }
  .page-heading { padding: 29px 23px; }
  .content-section { padding: 23px; }
  .content-section h2, .content-section h3 { font-size: 26px; }
  .content-section p, .content-section li { line-height: 1.75; }
  .form-handoff { padding: 24px; }
  .form-handoff .btn { width: 100%; }
  .field-list { gap: 8px; }
  .field-list span { max-width: 100%; }
  .gallery-pages { gap: 10px; flex-wrap: wrap; }
  .gallery-pages .btn { padding: 12px 18px; }
  .gallery-pages > span { font-size: 13px; }
  .visit-panel { padding: 27px 22px; }
  .service-list { padding: 23px; }
  .service-row { flex-wrap: wrap; align-items: center; gap: 8px 14px; }
  .service-row strong { font-size: 17px; }
  .services { gap: 0; padding: 6px 22px; grid-template-columns: 1fr; }
  .service, .service:first-child, .service:nth-child(3) {
    padding: 19px 0; border: 0; border-bottom: 1px solid var(--line);
  }
  .service:last-child { border-bottom: 0; }
  .service strong { font-size: 23px; }
  .service span, .service a { font-size: 14px; }
  .service small { font-size: 11px; }
  .mobile-nav.is-open {
    top: 88px; left: 12px; right: 12px; padding: 14px;
    max-height: calc(100dvh - 105px);
  }
  .footer-top { column-gap: 22px; }
  .footer-col a { overflow-wrap: anywhere; }
  .footer-bottom > div { display: flex; flex-wrap: wrap; gap: 4px 16px; }
  .footer-bottom a { margin: 0; padding: 8px 0; min-height: 44px; }
  .back-top { right: 14px; bottom: max(14px, env(safe-area-inset-bottom)); }
  dialog { padding: 12px; border-radius: 16px; }
  dialog img { max-height: calc(90dvh - 80px); }
}

@media (max-width: 374px) {
  .wrap { width: calc(100% - 24px); }
  .brand { width: 155px; }
  .site-header { gap: 10px; padding: 10px 12px; }
  .menu-toggle { padding: 8px 11px; }
  .hero-copy { padding: 26px 22px; }
  .hero-copy h1 { font-size: 2.7rem; }
  .hero-copy .eyebrow::before { width: 16px; }
  .mobile-nav.is-open { grid-template-columns: 1fr; }
  .visit-panel, .service-list { padding: 22px 18px; }
  .service-row { flex-direction: column; align-items: flex-start; }
  .footer-top { grid-template-columns: 1fr; }
  .footer-col:last-child { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  .nav-chevron { transition: none; }
}

/* Original transparent white artwork needs a contrasting canvas. */
img[data-contrast="dark"] { background: var(--ink); }
